blob: 861bcab06fbb9602ac3e707763fce1e2bb2ad222 [file] [log] [blame]
<!DOCTYPE html>
<!--
Copyright (c) 2013 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="/tracing/base/units/time_stamp.html">
<link rel="import" href="/tracing/model/timed_event.html">
<script>
'use strict';
/**
* @fileoverview Provides the Flow class.
*/
tr.exportTo('tr.model', function() {
/**
* A Flow represents an interval of time plus parameters associated
* with that interval.
*
* @constructor
*/
function FlowEvent(category, id, title, colorId, start, args, opt_duration) {
tr.model.TimedEvent.call(this, start);
this.category = category || '';
this.title = title;
this.colorId = colorId;
this.start = start;
this.args = args;
this.id = id;
this.startSlice = undefined;
this.endSlice = undefined;
this.startStackFrame = undefined;
this.endStackFrame = undefined;
if (opt_duration !== undefined)
this.duration = opt_duration;
}
FlowEvent.prototype = {
__proto__: tr.model.TimedEvent.prototype,
get userFriendlyName() {
return 'Flow event named ' + this.title + ' at ' +
tr.b.u.TimeStamp.format(this.timestamp);
}
};
tr.model.EventRegistry.register(
FlowEvent,
{
name: 'flowEvent',
pluralName: 'flowEvents',
singleViewElementName: 'tr-ui-a-single-flow-event-sub-view',
multiViewElementName: 'tr-ui-a-multi-flow-event-sub-view'
});
return {
FlowEvent: FlowEvent
};
});
</script>