WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
52879
Web Inspector: refactor debugger api
https://bugs.webkit.org/show_bug.cgi?id=52879
Summary
Web Inspector: refactor debugger api
Pavel Podivilov
Reported
2011-01-21 02:47:02 PST
The are two problems with setting breakpoints using our API: 1. Clients have to manage the list of sticky breakpoints and constantly call setStickyBreakpoints to sync that list with backend. 2. There is no way to set JavaScript breakpoint by url. To fix the first problem, we should update sticky breakpoints on backend each time client calls set/remove breakpoint method. Since we have two independent debugger agents (InspectorDebuggerAgent and InspectorBrowserDebuggerAgent), sticky breakpoints management should be implemented in both. Client should have to sync all breakpoints just once at the beginning using the following methods: [domain=Inspector] setAllJavaScriptBreakpoints(breakpoints) [domain=Inspector] setAllBrowserBreakpoints(breakpoints) To fix the second problem, JavaScript debugger API should allow setting breakpoint by both url and sourceID. [domain=Debugger] setJavaScriptBreakpoint(url, lineNumber, condition, enabled, out breakpointId) [domain=Debugger] setJavaScriptBreakpointBySourceID(sourceID, lineNumber, condition, enabled, out breakpointId) [domain=Debugger] removeJavaScriptBreakpoint(breakpointId)
Attachments
Add attachment
proposed patch, testcase, etc.
Ilya Tikhonovsky
Comment 1
2011-01-21 04:47:49 PST
(In reply to
comment #0
)
> The are two problems with setting breakpoints using our API: > 1. Clients have to manage the list of sticky breakpoints and constantly call setStickyBreakpoints to sync that list with backend. > 2. There is no way to set JavaScript breakpoint by url. > > > To fix the first problem, we should update sticky breakpoints on backend each time client calls set/remove breakpoint method. > Since we have two independent debugger agents (InspectorDebuggerAgent and InspectorBrowserDebuggerAgent), sticky breakpoints management should be implemented in both. > > Client should have to sync all breakpoints just once at the beginning using the following methods: > [domain=Inspector] setAllJavaScriptBreakpoints(breakpoints) > [domain=Inspector] setAllBrowserBreakpoints(breakpoints)
if it is an inspector domain method then you can have single method and just skip the breakpoints which can't be set for some reason. Also there is should be a notification or method about breakpoints statuses.
> To fix the second problem, JavaScript debugger API should allow setting breakpoint by both url and sourceID. > [domain=Debugger] setJavaScriptBreakpoint(url, lineNumber, condition, enabled, out breakpointId) > [domain=Debugger] setJavaScriptBreakpointBySourceID(sourceID, lineNumber, condition, enabled, out breakpointId)
It should be not an id but a structure with breakpoint info enough for persisting on front-end side.
> [domain=Debugger] removeJavaScriptBreakpoint(breakpointId)
ditto
Pavel Podivilov
Comment 2
2011-01-21 05:31:42 PST
(In reply to
comment #1
)
> (In reply to
comment #0
) > > The are two problems with setting breakpoints using our API: > > 1. Clients have to manage the list of sticky breakpoints and constantly call setStickyBreakpoints to sync that list with backend. > > 2. There is no way to set JavaScript breakpoint by url. > > > > > > To fix the first problem, we should update sticky breakpoints on backend each time client calls set/remove breakpoint method. > > Since we have two independent debugger agents (InspectorDebuggerAgent and InspectorBrowserDebuggerAgent), sticky breakpoints management should be implemented in both. > > > > Client should have to sync all breakpoints just once at the beginning using the following methods: > > [domain=Inspector] setAllJavaScriptBreakpoints(breakpoints) > > [domain=Inspector] setAllBrowserBreakpoints(breakpoints) > > if it is an inspector domain method then you can have single method and just skip the breakpoints which can't be set for some reason. > Also there is should be a notification or method about breakpoints statuses. >
I think we should better change the domain here: [domain=Debugger] setAllJavaScriptBreakpoints(breakpoints) [domain=BrowserDebugger] setAllBrowserBreakpoints(breakpoints)
> > > To fix the second problem, JavaScript debugger API should allow setting breakpoint by both url and sourceID. > > [domain=Debugger] setJavaScriptBreakpoint(url, lineNumber, condition, enabled, out breakpointId) > > [domain=Debugger] setJavaScriptBreakpointBySourceID(sourceID, lineNumber, condition, enabled, out breakpointId) > > It should be not an id but a structure with breakpoint info enough for persisting on front-end side. >
Here input parameters are enough to persist breakpoint on front-end side, so returning breakpointId should be ok.
> > [domain=Debugger] removeJavaScriptBreakpoint(breakpointId) > > ditto
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug