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

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: 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineModel.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d7082c7a65caff5622eeda394ccb67eff8f3cc8c..1c4b2dc0d7d0db8d227c8a4624239982470a6096 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
@@ -1268,16 +1268,33 @@ 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 time = lineInfo[1];
- uiSourceCode.addLineDecoration(line, WebInspector.TimelineUIUtils.PerformanceLineDecorator.type, time);
+ var rawLocation = debuggerModel.createRawLocationByURL(url, line - 1, 0);
+ if (rawLocation)
+ WebInspector.debuggerWorkspaceBinding.createLiveLocation(rawLocation, updateLocation.bind(null, time));
+ else if (uiSourceCode)
+ uiSourceCode.addLineDecoration(line, WebInspector.TimelineUIUtils.PerformanceLineDecorator.type, time);
}
}
+
+ /**
+ * @param {number} time
+ * @param {!WebInspector.LiveLocation} liveLocation
+ */
+ function updateLocation(time, liveLocation)
+ {
+ var uiLocation = liveLocation.uiLocation();
pfeldman 2016/03/17 01:20:58 remove them from the old one?
alph 2016/03/22 21:41:54 Done.
+ if (uiLocation)
+ uiLocation.uiSourceCode.addLineDecoration(uiLocation.lineNumber, WebInspector.TimelineUIUtils.PerformanceLineDecorator.type, time);
+ }
},
_resetLineLevelCPUProfile: function()
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineModel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698