Chromium Code Reviews| Index: tracing/tracing/model/activity.html |
| diff --git a/tracing/tracing/model/activity.html b/tracing/tracing/model/activity.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8e8aab635df51984474cce9e4dffc2ee46e104b1 |
| --- /dev/null |
| +++ b/tracing/tracing/model/activity.html |
| @@ -0,0 +1,55 @@ |
| +<!DOCTYPE html> |
| +<!-- |
| +Copyright (c) 2015 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/ui/base/color_scheme.html"> |
| + |
| +<script> |
| +'use strict'; |
| + |
| +/** |
| + * @fileoverview Class representing a user activity that is running |
| + * in the process. |
| + * On the Android platform, activities are mapped to Android Activities |
| + * running in the foreground of the process. |
| + * 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.
|
| + * the currently active window of the process. |
| + * |
|
dsinclair
2015/08/27 15:18:50
nit: remove blank line
coenen
2015/09/01 11:55:49
Done.
|
| + */ |
| +tr.exportTo('tr.model', function() { |
| + /** |
| + * @constructor |
| + * @param {String} name Name of the activity |
| + * @param {String} category Category of the activities |
| + * @param {String} range The time range where the activity was running |
| + * @param {String} args Additional arguments |
| + */ |
| + function Activity(name, category, range, args) { |
| + tr.model.TimedEvent.call(this, range.min); |
| + this.title = name; |
| + this.category = category; |
| + this.colorId = tr.ui.b.getColorIdForGeneralPurposeString(name); |
| + this.duration = range.duration; |
| + this.args = args; |
| + this.name = name; |
| + }; |
| + |
| + Activity.prototype = { |
| + __proto__: tr.model.TimedEvent.prototype, |
| + |
| + shiftTimestampsForward: function(amount) { |
| + this.start += amount; |
| + }, |
| + |
| + addBoundsToRange: function(range) { |
| + range.addValue(this.start); |
| + range.addValue(this.end); |
| + } |
| + }; |
| + return { |
| + Activity: Activity |
| + }; |
| +}); |
| +</script> |