lib/third_party/tracing/model/slice_group.js
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;
    }
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;
    }
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 ; }
Ends the last begun slice in this group and pushes it onto the slice
array.

@param {Number} ts Timestamp when the slice ended
@param {Number=} opt_colorId The color of the slice, defined by
its palette id (see ui/base/color_scheme.html).
@return {Slice} slice.
Ends the last begun slice in this group and pushes it onto the slice array .