| 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..1f353b1e6f2b56588a65bcc912bfa5b1f94a407d
|
| --- /dev/null
|
| +++ b/tracing/tracing/model/activity.html
|
| @@ -0,0 +1,54 @@
|
| +<!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 represent
|
| + * the currently active window of the process.
|
| + */
|
| +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>
|
|
|