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

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

Issue 1811773002: DevTools: Use live location for line level profile presentation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments. Created 4 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
Index: third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
index b4d110908d1e448bb31b971b1af1356d0fc41c1c..a048529b60574103524268abd836ee1550952c24 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
@@ -1269,14 +1269,20 @@ WebInspector.TimelinePanel.prototype = {
*/
_setLineLevelCPUProfile: function(profile)
{
+ var debuggerModel = WebInspector.DebuggerModel.fromTarget(WebInspector.targetManager.mainTarget());
+ if (!debuggerModel)
+ return;
for (var fileInfo of profile.files()) {
- var uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(/** @type {string} */ (fileInfo[0]));
- if (!uiSourceCode)
- continue;
+ var url = /** @type {string} */ (fileInfo[0]);
+ var uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(url);
for (var lineInfo of fileInfo[1]) {
- var line = lineInfo[0];
+ var line = lineInfo[0] - 1;
var time = lineInfo[1];
- uiSourceCode.addLineDecoration(line, WebInspector.TimelineUIUtils.PerformanceLineDecorator.type, time);
+ var rawLocation = debuggerModel.createRawLocationByURL(url, line, 0);
+ if (rawLocation)
+ new WebInspector.TimelineUIUtils.LineLevelProfilePresentation(rawLocation, time);
+ else if (uiSourceCode)
+ uiSourceCode.addLineDecoration(line, WebInspector.TimelineUIUtils.PerformanceLineDecorator.type, time);
}
}
},

Powered by Google App Engine
This is Rietveld 408576698