Chromium Code Reviews| Index: Source/devtools/front_end/SourceMap.js |
| diff --git a/Source/devtools/front_end/SourceMap.js b/Source/devtools/front_end/SourceMap.js |
| index 9aff06c0f79b58375e96d79da2a863bc791e7240..0a1d3d05cc7cb4d7580fe6f3db7e3364322a79da 100644 |
| --- a/Source/devtools/front_end/SourceMap.js |
| +++ b/Source/devtools/front_end/SourceMap.js |
| @@ -109,16 +109,16 @@ WebInspector.SourceMap.prototype = { |
| /** |
| * @param {string} sourceURL |
| * @param {WebInspector.ResourceType} contentType |
| - * @param {string=} mimeType |
| * @return {WebInspector.ContentProvider} |
| */ |
| - sourceContentProvider: function(sourceURL, contentType, mimeType) |
| + sourceContentProvider: function(sourceURL, contentType) |
| { |
| - // FIXME: We should detect mime type automatically (e.g. based on file extension) |
| + var lastIndexOfDot = sourceURL.lastIndexOf("."); |
| + var extension = lastIndexOfDot !== -1 ? sourceURL.substr(lastIndexOfDot + 1) : ""; |
|
apavlov
2013/07/01 12:31:29
You should definitely extension.toLowerCase()
|
| + var mimeType = WebInspector.ResourceType.mimeTypesForExtensions[extension]; |
| var sourceContent = this.sourceContent(sourceURL); |
| - var contentProvider; |
| if (sourceContent) |
| - return new WebInspector.StaticContentProvider(contentType, sourceContent); |
| + return new WebInspector.StaticContentProvider(contentType, sourceContent, mimeType); |
| return new WebInspector.CompilerSourceMappingContentProvider(sourceURL, contentType, mimeType); |
| }, |