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

Unified Diff: Source/devtools/front_end/timeline/TimelinePanel.js

Issue 321113003: Fix exception when selecting record in timeline based on trace events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | « no previous file | Source/devtools/front_end/timeline/TracingTimelineModel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/timeline/TimelinePanel.js
diff --git a/Source/devtools/front_end/timeline/TimelinePanel.js b/Source/devtools/front_end/timeline/TimelinePanel.js
index d34f59c9c55fd8c9987386466b59290bc0a61035..ae648e0a638d0486a2261267c5b8586bf7ab2e75 100644
--- a/Source/devtools/front_end/timeline/TimelinePanel.js
+++ b/Source/devtools/front_end/timeline/TimelinePanel.js
@@ -964,13 +964,16 @@ WebInspector.TimelinePanel.prototype = {
switch (this._selection.type()) {
case WebInspector.TimelineSelection.Type.Record:
var record = /** @type {!WebInspector.TimelineModel.Record} */ (this._selection.object());
- WebInspector.TimelineUIUtils.generatePopupContent(record, this._model, this._detailsLinkifier, this.showInDetails.bind(this, record.title()), this._model.loadedFromFile());
+ if (this._tracingTimelineModel) {
+ var event = this._tracingTimelineModel.traceEventFrom(record);
+ this._buildSelectionDetailsForTraceEvent(event);
+ } else {
+ WebInspector.TimelineUIUtils.generatePopupContent(record, this._model, this._detailsLinkifier, this.showInDetails.bind(this, record.title()), this._model.loadedFromFile());
+ }
break;
case WebInspector.TimelineSelection.Type.TraceEvent:
var event = /** @type {!WebInspector.TracingModel.Event} */ (this._selection.object());
- var title = WebInspector.TimelineUIUtils.styleForTimelineEvent(event.name).title;
- var tracingModel = this._tracingTimelineModel;
- WebInspector.TracingTimelineUIUtils.buildTraceEventDetails(event, tracingModel, this._detailsLinkifier, this.showInDetails.bind(this, title), false, this._model.target());
+ this._buildSelectionDetailsForTraceEvent(event);
break;
case WebInspector.TimelineSelection.Type.Frame:
var frame = /** @type {!WebInspector.TimelineFrame} */ (this._selection.object());
@@ -985,6 +988,15 @@ WebInspector.TimelinePanel.prototype = {
}
},
+ /**
+ * @param {!WebInspector.TracingModel.Event} event
+ */
+ _buildSelectionDetailsForTraceEvent: function(event)
+ {
+ var title = WebInspector.TimelineUIUtils.styleForTimelineEvent(event.name).title;
+ WebInspector.TracingTimelineUIUtils.buildTraceEventDetails(event, this._tracingTimelineModel, this._detailsLinkifier, this.showInDetails.bind(this, title), false, this._model.target());
+ },
+
_updateSelectedRangeStats: function()
{
if (this._selection)
« no previous file with comments | « no previous file | Source/devtools/front_end/timeline/TracingTimelineModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698