OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2015 The Chromium Authors. All rights reserved. | 3 Copyright 2015 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/task.html"> | 8 <link rel="import" href="/tracing/base/task.html"> |
9 <link rel="import" href="/tracing/core/filter.html"> | 9 <link rel="import" href="/tracing/core/filter.html"> |
10 <link rel="import" href="/tracing/core/scripting_object.html"> | 10 <link rel="import" href="/tracing/core/scripting_object.html"> |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 context.event = event.subSlices[i]; | 140 context.event = event.subSlices[i]; |
141 this.evaluateFilterExpressionForEvent_( | 141 this.evaluateFilterExpressionForEvent_( |
142 context, inputSelection, outputSelection, seenEvents); | 142 context, inputSelection, outputSelection, seenEvents); |
143 } | 143 } |
144 }, | 144 }, |
145 | 145 |
146 // Returns a task that fills the given selection with everything in the | 146 // Returns a task that fills the given selection with everything in the |
147 // model. | 147 // model. |
148 selectEverythingAsTask_: function(selection) { | 148 selectEverythingAsTask_: function(selection) { |
149 var filterTask = new tr.b.Task(); | 149 var filterTask = new tr.b.Task(); |
150 this.model_.iterateAllEventContainers(function(container) { | 150 for (var container of this.model_.getDescendantEventContainers()) { |
151 filterTask.subTask(function() { | 151 filterTask.subTask(() => { |
152 container.iterateAllEventsInThisContainer( | 152 for (var event of container.childEvents()) |
153 function() { return true; }, | 153 addEventTreeToSelection(selection, event); |
154 addEventTreeToSelection.bind(undefined, selection)); | |
155 }, this); | 154 }, this); |
156 }, this); | 155 } |
157 return filterTask; | 156 return filterTask; |
158 }, | 157 }, |
159 | 158 |
160 // Returns a promise which will resolve into a {EventSet} representing the | 159 // Returns a promise which will resolve into a {EventSet} representing the |
161 // result of this query. | 160 // result of this query. |
162 ready: function() { | 161 ready: function() { |
163 return new Promise(function(resolve, reject) { | 162 return new Promise(function(resolve, reject) { |
164 var graph = this.createFilterTaskGraph_(); | 163 var graph = this.createFilterTaskGraph_(); |
165 graph.lastTask = graph.lastTask.after(function() { | 164 graph.lastTask = graph.lastTask.after(function() { |
166 resolve(this.selection_); | 165 resolve(this.selection_); |
(...skipping 15 matching lines...) Expand all Loading... |
182 { | 181 { |
183 name: '$t' | 182 name: '$t' |
184 } | 183 } |
185 ); | 184 ); |
186 | 185 |
187 return { | 186 return { |
188 TQuery: TQuery | 187 TQuery: TQuery |
189 }; | 188 }; |
190 }); | 189 }); |
191 </script> | 190 </script> |
OLD | NEW |