| <!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="/core/trace_model/timed_event.html"> |
| <link rel="import" href="/core/analysis/util.html"> |
| |
| <script> |
| 'use strict'; |
| |
| /** |
| * @fileoverview Provides the Flow class. |
| */ |
| tv.exportTo('tv.c.trace_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) { |
| tv.c.trace_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; |
| |
| if (opt_duration !== undefined) |
| this.duration = opt_duration; |
| } |
| |
| FlowEvent.prototype = { |
| __proto__: tv.c.trace_model.TimedEvent.prototype, |
| |
| get userFriendlyName() { |
| return 'Flow event named ' + this.title + ' at ' + |
| tv.c.analysis.tsString(this.timestamp); |
| } |
| }; |
| |
| tv.c.trace_model.EventRegistry.register( |
| FlowEvent, |
| { |
| name: 'flowEvent', |
| pluralName: 'flowEvents', |
| singleViewElementName: 'tv-c-single-flow-event-sub-view', |
| multiViewElementName: 'tv-c-multi-flow-event-sub-view' |
| }); |
| |
| return { |
| FlowEvent: FlowEvent |
| }; |
| }); |
| </script> |
| |