| Summary: | Web Inspector: breakpoints are always speculatively resolved when restored from local storage | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Brian Burg <burg> | ||||
| Component: | Web Inspector | Assignee: | Brian Burg <burg> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | commit-queue, graouts, joepeck, timothy, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 135367 | ||||||
| Attachments: |
|
||||||
|
Description
Brian Burg
2014-07-29 15:30:45 PDT
Created attachment 235707 [details]
Patch
Comment on attachment 235707 [details] Patch Clearing flags on attachment: 235707 Committed r171784: <http://trac.webkit.org/changeset/171784> All reviewed patches have been landed. Closing bug. Comment on attachment 235707 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=235707&action=review > Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:257 > + function speculativelyResolveBreakpoint(breakpoint) { > + breakpoint.resolved = true; > + } > + > if (!breakpoint.disabled) > - this._setBreakpoint(breakpoint); > + this._setBreakpoint(breakpoint, shouldSpeculativelyResolve ? speculativelyResolveBreakpoint.bind(null, breakpoint) : null); I think we can improve this. The _setBreakpoint callback should be passed the breakpoint, so that we aren't creating all this bound functions. function speculativelyResolveBreakpoint(breakpoint) { breakpoint.resolved = true; } this._setBreakpoint(breakpoint, shouldSpeculativelyResolve ? speculativelyResolveBrekapoint : null); > Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:548 > + for (var location of locations) > + this.breakpointResolved(breakpointIdentifier, location); > > if (typeof callback === "function") > callback(); And here, callback would pass the breakpoint: callback(breakpoint); (In reply to comment #5) > (From update of attachment 235707 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=235707&action=review > > > Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:257 > > + function speculativelyResolveBreakpoint(breakpoint) { > > + breakpoint.resolved = true; > > + } > > + > > if (!breakpoint.disabled) > > - this._setBreakpoint(breakpoint); > > + this._setBreakpoint(breakpoint, shouldSpeculativelyResolve ? speculativelyResolveBreakpoint.bind(null, breakpoint) : null); > > I think we can improve this. > > The _setBreakpoint callback should be passed the breakpoint, so that we aren't creating all this bound functions. > > function speculativelyResolveBreakpoint(breakpoint) { > breakpoint.resolved = true; > } > > this._setBreakpoint(breakpoint, shouldSpeculativelyResolve ? speculativelyResolveBrekapoint : null); > > > Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:548 > > + for (var location of locations) > > + this.breakpointResolved(breakpointIdentifier, location); > > > > if (typeof callback === "function") > > callback(); > > And here, callback would pass the breakpoint: > > callback(breakpoint); I was going to go full-blown promises here since this code doesn't handle errors well, but I'm trying to restrain myself from allocation and command optimizations until we have some useful profiling data. |