Changeset 116846 in webkit
- Timestamp:
- May 12, 2012 3:02:53 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r116845 r116846 1 2012-05-12 Pavel Feldman <pfeldman@chromium.org> 2 3 Web Inspector: remove UISourceCode.id since it is no longer used. 4 https://bugs.webkit.org/show_bug.cgi?id=86286 5 6 Reviewed by Vsevolod Vlasov. 7 8 * inspector/debugger/breakpoint-manager.html: 9 * inspector/debugger/raw-source-code.html: 10 * inspector/debugger/scripts-file-selector.html: 11 * inspector/debugger/scripts-panel.html: 12 * inspector/debugger/scripts-sorting.html: 13 * inspector/debugger/ui-source-code-display-name.html: 14 * inspector/debugger/ui-source-code.html: 15 1 16 2012-05-12 Kent Tamura <tkent@chromium.org> 2 17 -
trunk/LayoutTests/inspector/debugger/breakpoint-manager-expected.txt
r116397 r116846 5 5 Created breakpoints manager 6 6 Dumping Storage 7 Adding UISourceCode: a.js (url=a.js)7 Adding UISourceCode: a.js) 8 8 Setting breakpoint at a.js:30 enabled:true condition: 9 9 debuggerModel.setBreakpoint(a.js:30:) … … 20 20 Created breakpoints manager 21 21 Dumping Storage 22 Adding UISourceCode: a.js (url=a.js)22 Adding UISourceCode: a.js) 23 23 Setting breakpoint at a.js:30 enabled:false condition: 24 24 breakpointAdded(a.js, 30, , false) … … 40 40 Created breakpoints manager 41 41 Dumping Storage 42 Adding UISourceCode: a.js (url=a.js)42 Adding UISourceCode: a.js) 43 43 Setting breakpoint at a.js:30 enabled:true condition:condition 44 44 debuggerModel.setBreakpoint(a.js:30:condition) … … 67 67 a.js:20 enabled:false condition: 68 68 b.js:3 enabled:true condition: 69 Adding UISourceCode: a.js (url=a.js)69 Adding UISourceCode: a.js) 70 70 debuggerModel.setBreakpoint(a.js:10:foo == bar) 71 71 breakpointAdded(a.js, 10, foo == bar, true) … … 88 88 a.js:20 enabled:false condition: 89 89 b.js:3 enabled:true condition: 90 Adding UISourceCode: a.js (url=a.js)91 debuggerModel.setBreakpoint(a.js:10:foo == bar) 92 breakpointAdded(a.js, 10, foo == bar, true) 93 Location created: a.js:10 94 breakpointAdded(a.js, 20, , false) 95 Adding UISourceCode: a.js (url=a.js)90 Adding UISourceCode: a.js) 91 debuggerModel.setBreakpoint(a.js:10:foo == bar) 92 breakpointAdded(a.js, 10, foo == bar, true) 93 Location created: a.js:10 94 breakpointAdded(a.js, 20, , false) 95 Adding UISourceCode: a.js) 96 96 Dumping Storage 97 97 a.js:10 enabled:true condition:foo == bar … … 110 110 a.js:20 enabled:false condition: 111 111 b.js:3 enabled:true condition: 112 Adding UISourceCode: a.js (url=a.js)112 Adding UISourceCode: a.js) 113 113 debuggerModel.setBreakpoint(a.js:10:foo == bar) 114 114 breakpointAdded(a.js, 10, foo == bar, true) … … 136 136 Created breakpoints manager 137 137 Dumping Storage 138 Adding UISourceCode: a.js (url=a.js)138 Adding UISourceCode: a.js) 139 139 Setting breakpoint at a.js:1015 enabled:true condition: 140 140 debuggerModel.setBreakpoint(a.js:1015:) … … 151 151 Created breakpoints manager 152 152 Dumping Storage 153 Adding UISourceCode: a.js (url=a.js)153 Adding UISourceCode: a.js) 154 154 Setting breakpoint at a.js:1015 enabled:true condition: 155 155 debuggerModel.setBreakpoint(a.js:1015:) … … 167 167 Created breakpoints manager 168 168 Dumping Storage 169 Adding UISourceCode: a.js (url=a.js)169 Adding UISourceCode: a.js) 170 170 debuggerModel.setBreakpoint(a.js:2500:) 171 171 breakpointAdded(a.js, 2500, , true) … … 182 182 a.js:20 enabled:false condition: 183 183 b.js:3 enabled:true condition: 184 Adding UISourceCode: a.js (url=a.js)184 Adding UISourceCode: a.js) 185 185 debuggerModel.setBreakpoint(a.js:10:foo == bar) 186 186 breakpointAdded(a.js, 10, foo == bar, true) … … 193 193 Location disposed: a.js:10 194 194 breakpointRemoved(a.js, 20) 195 Adding UISourceCode: b.js (url=b.js)195 Adding UISourceCode: b.js) 196 196 debuggerModel.setBreakpoint(b.js:3:) 197 197 breakpointAdded(b.js, 3, , true) … … 203 203 Location disposed: b.js:3 204 204 Resolving provisional breakpoint. 205 Adding UISourceCode: a.js (url=a.js)205 Adding UISourceCode: a.js) 206 206 debuggerModel.removeBreakpoint(a.js:10) 207 207 debuggerModel.setBreakpoint(a.js:10:foo == bar) … … 225 225 a.js:10 enabled:true condition:foo == bar 226 226 a.js:20 enabled:true condition: 227 Adding UISourceCode: a.js (url=a.js)227 Adding UISourceCode: a.js) 228 228 debuggerModel.setBreakpoint(a.js:10:foo == bar) 229 229 breakpointAdded(a.js, 10, foo == bar, true) … … 259 259 Dumping Storage 260 260 a.js:10 enabled:true condition:foo == bar 261 Adding UISourceCode: a.js (url=a.js)261 Adding UISourceCode: a.js) 262 262 debuggerModel.setBreakpoint(a.js:10:foo == bar) 263 263 breakpointAdded(a.js, 10, foo == bar, true) -
trunk/LayoutTests/inspector/debugger/breakpoint-manager.html
r116775 r116846 7 7 function test() 8 8 { 9 var uiSourceCodes = {}; 10 9 11 var defaultMapping = { 10 12 rawLocationToUILocation: function(rawLocation) 11 13 { 12 var uiSourceCode = new WebInspector.UISourceCode(rawLocation.scriptId, rawLocation.scriptId, null, this); 13 return new WebInspector.UILocation(uiSourceCode, rawLocation.lineNumber, 0); 14 return new WebInspector.UILocation(uiSourceCodes[rawLocation.scriptId], rawLocation.lineNumber, 0); 14 15 }, 15 16 16 17 uiLocationToRawLocation: function(uiSourceCode, lineNumber) 17 18 { 18 return { scriptId: uiSourceCode. id, lineNumber: lineNumber, columnNumber: 0 };19 return { scriptId: uiSourceCode.url, lineNumber: lineNumber, columnNumber: 0 }; 19 20 } 20 21 }; … … 23 24 rawLocationToUILocation: function(rawLocation) 24 25 { 25 var uiSourceCode = new WebInspector.UISourceCode(rawLocation.scriptId, rawLocation.scriptId, null, this); 26 return new WebInspector.UILocation(uiSourceCode, rawLocation.lineNumber + 10, 0); 26 return new WebInspector.UILocation(uiSourceCodes[rawLocation.scriptId], rawLocation.lineNumber + 10, 0); 27 27 }, 28 28 29 29 uiLocationToRawLocation: function(uiSourceCode, lineNumber) 30 30 { 31 return { scriptId: uiSourceCode. id, lineNumber: lineNumber - 10, columnNumber: 0 };31 return { scriptId: uiSourceCode.url, lineNumber: lineNumber - 10, columnNumber: 0 }; 32 32 } 33 33 }; … … 115 115 var breakpoint = event.data.breakpoint; 116 116 var uiLocation = event.data.uiLocation; 117 InspectorTest.addResult(" breakpointAdded(" + [uiLocation.uiSourceCode. id, uiLocation.lineNumber, breakpoint.condition(), breakpoint.enabled()].join(", ") + ")");117 InspectorTest.addResult(" breakpointAdded(" + [uiLocation.uiSourceCode.url, uiLocation.lineNumber, breakpoint.condition(), breakpoint.enabled()].join(", ") + ")"); 118 118 } 119 119 … … 121 121 { 122 122 var uiLocation = event.data.uiLocation; 123 InspectorTest.addResult(" breakpointRemoved(" + [uiLocation.uiSourceCode. id, uiLocation.lineNumber].join(", ") + ")");123 InspectorTest.addResult(" breakpointRemoved(" + [uiLocation.uiSourceCode.url, uiLocation.lineNumber].join(", ") + ")"); 124 124 } 125 125 … … 133 133 }, true); 134 134 135 function addUISourceCode(breakpointManager, id, url) 136 { 137 breakpointManager._debuggerModel._addScript(id, url); 138 InspectorTest.addResult(" Adding UISourceCode: " + id + " (url=" + (url || id) + ")"); 139 var uiSourceCode = new WebInspector.JavaScriptSource(id, url || id, null, defaultMapping); 135 function addUISourceCode(breakpointManager, url) 136 { 137 breakpointManager._debuggerModel._addScript(url, url); 138 InspectorTest.addResult(" Adding UISourceCode: " + url + ")"); 139 var uiSourceCode = new WebInspector.JavaScriptSource(url, null, defaultMapping); 140 uiSourceCodes[url] = uiSourceCode; 140 141 breakpointManager.restoreBreakpoints(uiSourceCode); 141 142 return uiSourceCode; … … 172 173 function setBreakpoint(breakpointManager, uiSourceCode, lineNumber, condition, enabled) 173 174 { 174 InspectorTest.addResult(" Setting breakpoint at " + uiSourceCode. id+ ":" + lineNumber + " enabled:" + enabled + " condition:" + condition);175 InspectorTest.addResult(" Setting breakpoint at " + uiSourceCode.url + ":" + lineNumber + " enabled:" + enabled + " condition:" + condition); 175 176 return breakpointManager.setBreakpoint(uiSourceCode, lineNumber, condition, enabled); 176 177 } … … 178 179 function removeBreakpoint(breakpointManager, uiSourceCode, lineNumber) 179 180 { 180 InspectorTest.addResult(" Removing breakpoint at " + uiSourceCode. id+ ":" + lineNumber);181 InspectorTest.addResult(" Removing breakpoint at " + uiSourceCode.url + ":" + lineNumber); 181 182 breakpointManager.findBreakpoint(uiSourceCode, lineNumber).remove(); 182 183 } … … 195 196 InspectorTest.addResult(" Resetting breakpoint manager"); 196 197 breakpointManager.reset(); 198 uiSourceCodes = {}; 197 199 next(); 198 200 } -
trunk/LayoutTests/inspector/debugger/raw-source-code.html
r116775 r116846 98 98 99 99 var uiSourceCode = rawSourceCode.uiSourceCode(); 100 InspectorTest.addResult("UISourceCode: " + rawSourceCode.uiSourceCode(). id);100 InspectorTest.addResult("UISourceCode: " + rawSourceCode.uiSourceCode().url); 101 101 InspectorTest.addResult("UISourceCode is content script: " + uiSourceCode.isContentScript); 102 102 InspectorTest.checkUILocation(uiSourceCode, 0, 5, rawSourceCode.rawLocationToUILocation(createRawLocation(0, 5))); -
trunk/LayoutTests/inspector/debugger/scripts-file-selector.html
r113563 r116846 14 14 function addUISourceCode(url, isContentScript) 15 15 { 16 var uiSourceCode = new WebInspector.UISourceCode( 0,url, null, null);16 var uiSourceCode = new WebInspector.UISourceCode(url, null, null); 17 17 uiSourceCode.isContentScript = isContentScript; 18 18 navigatorFileSelector.addUISourceCode(uiSourceCode); -
trunk/LayoutTests/inspector/debugger/scripts-panel.html
r116780 r116846 50 50 function createUISouceCode(url) 51 51 { 52 var uiSourceCode = new WebInspector.JavaScriptSource( 0,url, null, null);52 var uiSourceCode = new WebInspector.JavaScriptSource(url, null, null); 53 53 uiSourceCode.requestContent = function(callback) 54 54 { -
trunk/LayoutTests/inspector/debugger/scripts-sorting.html
r113563 r116846 12 12 var navigatorFileSelector = new WebInspector.ScriptsNavigator(); 13 13 14 var nextId = 1;15 14 function addUISourceCode(url, isContentScript) 16 15 { 17 var uiSourceCode = new WebInspector.UISourceCode( nextId++,url, null, null);16 var uiSourceCode = new WebInspector.UISourceCode(url, null, null); 18 17 uiSourceCode.isContentScript = isContentScript; 19 18 navigatorFileSelector.addUISourceCode(uiSourceCode); -
trunk/LayoutTests/inspector/debugger/ui-source-code-display-name.html
r114623 r116846 7 7 function dumpUISourceCodeDisplayName(url) 8 8 { 9 var uiSourceCode = new WebInspector.UISourceCode( "id",url, null, null);9 var uiSourceCode = new WebInspector.UISourceCode(url, null, null); 10 10 InspectorTest.addResult("UISourceCode display name for url \"" + url + "\" is \"" + WebInspector.TabbedEditorContainer.prototype._titleForFile(uiSourceCode) + "\"."); 11 11 } -
trunk/LayoutTests/inspector/debugger/ui-source-code.html
r114241 r116846 18 18 function testUISourceCode(next) 19 19 { 20 var uiSourceCode = new WebInspector.UISourceCode(" id", "url", contentProvider);20 var uiSourceCode = new WebInspector.UISourceCode("url", contentProvider); 21 21 function didRequestContent(callNumber, content, contentEncoded, mimeType) 22 22 { -
trunk/Source/WebCore/ChangeLog
r116843 r116846 1 2012-05-12 Pavel Feldman <pfeldman@chromium.org> 2 3 Web Inspector: remove UISourceCode.id since it is no longer used. 4 https://bugs.webkit.org/show_bug.cgi?id=86286 5 6 Reviewed by Vsevolod Vlasov. 7 8 We are now using breakpointStorageId property for breakpoint persistence. 9 10 * inspector/front-end/BreakpointManager.js: 11 (WebInspector.BreakpointManager): 12 (WebInspector.BreakpointManager.prototype._debuggerReset): 13 (WebInspector.BreakpointManager.prototype._uiLocationAdded.get if): 14 (WebInspector.BreakpointManager.prototype._uiLocationAdded): 15 (WebInspector.BreakpointManager.prototype._uiLocationRemoved.get if): 16 (WebInspector.BreakpointManager.prototype._uiLocationRemoved): 17 * inspector/front-end/CompilerScriptMapping.js: 18 * inspector/front-end/JavaScriptSource.js: 19 (WebInspector.JavaScriptSource): 20 * inspector/front-end/RawSourceCode.js: 21 (WebInspector.RawSourceCode): 22 (WebInspector.RawSourceCode.prototype.rawLocationToUILocation): 23 (WebInspector.RawSourceCode.prototype._createUISourceCode): 24 (WebInspector.RawSourceCode.prototype._finishedLoading): 25 * inspector/front-end/SnippetsModel.js: 26 (WebInspector.SnippetsScriptMapping.prototype._snippetAdded): 27 (WebInspector.SnippetsScriptMapping.prototype._createUISourceCodeForScript): 28 * inspector/front-end/UISourceCode.js: 29 (WebInspector.UISourceCode): 30 1 31 2012-05-12 Pavel Feldman <pfeldman@chromium.org> 2 32 -
trunk/Source/WebCore/inspector/front-end/BreakpointManager.js
r116789 r116846 42 42 this._breakpoints = []; 43 43 this._breakpointForDebuggerId = {}; 44 this._breakpointsForUI Location = {};44 this._breakpointsForUISourceCode = new Map(); 45 45 this._sourceFilesWithRestoredBreakpoints = {}; 46 46 … … 115 115 findBreakpoint: function(uiSourceCode, lineNumber) 116 116 { 117 var breakpoints = this._breakpointsForUILocation[uiSourceCode.id + ":" + lineNumber]; 118 return breakpoints ? breakpoints[0] : null; 117 var breakpoints = this._breakpointsForUISourceCode.get(uiSourceCode); 118 var lineBreakpoints = breakpoints ? breakpoints[lineNumber] : null; 119 return lineBreakpoints ? lineBreakpoints[0] : null; 119 120 }, 120 121 … … 167 168 } 168 169 this._breakpoints = []; 169 this._breakpointsForUI Location = {};170 this._breakpointsForUISourceCode.clear(); 170 171 this._sourceFilesWithRestoredBreakpoints = {}; 171 172 }, … … 199 200 _uiLocationAdded: function(breakpoint, uiLocation) 200 201 { 201 var key = uiLocation.uiSourceCode.id + ":" + uiLocation.lineNumber; 202 var breakpoints = this._breakpointsForUILocation[key]; 202 var breakpoints = this._breakpointsForUISourceCode.get(uiLocation.uiSourceCode); 203 203 if (!breakpoints) { 204 breakpoints = []; 205 this._breakpointsForUILocation[key] = breakpoints; 206 } 207 breakpoints.push(breakpoint); 204 breakpoints = {}; 205 this._breakpointsForUISourceCode.put(uiLocation.uiSourceCode, breakpoints); 206 } 207 208 var lineBreakpoints = breakpoints[uiLocation.lineNumber]; 209 if (!lineBreakpoints) { 210 lineBreakpoints = []; 211 breakpoints[uiLocation.lineNumber] = lineBreakpoints; 212 } 213 214 lineBreakpoints.push(breakpoint); 208 215 this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.BreakpointAdded, {breakpoint: breakpoint, uiLocation: uiLocation}); 209 216 }, … … 215 222 _uiLocationRemoved: function(breakpoint, uiLocation) 216 223 { 217 var key = uiLocation.uiSourceCode.id + ":" + uiLocation.lineNumber; 218 var breakpoints = this._breakpointsForUILocation[key]; 224 var breakpoints = this._breakpointsForUISourceCode.get(uiLocation.uiSourceCode); 219 225 if (!breakpoints) 220 226 return; 221 breakpoints.remove(breakpoint); 222 if (!breakpoints.length) 223 delete this._breakpointsForUILocation[key]; 227 228 var lineBreakpoints = breakpoints[uiLocation.lineNumber]; 229 if (!lineBreakpoints) 230 return; 231 232 lineBreakpoints.remove(breakpoint); 233 if (!lineBreakpoints.length) 234 delete breakpoints[uiLocation.lineNumber]; 224 235 this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.BreakpointRemoved, {breakpoint: breakpoint, uiLocation: uiLocation}); 225 236 } -
trunk/Source/WebCore/inspector/front-end/CompilerScriptMapping.js
r116775 r116846 117 117 else 118 118 contentProvider = new WebInspector.CompilerSourceMappingContentProvider(sourceURL); 119 var uiSourceCode = new WebInspector.JavaScriptSource(sourceURL, sourceURL,contentProvider, this);119 var uiSourceCode = new WebInspector.JavaScriptSource(sourceURL, contentProvider, this); 120 120 uiSourceCode.isContentScript = script.isContentScript; 121 121 uiSourceCode.isEditable = false; -
trunk/Source/WebCore/inspector/front-end/JavaScriptSource.js
r116789 r116846 32 32 * @constructor 33 33 * @extends {WebInspector.UISourceCode} 34 * @param {string} id35 34 * @param {string} url 36 35 * @param {WebInspector.ContentProvider} contentProvider 37 36 * @param {WebInspector.SourceMapping} sourceMapping 38 37 */ 39 WebInspector.JavaScriptSource = function( id,url, contentProvider, sourceMapping)38 WebInspector.JavaScriptSource = function(url, contentProvider, sourceMapping) 40 39 { 41 WebInspector.UISourceCode.call(this, id,url, contentProvider, sourceMapping);40 WebInspector.UISourceCode.call(this, url, contentProvider, sourceMapping); 42 41 43 42 this._formatterMapping = new WebInspector.IdentityFormatterSourceMapping(); -
trunk/Source/WebCore/inspector/front-end/RawSourceCode.js
r116775 r116846 55 55 this._pendingRequest.addEventListener(WebInspector.NetworkRequest.Events.FinishedLoading, this._finishedLoading, this); 56 56 else 57 this._uiSourceCode = this._createUISourceCode( this.url);57 this._uiSourceCode = this._createUISourceCode(); 58 58 } 59 59 … … 79 79 var uiSourceCode = this._uiSourceCode || this._temporaryUISourceCode; 80 80 if (!uiSourceCode) { 81 this._temporaryUISourceCode = this._createUISourceCode( "tmp-" + this.url);81 this._temporaryUISourceCode = this._createUISourceCode(); 82 82 uiSourceCode = this._temporaryUISourceCode; 83 83 this.dispatchEventToListeners(WebInspector.RawSourceCode.Events.UISourceCodeChanged, { uiSourceCode: uiSourceCode }); … … 87 87 88 88 /** 89 * @param {string} id90 89 * @return {WebInspector.UISourceCode} 91 90 */ 92 _createUISourceCode: function( id)91 _createUISourceCode: function() 93 92 { 94 93 var isStandaloneScript = this._scripts.length === 1 && !this._scripts[0].isInlineScript(); … … 102 101 contentProvider = new WebInspector.ConcatenatedScriptsContentProvider(this._scripts); 103 102 104 var uiSourceCode = new WebInspector.JavaScriptSource( id,this.url, contentProvider, this._sourceMapping);103 var uiSourceCode = new WebInspector.JavaScriptSource(this.url, contentProvider, this._sourceMapping); 105 104 uiSourceCode.isContentScript = this.isContentScript; 106 105 uiSourceCode.isEditable = isStandaloneScript; … … 134 133 delete this._pendingRequest; 135 134 var oldUISourceCode = this._uiSourceCode || this._temporaryUISourceCode; 136 this._uiSourceCode = this._createUISourceCode( this.url);135 this._uiSourceCode = this._createUISourceCode(); 137 136 this.dispatchEventToListeners(WebInspector.RawSourceCode.Events.UISourceCodeChanged, { uiSourceCode: this._uiSourceCode, oldUISourceCode: oldUISourceCode }); 138 137 } -
trunk/Source/WebCore/inspector/front-end/SnippetsModel.js
r116775 r116846 392 392 _snippetAdded: function(snippet) 393 393 { 394 var uiSourceCodeId = ""; // FIXME: to be implemented.395 394 var uiSourceCodeURL = ""; // FIXME: to be implemented. 396 var uiSourceCode = new WebInspector.JavaScriptSource(uiSourceCode Id, uiSourceCodeURL, new WebInspector.SnippetContentProvider(snippet), this);395 var uiSourceCode = new WebInspector.JavaScriptSource(uiSourceCodeURL, new WebInspector.SnippetContentProvider(snippet), this); 397 396 uiSourceCode.isSnippet = true; 398 397 uiSourceCode.isEditable = true; … … 417 416 _createUISourceCodeForScript: function(script) 418 417 { 419 var uiSourceCode = new WebInspector.JavaScriptSource(script.sourceURL, script .sourceURL, script, this);418 var uiSourceCode = new WebInspector.JavaScriptSource(script.sourceURL, script, this); 420 419 uiSourceCode.isSnippetEvaluation = true; 421 420 var oldUISourceCode = this._uiSourceCodeForScriptId[script.scriptId]; -
trunk/Source/WebCore/inspector/front-end/UISourceCode.js
r116789 r116846 33 33 * @constructor 34 34 * @extends {WebInspector.Object} 35 * @param {string} id36 35 * @param {string} url 37 36 * @param {WebInspector.ContentProvider} contentProvider 38 37 * @param {WebInspector.SourceMapping} sourceMapping 39 38 */ 40 WebInspector.UISourceCode = function( id,url, contentProvider, sourceMapping)39 WebInspector.UISourceCode = function(url, contentProvider, sourceMapping) 41 40 { 42 this._id = id;43 41 this._url = url; 44 42 this._parsedURL = new WebInspector.ParsedURL(url); … … 66 64 67 65 WebInspector.UISourceCode.prototype = { 68 /**69 * @return {string}70 */71 get id()72 {73 return this._id;74 },75 76 66 /** 77 67 * @return {string}
Note: See TracChangeset
for help on using the changeset viewer.