| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 for (var i = 0; i < sourceURLs.length; ++i) { | 127 for (var i = 0; i < sourceURLs.length; ++i) { |
| 128 var sourceURL = sourceURLs[i]; | 128 var sourceURL = sourceURLs[i]; |
| 129 if (this._sourceMapForURL.get(sourceURL)) | 129 if (this._sourceMapForURL.get(sourceURL)) |
| 130 continue; | 130 continue; |
| 131 this._sourceMapForURL.put(sourceURL, sourceMap); | 131 this._sourceMapForURL.put(sourceURL, sourceMap); |
| 132 if (!this._workspace.hasMappingForURL(sourceURL) && !this._works
pace.uiSourceCodeForURL(sourceURL)) { | 132 if (!this._workspace.hasMappingForURL(sourceURL) && !this._works
pace.uiSourceCodeForURL(sourceURL)) { |
| 133 var contentProvider = sourceMap.sourceContentProvider(source
URL, WebInspector.resourceTypes.Script); | 133 var contentProvider = sourceMap.sourceContentProvider(source
URL, WebInspector.resourceTypes.Script); |
| 134 this._networkWorkspaceBinding.addFileForURL(sourceURL, conte
ntProvider, script.isContentScript()); | 134 this._networkWorkspaceBinding.addFileForURL(sourceURL, conte
ntProvider, script.isContentScript()); |
| 135 } | 135 } |
| 136 var uiSourceCode = this._workspace.uiSourceCodeForURL(sourceURL)
; | 136 var uiSourceCode = this._workspace.uiSourceCodeForURL(sourceURL)
; |
| 137 if (uiSourceCode) | 137 if (uiSourceCode) { |
| 138 this._bindUISourceCode(uiSourceCode); | 138 this._bindUISourceCode(uiSourceCode); |
| 139 else | 139 } else { |
| 140 this._target.consoleModel.showErrorMessage(WebInspector.UISt
ring("Failed to locate workspace file mapped to URL %s from source map %s", sour
ceURL, sourceMap.url())); | 140 // FIXME: Make use of this._target once we have more targets
. |
| 141 WebInspector.messageSink.addErrorMessage(WebInspector.UIStri
ng("Failed to locate workspace file mapped to URL %s from source map %s", source
URL, sourceMap.url()), true); |
| 142 } |
| 141 } | 143 } |
| 142 script.updateLocations(); | 144 script.updateLocations(); |
| 143 } | 145 } |
| 144 }, | 146 }, |
| 145 | 147 |
| 146 /** | 148 /** |
| 147 * @return {boolean} | 149 * @return {boolean} |
| 148 */ | 150 */ |
| 149 isIdentity: function() | 151 isIdentity: function() |
| 150 { | 152 { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 | 254 |
| 253 this._sourceMapForURL.keys().forEach(unbindUISourceCodeForURL.bind(this)
); | 255 this._sourceMapForURL.keys().forEach(unbindUISourceCodeForURL.bind(this)
); |
| 254 | 256 |
| 255 this._sourceMapForSourceMapURL = {}; | 257 this._sourceMapForSourceMapURL = {}; |
| 256 this._pendingSourceMapLoadingCallbacks = {}; | 258 this._pendingSourceMapLoadingCallbacks = {}; |
| 257 this._sourceMapForScriptId = {}; | 259 this._sourceMapForScriptId = {}; |
| 258 this._scriptForSourceMap.clear(); | 260 this._scriptForSourceMap.clear(); |
| 259 this._sourceMapForURL.clear(); | 261 this._sourceMapForURL.clear(); |
| 260 } | 262 } |
| 261 } | 263 } |
| OLD | NEW |