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

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

Issue 1564113003: DevTools: merge uisourcecode's url-alike members. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed Created 4 years, 11 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 /** 170 /**
171 * @param {!WebInspector.Script} script 171 * @param {!WebInspector.Script} script
172 */ 172 */
173 _processScript: function(script) 173 _processScript: function(script)
174 { 174 {
175 // Create stub UISourceCode for the time source mapping is being loaded. 175 // Create stub UISourceCode for the time source mapping is being loaded.
176 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)); 176 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));
177 this._stubUISourceCodes.set(script.scriptId, stubUISourceCode); 177 this._stubUISourceCodes.set(script.scriptId, stubUISourceCode);
178 178
179 this._debuggerWorkspaceBinding.pushSourceMapping(script, this); 179 this._debuggerWorkspaceBinding.pushSourceMapping(script, this);
180 this._loadSourceMapForScript(script, this._sourceMapLoaded.bind(this, sc ript, stubUISourceCode.path())); 180 this._loadSourceMapForScript(script, this._sourceMapLoaded.bind(this, sc ript, stubUISourceCode.url()));
181 }, 181 },
182 182
183 /** 183 /**
184 * @param {!WebInspector.Script} script 184 * @param {!WebInspector.Script} script
185 * @param {string} uiSourceCodePath 185 * @param {string} uiSourceCodePath
186 * @param {?WebInspector.SourceMap} sourceMap 186 * @param {?WebInspector.SourceMap} sourceMap
187 */ 187 */
188 _sourceMapLoaded: function(script, uiSourceCodePath, sourceMap) 188 _sourceMapLoaded: function(script, uiSourceCodePath, sourceMap)
189 { 189 {
190 this._stubUISourceCodes.delete(script.scriptId); 190 this._stubUISourceCodes.delete(script.scriptId);
(...skipping 14 matching lines...) Expand all
205 this._scriptForSourceMap.set(sourceMap, script); 205 this._scriptForSourceMap.set(sourceMap, script);
206 206
207 var sourceURLs = sourceMap.sources(); 207 var sourceURLs = sourceMap.sources();
208 var missingSources = []; 208 var missingSources = [];
209 for (var i = 0; i < sourceURLs.length; ++i) { 209 for (var i = 0; i < sourceURLs.length; ++i) {
210 var sourceURL = sourceURLs[i]; 210 var sourceURL = sourceURLs[i];
211 if (this._sourceMapForURL.get(sourceURL)) 211 if (this._sourceMapForURL.get(sourceURL))
212 continue; 212 continue;
213 this._sourceMapForURL.set(sourceURL, sourceMap); 213 this._sourceMapForURL.set(sourceURL, sourceMap);
214 var uiSourceCode = this._networkMapping.uiSourceCodeForScriptURL(sou rceURL, script); 214 var uiSourceCode = this._networkMapping.uiSourceCodeForScriptURL(sou rceURL, script);
215 if (!uiSourceCode && !this._networkMapping.hasMappingForURL(sourceUR L)) { 215 if (!uiSourceCode && !this._networkMapping.hasMappingForNetworkURL(s ourceURL)) {
216 var contentProvider = sourceMap.sourceContentProvider(sourceURL, WebInspector.resourceTypes.SourceMapScript); 216 var contentProvider = sourceMap.sourceContentProvider(sourceURL, WebInspector.resourceTypes.SourceMapScript);
217 uiSourceCode = this._networkProject.addFileForURL(sourceURL, con tentProvider, WebInspector.ResourceTreeFrame.fromScript(script), script.isConten tScript()); 217 uiSourceCode = this._networkProject.addFileForURL(sourceURL, con tentProvider, WebInspector.ResourceTreeFrame.fromScript(script), script.isConten tScript());
218 uiSourceCode[WebInspector.CompilerScriptMapping._originSymbol] = script.sourceURL; 218 uiSourceCode[WebInspector.CompilerScriptMapping._originSymbol] = script.sourceURL;
219 } 219 }
220 if (uiSourceCode) { 220 if (uiSourceCode) {
221 this._bindUISourceCode(uiSourceCode); 221 this._bindUISourceCode(uiSourceCode);
222 } else { 222 } else {
223 if (missingSources.length < 3) 223 if (missingSources.length < 3)
224 missingSources.push(sourceURL); 224 missingSources.push(sourceURL);
225 else if (missingSources.peekLast() !== "\u2026") 225 else if (missingSources.peekLast() !== "\u2026")
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 this._sourceMapForScriptId = {}; 373 this._sourceMapForScriptId = {};
374 this._scriptForSourceMap.clear(); 374 this._scriptForSourceMap.clear();
375 this._sourceMapForURL.clear(); 375 this._sourceMapForURL.clear();
376 }, 376 },
377 377
378 dispose: function() 378 dispose: function()
379 { 379 {
380 this._workspace.removeEventListener(WebInspector.Workspace.Events.UISour ceCodeAdded, this._uiSourceCodeAddedToWorkspace, this); 380 this._workspace.removeEventListener(WebInspector.Workspace.Events.UISour ceCodeAdded, this._uiSourceCodeAddedToWorkspace, this);
381 } 381 }
382 } 382 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698