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

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

Issue 212953003: TimelinePanel: provide scriptId in FunctionCall event. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: minor change Created 6 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
« no previous file with comments | « Source/devtools/front_end/TimelineModel.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/TimelineUIUtils.js
diff --git a/Source/devtools/front_end/TimelineUIUtils.js b/Source/devtools/front_end/TimelineUIUtils.js
index aefebd09acaf0d39e48753d8771e8d432779ecba..0f9b3b4e90a45683654eca7e95f9bd9cb368d084 100644
--- a/Source/devtools/front_end/TimelineUIUtils.js
+++ b/Source/devtools/front_end/TimelineUIUtils.js
@@ -678,6 +678,7 @@ WebInspector.TimelineUIUtils.buildDetailsNode = function(record, linkifier)
{
var details;
var detailsText;
+ var model = record.model();
switch (record.type) {
case WebInspector.TimelineModel.RecordType.GCEvent:
@@ -687,8 +688,7 @@ WebInspector.TimelineUIUtils.buildDetailsNode = function(record, linkifier)
detailsText = record.data["timerId"];
break;
case WebInspector.TimelineModel.RecordType.FunctionCall:
- if (record.scriptName)
- details = linkifyLocation(record.scriptName, record.scriptLine, 0);
+ details = linkifyLocation(record.scriptId, record.scriptName, record.scriptLine, 0);
break;
case WebInspector.TimelineModel.RecordType.FireAnimationFrame:
detailsText = record.data["id"];
@@ -717,7 +717,7 @@ WebInspector.TimelineUIUtils.buildDetailsNode = function(record, linkifier)
details = linkifyTopCallFrame();
break;
case WebInspector.TimelineModel.RecordType.EvaluateScript:
- details = record.url ? linkifyLocation(record.url, record.data["lineNumber"], 0) : null;
+ details = linkifyLocation("", record.url, record.data["lineNumber"], 0);
break;
case WebInspector.TimelineModel.RecordType.XHRReadyStateChange:
case WebInspector.TimelineModel.RecordType.XHRLoad:
@@ -737,7 +737,7 @@ WebInspector.TimelineUIUtils.buildDetailsNode = function(record, linkifier)
detailsText = record.data["callbackName"];
break;
default:
- details = record.scriptName ? linkifyLocation(record.scriptName, record.scriptLine, 0) : linkifyTopCallFrame();
+ details = linkifyTopCallFrame();
break;
}
@@ -746,12 +746,21 @@ WebInspector.TimelineUIUtils.buildDetailsNode = function(record, linkifier)
return details;
/**
+ * @param {string} scriptId
* @param {string} url
* @param {number} lineNumber
* @param {number=} columnNumber
*/
- function linkifyLocation(url, lineNumber, columnNumber)
+ function linkifyLocation(scriptId, url, lineNumber, columnNumber)
{
+ if (!model.loadedFromFile() && scriptId) {
+ var location = new WebInspector.DebuggerModel.Location(scriptId, lineNumber, columnNumber || 0);
+ return linkifier.linkifyRawLocation(location, "timeline-details");
+ }
+
+ if (!url)
+ return null;
+
// FIXME(62725): stack trace line/column numbers are one-based.
columnNumber = columnNumber ? columnNumber - 1 : 0;
return linkifier.linkifyLocation(url, lineNumber - 1, columnNumber, "timeline-details");
@@ -762,7 +771,7 @@ WebInspector.TimelineUIUtils.buildDetailsNode = function(record, linkifier)
*/
function linkifyCallFrame(callFrame)
{
- return linkifyLocation(callFrame.url, callFrame.lineNumber, callFrame.columnNumber);
+ return linkifyLocation(callFrame.scriptId, callFrame.url, callFrame.lineNumber, callFrame.columnNumber);
}
/**
@@ -776,14 +785,6 @@ WebInspector.TimelineUIUtils.buildDetailsNode = function(record, linkifier)
return linkifyCallFrame(record.callSiteStackTrace[0]);
return null;
}
-
- /**
- * @return {?Element}
- */
- function linkifyScriptLocation()
- {
- return record.scriptName ? linkifyLocation(record.scriptName, record.scriptLine, 0) : null;
- }
}
/**
« no previous file with comments | « Source/devtools/front_end/TimelineModel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698