RESOLVED FIXED Bug 66224
Web Inspector: extract breakpoint management code to a helper class and add tests.
https://bugs.webkit.org/show_bug.cgi?id=66224
Summary Web Inspector: extract breakpoint management code to a helper class and add t...
Pavel Podivilov
Reported 2011-08-15 07:34:11 PDT
Web Inspector: extract breakpoint management code to a helper class and add tests. Our breakpoint management code is quite complex, why don't we move it to a separate class and add a set of unit tests for it? The next step would be to dispatch breakpoint events on uiSourceCode objects directly and thus completely decouple breakpoint management code from the rest of presentation model's code.
Attachments
Patch (28.77 KB, patch)
2011-08-15 07:35 PDT, Pavel Podivilov
no flags
Patch (29.88 KB, patch)
2011-08-16 05:23 PDT, Pavel Podivilov
no flags
Patch (33.67 KB, patch)
2011-08-18 04:50 PDT, Pavel Podivilov
pfeldman: review+
Pavel Podivilov
Comment 1 2011-08-15 07:35:45 PDT
Pavel Podivilov
Comment 2 2011-08-15 07:41:09 PDT
For actually switching to BreakpointHelper in DebuggerPresentationModel see https://bugs.webkit.org/show_bug.cgi?id=66225.
Pavel Podivilov
Comment 3 2011-08-16 05:23:36 PDT
Pavel Podivilov
Comment 4 2011-08-16 05:24:21 PDT
(In reply to comment #3) > Created an attachment (id=104028) [details] > Patch Split BreakpointHelper into 3 classes and cleanup the code.
Pavel Feldman
Comment 5 2011-08-18 01:56:58 PDT
Comment on attachment 104028 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=104028&action=review > Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:705 > +WebInspector.BreakpointHelper = function(debuggerModel, breakpoints, breakpointAddedDelegate, breakpointRemovedDelegate) Class with two inner classes deserves to be defined in a separate file. > Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:720 > + registerUISourceCode: function(uiSourceCodeId, rawSourceCode, persistent) Can we pass real instance here? Also, remove <persist>. This could be called uiSourceCodeAdded > Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:722 > + this._uiSourceCodeInfo[uiSourceCodeId] = { rawSourceCode: rawSourceCode, persistent: persistent }; This mapping should be bi-directional, should be defined in the RawSourceCode <-> UISourceCode terms. > Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:745 > + this._uiBreakpoints.addBreakpoint(breakpoint); Either pass all the parameters into addBreakpoint or define a class for a breakpoint.
Pavel Podivilov
Comment 6 2011-08-18 04:50:13 PDT
Pavel Feldman
Comment 7 2011-08-18 07:45:16 PDT
Comment on attachment 104324 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=104324&action=review > Source/WebCore/inspector/front-end/BreakpointManager.js:31 > +WebInspector.BreakpointManager = function(debuggerModel, breakpoints, breakpointAddedDelegate, breakpointRemovedDelegate) Please remove the breakpoints parameter and replace it with the "setBreakpointsForTest" method.
Pavel Podivilov
Comment 8 2011-08-19 08:50:49 PDT
Pavel Feldman
Comment 10 2011-08-19 23:31:03 PDT
> I don't even know on which platform this test passes. I'm rolling it now, sorry for trouble.
Note You need to log in before you can comment on or make changes to this bug.