OLD | NEW |
(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> |
OLD | NEW |