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

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

Issue 400143002: DevTools: Make target on TimelineRecord nullable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 6 years, 5 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: Source/devtools/front_end/timeline/TimelineView.js
diff --git a/Source/devtools/front_end/timeline/TimelineView.js b/Source/devtools/front_end/timeline/TimelineView.js
index 6fe0dd84ffa2ffe07ffa2076ff70be503a101906..8bf18b9fa06a6d69924dbaa155e810ea69834288 100644
--- a/Source/devtools/front_end/timeline/TimelineView.js
+++ b/Source/devtools/front_end/timeline/TimelineView.js
@@ -837,21 +837,24 @@ WebInspector.TimelineView.prototype = {
var record = presentationRecord.record();
if (this._highlightedQuadRecord === record)
return true;
- this._highlightedQuadRecord = record;
var quad = this._uiUtils.highlightQuadForRecord(record);
- if (!quad)
+ var target = record.target();
+ if (!quad || !target)
return false;
- record.target().domAgent().highlightQuad(quad, WebInspector.Color.PageHighlight.Content.toProtocolRGBA(), WebInspector.Color.PageHighlight.ContentOutline.toProtocolRGBA());
+ this._highlightedQuadRecord = record;
+ target.domAgent().highlightQuad(quad, WebInspector.Color.PageHighlight.Content.toProtocolRGBA(), WebInspector.Color.PageHighlight.ContentOutline.toProtocolRGBA());
return true;
},
_hideQuadHighlight: function()
{
- if (this._highlightedQuadRecord) {
- this._highlightedQuadRecord.target().domAgent().hideHighlight();
+ var target = this._highlightedQuadRecord ? this._highlightedQuadRecord.target() : null;
+ if (target)
+ target.domAgent().hideHighlight();
+
+ if (this._highlightedQuadRecord)
delete this._highlightedQuadRecord;
- }
},
/**
@@ -1081,7 +1084,7 @@ WebInspector.TimelineRecordListRow.prototype = {
if (presentationRecord.coalesced()) {
this._dataElement.createTextChild(WebInspector.UIString("× %d", presentationRecord.presentationChildren().length));
} else {
- var detailsNode = uiUtils.buildDetailsNode(record, this._linkifier, loadedFromFile);
+ var detailsNode = uiUtils.buildDetailsNode(record, this._linkifier);
if (detailsNode) {
this._dataElement.createTextChild("(");
this._dataElement.appendChild(detailsNode);
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineUIUtilsImpl.js ('k') | Source/devtools/front_end/timeline/TracingTimelineModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698