Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: tracing/tracing/model/activity.html

Issue 1319013002: Android event log importer. (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698