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

Unified 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: Removed console.log Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tracing/tracing/extras/systrace_config.html ('k') | tracing/tracing/model/process.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « tracing/tracing/extras/systrace_config.html ('k') | tracing/tracing/model/process.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698