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

Unified Diff: third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineProfileTree.js

Issue 2703433002: DevTools: Do not do deep search in case of bottom-up profile tree. (Closed)
Patch Set: Created 3 years, 10 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 | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+ }
};
/**
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698