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

Unified Diff: third_party/WebKit/Source/devtools/front_end/source_frame/SourcesTextEditor.js

Issue 2498783002: DevTools: [Sources] Improve editor load time by optimizing setMimeType (Closed)
Patch Set: installMimeTypeModes Created 4 years, 1 month 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/SourcesTextEditor.js
diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/SourcesTextEditor.js b/third_party/WebKit/Source/devtools/front_end/source_frame/SourcesTextEditor.js
index 7057ba607a69a4a19f8271e10539599101d469da..a70036a8182d48f7641da8933c1b38ed59741aa0 100644
--- a/third_party/WebKit/Source/devtools/front_end/source_frame/SourcesTextEditor.js
+++ b/third_party/WebKit/Source/devtools/front_end/source_frame/SourcesTextEditor.js
@@ -502,27 +502,16 @@ SourceFrame.SourcesTextEditor = class extends TextEditor.CodeMirrorTextEditor {
delete this._muteTextChangedEvent;
}
- /**
- * @override
- * @param {string} mimeType
- * @return {!Promise}
- */
- setMimeType(mimeType) {
- this._mimeType = mimeType;
- return super.setMimeType(mimeType).then(
- () => this._codeMirror.setOption('mode', this._applyWhitespaceMimetype(mimeType)));
- }
-
_updateWhitespace() {
- if (this._mimeType)
- this.setMimeType(this._mimeType);
+ this.setMimeType(this.mimeType());
}
/**
+ * @override
* @param {string} mimeType
* @return {string}
*/
- _applyWhitespaceMimetype(mimeType) {
+ rewriteMimeType(mimeType) {
this._setupWhitespaceHighlight();
var whitespaceMode = Common.moduleSetting('showWhitespacesInEditor').get();
this.element.classList.toggle('show-whitespaces', whitespaceMode === 'all');

Powered by Google App Engine
This is Rietveld 408576698