Web Inspector: DOMDebugger: protocol error on first open
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Mar 2019 21:56:32 +0000 (21:56 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Mar 2019 21:56:32 +0000 (21:56 +0000)
commit4086861ba860749a7094cc7d0bc7ed4b86d78f68
treed3fb95ca3071911d6a7af4b007cfdc94f15e8ff1
parent9300888071a9e98cc5720870d28bd25441d723a2
Web Inspector: DOMDebugger: protocol error on first open
https://bugs.webkit.org/show_bug.cgi?id=195248
<rdar://problem/48538465>

Reviewed by Joseph Pecoraro.

Don't try to call `DOMDebugger` commands until a target has been initialized.
Still attempt to resolve DOM breakpoints whenever the main resource/frame changes.

* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager):
(WI.DOMDebuggerManager.prototype.initializeTarget): Added.
(WI.DOMDebuggerManager.supportsEventBreakpoints):
(WI.DOMDebuggerManager.prototype.get supported):
(WI.DOMDebuggerManager.prototype.addDOMBreakpoint):
(WI.DOMDebuggerManager.prototype.removeDOMBreakpoint):
(WI.DOMDebuggerManager.prototype.addEventBreakpoint):
(WI.DOMDebuggerManager.prototype.removeEventBreakpoint):
(WI.DOMDebuggerManager.prototype.addURLBreakpoint):
(WI.DOMDebuggerManager.prototype.removeURLBreakpoint):
(WI.DOMDebuggerManager.prototype._speculativelyResolveDOMBreakpointsForURL): Added.
(WI.DOMDebuggerManager.prototype._resolveDOMBreakpoint):
(WI.DOMDebuggerManager.prototype._updateDOMBreakpoint):
(WI.DOMDebuggerManager.prototype._updateEventBreakpoint):
(WI.DOMDebuggerManager.prototype._updateURLBreakpoint):
(WI.DOMDebuggerManager.prototype._saveDOMBreakpoints):
(WI.DOMDebuggerManager.prototype._handleDOMBreakpointDisabledStateChanged):
(WI.DOMDebuggerManager.prototype._handleEventBreakpointDisabledStateChanged):
(WI.DOMDebuggerManager.prototype._handleURLBreakpointDisabledStateChanged):
(WI.DOMDebuggerManager.prototype._mainFrameDidChange):
(WI.DOMDebuggerManager.prototype._mainResourceDidChange):
(WI.DOMDebuggerManager.prototype.removeEventBreakpoint.breakpointRemoved): Deleted.
(WI.DOMDebuggerManager.prototype._speculativelyResolveBreakpoints): Deleted.
(WI.DOMDebuggerManager.prototype._updateDOMBreakpoint.breakpointUpdated): Deleted.
(WI.DOMDebuggerManager.prototype._resolveEventBreakpoint): Deleted.
(WI.DOMDebuggerManager.prototype._resolveURLBreakpoint): Deleted.

* UserInterface/Base/Multimap.js: Added.
(Multimap):
(Multimap.prototype.get):
(Multimap.prototype.add):
(Multimap.prototype.delete):
(Multimap.prototype.clear):
(Multimap.prototype.keys):
(Multimap.prototype.*values):
(Multimap.prototype.*[Symbol.iterator]):
(Multimap.prototype.toJSON):
* .eslintrc:
* UserInterface/Main.html:
* UserInterface/Test.html:
Helper data structure for managing Maps of Sets (e.g. all DOM breakpoints for a URL).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242743 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/.eslintrc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Multimap.js [new file with mode: 0644]
Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js
Source/WebInspectorUI/UserInterface/Main.html
Source/WebInspectorUI/UserInterface/Test.html