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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js

Issue 1748993002: DevTools: Initial implementation of line-level CPU profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add decorators Created 4 years, 10 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/sources/UISourceCodeFrame.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js b/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js
index df56d748899a2be33b825c6110a4fb8679790baa..005f6d481338e5f33111aaa57d8de31c132cd1c8 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js
@@ -41,6 +41,7 @@ WebInspector.UISourceCodeFrame = function(uiSourceCode)
this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted, this._onWorkingCopyCommitted, this);
this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.MessageAdded, this._onMessageAdded, this);
this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.MessageRemoved, this._onMessageRemoved, this);
+ this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.LineMarkersChanged, this._updateMarkerDecorations, this);
this._updateStyle();
this._errorPopoverHelper = new WebInspector.PopoverHelper(this.element, this._getErrorAnchor.bind(this), this._showErrorPopover.bind(this));
@@ -118,6 +119,7 @@ WebInspector.UISourceCodeFrame.prototype = {
WebInspector.SourceFrame.prototype.onTextEditorContentLoaded.call(this);
for (var message of this._uiSourceCode.messages())
this._addMessageToSource(message);
+ this._updateMarkerDecorations();
},
/**
@@ -330,6 +332,21 @@ WebInspector.UISourceCodeFrame.prototype = {
}
},
+ _updateMarkerDecorations: function()
+ {
+ this._textEditor.removeAllLineMarkers();
pfeldman 2016/03/02 19:48:59 Should we make this granular? then you would go o
alph 2016/03/03 02:02:52 Done.
+ var lineMarkers = this._uiSourceCode.lineMarkers();
+ if (!lineMarkers)
+ return;
+ for (var marker of lineMarkers) {
+ var lineNumber = marker.line();
+ var element = createElementWithClass("div", "text-editor-line-marker");
+ element.textContent = marker.text();
+ element.style.backgroundColor = marker.color();
+ this._textEditor.addLineMarker(lineNumber, element);
+ }
+ },
+
__proto__: WebInspector.SourceFrame.prototype
}

Powered by Google App Engine
This is Rietveld 408576698