| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 this._sourceMapByURL[completeSourceMapURL] = sourceMap; | 152 this._sourceMapByURL[completeSourceMapURL] = sourceMap; |
| 153 else | 153 else |
| 154 delete this._sourceMapByURL[completeSourceMapURL]; | 154 delete this._sourceMapByURL[completeSourceMapURL]; |
| 155 | 155 |
| 156 // Then report sources. | 156 // Then report sources. |
| 157 var sources = sourceMap ? sourceMap.sources() : []; | 157 var sources = sourceMap ? sourceMap.sources() : []; |
| 158 for (var i = 0; i < sources.length; ++i) { | 158 for (var i = 0; i < sources.length; ++i) { |
| 159 var sassURL = sources[i]; | 159 var sassURL = sources[i]; |
| 160 if (!this._networkMapping.hasMappingForURL(sassURL)) { | 160 if (!this._networkMapping.hasMappingForURL(sassURL)) { |
| 161 var contentProvider = sourceMap.sourceContentProvider(sassUR
L, WebInspector.resourceTypes.Stylesheet); | 161 var contentProvider = sourceMap.sourceContentProvider(sassUR
L, WebInspector.resourceTypes.Stylesheet); |
| 162 // Override source map content providers. | |
| 163 this._networkProject.removeFileForURL(sassURL); | |
| 164 this._networkProject.addFileForURL(sassURL, contentProvider)
; | 162 this._networkProject.addFileForURL(sassURL, contentProvider)
; |
| 165 } | 163 } |
| 166 } | 164 } |
| 167 | 165 |
| 168 for (var i = 0; callbacks && i < callbacks.length; ++i) | 166 for (var i = 0; callbacks && i < callbacks.length; ++i) |
| 169 callbacks[i](sourceMap); | 167 callbacks[i](sourceMap); |
| 170 } | 168 } |
| 171 }, | 169 }, |
| 172 | 170 |
| 173 /** | 171 /** |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 | 229 |
| 232 _reset: function() | 230 _reset: function() |
| 233 { | 231 { |
| 234 /** @type {!Object.<string, !Array.<function(?WebInspector.SourceMap)>>}
*/ | 232 /** @type {!Object.<string, !Array.<function(?WebInspector.SourceMap)>>}
*/ |
| 235 this._pendingSourceMapLoadingCallbacks = {}; | 233 this._pendingSourceMapLoadingCallbacks = {}; |
| 236 /** @type {!Object.<string, !WebInspector.SourceMap>} */ | 234 /** @type {!Object.<string, !WebInspector.SourceMap>} */ |
| 237 this._sourceMapByURL = {}; | 235 this._sourceMapByURL = {}; |
| 238 this._sourceMapByStyleSheetURL = {}; | 236 this._sourceMapByStyleSheetURL = {}; |
| 239 } | 237 } |
| 240 } | 238 } |
| OLD | NEW |