 Chromium Code Reviews
 Chromium Code Reviews Issue 2889013002:
  DevTools: introduce uiSourceCode.mimeType() method  (Closed)
    
  
    Issue 2889013002:
  DevTools: introduce uiSourceCode.mimeType() method  (Closed) 
  | 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..9388740a1442fed9847d5e4ec3a9b802768b85df 100644 | 
| --- a/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js | 
| +++ b/third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js | 
| @@ -73,11 +73,11 @@ Bindings.CompilerScriptMapping = class { | 
| * @param {!SDK.Script} script | 
| */ | 
| _addStubUISourceCode(script) { | 
| - var stubUISourceCode = this._stubProject.addContentProvider( | 
| - 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!')); | 
| + var url = script.sourceURL + ':sourcemap'; | 
| + var contentProvider = Common.StaticContentProvider.fromString( | 
| + url, Common.resourceTypes.Script, | 
| 
dgozman
2017/05/19 18:55:52
script.sourceURL?
 
lushnikov
2017/05/19 19:00:51
reverted the change
 | 
| + '\n\n\n\n\n// Please wait a bit.\n// Compiled script is not shown while source map is being loaded!'); | 
| + var stubUISourceCode = this._stubProject.addContentProvider(url, contentProvider, 'text/javascript'); | 
| this._stubUISourceCodes.set(script, stubUISourceCode); | 
| } | 
| @@ -269,13 +269,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); |