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

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

Issue 184823002: DevTools: do not cache details node, remove linkifier from presentation record. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review comments addressed. Created 6 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 | « Source/devtools/front_end/TimelineUIUtils.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/TimelineView.js
diff --git a/Source/devtools/front_end/TimelineView.js b/Source/devtools/front_end/TimelineView.js
index 754854d95c9f6d782b0ac70c6a9ed4e3f482e8a6..423389879bbbeb7c3fdf3354e4c8f94f793bc8c1 100644
--- a/Source/devtools/front_end/TimelineView.js
+++ b/Source/devtools/front_end/TimelineView.js
@@ -47,6 +47,7 @@ WebInspector.TimelineView = function(delegate, presentationModel, frameModel)
this._presentationModel = presentationModel;
this._frameModel = frameModel;
this._calculator = new WebInspector.TimelineCalculator(this._presentationModel);
+ this._linkifier = new WebInspector.Linkifier();
this._boundariesAreValid = true;
this._scrollTop = 0;
@@ -267,6 +268,7 @@ WebInspector.TimelineView.prototype = {
this._windowEndTime = -1;
this._boundariesAreValid = false;
this._adjustScrollPosition(0);
+ this._linkifier.reset();
this._closeRecordDetails();
this._automaticallySizeWindow = true;
},
@@ -287,7 +289,6 @@ WebInspector.TimelineView.prototype = {
refreshRecords: function()
{
- this._resetView();
this._automaticallySizeWindow = false;
this._invalidateAndScheduleRefresh(false, true);
},
@@ -521,7 +522,7 @@ WebInspector.TimelineView.prototype = {
}
} else {
if (!listRowElement) {
- listRowElement = new WebInspector.TimelineRecordListRow(selectRecordCallback, scheduleRefreshCallback).element;
+ listRowElement = new WebInspector.TimelineRecordListRow(this._linkifier, selectRecordCallback, scheduleRefreshCallback).element;
this._sidebarListElement.appendChild(listRowElement);
}
if (!graphRowElement) {
@@ -800,7 +801,7 @@ WebInspector.TimelineView.prototype = {
popover.show(WebInspector.TimelineUIUtils.generatePopupContentForFrame(frame), anchor);
} else {
if (anchor.row && anchor.row._record)
- anchor.row._record.generatePopupContent(showCallback);
+ anchor.row._record.generatePopupContent(this._linkifier, showCallback);
else if (anchor._tasksInfo)
popover.show(WebInspector.TimelineUIUtils.generateMainThreadBarPopupContent(this._presentationModel, anchor._tasksInfo), anchor, null, null, WebInspector.Popover.Orientation.Bottom);
}
@@ -977,10 +978,11 @@ WebInspector.TimelineCalculator.prototype = {
/**
* @constructor
+ * @param {!WebInspector.Linkifier} linkifier
* @param {function(!WebInspector.TimelinePresentationModel.Record)} selectRecord
* @param {function()} scheduleRefresh
*/
-WebInspector.TimelineRecordListRow = function(selectRecord, scheduleRefresh)
+WebInspector.TimelineRecordListRow = function(linkifier, selectRecord, scheduleRefresh)
{
this.element = document.createElement("div");
this.element.row = this;
@@ -988,6 +990,7 @@ WebInspector.TimelineRecordListRow = function(selectRecord, scheduleRefresh)
this.element.addEventListener("click", this._onClick.bind(this), false);
this.element.addEventListener("mouseover", this._onMouseOver.bind(this), false);
this.element.addEventListener("mouseout", this._onMouseOut.bind(this), false);
+ this._linkifier = linkifier;
// Warning is float right block, it goes first.
this._warningElement = this.element.createChild("div", "timeline-tree-item-warning hidden");
@@ -1017,7 +1020,7 @@ WebInspector.TimelineRecordListRow.prototype = {
if (record.isBackground())
this.element.classList.add("background");
- this._typeElement.textContent = record.title;
+ this._typeElement.textContent = record.title();
if (this._dataElement.firstChild)
this._dataElement.removeChildren();
@@ -1025,8 +1028,12 @@ WebInspector.TimelineRecordListRow.prototype = {
this._warningElement.enableStyleClass("hidden", !record.hasWarnings() && !record.childHasWarnings());
this._warningElement.enableStyleClass("timeline-tree-item-child-warning", record.childHasWarnings() && !record.hasWarnings());
- if (record.detailsNode())
- this._dataElement.appendChild(record.detailsNode());
+ var detailsNode = record.buildDetailsNode(this._linkifier);
+ if (detailsNode) {
+ this._dataElement.appendChild(document.createTextNode("("));
+ this._dataElement.appendChild(detailsNode);
+ this._dataElement.appendChild(document.createTextNode(")"));
+ }
this._expandArrowElement.enableStyleClass("parent", record.children && record.children.length);
this._expandArrowElement.enableStyleClass("expanded", record.visibleChildrenCount);
this._record.setUserObject("WebInspector.TimelineRecordListRow", this);
« no previous file with comments | « Source/devtools/front_end/TimelineUIUtils.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698