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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js

Issue 2962063002: DevTools: eliminate {Default,Resource}ScriptMapping.addScript method (Closed)
Patch Set: remove code from breakpoint-manager.js Created 3 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var initialize_BreakpointManagerTest = function() { 1 var initialize_BreakpointManagerTest = function() {
2 2
3 InspectorTest.createWorkspace = function() 3 InspectorTest.createWorkspace = function()
4 { 4 {
5 InspectorTest.testTargetManager = new SDK.TargetManager(); 5 InspectorTest.testTargetManager = new SDK.TargetManager();
6 InspectorTest.testWorkspace = new Workspace.Workspace(); 6 InspectorTest.testWorkspace = new Workspace.Workspace();
7 InspectorTest.testNetworkProjectManager = new Bindings.NetworkProjectManager (InspectorTest.testTargetManager, InspectorTest.testWorkspace); 7 InspectorTest.testNetworkProjectManager = new Bindings.NetworkProjectManager (InspectorTest.testTargetManager, InspectorTest.testWorkspace);
8 InspectorTest.testResourceMapping = new Bindings.ResourceMapping(InspectorTe st.testTargetManager, InspectorTest.testWorkspace); 8 InspectorTest.testResourceMapping = new Bindings.ResourceMapping(InspectorTe st.testTargetManager, InspectorTest.testWorkspace);
9 InspectorTest.testDebuggerWorkspaceBinding = new Bindings.DebuggerWorkspaceB inding(InspectorTest.testTargetManager, InspectorTest.testWorkspace); 9 InspectorTest.testDebuggerWorkspaceBinding = new Bindings.DebuggerWorkspaceB inding(InspectorTest.testTargetManager, InspectorTest.testWorkspace);
10 // Override ResourceMapping so that CSSWorkspaceBinding and DebuggerWorkspac eBinding refer to the correct one. 10 // Override ResourceMapping so that CSSWorkspaceBinding and DebuggerWorkspac eBinding refer to the correct one.
(...skipping 24 matching lines...) Expand all
35 return target; 35 return target;
36 } 36 }
37 37
38 InspectorTest.uiSourceCodes = {}; 38 InspectorTest.uiSourceCodes = {};
39 39
40 InspectorTest.initializeDefaultMappingOnTarget = function(target) 40 InspectorTest.initializeDefaultMappingOnTarget = function(target)
41 { 41 {
42 var defaultMapping = { 42 var defaultMapping = {
43 rawLocationToUILocation: function(rawLocation) 43 rawLocationToUILocation: function(rawLocation)
44 { 44 {
45 return InspectorTest.uiSourceCodes[rawLocation.scriptId].uiLocation( rawLocation.lineNumber, 0); 45 return null;
46 }, 46 },
47 47
48 uiLocationToRawLocation: function(uiSourceCode, lineNumber) 48 uiLocationToRawLocation: function(uiSourceCode, lineNumber)
49 { 49 {
50 if (!InspectorTest.uiSourceCodes[uiSourceCode.url()]) 50 if (!InspectorTest.uiSourceCodes[uiSourceCode.url()])
51 return null; 51 return null;
52 return new SDK.DebuggerModel.Location(target.debuggerModel, uiSource Code.url(), lineNumber, 0); 52 return new SDK.DebuggerModel.Location(target.debuggerModel, uiSource Code.url(), lineNumber, 0);
53 }, 53 },
54 54
55 isIdentity: function() 55 isIdentity: function()
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 scriptsForSourceURL(url) 96 scriptsForSourceURL(url)
97 { 97 {
98 var script = this._scriptForURL(url); 98 var script = this._scriptForURL(url);
99 return script ? [script] : []; 99 return script ? [script] : [];
100 } 100 }
101 101
102 _addScript(scriptId, url) 102 _addScript(scriptId, url)
103 { 103 {
104 var script = new SDK.Script(this, scriptId, url); 104 var script = new SDK.Script(this, scriptId, url);
105 this._scripts[scriptId] = script; 105 this._scripts[scriptId] = script;
106 this._debuggerWorkspaceBinding._debuggerModelToData.get(this)._parsedScr iptSource({data: script}); 106 var modelData = this._debuggerWorkspaceBinding._debuggerModelToData.get( this);
107 modelData._defaultMapping._parsedScriptSource({data: script});
108 modelData._resourceMapping._parsedScriptSource({data: script});
107 } 109 }
108 110
109 _scriptForURL(url) 111 _scriptForURL(url)
110 { 112 {
111 for (var scriptId in this._scripts) { 113 for (var scriptId in this._scripts) {
112 var script = this._scripts[scriptId]; 114 var script = this._scripts[scriptId];
113 if (script.sourceURL === url) 115 if (script.sourceURL === url)
114 return script; 116 return script;
115 } 117 }
116 } 118 }
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 InspectorTest.addSniffer(Bindings.DebuggerWorkspaceBinding.Location.prototyp e, "dispose", function() 222 InspectorTest.addSniffer(Bindings.DebuggerWorkspaceBinding.Location.prototyp e, "dispose", function()
221 { 223 {
222 InspectorTest.addResult(" Location disposed: " + this._rawLocation.sc riptId + ":" + this._rawLocation.lineNumber); 224 InspectorTest.addResult(" Location disposed: " + this._rawLocation.sc riptId + ":" + this._rawLocation.lineNumber);
223 }, true); 225 }, true);
224 } 226 }
225 227
226 InspectorTest.addScript = function(target, breakpointManager, url) 228 InspectorTest.addScript = function(target, breakpointManager, url)
227 { 229 {
228 target.debuggerModel._addScript(url, url); 230 target.debuggerModel._addScript(url, url);
229 InspectorTest.addResult(" Adding script: " + url); 231 InspectorTest.addResult(" Adding script: " + url);
230 var uiSourceCodes = breakpointManager._workspace.uiSourceCodesForProjectType (Workspace.projectTypes.Debugger);
231 for (var i = 0; i < uiSourceCodes.length; ++i) {
232 var uiSourceCode = uiSourceCodes[i];
233 if (uiSourceCode.url() === url) {
234 InspectorTest.uiSourceCodes[url] = uiSourceCode;
235 return uiSourceCode;
236 }
237 }
238 } 232 }
239 233
240 InspectorTest.addUISourceCode = function(target, breakpointManager, url, doNotSe tSourceMapping, doNotAddScript) 234 InspectorTest.addUISourceCode = function(target, breakpointManager, url, doNotSe tSourceMapping, doNotAddScript)
241 { 235 {
242 if (!doNotAddScript) 236 if (!doNotAddScript)
243 InspectorTest.addScript(target, breakpointManager, url); 237 InspectorTest.addScript(target, breakpointManager, url);
244 InspectorTest.addResult(" Adding UISourceCode: " + url); 238 InspectorTest.addResult(" Adding UISourceCode: " + url);
245 239
246 // Add resource to get UISourceCode. 240 // Add resource to get UISourceCode.
247 var resourceMappingModelInfo = resourceMappingModelInfoForTarget(target); 241 var resourceMappingModelInfo = resourceMappingModelInfoForTarget(target);
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 } 405 }
412 406
413 function finish() 407 function finish()
414 { 408 {
415 InspectorTest.dumpBreakpointLocations(breakpointManager); 409 InspectorTest.dumpBreakpointLocations(breakpointManager);
416 next(); 410 next();
417 } 411 }
418 } 412 }
419 413
420 } 414 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698