docs: function(ts, opt_tts, opt_colorId) {
        if (!this.openSliceCount)
          throw new Error('endSlice called without an open slice');
  
        var slice = this.openPartialSlices_[this.openSliceCount - 1];
        this.openPartialSlices_.splice(this.openSliceCount - 1, 1);
        if (ts < slice.start)
          throw new Error('Slice ' + slice.title +
                          ' end time is before its start.');
  
        slice.duration = ts - slice.start;
        slice.didNotFinish = false;
        slice.colorId = opt_colorId || slice.colorId;
  
        if (opt_tts && slice.cpuStart !== undefined)
          slice.cpuDuration = opt_tts - slice.cpuStart;
  
        return slice;
      }