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

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

Issue 1748993002: DevTools: Initial implementation of line-level CPU profile. (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 d59e1f808803a6db600125f2b2fb7c07425399b5..47615c7ad625159336575cd78ff1c8459719e551 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
@@ -679,6 +679,7 @@ WebInspector.TimelinePanel.prototype = {
{
this._tracingModel.reset();
this._model.reset();
+ this._resetLineLevelCPUProfile();
this._showRecordingHelpMessage();
this.requestWindowTimes(0, Infinity);
@@ -806,6 +807,7 @@ WebInspector.TimelinePanel.prototype = {
this._frameModel.addTraceEvents(this._model.target(), this._model.inspectedTargetEvents(), this._model.sessionId() || "");
if (this._irModel)
this._irModel.populate(this._model);
+ this._setLineLevelCPUProfile(this._model.lineLevelCPUProfile());
if (this._statusPane)
this._statusPane.hide();
delete this._statusPane;
@@ -1261,6 +1263,28 @@ WebInspector.TimelinePanel.prototype = {
this.requestWindowTimes(leftTime, rightTime);
},
+ /**
+ * @param {!WebInspector.TimelineModel.LineLevelProfile} profile
+ */
+ _setLineLevelCPUProfile: function(profile)
+ {
+ for (var fileInfo of profile.files()) {
+ var uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(/** @type {string} */ (fileInfo[0]));
+ if (!uiSourceCode)
+ continue;
+ for (var lineInfo of fileInfo[1]) {
+ var line = lineInfo[0];
+ var time = lineInfo[1];
+ uiSourceCode.addLineDecoration(line, WebInspector.TimelineUIUtils.PerformanceLineDecorator.type, time);
+ }
+ }
+ },
+
+ _resetLineLevelCPUProfile: function()
+ {
+ WebInspector.workspace.uiSourceCodes().forEach(uiSourceCode => uiSourceCode.removeAllLineDecorations(WebInspector.TimelineUIUtils.PerformanceLineDecorator.type));
+ },
+
__proto__: WebInspector.Panel.prototype
}

Powered by Google App Engine
This is Rietveld 408576698