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

Unified Diff: third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.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/source_frame/CodeMirrorTextEditor.js
diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js b/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js
index 8b6730246bfd24ec7e530708cf48f232c02e88e4..a0396a062f524bcedb3ae7f5d4c3bd4f8a24152c 100644
--- a/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js
+++ b/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js
@@ -1118,6 +1118,30 @@ WebInspector.CodeMirrorTextEditor.prototype = {
/**
* @param {number} lineNumber
+ * @param {!Element} element
+ */
+ addLineMarker: function(lineNumber, element)
pfeldman 2016/03/02 19:48:59 You don't need this.
alph 2016/03/03 02:02:52 I need a plumbing from UISourceCodeFrame to CM.
+ {
+ if (!this._hasMarkers) {
+ this._codeMirror.refresh();
+ this._codeMirror.setOption("gutters", ["CodeMirror-linenumbers", "CodeMirror-linemarkers"]);
+ this._hasMarkers = true;
+ }
+ this._codeMirror.setGutterMarker(lineNumber, "CodeMirror-linemarkers", element);
+ },
+
+ removeAllLineMarkers: function()
pfeldman 2016/03/02 19:48:59 ditto. it'll become one of the decorators. you can
alph 2016/03/03 02:02:52 ditto
+ {
+ if (!this._hasMarkers)
+ return;
+ this._hasMarkers = false;
+ this._codeMirror.clearGutter("CodeMirror-linemarkers");
+ this._codeMirror.setOption("gutters", ["CodeMirror-linenumbers"]);
+ this._codeMirror.refresh();
+ },
+
+ /**
+ * @param {number} lineNumber
* @param {number} columnNumber
*/
setExecutionLocation: function(lineNumber, columnNumber)

Powered by Google App Engine
This is Rietveld 408576698