Changeset 171784 in webkit
- Timestamp:
- Jul 29, 2014 8:48:54 PM (10 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r171783 r171784 1 2014-07-29 Brian J. Burg <burg@cs.washington.edu> 2 3 Web Inspector: breakpoints are always speculatively resolved when restored from local storage 4 https://bugs.webkit.org/show_bug.cgi?id=135396 5 6 Reviewed by Timothy Hatcher. 7 8 A longstanding quirk/optimization in the frontend is that we immediately set a breakpoint 9 as resolved if the breakpoint was successfully set in the backend. This ensures that clicking in 10 the gutter immediately produces a resolved breakpoint with only one round-trip. 11 12 However, not all breakpoints should be speculatively resolved, because the corresponding resource 13 may not be loaded yet. This situation causes problems for code that assumes a resolved breakpoint 14 also has a valid sourceCodeLocation.sourceCode. 15 16 * UserInterface/Controllers/DebuggerManager.js: 17 (WebInspector.DebuggerManager.restoreBreakpointsSoon): Don't leak the variable to global scope. 18 (WebInspector.DebuggerManager): 19 (WebInspector.DebuggerManager.prototype.speculativelyResolveBreakpoint): 20 (WebInspector.DebuggerManager.prototype.addBreakpoint): Speculatively resolve here if requested 21 using the success callback passed to _setBreakpoint. 22 23 (WebInspector.DebuggerManager.prototype.didSetBreakpoint): Emit simulated 24 Debugger.breakpointResolved events since they are only sent by the backend when a script is parsed. 25 26 (WebInspector.DebuggerManager.prototype._setBreakpoint): 27 * UserInterface/Views/SourceCodeTextEditor.js: 28 (WebInspector.SourceCodeTextEditor.prototype.textEditorBreakpointAdded): Request speculative resolve. 29 1 30 2014-07-29 Joseph Pecoraro <pecoraro@apple.com> 2 31 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
r171013 r171784 68 68 69 69 function restoreBreakpointsSoon() { 70 for ( cookie of this._breakpointsSetting.value)70 for (var cookie of this._breakpointsSetting.value) 71 71 this.addBreakpoint(new WebInspector.Breakpoint(cookie)); 72 72 } … … 228 228 }, 229 229 230 addBreakpoint: function(breakpoint, skipEventDispatch )230 addBreakpoint: function(breakpoint, skipEventDispatch, shouldSpeculativelyResolve) 231 231 { 232 232 console.assert(breakpoint instanceof WebInspector.Breakpoint, "Bad argument to DebuggerManger.addBreakpoint: ", breakpoint); … … 250 250 this._breakpoints.push(breakpoint); 251 251 252 function speculativelyResolveBreakpoint(breakpoint) { 253 breakpoint.resolved = true; 254 } 255 252 256 if (!breakpoint.disabled) 253 this._setBreakpoint(breakpoint );257 this._setBreakpoint(breakpoint, shouldSpeculativelyResolve ? speculativelyResolveBreakpoint.bind(null, breakpoint) : null); 254 258 255 259 if (!skipEventDispatch) … … 525 529 this.breakpointsEnabled = true; 526 530 527 function didSetBreakpoint(error, breakpointIdentifier )531 function didSetBreakpoint(error, breakpointIdentifier, locations) 528 532 { 529 533 if (error) … … 533 537 534 538 breakpoint.identifier = breakpointIdentifier; 535 breakpoint.resolved = true; 539 540 // Debugger.setBreakpoint returns a single location. 541 if (!(locations instanceof Array)) 542 locations = [locations]; 543 544 for (var location of locations) 545 this.breakpointResolved(breakpointIdentifier, location); 536 546 537 547 if (typeof callback === "function") -
trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js
r170899 r171784 840 840 841 841 this._ignoreBreakpointAddedBreakpoint = breakpoint; 842 WebInspector.debuggerManager.addBreakpoint(breakpoint); 842 843 var shouldSkipEventDispatch = false; 844 var shouldSpeculativelyResolveBreakpoint = true; 845 WebInspector.debuggerManager.addBreakpoint(breakpoint, shouldSkipEventDispatch, shouldSpeculativelyResolveBreakpoint); 843 846 delete this._ignoreBreakpointAddedBreakpoint; 844 847
Note: See TracChangeset
for help on using the changeset viewer.