| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 4 Use of this source code is governed by a BSD-style license that can be |
| 5 found in the LICENSE file. | 5 found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 | 7 |
| 8 <link rel="import" href="/tracing/base/guid.html"> | 8 <link rel="import" href="/tracing/base/guid.html"> |
| 9 <link rel="import" href="/tracing/base/range.html"> | 9 <link rel="import" href="/tracing/base/range.html"> |
| 10 <link rel="import" href="/tracing/model/async_slice.html"> | 10 <link rel="import" href="/tracing/model/async_slice.html"> |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 subGroupsByTitle[subGroupTitle].push(slice); | 127 subGroupsByTitle[subGroupTitle].push(slice); |
| 128 } | 128 } |
| 129 this.viewSubGroups_ = tr.b.dictionaryValues(subGroupsByTitle); | 129 this.viewSubGroups_ = tr.b.dictionaryValues(subGroupsByTitle); |
| 130 this.viewSubGroups_.sort(function(a, b) { | 130 this.viewSubGroups_.sort(function(a, b) { |
| 131 return a.slices[0].compareTo(b.slices[0]); | 131 return a.slices[0].compareTo(b.slices[0]); |
| 132 }); | 132 }); |
| 133 } | 133 } |
| 134 return this.viewSubGroups_; | 134 return this.viewSubGroups_; |
| 135 }, | 135 }, |
| 136 | 136 |
| 137 findTopmostSlicesInThisContainer: function(eventPredicate, callback, | 137 findTopmostSlicesInThisContainer: function*(eventPredicate, opt_this) { |
| 138 opt_this) { | 138 for (var slice of this.slices) { |
| 139 for (var i = 0; i < this.slices.length; i++) { | 139 if (slice.isTopLevel) { |
| 140 var slice = this.slices[i]; | 140 yield * slice.findTopmostSlicesRelativeToThisSlice( |
| 141 if (slice.isTopLevel) | 141 eventPredicate, opt_this); |
| 142 slice.findTopmostSlicesRelativeToThisSlice(eventPredicate, callback, | 142 } |
| 143 opt_this); | |
| 144 } | 143 } |
| 145 }, | 144 }, |
| 146 | 145 |
| 147 childEvents: function*(eventTypePredicate, opt_this) { | 146 childEvents: function*() { |
| 148 // Async slices normally don't have sub-slices, and when they do, | 147 // Async slices normally don't have sub-slices, and when they do, |
| 149 // the sub-slice is specific to the type of async slice. Thus, | 148 // the sub-slice is specific to the type of async slice. Thus, |
| 150 // it is not expected for sub-slices to themselves have sub-sub-slices, | 149 // it is not expected for sub-slices to themselves have sub-sub-slices, |
| 151 // which is why we don't recurse into the sub-slices here. | 150 // which is why we don't recurse into the sub-slices here. |
| 152 if (eventTypePredicate.call(opt_this, tr.model.AsyncSlice)) { | 151 for (var slice of this.slices) { |
| 153 for (var slice of this.slices) { | 152 yield slice; |
| 154 yield slice; | 153 if (slice.subSlices) |
| 155 if (slice.subSlices) | 154 yield * slice.subSlices; |
| 156 yield * slice.subSlices; | |
| 157 } | |
| 158 } | 155 } |
| 159 }, | 156 }, |
| 160 | 157 |
| 161 childEventContainers: function*() { | 158 childEventContainers: function*() { |
| 162 } | 159 } |
| 163 }; | 160 }; |
| 164 | 161 |
| 165 return { | 162 return { |
| 166 AsyncSliceGroup: AsyncSliceGroup | 163 AsyncSliceGroup: AsyncSliceGroup |
| 167 }; | 164 }; |
| 168 }); | 165 }); |
| 169 </script> | 166 </script> |
| OLD | NEW |