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

Unified Diff: Source/devtools/front_end/TimelineUIUtils.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: 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
Index: Source/devtools/front_end/TimelineUIUtils.js
diff --git a/Source/devtools/front_end/TimelineUIUtils.js b/Source/devtools/front_end/TimelineUIUtils.js
index 39b3af9975abc355a84e8f465addd02900859b98..b85f96d27f463eec4257f18bd4c50cc3335ed487 100644
--- a/Source/devtools/front_end/TimelineUIUtils.js
+++ b/Source/devtools/front_end/TimelineUIUtils.js
@@ -377,7 +377,7 @@ WebInspector.TimelineUIUtils.generatePopupContentForFrameStatistics = function(s
return WebInspector.UIString("%s (%.0f FPS)", Number.millisToString(time, true), 1 / time);
}
- var contentHelper = new WebInspector.TimelineDetailsContentHelper(false);
+ var contentHelper = new WebInspector.TimelineDetailsContentHelper(new WebInspector.Linkifier(), false);
caseq 2014/03/03 07:53:15 So what happens to locations created by the linkif
pfeldman 2014/03/03 09:16:48 It is never called here.
contentHelper.appendTextRow(WebInspector.UIString("Minimum Time"), formatTimeAndFPS(statistics.minDuration));
contentHelper.appendTextRow(WebInspector.UIString("Average Time"), formatTimeAndFPS(statistics.average));
contentHelper.appendTextRow(WebInspector.UIString("Maximum Time"), formatTimeAndFPS(statistics.maxDuration));
@@ -527,7 +527,7 @@ WebInspector.TimelinePopupContentHelper.prototype = {
/**
* @param {string} title
- * @param {!Element|string} content
+ * @param {!Node|string} content
*/
appendElementRow: function(title, content)
{
@@ -547,13 +547,16 @@ WebInspector.TimelinePopupContentHelper.prototype = {
/**
* @constructor
+ * @param {!WebInspector.Linkifier} linkifier
* @param {boolean} monospaceValues
*/
-WebInspector.TimelineDetailsContentHelper = function(monospaceValues)
+WebInspector.TimelineDetailsContentHelper = function(linkifier, monospaceValues)
{
+ this._linkifier = linkifier;
caseq 2014/03/03 07:53:15 one
pfeldman 2014/03/03 09:16:48 Done.
this.element = document.createElement("div");
this.element.className = "timeline-details-view-block";
this._monospaceValues = monospaceValues;
+ this._linkifier = new WebInspector.Linkifier();
caseq 2014/03/03 07:53:15 two
pfeldman 2014/03/03 09:16:48 Done.
}
WebInspector.TimelineDetailsContentHelper.prototype = {
@@ -570,7 +573,7 @@ WebInspector.TimelineDetailsContentHelper.prototype = {
/**
* @param {string} title
- * @param {!Element|string} content
+ * @param {!Node|string} content
*/
appendElementRow: function(title, content)
{
@@ -585,10 +588,19 @@ WebInspector.TimelineDetailsContentHelper.prototype = {
/**
* @param {string} title
+ * @param {string} url
+ * @param {number} line
+ */
+ appendLocationRow: function(title, url, line)
+ {
+ this.appendElementRow(title, this._linkifier.linkifyLocation(url, line - 1) || "");
+ },
+
+ /**
+ * @param {string} title
* @param {!Array.<!ConsoleAgent.CallFrame>} stackTrace
- * @param {function(!ConsoleAgent.CallFrame)} callFrameLinkifier
*/
- appendStackTrace: function(title, stackTrace, callFrameLinkifier)
+ appendStackTrace: function(title, stackTrace)
{
var rowElement = this.element.createChild("div", "timeline-details-view-row");
rowElement.createChild("span", "timeline-details-view-row-title").textContent = WebInspector.UIString("%s: ", title);
@@ -599,7 +611,7 @@ WebInspector.TimelineDetailsContentHelper.prototype = {
var row = stackTraceElement.createChild("div");
row.createTextChild(stackFrame.functionName || WebInspector.UIString("(anonymous function)"));
row.createTextChild(" @ ");
- var urlElement = callFrameLinkifier(stackFrame);
+ var urlElement = this._linkifier.linkifyLocation(stackFrame.url, stackFrame.lineNumber - 1);
row.appendChild(urlElement);
}
}

Powered by Google App Engine
This is Rietveld 408576698