Changeset 146903 in webkit
- Timestamp:
- Mar 26, 2013 10:22:13 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r146901 r146903 1 2013-03-26 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Web Inspector: Distinguish breakpoints and breakpoint locations in BreakpointManager API 4 https://bugs.webkit.org/show_bug.cgi?id=113311 5 6 Reviewed by Pavel Feldman. 7 8 * inspector/debugger/live-edit-breakpoints-expected.txt: 9 * inspector/debugger/live-edit-breakpoints.html: 10 1 11 2013-03-26 Dmitry Zvorygin <zvorygin@chromium.org> 2 12 -
trunk/LayoutTests/inspector/debugger/live-edit-breakpoints-expected.txt
r146191 r146903 11 11 Dumping breakpoint locations 12 12 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 13 Editing source: 14 TextEditor.removeBreakpoint(lineNumber = 2) 15 TextEditor.addBreakpoint(lineNumber = 2, disabled = true) 16 OriginalTextEditor.addBreakpoint(lineNumber = 2, disabled = false) 17 Dumping breakpoint storage 18 edit-me-breakpoints.js:2, enabled:true 19 Dumping breakpoint locations 20 url: edit-me-breakpoints.js, lineNumber: 2, project type: debugger, project id: debugger: 21 Undoing source editing: 22 OriginalTextEditor.removeBreakpoint(lineNumber = 2) 23 TextEditor.removeBreakpoint(lineNumber = 2) 24 TextEditor.removeBreakpoint(lineNumber = 2) 25 TextEditor.addBreakpoint(lineNumber = 2, disabled = false) 26 Dumping breakpoint storage 27 edit-me-breakpoints.js:2, enabled:true 28 Dumping breakpoint locations 29 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 30 Finally removing breakpoint: 31 TextEditor.removeBreakpoint(lineNumber = 2) 32 Dumping breakpoint storage 33 Dumping breakpoint locations 13 Dumping breakpoints 14 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 15 Editing source: 16 TextEditor.removeBreakpoint(lineNumber = 2) 17 TextEditor.addBreakpoint(lineNumber = 2, disabled = true) 18 OriginalTextEditor.addBreakpoint(lineNumber = 2, disabled = false) 19 Dumping breakpoint storage 20 edit-me-breakpoints.js:2, enabled:true 21 Dumping breakpoint locations 22 url: edit-me-breakpoints.js, lineNumber: 2, project type: debugger, project id: debugger: 23 Dumping breakpoints 24 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 25 Undoing source editing: 26 OriginalTextEditor.removeBreakpoint(lineNumber = 2) 27 TextEditor.removeBreakpoint(lineNumber = 2) 28 TextEditor.removeBreakpoint(lineNumber = 2) 29 TextEditor.addBreakpoint(lineNumber = 2, disabled = false) 30 Dumping breakpoint storage 31 edit-me-breakpoints.js:2, enabled:true 32 Dumping breakpoint locations 33 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 34 Dumping breakpoints 35 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 36 Finally removing breakpoint: 37 TextEditor.removeBreakpoint(lineNumber = 2) 38 Dumping breakpoint storage 39 Dumping breakpoint locations 40 Dumping breakpoints 34 41 35 42 Running: testEditCommit … … 40 47 Dumping breakpoint locations 41 48 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 42 Editing source: 43 OriginalTextEditor.addBreakpoint(lineNumber = 2, disabled = false) 44 TextEditor.removeBreakpoint(lineNumber = 2) 45 TextEditor.addBreakpoint(lineNumber = 2, disabled = true) 46 Dumping breakpoint storage 47 edit-me-breakpoints.js:2, enabled:true 48 Dumping breakpoint locations 49 url: edit-me-breakpoints.js, lineNumber: 2, project type: debugger, project id: debugger: 49 Dumping breakpoints 50 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 51 Editing source: 52 OriginalTextEditor.addBreakpoint(lineNumber = 2, disabled = false) 53 TextEditor.removeBreakpoint(lineNumber = 2) 54 TextEditor.addBreakpoint(lineNumber = 2, disabled = true) 55 Dumping breakpoint storage 56 edit-me-breakpoints.js:2, enabled:true 57 Dumping breakpoint locations 58 url: edit-me-breakpoints.js, lineNumber: 2, project type: debugger, project id: debugger: 59 Dumping breakpoints 60 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 50 61 Committing edited source: 51 62 OriginalTextEditor.removeBreakpoint(lineNumber = 2) … … 57 68 Dumping breakpoint locations 58 69 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 59 Finally removing breakpoint: 60 TextEditor.removeBreakpoint(lineNumber = 2) 61 Dumping breakpoint storage 62 Dumping breakpoint locations 70 Dumping breakpoints 71 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 72 Finally removing breakpoint: 73 TextEditor.removeBreakpoint(lineNumber = 2) 74 Dumping breakpoint storage 75 Dumping breakpoint locations 76 Dumping breakpoints 63 77 64 78 Running: testEditCommitFailEditCommit … … 69 83 Dumping breakpoint locations 70 84 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 71 Editing source: 72 OriginalTextEditor.addBreakpoint(lineNumber = 2, disabled = false) 73 TextEditor.removeBreakpoint(lineNumber = 2) 74 TextEditor.addBreakpoint(lineNumber = 2, disabled = true) 75 Dumping breakpoint storage 76 edit-me-breakpoints.js:2, enabled:true 77 Dumping breakpoint locations 78 url: edit-me-breakpoints.js, lineNumber: 2, project type: debugger, project id: debugger: 85 Dumping breakpoints 86 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 87 Editing source: 88 OriginalTextEditor.addBreakpoint(lineNumber = 2, disabled = false) 89 TextEditor.removeBreakpoint(lineNumber = 2) 90 TextEditor.addBreakpoint(lineNumber = 2, disabled = true) 91 Dumping breakpoint storage 92 edit-me-breakpoints.js:2, enabled:true 93 Dumping breakpoint locations 94 url: edit-me-breakpoints.js, lineNumber: 2, project type: debugger, project id: debugger: 95 Dumping breakpoints 96 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 79 97 Committing edited source: 80 98 Dumping breakpoint storage … … 82 100 Dumping breakpoint locations 83 101 url: edit-me-breakpoints.js, lineNumber: 2, project type: debugger, project id: debugger: 102 Dumping breakpoints 103 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 84 104 Editing source again so that live edit could succeed: 85 105 Dumping breakpoint storage … … 87 107 Dumping breakpoint locations 88 108 url: edit-me-breakpoints.js, lineNumber: 2, project type: debugger, project id: debugger: 109 Dumping breakpoints 110 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 89 111 Committing edited source again: 90 112 OriginalTextEditor.removeBreakpoint(lineNumber = 2) … … 96 118 Dumping breakpoint locations 97 119 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 98 Finally removing breakpoint: 99 TextEditor.removeBreakpoint(lineNumber = 2) 100 Dumping breakpoint storage 101 Dumping breakpoint locations 120 Dumping breakpoints 121 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 122 Finally removing breakpoint: 123 TextEditor.removeBreakpoint(lineNumber = 2) 124 Dumping breakpoint storage 125 Dumping breakpoint locations 126 Dumping breakpoints 102 127 103 128 Running: testEditCommitFailUndoCommit … … 108 133 Dumping breakpoint locations 109 134 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 110 Editing source: 111 OriginalTextEditor.addBreakpoint(lineNumber = 2, disabled = false) 112 TextEditor.removeBreakpoint(lineNumber = 2) 113 TextEditor.addBreakpoint(lineNumber = 2, disabled = true) 114 Dumping breakpoint storage 115 edit-me-breakpoints.js:2, enabled:true 116 Dumping breakpoint locations 117 url: edit-me-breakpoints.js, lineNumber: 2, project type: debugger, project id: debugger: 135 Dumping breakpoints 136 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 137 Editing source: 138 OriginalTextEditor.addBreakpoint(lineNumber = 2, disabled = false) 139 TextEditor.removeBreakpoint(lineNumber = 2) 140 TextEditor.addBreakpoint(lineNumber = 2, disabled = true) 141 Dumping breakpoint storage 142 edit-me-breakpoints.js:2, enabled:true 143 Dumping breakpoint locations 144 url: edit-me-breakpoints.js, lineNumber: 2, project type: debugger, project id: debugger: 145 Dumping breakpoints 146 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 118 147 Committing edited source: 119 148 Dumping breakpoint storage … … 121 150 Dumping breakpoint locations 122 151 url: edit-me-breakpoints.js, lineNumber: 2, project type: debugger, project id: debugger: 123 Undoing source editing: 124 Dumping breakpoint storage 125 edit-me-breakpoints.js:2, enabled:true 126 Dumping breakpoint locations 127 url: edit-me-breakpoints.js, lineNumber: 2, project type: debugger, project id: debugger: 152 Dumping breakpoints 153 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 154 Undoing source editing: 155 Dumping breakpoint storage 156 edit-me-breakpoints.js:2, enabled:true 157 Dumping breakpoint locations 158 url: edit-me-breakpoints.js, lineNumber: 2, project type: debugger, project id: debugger: 159 Dumping breakpoints 160 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 128 161 Committing edited source again: 129 162 OriginalTextEditor.removeBreakpoint(lineNumber = 2) … … 135 168 Dumping breakpoint locations 136 169 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 137 Finally removing breakpoint: 138 TextEditor.removeBreakpoint(lineNumber = 2) 139 Dumping breakpoint storage 140 Dumping breakpoint locations 170 Dumping breakpoints 171 url: edit-me-breakpoints.js, lineNumber: 2, project type: network, project id: file:// 172 Finally removing breakpoint: 173 TextEditor.removeBreakpoint(lineNumber = 2) 174 Dumping breakpoint storage 175 Dumping breakpoint locations 176 Dumping breakpoints 141 177 142 178 Running: testEditAnonymousUndo … … 150 186 Dumping breakpoint locations 151 187 url: , lineNumber: 2, project type: debugger, project id: debugger: 152 Editing source: 153 Dumping breakpoint storage 154 Dumping breakpoint locations 155 url: , lineNumber: 2, project type: debugger, project id: debugger: 156 Undoing source editing: 157 Dumping breakpoint storage 158 Dumping breakpoint locations 159 url: , lineNumber: 2, project type: debugger, project id: debugger: 160 Finally removing breakpoint: 161 TextEditor.removeBreakpoint(lineNumber = 2) 162 Dumping breakpoint storage 163 Dumping breakpoint locations 188 Dumping breakpoints 189 url: , lineNumber: 2, project type: debugger, project id: debugger: 190 Editing source: 191 Dumping breakpoint storage 192 Dumping breakpoint locations 193 url: , lineNumber: 2, project type: debugger, project id: debugger: 194 Dumping breakpoints 195 url: , lineNumber: 2, project type: debugger, project id: debugger: 196 Undoing source editing: 197 Dumping breakpoint storage 198 Dumping breakpoint locations 199 url: , lineNumber: 2, project type: debugger, project id: debugger: 200 Dumping breakpoints 201 url: , lineNumber: 2, project type: debugger, project id: debugger: 202 Finally removing breakpoint: 203 TextEditor.removeBreakpoint(lineNumber = 2) 204 Dumping breakpoint storage 205 Dumping breakpoint locations 206 Dumping breakpoints 164 207 165 208 Running: testEditDynamicAnonymousUndo … … 173 216 Dumping breakpoint locations 174 217 url: , lineNumber: 2, project type: debugger, project id: debugger: 175 Editing source: 176 Dumping breakpoint storage 177 Dumping breakpoint locations 178 url: , lineNumber: 2, project type: debugger, project id: debugger: 179 Undoing source editing: 180 Dumping breakpoint storage 181 Dumping breakpoint locations 182 url: , lineNumber: 2, project type: debugger, project id: debugger: 183 Finally removing breakpoint: 184 TextEditor.removeBreakpoint(lineNumber = 2) 185 Dumping breakpoint storage 186 Dumping breakpoint locations 218 Dumping breakpoints 219 url: , lineNumber: 2, project type: debugger, project id: debugger: 220 Editing source: 221 Dumping breakpoint storage 222 Dumping breakpoint locations 223 url: , lineNumber: 2, project type: debugger, project id: debugger: 224 Dumping breakpoints 225 url: , lineNumber: 2, project type: debugger, project id: debugger: 226 Undoing source editing: 227 Dumping breakpoint storage 228 Dumping breakpoint locations 229 url: , lineNumber: 2, project type: debugger, project id: debugger: 230 Dumping breakpoints 231 url: , lineNumber: 2, project type: debugger, project id: debugger: 232 Finally removing breakpoint: 233 TextEditor.removeBreakpoint(lineNumber = 2) 234 Dumping breakpoint storage 235 Dumping breakpoint locations 236 Dumping breakpoints 187 237 Debugger was disabled. 188 238 -
trunk/LayoutTests/inspector/debugger/live-edit-breakpoints.html
r143202 r146903 40 40 var uiLocation = locations[i].uiLocation; 41 41 var uiSourceCode = uiLocation.uiSourceCode; 42 var originURL = uiSourceCode.originURL(); 43 var lineNumber = uiLocation.lineNumber; 42 44 var project = uiSourceCode.project(); 43 InspectorTest.addResult(" url: " + pathToFileName(uiSourceCode.originURL()) + ", lineNumber: " + uiLocation.lineNumber + ", project type: " + project.type() + ", project id: " + project.id()); 45 InspectorTest.addResult(" url: " + pathToFileName(originURL) + ", lineNumber: " + lineNumber + ", project type: " + project.type() + ", project id: " + project.id()); 46 } 47 48 breakpoints = breakpointManager.allBreakpoints(); 49 InspectorTest.addResult(" Dumping breakpoints"); 50 for (var i = 0; i < breakpoints.length; ++i) { 51 var breakpoint = breakpoints[i]; 52 var primaryUILocation = breakpoint.primaryUILocation(); 53 var uiSourceCode = primaryUILocation.uiSourceCode; 54 var originURL = uiSourceCode.originURL(); 55 var lineNumber = primaryUILocation.lineNumber; 56 var project = uiSourceCode.project(); 57 InspectorTest.addResult(" url: " + pathToFileName(originURL) + ", lineNumber: " + lineNumber + ", project type: " + project.type() + ", project id: " + project.id()); 44 58 } 45 59 } -
trunk/Source/WebCore/ChangeLog
r146901 r146903 1 2013-03-26 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Web Inspector: Distinguish breakpoints and breakpoint locations in BreakpointManager API 4 https://bugs.webkit.org/show_bug.cgi?id=113311 5 6 Reviewed by Pavel Feldman. 7 8 Made independent handling of breakpoints and breakpoint location in breakpoint manager consistent. 9 JavaScriptSourceFrame now removes breakpoints originally set in it based on primary UI location. 10 11 * inspector/front-end/BreakpointManager.js: 12 (WebInspector.BreakpointManager.prototype.breakpointsForUISourceCode): 13 (WebInspector.BreakpointManager.prototype.allBreakpoints): 14 (WebInspector.BreakpointManager.prototype.breakpointLocationsForUISourceCode): 15 (WebInspector.BreakpointManager.prototype.allBreakpointLocations): 16 (WebInspector.BreakpointManager.prototype._projectWillReset.get for): 17 (WebInspector.BreakpointManager.prototype._projectWillReset): 18 * inspector/front-end/JavaScriptSourceFrame.js: 19 (WebInspector.JavaScriptSourceFrame.prototype.onUISourceCodeContentChanged): 20 (WebInspector.JavaScriptSourceFrame.prototype._restoreBreakpointsAfterEditing): 21 (WebInspector.JavaScriptSourceFrame.prototype._removeAllBreakpoints): 22 1 23 2013-03-26 Dmitry Zvorygin <zvorygin@chromium.org> 2 24 -
trunk/Source/WebCore/inspector/front-end/BreakpointManager.js
r146898 r146903 161 161 162 162 /** 163 * @param { function(WebInspector.BreakpointManager.Breakpoint, WebInspector.UILocation)} filter164 * @return {Array.< {breakpoint: WebInspector.BreakpointManager.Breakpoint, uiLocation: WebInspector.UILocation}>}165 */ 166 _filteredBreakpointLocations: function(filter)163 * @param {WebInspector.UISourceCode} uiSourceCode 164 * @return {Array.<WebInspector.BreakpointManager.Breakpoint>} 165 */ 166 breakpointsForUISourceCode: function(uiSourceCode) 167 167 { 168 168 var result = []; … … 170 170 for (var i = 0; i < breakpoints.length; ++i) { 171 171 var breakpoint = breakpoints[i]; 172 for (var stringifiedLocation in breakpoint._uiLocations) { 173 var uiLocation = breakpoint._uiLocations[stringifiedLocation]; 174 if (filter(breakpoint, uiLocation)) 175 result.push({breakpoint: breakpoint, uiLocation: uiLocation}); 176 } 172 var uiLocation = breakpoint._primaryUILocation; 173 if (uiLocation.uiSourceCode === uiSourceCode) 174 result.push(breakpoint); 177 175 } 178 176 return result; 177 }, 178 179 /** 180 * @return {Array.<WebInspector.BreakpointManager.Breakpoint>} 181 */ 182 allBreakpoints: function() 183 { 184 var result = []; 185 var breakpoints = /** @type {Array.<WebInspector.BreakpointManager.Breakpoint>} */(this._breakpoints.keys()); 186 return breakpoints; 179 187 }, 180 188 … … 185 193 breakpointLocationsForUISourceCode: function(uiSourceCode) 186 194 { 187 function filter(breakpoint, uiLocation) 188 { 189 return uiLocation.uiSourceCode === uiSourceCode; 190 } 191 192 return this._filteredBreakpointLocations(filter); 195 var result = []; 196 var breakpoints = /** @type {Array.<WebInspector.BreakpointManager.Breakpoint>} */(this._breakpoints.keys()); 197 for (var i = 0; i < breakpoints.length; ++i) { 198 var breakpoint = breakpoints[i]; 199 var uiLocations = Object.values(breakpoint._uiLocations); 200 for (var j = 0; j < uiLocations.length; ++j) { 201 var uiLocation = uiLocations[j]; 202 if (uiLocation.uiSourceCode === uiSourceCode) 203 result.push({breakpoint: breakpoint, uiLocation: uiLocations[j]}); 204 } 205 } 206 return result; 193 207 }, 194 208 … … 198 212 allBreakpointLocations: function() 199 213 { 200 return this._filteredBreakpointLocations(function(breakpoint, uiLocation) { return true; }); 214 var result = []; 215 var breakpoints = /** @type {Array.<WebInspector.BreakpointManager.Breakpoint>} */(this._breakpoints.keys()); 216 for (var i = 0; i < breakpoints.length; ++i) { 217 var breakpoint = breakpoints[i]; 218 var uiLocations = Object.values(breakpoint._uiLocations); 219 for (var j = 0; j < uiLocations.length; ++j) 220 result.push({breakpoint: breakpoint, uiLocation: uiLocations[j]}); 221 } 222 return result; 201 223 }, 202 224 … … 246 268 for (var j = 0; j < lineBreakpoints.length; ++j) { 247 269 var breakpoint = lineBreakpoints[j]; 248 this._breakpoints.remove(breakpoint);249 delete breakpoint._primaryUILocation;250 270 breakpoint._resetLocations(); 251 271 } 252 272 } 253 273 this._breakpointsForUISourceCode.remove(uiSourceCode); 274 275 var breakpoints = this.breakpointsForUISourceCode(uiSourceCode); 276 for (var j = 0; j < breakpoints.length; ++j) { 277 this._breakpoints.remove(breakpoints[j]); 278 delete breakpoint._primaryUILocation; 279 } 280 254 281 var sourceFileId = WebInspector.BreakpointManager.sourceFileId(uiSourceCode); 255 282 delete this._sourceFilesWithRestoredBreakpoints[sourceFileId]; -
trunk/Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js
r146769 r146903 81 81 onUISourceCodeContentChanged: function(content, contentEncoded, mimeType) 82 82 { 83 var breakpointLocations = this._breakpointManager.breakpointLocationsForUISourceCode(this._uiSourceCode); 84 for (var i = 0; i < breakpointLocations.length; ++i) 85 breakpointLocations[i].breakpoint.remove(); 83 this._removeAllBreakpoints(); 86 84 WebInspector.UISourceCodeFrame.prototype.onUISourceCodeContentChanged.call(this, content); 87 85 }, … … 191 189 192 190 // Remove all breakpoints. 193 var breakpointLocations = this._breakpointManager.breakpointLocationsForUISourceCode(this._uiSourceCode); 194 var lineNumbers = {}; 195 for (var i = 0; i < breakpointLocations.length; ++i) { 196 var breakpoint = breakpointLocations[i].breakpoint; 197 breakpointLocations[i].breakpoint.remove(); 198 } 191 this._removeAllBreakpoints(); 199 192 200 193 // Restore all breakpoints from saved decorations. … … 206 199 this._setBreakpoint(lineNumber, breakpointDecoration.condition, breakpointDecoration.enabled); 207 200 } 201 }, 202 203 _removeAllBreakpoints: function() 204 { 205 var breakpoints = this._breakpointManager.breakpointsForUISourceCode(this._uiSourceCode); 206 for (var i = 0; i < breakpoints.length; ++i) 207 breakpoints[i].remove(); 208 208 }, 209 209
Note: See TracChangeset
for help on using the changeset viewer.