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

Unified Diff: third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.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/bindings/CompilerScriptMapping.js
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js b/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
index 6dbfcb8a99d098e2f67d1c77f02f19001f2a7657..16bf022c64f9a4999f7aa951ae9c7a5cce3614ec 100644
--- a/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js
@@ -77,7 +77,8 @@ Bindings.CompilerScriptMapping = class {
script.sourceURL + ':sourcemap',
Common.StaticContentProvider.fromString(
script.sourceURL, Common.resourceTypes.Script,
- '\n\n\n\n\n// Please wait a bit.\n// Compiled script is not shown while source map is being loaded!'));
+ '\n\n\n\n\n// Please wait a bit.\n// Compiled script is not shown while source map is being loaded!'),
+ 'text/javascript');
this._stubUISourceCodes.set(script, stubUISourceCode);
}
@@ -269,13 +270,14 @@ Bindings.CompilerScriptMapping = class {
}
var contentProvider = sourceMap.sourceContentProvider(sourceURL, Common.resourceTypes.SourceMapScript);
+ var mimeType = Common.ResourceType.mimeFromURL(sourceURL) || contentProvider.contentType().canonicalMimeType();
var embeddedContent = sourceMap.embeddedContentByURL(sourceURL);
var metadata =
typeof embeddedContent === 'string' ? new Workspace.UISourceCodeMetadata(null, embeddedContent.length) : null;
uiSourceCode = project.createUISourceCode(sourceURL, contentProvider.contentType());
uiSourceCode[Bindings.CompilerScriptMapping._sourceMapSymbol] = sourceMap;
Bindings.NetworkProject.setInitialFrameAttribution(uiSourceCode, frameId);
- project.addUISourceCodeWithProvider(uiSourceCode, contentProvider, metadata);
+ project.addUISourceCodeWithProvider(uiSourceCode, contentProvider, metadata, mimeType);
this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel, uiSourceCode, this);
}
this._debuggerWorkspaceBinding.updateLocations(script);

Powered by Google App Engine
This is Rietveld 408576698