 Chromium Code Reviews
 Chromium Code Reviews Issue 1699183003:
  [DevTools] Don't load sourcemap for blackboxed scripts  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@add-source-map-support-v3
    
  
    Issue 1699183003:
  [DevTools] Don't load sourcemap for blackboxed scripts  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@add-source-map-support-v3| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 159 /** | 159 /** | 
| 160 * @param {!WebInspector.Script} script | 160 * @param {!WebInspector.Script} script | 
| 161 * @return {?WebInspector.SourceMap} | 161 * @return {?WebInspector.SourceMap} | 
| 162 */ | 162 */ | 
| 163 sourceMapForScript: function(script) | 163 sourceMapForScript: function(script) | 
| 164 { | 164 { | 
| 165 return this._sourceMapForScriptId[script.scriptId]; | 165 return this._sourceMapForScriptId[script.scriptId]; | 
| 166 }, | 166 }, | 
| 167 | 167 | 
| 168 /** | 168 /** | 
| 169 * @param {!WebInspector.Script} script | |
| 170 */ | |
| 171 maybeLoadSourceMap: function(script) | |
| 172 { | |
| 173 if (!script.sourceMapURL) | |
| 174 return; | |
| 175 if (this._pendingSourceMapLoadingCallbacks[script.sourceMapURL]) | |
| 176 return; | |
| 177 if (this._sourceMapForScriptId[script.scriptId]) | |
| 178 return; | |
| 179 this._processScript(script); | |
| 180 }, | |
| 181 | |
| 182 /** | |
| 169 * @param {!WebInspector.Event} event | 183 * @param {!WebInspector.Event} event | 
| 170 */ | 184 */ | 
| 171 _sourceMapURLAdded: function(event) | 185 _sourceMapURLAdded: function(event) | 
| 172 { | 186 { | 
| 173 var script = /** @type {!WebInspector.Script} */ (event.target); | 187 var script = /** @type {!WebInspector.Script} */ (event.target); | 
| 174 if (!script.sourceMapURL) | 188 if (!script.sourceMapURL) | 
| 175 return; | 189 return; | 
| 176 this._processScript(script); | 190 this._processScript(script); | 
| 177 }, | 191 }, | 
| 178 | 192 | 
| 179 /** | 193 /** | 
| 180 * @param {!WebInspector.Script} script | 194 * @param {!WebInspector.Script} script | 
| 181 */ | 195 */ | 
| 182 _processScript: function(script) | 196 _processScript: function(script) | 
| 183 { | 197 { | 
| 198 var location = this._debuggerModel.createRawLocation(script, 0, 0); | |
| 
kozy
2016/02/22 05:12:14
I can't user isBlackboxedUISourceCode here because
 
dgozman
2016/02/22 17:34:56
Then use the url+isContentScript version.
 | |
| 199 if (location && WebInspector.blackboxManager.isBlackboxedRawLocation(loc ation)) | |
| 200 return; | |
| 184 // Create stub UISourceCode for the time source mapping is being loaded. | 201 // Create stub UISourceCode for the time source mapping is being loaded. | 
| 185 var stubUISourceCode = this._stubProject.addContentProvider(script.sourc eURL, new WebInspector.StaticContentProvider(WebInspector.resourceTypes.Script, "\n\n\n\n\n// Please wait a bit.\n// Compiled script is not shown while source m ap is being loaded!", script.sourceURL)); | 202 var stubUISourceCode = this._stubProject.addContentProvider(script.sourc eURL, new WebInspector.StaticContentProvider(WebInspector.resourceTypes.Script, "\n\n\n\n\n// Please wait a bit.\n// Compiled script is not shown while source m ap is being loaded!", script.sourceURL)); | 
| 186 this._stubUISourceCodes.set(script.scriptId, stubUISourceCode); | 203 this._stubUISourceCodes.set(script.scriptId, stubUISourceCode); | 
| 187 | 204 | 
| 188 this._debuggerWorkspaceBinding.pushSourceMapping(script, this); | 205 this._debuggerWorkspaceBinding.pushSourceMapping(script, this); | 
| 189 this._loadSourceMapForScript(script, this._sourceMapLoaded.bind(this, sc ript, stubUISourceCode.url())); | 206 this._loadSourceMapForScript(script, this._sourceMapLoaded.bind(this, sc ript, stubUISourceCode.url())); | 
| 190 }, | 207 }, | 
| 191 | 208 | 
| 192 /** | 209 /** | 
| 193 * @param {!WebInspector.Script} script | 210 * @param {!WebInspector.Script} script | 
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 384 this._sourceMapForScriptId = {}; | 401 this._sourceMapForScriptId = {}; | 
| 385 this._scriptForSourceMap.clear(); | 402 this._scriptForSourceMap.clear(); | 
| 386 this._sourceMapForURL.clear(); | 403 this._sourceMapForURL.clear(); | 
| 387 }, | 404 }, | 
| 388 | 405 | 
| 389 dispose: function() | 406 dispose: function() | 
| 390 { | 407 { | 
| 391 this._workspace.removeEventListener(WebInspector.Workspace.Events.UISour ceCodeAdded, this._uiSourceCodeAddedToWorkspace, this); | 408 this._workspace.removeEventListener(WebInspector.Workspace.Events.UISour ceCodeAdded, this._uiSourceCodeAddedToWorkspace, this); | 
| 392 } | 409 } | 
| 393 } | 410 } | 
| OLD | NEW |