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

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

Issue 2779253003: DevTools: Show top level event initiator when a child is selected. (Closed)
Patch Set: Created 3 years, 9 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
Index: third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js
index d9e3925e16f3239f405a77ba8564a1eb57530692..19fd3a7534b65048fa076c56153c3f42d89df2f8 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js
@@ -565,8 +565,9 @@ TimelineModel.TimelineModel = class {
_processEvent(event) {
var recordTypes = TimelineModel.TimelineModel.RecordType;
var eventStack = this._eventStack;
-
- if (!eventStack.length) {
+ if (eventStack.length) {
+ event[TimelineModel.TimelineModel._parentSymbol] = eventStack.peekLast();
caseq 2017/03/29 22:08:20 should we stop pretending and do this in TracingMo
alph 2017/03/29 22:16:57 Can't do it on the TracingModel level, as we have
+ } else {
if (this._currentTaskLayoutAndRecalcEvents && this._currentTaskLayoutAndRecalcEvents.length) {
var totalTime = this._currentTaskLayoutAndRecalcEvents.reduce((time, event) => time + event.duration, 0);
if (totalTime > TimelineModel.TimelineModel.Thresholds.ForcedLayout) {
@@ -1031,8 +1032,18 @@ TimelineModel.TimelineModel = class {
}
return zeroStartRequestsList.concat(requestsList);
}
+
+ /**
+ * @param {!SDK.TracingModel.Event} event
+ * @return {?SDK.TracingModel.Event}
+ */
+ static parentEvent(event) {
+ return event[TimelineModel.TimelineModel._parentSymbol] || null;
+ }
};
+TimelineModel.TimelineModel._parentSymbol = Symbol('parent');
+
/**
* @enum {string}
*/

Powered by Google App Engine
This is Rietveld 408576698