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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <!--
3 Copyright (c) 2013 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
8 <link rel="import" href="/tracing/extras/chrome/chrome_model_helper.html">
9 <link rel="import" href="/tracing/model/async_slice.html">
10 <link rel="import" href="/tracing/model/event_set.html">
11
12 <script>
13 'use strict';
14
15 tr.exportTo('tr.e.cc', function() {
16 function Animation() {
17 tr.model.AsyncSlice.apply(this, arguments);
18 this.associatedEvents_ = undefined;
19 }
20
21 Animation.prototype = {
22 __proto__: tr.model.AsyncSlice.prototype,
23
24 get associatedEvents() {
25 if (!this.associatedEvents_)
26 this.findAssociatedEvents_();
27 return this.associatedEvents_;
28 },
29
30 findAssociatedEvents_: function() {
31 this.associatedEvents_ = new tr.model.EventSet();
32 var modelIndices = this.startThread.parent.model.modelIndices;
33 var flowEvents = modelIndices.getFlowEventsWithId(this.id);
34
35 if (flowEvents.length === 0)
36 return;
37
38 flowEvents.forEach(function(flowEvent) {
39 this.associatedEvents_.push(flowEvent);
40 if (flowEvent.startSlice)
41 this.associatedEvents_.addEventSet(
42 flowEvent.startSlice.entireHierarchy);
43 if (flowEvent.endSlice)
44 this.associatedEvents_.addEventSet(
45 flowEvent.endSlice.entireHierarchy);
46 }, this);
47 }
48 };
49
50 tr.model.AsyncSlice.register(Animation, {
51 typeNames: ['Animation'],
52 categoryParts: ['blink.animations']
53 });
54
55 return {
56 Animation: Animation
57 };
58 });
59 </script>
OLDNEW
« 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