Home | History | Annotate | Download | only in trace_model
      1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 'use strict';
      6 
      7 /**
      8  * @fileoverview Provides the TraceModelEvent class.
      9  */
     10 base.exportTo('tracing.trace_model', function() {
     11   /**
     12    * A TraceModelEvent represents the basic set of information collected for
     13    * each type of event in the system.
     14    *
     15    * All time units are stored in milliseconds.
     16    * @constructor
     17    */
     18   function TraceModelEvent(category, title, colorId, start, args) {
     19     this.category = category || '';
     20     this.title = title;
     21     this.colorId = colorId;
     22     this.start = start;
     23     this.args = args;
     24 
     25     this.didNotFinish = false;
     26   }
     27 
     28   TraceModelEvent.prototype = {
     29     selected: false,
     30 
     31     duration: 0,
     32 
     33     get end() {
     34       return this.start;
     35     }
     36   };
     37 
     38   return {
     39     TraceModelEvent: TraceModelEvent
     40   };
     41 });
     42 
     43