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

Unified Diff: tracing/tracing/extras/chrome/cc/animation.html

Issue 1338633004: Animation AsyncSlice collects associatedEvents (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tracing/trace_viewer.gypi ('k') | tracing/tracing/extras/chrome/cc/animation_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/extras/chrome/cc/animation.html
diff --git a/tracing/tracing/extras/chrome/cc/animation.html b/tracing/tracing/extras/chrome/cc/animation.html
new file mode 100644
index 0000000000000000000000000000000000000000..93c37a9ea0f6189b3b862aa6b0c8820cc918afa4
--- /dev/null
+++ b/tracing/tracing/extras/chrome/cc/animation.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2013 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/extras/chrome/chrome_model_helper.html">
+<link rel="import" href="/tracing/model/async_slice.html">
+<link rel="import" href="/tracing/model/event_set.html">
+
+<script>
+'use strict';
+
+tr.exportTo('tr.e.cc', function() {
+ function Animation() {
+ tr.model.AsyncSlice.apply(this, arguments);
+ this.associatedEvents_ = undefined;
+ }
+
+ Animation.prototype = {
+ __proto__: tr.model.AsyncSlice.prototype,
+
+ get associatedEvents() {
+ if (!this.associatedEvents_)
+ this.findAssociatedEvents_();
+ return this.associatedEvents_;
+ },
+
+ findAssociatedEvents_: function() {
+ this.associatedEvents_ = new tr.model.EventSet();
+ var modelIndices = this.startThread.parent.model.modelIndices;
+ var flowEvents = modelIndices.getFlowEventsWithId(this.id);
+
+ if (flowEvents.length === 0)
+ return;
+
+ flowEvents.forEach(function(flowEvent) {
+ this.associatedEvents_.push(flowEvent);
+ if (flowEvent.startSlice)
+ this.associatedEvents_.addEventSet(
+ flowEvent.startSlice.entireHierarchy);
+ if (flowEvent.endSlice)
+ this.associatedEvents_.addEventSet(
+ flowEvent.endSlice.entireHierarchy);
+ }, this);
+ }
+ };
+
+ tr.model.AsyncSlice.register(Animation, {
+ typeNames: ['Animation'],
+ categoryParts: ['blink.animations']
+ });
+
+ return {
+ Animation: Animation
+ };
+});
+</script>
« no previous file with comments | « tracing/trace_viewer.gypi ('k') | tracing/tracing/extras/chrome/cc/animation_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698