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

Unified Diff: tracing/tracing/model/slice.html

Issue 2083213002: Change call-sites in trace viewer to use generators instead of iteration functions. (Closed) Base URL: git@github.com:catapult-project/catapult@master
Patch Set: fix nits, rebase Created 4 years, 6 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/tracing/model/process_base.html ('k') | tracing/tracing/model/slice_group.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/model/slice.html
diff --git a/tracing/tracing/model/slice.html b/tracing/tracing/model/slice.html
index 633dcd98611d9c672f4bbaf846eeccfa74a5539c..7c53deb305dcc55fe0c8a5ec6fd7fdfc139b2e20 100644
--- a/tracing/tracing/model/slice.html
+++ b/tracing/tracing/model/slice.html
@@ -135,17 +135,13 @@ tr.exportTo('tr.model', function() {
* [ D ]
* [C1] [C2]
*/
- findTopmostSlicesRelativeToThisSlice: function(eventPredicate, callback,
- opt_this) {
+ findTopmostSlicesRelativeToThisSlice: function*(eventPredicate) {
if (eventPredicate(this)) {
- callback.call(opt_this, this);
+ yield this;
return;
}
-
- this.subSlices.forEach(function(s) {
- s.findTopmostSlicesRelativeToThisSlice(eventPredicate, callback,
- opt_this);
- });
+ for (var s of this.subSlices)
+ yield * s.findTopmostSlicesRelativeToThisSlice(eventPredicate);
},
/**
« no previous file with comments | « tracing/tracing/model/process_base.html ('k') | tracing/tracing/model/slice_group.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698