Chromium Code Reviews| 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 314 return; | 314 return; |
| 315 this._bindUISourceCode(uiSourceCode); | 315 this._bindUISourceCode(uiSourceCode); |
| 316 }, | 316 }, |
| 317 | 317 |
| 318 /** | 318 /** |
| 319 * @param {!WebInspector.Script} script | 319 * @param {!WebInspector.Script} script |
| 320 * @return {!Promise<?WebInspector.TextSourceMap>} | 320 * @return {!Promise<?WebInspector.TextSourceMap>} |
| 321 */ | 321 */ |
| 322 _loadSourceMapForScript: function(script) | 322 _loadSourceMapForScript: function(script) |
| 323 { | 323 { |
| 324 // script.sourceURL can be a random string, but is generally an absolute path -> complete it to inspected page url for | 324 // script.sourceURL can be a random string, but is generally an absolute path -> complete it to inspected page url for |
|
pfeldman
2016/07/07 17:44:13
This arguably belongs here, we should have resolve
eostroukhov-old
2016/07/13 23:30:58
Done.
| |
| 325 // relative links. | 325 // relative links. |
| 326 var scriptURL = WebInspector.ParsedURL.completeURL(this._target.resource TreeModel.inspectedPageURL(), script.sourceURL); | 326 var scriptURL = script.sourceURL; |
| 327 var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(this._ target); | |
| 328 if (resourceTreeModel) | |
| 329 scriptURL = WebInspector.ParsedURL.completeURL(resourceTreeModel.ins pectedPageURL(), scriptURL); | |
| 327 if (!scriptURL) | 330 if (!scriptURL) |
| 328 return Promise.resolve(/** @type {?WebInspector.TextSourceMap} */(nu ll)); | 331 return Promise.resolve(/** @type {?WebInspector.TextSourceMap} */(nu ll)); |
| 329 | 332 |
| 330 console.assert(script.sourceMapURL); | 333 console.assert(script.sourceMapURL); |
| 331 var scriptSourceMapURL = /** @type {string} */ (script.sourceMapURL); | 334 var scriptSourceMapURL = /** @type {string} */ (script.sourceMapURL); |
| 332 | 335 |
| 333 var sourceMapURL = WebInspector.ParsedURL.completeURL(scriptURL, scriptS ourceMapURL); | 336 var sourceMapURL = WebInspector.ParsedURL.completeURL(scriptURL, scriptS ourceMapURL); |
| 334 if (!sourceMapURL) | 337 if (!sourceMapURL) |
| 335 return Promise.resolve(/** @type {?WebInspector.TextSourceMap} */(nu ll)); | 338 return Promise.resolve(/** @type {?WebInspector.TextSourceMap} */(nu ll)); |
| 336 | 339 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 382 this._sourceMapForScriptId.clear() | 385 this._sourceMapForScriptId.clear() |
| 383 this._scriptForSourceMap.clear(); | 386 this._scriptForSourceMap.clear(); |
| 384 this._sourceMapForURL.clear(); | 387 this._sourceMapForURL.clear(); |
| 385 }, | 388 }, |
| 386 | 389 |
| 387 dispose: function() | 390 dispose: function() |
| 388 { | 391 { |
| 389 this._workspace.removeEventListener(WebInspector.Workspace.Events.UISour ceCodeAdded, this._uiSourceCodeAddedToWorkspace, this); | 392 this._workspace.removeEventListener(WebInspector.Workspace.Events.UISour ceCodeAdded, this._uiSourceCodeAddedToWorkspace, this); |
| 390 } | 393 } |
| 391 } | 394 } |
| OLD | NEW |