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

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

Issue 2889013002: DevTools: introduce uiSourceCode.mimeType() method (Closed)
Patch Set: address comments Created 3 years, 7 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/SourceFormatter.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js b/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js
index 4ce4d5e5c47727ed9d7f1414dee25273f9b841d0..95b5abd54732fb27c2ed65b3aff9a7344372a2ff 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js
@@ -89,12 +89,12 @@ Sources.SourceFormatter = class {
return Sources.SourceFormatData._for(formattedUISourceCode);
var content = await uiSourceCode.requestContent();
- var highlighterType = Bindings.NetworkProject.uiSourceCodeMimeType(uiSourceCode);
var fulfillFormatPromise;
var resultPromise = new Promise(fulfill => {
fulfillFormatPromise = fulfill;
});
- Sources.Formatter.format(uiSourceCode.contentType(), highlighterType, content || '', innerCallback.bind(this));
+ Sources.Formatter.format(
+ uiSourceCode.contentType(), uiSourceCode.mimeType(), content || '', innerCallback.bind(this));
return resultPromise;
/**
@@ -106,7 +106,8 @@ Sources.SourceFormatter = class {
var formattedURL = uiSourceCode.url() + ':formatted';
var contentProvider =
Common.StaticContentProvider.fromString(formattedURL, uiSourceCode.contentType(), formattedContent);
- var formattedUISourceCode = this._project.addContentProvider(formattedURL, contentProvider);
+ var formattedUISourceCode =
+ this._project.addContentProvider(formattedURL, contentProvider, uiSourceCode.mimeType());
var formatData = new Sources.SourceFormatData(uiSourceCode, formattedUISourceCode, formatterMapping);
formattedUISourceCode[Sources.SourceFormatData._formatDataSymbol] = formatData;
this._scriptMapping._setSourceMappingEnabled(formatData, true);

Powered by Google App Engine
This is Rietveld 408576698