Chromium Code Reviews| 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() |