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

Unified Diff: third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js

Issue 2058513003: DevTools: max length limit for formatting commands (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove style changes Created 4 years, 6 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/components/Linkifier.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/console/ConsoleView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
index 14ea9163233aac7ca023995c716cda4d134ea920..e893a975e16b82d96f9783b4443754cad7cd0f89 100644
--- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
+++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
@@ -1192,8 +1192,12 @@ WebInspector.ConsoleCommand.prototype = {
this._formattedCommand.textContent = this.text.replaceControlCharacters();
this._element.appendChild(this._formattedCommand);
- var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter("text/javascript", true);
- javascriptSyntaxHighlighter.syntaxHighlightNode(this._formattedCommand).then(this._updateSearch.bind(this))
+ if (this._formattedCommand.textContent.length < WebInspector.ConsoleCommand.MaxLengthToIgnoreHighlighter) {
+ var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter("text/javascript", true);
+ javascriptSyntaxHighlighter.syntaxHighlightNode(this._formattedCommand).then(this._updateSearch.bind(this))
+ } else {
+ this._updateSearch();
+ }
}
return this._element;
},
@@ -1207,6 +1211,13 @@ WebInspector.ConsoleCommand.prototype = {
}
/**
+ * The maximum length before strings are considered too long for syntax highlighting.
+ * @const
+ * @type {number}
+ */
+WebInspector.ConsoleCommand.MaxLengthToIgnoreHighlighter = 10000;
+
+/**
* @constructor
* @extends {WebInspector.ConsoleViewMessage}
* @param {!WebInspector.ConsoleMessage} message
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/components/Linkifier.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698