Web Inspector: breakpoints are always speculatively resolved when restored from local...
authorburg@cs.washington.edu <burg@cs.washington.edu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Jul 2014 03:48:54 +0000 (03:48 +0000)
committerburg@cs.washington.edu <burg@cs.washington.edu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Jul 2014 03:48:54 +0000 (03:48 +0000)
commitdad751387b7d627e40f3127e076497ba3956f540
treeebd2ecff8fa278f822fe5986bb104cb6e8233f7a
parent26d1404383ef0218f9cb4d37ca46d86d3044c675
Web Inspector: breakpoints are always speculatively resolved when restored from local storage
https://bugs.webkit.org/show_bug.cgi?id=135396

Reviewed by Timothy Hatcher.

A longstanding quirk/optimization in the frontend is that we immediately set a breakpoint
as resolved if the breakpoint was successfully set in the backend. This ensures that clicking in
the gutter immediately produces a resolved breakpoint with only one round-trip.

However, not all breakpoints should be speculatively resolved, because the corresponding resource
may not be loaded yet. This situation causes problems for code that assumes a resolved breakpoint
also has a valid sourceCodeLocation.sourceCode.

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.restoreBreakpointsSoon): Don't leak the variable to global scope.
(WebInspector.DebuggerManager):
(WebInspector.DebuggerManager.prototype.speculativelyResolveBreakpoint):
(WebInspector.DebuggerManager.prototype.addBreakpoint): Speculatively resolve here if requested
using the success callback passed to _setBreakpoint.

(WebInspector.DebuggerManager.prototype.didSetBreakpoint): Emit simulated
Debugger.breakpointResolved events since they are only sent by the backend when a script is parsed.

(WebInspector.DebuggerManager.prototype._setBreakpoint):
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype.textEditorBreakpointAdded): Request speculative resolve.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@171784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js