Index: third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineProfileTree.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineProfileTree.js b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineProfileTree.js |
index 84426bac621446a38e5a4095fc3863ad007298be..c08f3965af201d88faff04c101447a437d835ac8 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineProfileTree.js |
+++ b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineProfileTree.js |
@@ -49,6 +49,20 @@ TimelineModel.TimelineProfileTree.Node = class { |
children() { |
throw 'Not implemented'; |
} |
+ |
+ /** |
+ * @param {function(!SDK.TracingModel.Event):boolean} matchFunction |
+ * @param {!Array<!TimelineModel.TimelineProfileTree.Node>=} results |
+ * @return {!Array<!TimelineModel.TimelineProfileTree.Node>} |
+ */ |
+ searchTree(matchFunction, results) { |
+ results = results || []; |
+ if (this.event && matchFunction(this.event)) |
+ results.push(this); |
+ for (var child of this.children().values()) |
+ child.searchTree(matchFunction, results); |
+ return results; |
+ } |
}; |
TimelineModel.TimelineProfileTree.TopDownNode = class extends TimelineModel.TimelineProfileTree.Node { |
@@ -505,6 +519,19 @@ TimelineModel.TimelineProfileTree.BottomUpNode = class extends TimelineModel.Tim |
this._cachedChildren = nodeById; |
return nodeById; |
} |
+ |
+ /** |
+ * @override |
+ * @param {function(!SDK.TracingModel.Event):boolean} matchFunction |
+ * @param {!Array<!TimelineModel.TimelineProfileTree.Node>=} results |
+ * @return {!Array<!TimelineModel.TimelineProfileTree.Node>} |
+ */ |
+ searchTree(matchFunction, results) { |
+ results = results || []; |
+ if (this.event && matchFunction(this.event)) |
+ results.push(this); |
+ return results; |
+ } |
}; |
/** |