Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js

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
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 if (WebInspector.blackboxManager.isBlackboxedURL(script.sourceURL, scrip t.isContentScript()))
199 return;
184 // Create stub UISourceCode for the time source mapping is being loaded. 200 // 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)); 201 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); 202 this._stubUISourceCodes.set(script.scriptId, stubUISourceCode);
187 203
188 this._debuggerWorkspaceBinding.pushSourceMapping(script, this); 204 this._debuggerWorkspaceBinding.pushSourceMapping(script, this);
189 this._loadSourceMapForScript(script, this._sourceMapLoaded.bind(this, sc ript, stubUISourceCode.url())); 205 this._loadSourceMapForScript(script, this._sourceMapLoaded.bind(this, sc ript, stubUISourceCode.url()));
190 }, 206 },
191 207
192 /** 208 /**
193 * @param {!WebInspector.Script} script 209 * @param {!WebInspector.Script} script
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 this._sourceMapForScriptId = {}; 400 this._sourceMapForScriptId = {};
385 this._scriptForSourceMap.clear(); 401 this._scriptForSourceMap.clear();
386 this._sourceMapForURL.clear(); 402 this._sourceMapForURL.clear();
387 }, 403 },
388 404
389 dispose: function() 405 dispose: function()
390 { 406 {
391 this._workspace.removeEventListener(WebInspector.Workspace.Events.UISour ceCodeAdded, this._uiSourceCodeAddedToWorkspace, this); 407 this._workspace.removeEventListener(WebInspector.Workspace.Events.UISour ceCodeAdded, this._uiSourceCodeAddedToWorkspace, this);
392 } 408 }
393 } 409 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698