Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <!-- | |
| 3 Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
| 4 Use of this source code is governed by a BSD-style license that can be | |
| 5 found in the LICENSE file. | |
| 6 --> | |
| 7 <link rel="import" href="/tracing/ui/base/color_scheme.html"> | |
| 8 | |
| 9 <script> | |
| 10 'use strict'; | |
| 11 | |
| 12 /** | |
| 13 * @fileoverview Class representing a user activity that is running | |
| 14 * in the process. | |
| 15 * On the Android platform, activities are mapped to Android Activities | |
| 16 * running in the foreground of the process. | |
| 17 * On Windows/OS X this could for example representing | |
|
dsinclair
2015/08/27 15:18:50
s/representing/represent
coenen
2015/09/01 11:55:49
Done.
| |
| 18 * the currently active window of the process. | |
| 19 * | |
|
dsinclair
2015/08/27 15:18:50
nit: remove blank line
coenen
2015/09/01 11:55:49
Done.
| |
| 20 */ | |
| 21 tr.exportTo('tr.model', function() { | |
| 22 /** | |
| 23 * @constructor | |
| 24 * @param {String} name Name of the activity | |
| 25 * @param {String} category Category of the activities | |
| 26 * @param {String} range The time range where the activity was running | |
| 27 * @param {String} args Additional arguments | |
| 28 */ | |
| 29 function Activity(name, category, range, args) { | |
| 30 tr.model.TimedEvent.call(this, range.min); | |
| 31 this.title = name; | |
| 32 this.category = category; | |
| 33 this.colorId = tr.ui.b.getColorIdForGeneralPurposeString(name); | |
| 34 this.duration = range.duration; | |
| 35 this.args = args; | |
| 36 this.name = name; | |
| 37 }; | |
| 38 | |
| 39 Activity.prototype = { | |
| 40 __proto__: tr.model.TimedEvent.prototype, | |
| 41 | |
| 42 shiftTimestampsForward: function(amount) { | |
| 43 this.start += amount; | |
| 44 }, | |
| 45 | |
| 46 addBoundsToRange: function(range) { | |
| 47 range.addValue(this.start); | |
| 48 range.addValue(this.end); | |
| 49 } | |
| 50 }; | |
| 51 return { | |
| 52 Activity: Activity | |
| 53 }; | |
| 54 }); | |
| 55 </script> | |
| OLD | NEW |