Web Inspector: rework frontend agent construction to allow commands/events to be...
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Oct 2019 08:00:46 +0000 (08:00 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Oct 2019 08:00:46 +0000 (08:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200384
<rdar://problem/53850352>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/scripts/codegen/generate_js_backend_commands.py:
(JSBackendCommandsGenerator.generate_domain):
(JSBackendCommandsGenerator.generate_domain.generate_parameter_object):
* inspector/scripts/codegen/models.py:
(validate_target_types): Added.
(Protocol.parse_domain):
(Protocol.parse_command):
(Protocol.parse_event):
(Domain.__init__):
(Domains):
(Command.__init__):
(Event.__init__):
* inspector/protocol/ApplicationCache.json:
* inspector/protocol/Audit.json:
* inspector/protocol/CPUProfiler.json:
* inspector/protocol/CSS.json:
* inspector/protocol/Canvas.json:
* inspector/protocol/Console.json:
* inspector/protocol/DOM.json:
* inspector/protocol/DOMDebugger.json:
* inspector/protocol/DOMStorage.json:
* inspector/protocol/Database.json:
* inspector/protocol/Debugger.json:
* inspector/protocol/Heap.json:
* inspector/protocol/IndexedDB.json:
* inspector/protocol/Inspector.json:
* inspector/protocol/LayerTree.json:
* inspector/protocol/Memory.json:
* inspector/protocol/Network.json:
* inspector/protocol/Page.json:
* inspector/protocol/Recording.json:
* inspector/protocol/Runtime.json:
* inspector/protocol/ScriptProfiler.json:
* inspector/protocol/Security.json:
* inspector/protocol/ServiceWorker.json:
* inspector/protocol/Target.json:
* inspector/protocol/Timeline.json:
* inspector/protocol/Worker.json:
Add `debuggableTypes` and `targetTypes` arrays to domains/commands/events that are used when
generating InspectorBackendCommands.js for more accurate compatibility checks.

* inspector/InspectorTarget.h:
* inspector/agents/InspectorTargetAgent.h:
* inspector/agents/InspectorTargetAgent.cpp:
(Inspector::targetTypeToProtocolType):
(Inspector::InspectorTargetAgent::exists): Deleted.
Remove `Target.exists` now that the frontend can do proper feature checking.

* inspector/remote/RemoteControllableTarget.h:
* inspector/remote/RemoteInspectionTarget.h:
* inspector/remote/RemoteInspectorConstants.h:
* inspector/remote/cocoa/RemoteInspectorCocoa.mm:
(Inspector::RemoteInspector::listingForInspectionTarget const):
* inspector/remote/glib/RemoteInspectorGlib.cpp:
(Inspector::RemoteInspector::listingForInspectionTarget const):
* inspector/remote/socket/RemoteInspectorSocket.cpp:
(Inspector::RemoteInspector::listingForInspectionTarget const):
Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).

* inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result:
* inspector/scripts/tests/generic/command-targetType-matching-domain-debuggableType.json: Added.
* inspector/scripts/tests/generic/domain-availability.json: Removed.
* inspector/scripts/tests/generic/domain-debuggableTypes.json: Added.
* inspector/scripts/tests/generic/domain-targetType-matching-domain-debuggableType.json: Added.
* inspector/scripts/tests/generic/domain-targetTypes.json: Added.
* inspector/scripts/tests/generic/event-targetType-matching-domain-debuggableType.json: Added.
* inspector/scripts/tests/generic/expected/command-targetType-matching-domain-debuggableType.json-result: Added.
* inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/generic/expected/domain-debuggableTypes.json-result: Added.
* inspector/scripts/tests/generic/expected/domain-targetType-matching-domain-debuggableType.json-result: Added.
* inspector/scripts/tests/generic/expected/domain-targetTypes.json-result: Added.
* inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/generic/expected/enum-values.json-result:
* inspector/scripts/tests/generic/expected/event-targetType-matching-domain-debuggableType.json-result: Added.
* inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/generic/expected/fail-on-command-targetType-matching-domain-debuggableType.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-command-targetTypes-type.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-command-targetTypes-value.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-domain-availability-type.json-error: Removed.
* inspector/scripts/tests/generic/expected/fail-on-domain-availability-value.json-error: Removed.
* inspector/scripts/tests/generic/expected/fail-on-domain-availability.json-error: Removed.
* inspector/scripts/tests/generic/expected/fail-on-domain-debuggableTypes-type.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-domain-debuggableTypes-value.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-domain-targetType-matching-domain-debuggableType.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-domain-targetTypes-type.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-domain-targetTypes-value.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-event-targetType-matching-domain-debuggableType.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-event-targetTypes-type.json-error: Added.
* inspector/scripts/tests/generic/expected/fail-on-event-targetTypes-value.json-error: Added.
* inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result:
* inspector/scripts/tests/generic/expected/version.json-result:
* inspector/scripts/tests/generic/fail-on-command-targetType-matching-domain-debuggableType.json: Added.
* inspector/scripts/tests/generic/fail-on-command-targetTypes-type.json: Added.
* inspector/scripts/tests/generic/fail-on-command-targetTypes-value.json: Added.
* inspector/scripts/tests/generic/fail-on-domain-debuggableTypes-type.json: Added.
* inspector/scripts/tests/generic/fail-on-domain-debuggableTypes-value.json: Added.
* inspector/scripts/tests/generic/fail-on-domain-targetType-matching-domain-debuggableType.json: Added.
* inspector/scripts/tests/generic/fail-on-domain-targetTypes-type.json: Added.
* inspector/scripts/tests/generic/fail-on-domain-targetTypes-value.json: Added.
* inspector/scripts/tests/generic/fail-on-event-targetType-matching-domain-debuggableType.json: Added.
* inspector/scripts/tests/generic/fail-on-event-targetTypes-type.json: Added.
* inspector/scripts/tests/generic/fail-on-event-targetTypes-value.json: Added.
* inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result:
Update test results, as well as added new tests for `debuggableTypes` and `targetTypes`.

Source/WebCore:

* inspector/InspectorFrontendClient.h:
(WebCore::InspectorFrontendClient::backendCommandsURL): Deleted.
(WebCore::InspectorFrontendClient::debuggableType): Deleted.
* inspector/InspectorFrontendClientLocal.h:
* page/PageDebuggable.h:
(WebCore::PageDebuggable::type const):
* testing/Internals.cpp:
(WebCore::InspectorStubFrontend::debuggableType const): Added.
Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).

Source/WebInspectorUI:

`InspectorBackend.domains.${domain}` isn't a truly valid way to feature check, as it
indicates what's supported by the WebKit framework underlying whatever's currently being
inspected, not what the current inspection target supports.

As an example, inspecting an iOS `JSContext` will still show `InspectorBackend.domains.DOM`
as the `DOMAgent` is supported by WebKit, even though `JSContext`s have no concept of the
DOM. In this example, however, `window.DOMAgent` would NOT exist, as the `availability`
check for the `DOM` domain wouldn't pass, meaning that the agent never gets connected.

In order to do proper feature checking, `InspectorBackend.domains` needs to be accurate
depending on the debuggable type. Furthermore, each target underneath that debuggable needs
to be able to "choose" what commands/events are supported based on that target's type.

This patch modifies how InspectorBackendCommands.js ties into `InspectorBackend`. Rather
than directly creating an `InspectorBackend.Agent` for each domain, we now create more of a
"blueprint" of the domain, and wait to actually create an `InspectorBackend.Agent` until we
have a `WI.Target` (and therefore an `InspectorBackend.Connection`). Each "concept" of the
protocol now directly maps to an object.
 - InspectorBackend.Domain
 - InspectorBackend.Command
 - InspectorBackend.Event
 - InspectorBackend.Dispatcher
When a `WI.Target` is created, it gets the list of `InspectorBackend.Domain` that support
that `WI.Target`'s type (specified in the protocol JSON files) and generates an
`InspectorBackend.Agent` for each, which in turn generates an `InspectorBackend.Callable`
for each supported `InspectorBackend.Command` and instantiates `InspectorBackend.Dispatcher`.

Activating a `InspectorBackend.Domain` means it's visible for `InspectorBackend` feature
checking. This must be done this way for older ITML backends that will still appear as
"JSContext" targets and therefore go through the "extra domains" path. Ideally, the process
of registering a domain should be enough to activate it. <https://webkit.org/b/201150>

Feature checking can now only be done via `hasDomain`, `hasCommand`, and `hasEvent` on
`InspectorBackend` or a specific `WI.Target`, and there are different implications for each:
 - `InspectorBackend.hasDomain(DOM)` asks whether the `DOM` domain is supported by the
   current debuggable, but says nothing about whether any `WI.Target` support `DOM`.
 - `target.hasDomain("DOM")` asks whether the given `target` supports `DOM`, which is
   limited by `InspectorBackend.hasDomain("DOM")`.

Now that `InspectorBackend.Agent` is only created by a `WI.Target`, it's no longer valid to
write `window.DOMAgent`, as there is no "global" agent. All protocol logic _must_ go through
a `WI.Target`. <https://webkit.org/b/201149>

Debuggable Types:
 - JavaScript (JSC::JSGlobalObject)
 - Page (WebCore::Page)
 - ServiceWorker (WebCore::ServiceWorkerThreadProxy)
 - WebPage (WebKit::WebPageProxy)

Target Types:
 - JavaScript (direct connection)
 - Page (multi-target connection to any Worker)
 - ServiceWorker (direct connection)
 - WebPage (multi-target connection to 1+ Page)
 - Worker (direct connection, only available for Page debuggables)

* UserInterface/Base/DebuggableType.js:
* UserInterface/Base/TargetType.js: Copied from Source/WebInspectorUI/UserInterface/Base/DebuggableType.js.
* UserInterface/Protocol/Connection.js:
* UserInterface/Protocol/InspectorBackend.js:

* UserInterface/Protocol/ApplicationCacheObserver.js:
* UserInterface/Protocol/CPUProfilerObserver.js:
* UserInterface/Protocol/CSSObserver.js:
* UserInterface/Protocol/CanvasObserver.js:
* UserInterface/Protocol/ConsoleObserver.js:
* UserInterface/Protocol/DOMObserver.js:
* UserInterface/Protocol/DOMStorageObserver.js:
* UserInterface/Protocol/DatabaseObserver.js:
* UserInterface/Protocol/DebuggerObserver.js:
* UserInterface/Protocol/HeapObserver.js:
* UserInterface/Protocol/InspectorObserver.js:
* UserInterface/Protocol/LayerTreeObserver.js:
* UserInterface/Protocol/MemoryObserver.js:
* UserInterface/Protocol/NetworkObserver.js:
* UserInterface/Protocol/PageObserver.js:
* UserInterface/Protocol/RuntimeObserver.js:
* UserInterface/Protocol/ScriptProfilerObserver.js:
* UserInterface/Protocol/TargetObserver.js:
* UserInterface/Protocol/TimelineObserver.js:
* UserInterface/Protocol/WorkerObserver.js:
All observers now extend from `InspectorBackend.Dispatcher` and have a separate instance for
each `InspectorBackend.Agent`, each having their own `_target`.

* UserInterface/Protocol/Target.js:
* UserInterface/Protocol/DirectBackendTarget.js:
* UserInterface/Protocol/JavaScriptContextTarget.js: Removed.
* UserInterface/Protocol/MultiplexingBackendTarget.js:
* UserInterface/Protocol/PageTarget.js:
* UserInterface/Protocol/WorkerTarget.js:
Agents are now created per-target instead of copied from the "global" list. This means that
agents can have a different set of commands/events depending on the associated target.

* UserInterface/Base/Main.js:
* UserInterface/Base/Utilities.js:
* UserInterface/Controllers/AppController.js:
* UserInterface/Controllers/AppControllerBase.js:
* UserInterface/Controllers/ApplicationCacheManager.js:
* UserInterface/Controllers/AuditManager.js:
* UserInterface/Controllers/BreakpointPopoverController.js:
* UserInterface/Controllers/CSSManager.js:
* UserInterface/Controllers/CanvasManager.js:
* UserInterface/Controllers/ConsoleManager.js:
* UserInterface/Controllers/DOMDebuggerManager.js:
* UserInterface/Controllers/DOMManager.js:
* UserInterface/Controllers/DOMStorageManager.js:
* UserInterface/Controllers/DatabaseManager.js:
* UserInterface/Controllers/DebuggerManager.js:
* UserInterface/Controllers/HeapManager.js:
* UserInterface/Controllers/IndexedDBManager.js:
* UserInterface/Controllers/JavaScriptLogViewController.js:
* UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
* UserInterface/Controllers/LayerTreeManager.js:
* UserInterface/Controllers/MemoryManager.js:
* UserInterface/Controllers/NetworkManager.js:
* UserInterface/Controllers/RuntimeManager.js:
* UserInterface/Controllers/TargetManager.js:
* UserInterface/Controllers/TimelineManager.js:
* UserInterface/Controllers/WorkerManager.js:
* UserInterface/Main.html:
* UserInterface/Models/AuditTestBase.js:
* UserInterface/Models/AuditTestCase.js:
* UserInterface/Models/AuditTestCaseResult.js:
* UserInterface/Models/CPUInstrument.js:
* UserInterface/Models/CPUTimelineRecord.js:
* UserInterface/Models/CSSCompletions.js:
* UserInterface/Models/CSSStyleSheet.js:
* UserInterface/Models/Canvas.js:
* UserInterface/Models/DOMNode.js:
* UserInterface/Models/DOMNodeStyles.js:
* UserInterface/Models/DOMStorageObject.js:
* UserInterface/Models/DOMTree.js:
* UserInterface/Models/DatabaseObject.js:
* UserInterface/Models/FPSInstrument.js:
* UserInterface/Models/GarbageCollection.js:
* UserInterface/Models/HeapAllocationsInstrument.js:
* UserInterface/Models/Instrument.js:
* UserInterface/Models/MediaInstrument.js:
* UserInterface/Models/MemoryInstrument.js:
* UserInterface/Models/MemoryPressureEvent.js:
* UserInterface/Models/MemoryTimelineRecord.js:
* UserInterface/Models/Recording.js:
* UserInterface/Models/Resource.js:
* UserInterface/Models/ScriptInstrument.js:
* UserInterface/Models/ScriptSyntaxTree.js:
* UserInterface/Models/ScriptTimelineRecord.js:
* UserInterface/Models/ShaderProgram.js:
* UserInterface/Models/SourceMapResource.js:
* UserInterface/Models/TimelineRecording.js:
* UserInterface/Protocol/RemoteObject.js:
* UserInterface/Test.html:
* UserInterface/Test/FrontendTestHarness.js:
* UserInterface/Test/Test.js:
* UserInterface/Test/TestAppController.js:
* UserInterface/Views/AuditNavigationSidebarPanel.js:
* UserInterface/Views/AuditTabContentView.js:
* UserInterface/Views/CanvasTabContentView.js:
* UserInterface/Views/ContextMenuUtilities.js:
* UserInterface/Views/CookieStorageContentView.js:
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
* UserInterface/Views/DOMTreeContentView.js:
* UserInterface/Views/ElementsTabContentView.js:
* UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js:
* UserInterface/Views/Layers3DContentView.js:
* UserInterface/Views/LayersTabContentView.js:
* UserInterface/Views/LayoutTimelineView.js:
* UserInterface/Views/LogContentView.js:
* UserInterface/Views/NetworkTabContentView.js:
* UserInterface/Views/NetworkTableContentView.js:
* UserInterface/Views/NetworkTimelineView.js:
* UserInterface/Views/ObjectTreeView.js:
* UserInterface/Views/QuickConsole.js:
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
* UserInterface/Views/ScriptClusterTimelineView.js:
* UserInterface/Views/ScriptDetailsTimelineView.js:
* UserInterface/Views/ScriptTreeElement.js:
* UserInterface/Views/SearchSidebarPanel.js:
* UserInterface/Views/SearchTabContentView.js:
* UserInterface/Views/SettingsTabContentView.js:
* UserInterface/Views/SourceCodeTextEditor.js:
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
* UserInterface/Views/SpreadsheetStyleProperty.js:
* UserInterface/Views/StorageTabContentView.js:
* UserInterface/Views/TimelineRecordingContentView.js:
* UserInterface/Views/TimelineTabContentView.js:
* UserInterface/Views/Toolbar.js:
* UserInterface/Views/WebSocketContentView.js:
* UserInterface/Views/WorkerTreeElement.js:
Replace all instances of `window.DomainAgent` with `target.DomainAgent`, where `target` is
either derived from an associated model object or `WI.assumingMainTarget()`.
Split the `WI.DebuggableType.Web` debuggable type into `WI.DebuggableType.Page` (WebCore::Page)
and `WI.DebuggableType.WebPage` (WebKit::WebPageProxy).

* UserInterface/Protocol/Legacy/*:
* Versions/*:
Update protocol files for older versions of iOS.

* .eslintrc:
* Localizations/en.lproj/localizedStrings.js:

Source/WebKit:

* WebProcess/WebPage/RemoteWebInspectorUI.h:
(WebKit::WebInspectorUI::backendCommandsURL const): Added.
(WebKit::WebInspectorUI::debuggableType const): Added.
(WebKit::WebInspectorUI::backendCommandsURL): Deleted.
(WebKit::WebInspectorUI::debuggableType): Deleted.
* WebProcess/WebPage/WebInspectorUI.h:
(WebKit::WebInspectorUI::backendCommandsURL const): Added.
(WebKit::WebInspectorUI::debuggableType const): Added.
* UIProcess/WebPageDebuggable.h:
(WebKit::WebPageDebuggable::type const):
* UIProcess/glib/RemoteInspectorClient.cpp:
(WebKit::RemoteInspectorClient::RemoteInspectorClient):
* UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
* UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
(debuggableTypeString):
Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).

Source/WebKitLegacy/mac:

* WebCoreSupport/WebInspectorClient.h:
(WebInspectorFrontendClient::debuggableType const): Added.
Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).

Source/WebKitLegacy/win:

* WebCoreSupport/WebInspectorClient.h:
(WebInspectorFrontendClient::debuggableType const): Added.
Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).

LayoutTests:

* inspector/canvas/requestShaderSource-webgl.html:
* inspector/canvas/updateShader-webgl:
* inspector/page/overrideSetting.html:
* inspector/page/overrideSetting-ICECandidateFilteringEnabled.html:
* inspector/page/overrideSetting-MockCaptureDevicesEnabled.html:
* inspector/runtime/parse.html:
Replace all instances of `DomainAgent.Enum` with `InspectorBackend.domains.Domain.Enum`.

* inspector/audit/run.html:
* inspector/audit/version.html:
* inspector/recording/version.html:
Use new `InspectorBackend` methods.

* inspector/unit-tests/target-manager.html:
* inspector/unit-tests/target-manager-expected.txt:
* inspector/worker/console-basic.html:
* inspector/worker/debugger-pause.html:
* inspector/worker/debugger-scripts.html:
* inspector/worker/debugger-shared-breakpoint.html:
* inspector/worker/resources-in-worker.html:
* inspector/worker/resources/dom-debugger-utilities.js:
* inspector/worker/runtime-basic.html:
* http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts.html:
Replace `WI.Target.Type` with `WI.TargetType`.

* inspector/dom/inspect.html:
* inspector/dom/inspect-expected.txt:
Rewrite test since faking events from the backend now requires a target.

* inspector/unit-tests/set-utilities.html:
* inspector/unit-tests/set-utilities-expected.txt:
Add tests for `Set.prototype.addAll`.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251227 268f45cc-cd09-0410-ab3c-d52691b4dbfc

275 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts.html
LayoutTests/inspector/audit/run.html
LayoutTests/inspector/audit/version.html
LayoutTests/inspector/canvas/requestShaderSource-webgl.html
LayoutTests/inspector/canvas/updateShader-webgl.html
LayoutTests/inspector/dom/inspect-expected.txt
LayoutTests/inspector/dom/inspect.html
LayoutTests/inspector/page/overrideSetting-ICECandidateFilteringEnabled.html
LayoutTests/inspector/page/overrideSetting-MockCaptureDevicesEnabled.html
LayoutTests/inspector/page/overrideSetting.html
LayoutTests/inspector/recording/version.html
LayoutTests/inspector/runtime/parse.html
LayoutTests/inspector/unit-tests/set-utilities-expected.txt
LayoutTests/inspector/unit-tests/set-utilities.html
LayoutTests/inspector/unit-tests/target-manager-expected.txt
LayoutTests/inspector/unit-tests/target-manager.html
LayoutTests/inspector/worker/console-basic.html
LayoutTests/inspector/worker/debugger-pause.html
LayoutTests/inspector/worker/debugger-scripts.html
LayoutTests/inspector/worker/debugger-shared-breakpoint.html
LayoutTests/inspector/worker/resources-in-worker.html
LayoutTests/inspector/worker/resources/dom-debugger-utilities.js
LayoutTests/inspector/worker/runtime-basic.html
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/InspectorTarget.h
Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.cpp
Source/JavaScriptCore/inspector/agents/InspectorTargetAgent.h
Source/JavaScriptCore/inspector/protocol/ApplicationCache.json
Source/JavaScriptCore/inspector/protocol/Audit.json
Source/JavaScriptCore/inspector/protocol/CPUProfiler.json
Source/JavaScriptCore/inspector/protocol/CSS.json
Source/JavaScriptCore/inspector/protocol/Canvas.json
Source/JavaScriptCore/inspector/protocol/Console.json
Source/JavaScriptCore/inspector/protocol/DOM.json
Source/JavaScriptCore/inspector/protocol/DOMDebugger.json
Source/JavaScriptCore/inspector/protocol/DOMStorage.json
Source/JavaScriptCore/inspector/protocol/Database.json
Source/JavaScriptCore/inspector/protocol/Debugger.json
Source/JavaScriptCore/inspector/protocol/Heap.json
Source/JavaScriptCore/inspector/protocol/IndexedDB.json
Source/JavaScriptCore/inspector/protocol/Inspector.json
Source/JavaScriptCore/inspector/protocol/LayerTree.json
Source/JavaScriptCore/inspector/protocol/Memory.json
Source/JavaScriptCore/inspector/protocol/Network.json
Source/JavaScriptCore/inspector/protocol/Page.json
Source/JavaScriptCore/inspector/protocol/Recording.json
Source/JavaScriptCore/inspector/protocol/Runtime.json
Source/JavaScriptCore/inspector/protocol/ScriptProfiler.json
Source/JavaScriptCore/inspector/protocol/Security.json
Source/JavaScriptCore/inspector/protocol/ServiceWorker.json
Source/JavaScriptCore/inspector/protocol/Target.json
Source/JavaScriptCore/inspector/protocol/Timeline.json
Source/JavaScriptCore/inspector/protocol/Worker.json
Source/JavaScriptCore/inspector/remote/RemoteControllableTarget.h
Source/JavaScriptCore/inspector/remote/RemoteInspectionTarget.h
Source/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h
Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm
Source/JavaScriptCore/inspector/remote/glib/RemoteInspectorGlib.cpp
Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.cpp
Source/JavaScriptCore/inspector/scripts/codegen/generate_js_backend_commands.py
Source/JavaScriptCore/inspector/scripts/codegen/models.py
Source/JavaScriptCore/inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/command-targetType-matching-domain-debuggableType.json [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/domain-availability.json [deleted file]
Source/JavaScriptCore/inspector/scripts/tests/generic/domain-debuggableTypes.json [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/domain-targetType-matching-domain-debuggableType.json [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/domain-targetTypes.json [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/event-targetType-matching-domain-debuggableType.json [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/command-targetType-matching-domain-debuggableType.json-result [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-debuggableTypes.json-result [moved from Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-availability.json-result with 81% similarity]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-targetType-matching-domain-debuggableType.json-result [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-targetTypes.json-result [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/enum-values.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/event-targetType-matching-domain-debuggableType.json-result [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-command-targetType-matching-domain-debuggableType.json-error [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-command-targetTypes-type.json-error [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-command-targetTypes-value.json-error [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-domain-availability-type.json-error [deleted file]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-domain-availability-value.json-error [deleted file]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-domain-availability.json-error [deleted file]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-domain-debuggableTypes-type.json-error [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-domain-debuggableTypes-value.json-error [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-domain-targetType-matching-domain-debuggableType.json-error [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-domain-targetTypes-type.json-error [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-domain-targetTypes-value.json-error [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-event-targetType-matching-domain-debuggableType.json-error [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-event-targetTypes-type.json-error [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/fail-on-event-targetTypes-value.json-error [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/version.json-result
Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-command-targetType-matching-domain-debuggableType.json [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-command-targetTypes-type.json [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-command-targetTypes-value.json [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-domain-debuggableTypes-type.json [moved from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-domain-availability-type.json with 76% similarity]
Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-domain-debuggableTypes-value.json [moved from Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-domain-availability-value.json with 75% similarity]
Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-domain-targetType-matching-domain-debuggableType.json [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-domain-targetTypes-type.json [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-domain-targetTypes-value.json [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-event-targetType-matching-domain-debuggableType.json [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-event-targetTypes-type.json [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/generic/fail-on-event-targetTypes-value.json [new file with mode: 0644]
Source/JavaScriptCore/inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result
Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorFrontendClient.h
Source/WebCore/inspector/InspectorFrontendClientLocal.h
Source/WebCore/page/PageDebuggable.h
Source/WebCore/testing/Internals.cpp
Source/WebInspectorUI/.eslintrc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Base/DebuggableType.js
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Base/TargetType.js [moved from Source/WebInspectorUI/UserInterface/Protocol/JavaScriptContextTarget.js with 74% similarity]
Source/WebInspectorUI/UserInterface/Base/Utilities.js
Source/WebInspectorUI/UserInterface/Controllers/AppController.js
Source/WebInspectorUI/UserInterface/Controllers/AppControllerBase.js
Source/WebInspectorUI/UserInterface/Controllers/ApplicationCacheManager.js
Source/WebInspectorUI/UserInterface/Controllers/AuditManager.js
Source/WebInspectorUI/UserInterface/Controllers/BreakpointPopoverController.js
Source/WebInspectorUI/UserInterface/Controllers/CSSManager.js
Source/WebInspectorUI/UserInterface/Controllers/CanvasManager.js
Source/WebInspectorUI/UserInterface/Controllers/ConsoleManager.js
Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js
Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js
Source/WebInspectorUI/UserInterface/Controllers/DOMStorageManager.js
Source/WebInspectorUI/UserInterface/Controllers/DatabaseManager.js
Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
Source/WebInspectorUI/UserInterface/Controllers/HeapManager.js
Source/WebInspectorUI/UserInterface/Controllers/IndexedDBManager.js
Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js
Source/WebInspectorUI/UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js
Source/WebInspectorUI/UserInterface/Controllers/LayerTreeManager.js
Source/WebInspectorUI/UserInterface/Controllers/MemoryManager.js
Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js
Source/WebInspectorUI/UserInterface/Controllers/RuntimeManager.js
Source/WebInspectorUI/UserInterface/Controllers/TargetManager.js
Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js
Source/WebInspectorUI/UserInterface/Controllers/WorkerManager.js
Source/WebInspectorUI/UserInterface/Main.html
Source/WebInspectorUI/UserInterface/Models/AuditTestBase.js
Source/WebInspectorUI/UserInterface/Models/AuditTestCase.js
Source/WebInspectorUI/UserInterface/Models/AuditTestCaseResult.js
Source/WebInspectorUI/UserInterface/Models/CPUInstrument.js
Source/WebInspectorUI/UserInterface/Models/CPUTimelineRecord.js
Source/WebInspectorUI/UserInterface/Models/CSSCompletions.js
Source/WebInspectorUI/UserInterface/Models/CSSStyleSheet.js
Source/WebInspectorUI/UserInterface/Models/Canvas.js
Source/WebInspectorUI/UserInterface/Models/DOMNode.js
Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js
Source/WebInspectorUI/UserInterface/Models/DOMStorageObject.js
Source/WebInspectorUI/UserInterface/Models/DOMTree.js
Source/WebInspectorUI/UserInterface/Models/DatabaseObject.js
Source/WebInspectorUI/UserInterface/Models/FPSInstrument.js
Source/WebInspectorUI/UserInterface/Models/GarbageCollection.js
Source/WebInspectorUI/UserInterface/Models/HeapAllocationsInstrument.js
Source/WebInspectorUI/UserInterface/Models/Instrument.js
Source/WebInspectorUI/UserInterface/Models/MediaInstrument.js
Source/WebInspectorUI/UserInterface/Models/MemoryInstrument.js
Source/WebInspectorUI/UserInterface/Models/MemoryPressureEvent.js
Source/WebInspectorUI/UserInterface/Models/MemoryTimelineRecord.js
Source/WebInspectorUI/UserInterface/Models/Recording.js
Source/WebInspectorUI/UserInterface/Models/Resource.js
Source/WebInspectorUI/UserInterface/Models/ScriptInstrument.js
Source/WebInspectorUI/UserInterface/Models/ScriptSyntaxTree.js
Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js
Source/WebInspectorUI/UserInterface/Models/ShaderProgram.js
Source/WebInspectorUI/UserInterface/Models/SourceMapResource.js
Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js
Source/WebInspectorUI/UserInterface/Protocol/ApplicationCacheObserver.js
Source/WebInspectorUI/UserInterface/Protocol/CPUProfilerObserver.js
Source/WebInspectorUI/UserInterface/Protocol/CSSObserver.js
Source/WebInspectorUI/UserInterface/Protocol/CanvasObserver.js
Source/WebInspectorUI/UserInterface/Protocol/Connection.js
Source/WebInspectorUI/UserInterface/Protocol/ConsoleObserver.js
Source/WebInspectorUI/UserInterface/Protocol/DOMObserver.js
Source/WebInspectorUI/UserInterface/Protocol/DOMStorageObserver.js
Source/WebInspectorUI/UserInterface/Protocol/DatabaseObserver.js
Source/WebInspectorUI/UserInterface/Protocol/DebuggerObserver.js
Source/WebInspectorUI/UserInterface/Protocol/DirectBackendTarget.js
Source/WebInspectorUI/UserInterface/Protocol/HeapObserver.js
Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js
Source/WebInspectorUI/UserInterface/Protocol/InspectorObserver.js
Source/WebInspectorUI/UserInterface/Protocol/LayerTreeObserver.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/10.0/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/10.3/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/11.0/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/12.0/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/12.2/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/13.0/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/Legacy/9.3/InspectorBackendCommands.js
Source/WebInspectorUI/UserInterface/Protocol/MemoryObserver.js
Source/WebInspectorUI/UserInterface/Protocol/MultiplexingBackendTarget.js
Source/WebInspectorUI/UserInterface/Protocol/NetworkObserver.js
Source/WebInspectorUI/UserInterface/Protocol/PageObserver.js
Source/WebInspectorUI/UserInterface/Protocol/PageTarget.js
Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js
Source/WebInspectorUI/UserInterface/Protocol/RuntimeObserver.js
Source/WebInspectorUI/UserInterface/Protocol/ScriptProfilerObserver.js
Source/WebInspectorUI/UserInterface/Protocol/Target.js
Source/WebInspectorUI/UserInterface/Protocol/TargetObserver.js
Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js
Source/WebInspectorUI/UserInterface/Protocol/WorkerObserver.js
Source/WebInspectorUI/UserInterface/Protocol/WorkerTarget.js
Source/WebInspectorUI/UserInterface/Test.html
Source/WebInspectorUI/UserInterface/Test/FrontendTestHarness.js
Source/WebInspectorUI/UserInterface/Test/Test.js
Source/WebInspectorUI/UserInterface/Test/TestAppController.js
Source/WebInspectorUI/UserInterface/Views/AuditNavigationSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/AuditTabContentView.js
Source/WebInspectorUI/UserInterface/Views/CanvasTabContentView.js
Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js
Source/WebInspectorUI/UserInterface/Views/CookieStorageContentView.js
Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js
Source/WebInspectorUI/UserInterface/Views/ElementsTabContentView.js
Source/WebInspectorUI/UserInterface/Views/IndexedDatabaseDetailsSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/Layers3DContentView.js
Source/WebInspectorUI/UserInterface/Views/LayersTabContentView.js
Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js
Source/WebInspectorUI/UserInterface/Views/LogContentView.js
Source/WebInspectorUI/UserInterface/Views/NetworkTabContentView.js
Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js
Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js
Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js
Source/WebInspectorUI/UserInterface/Views/QuickConsole.js
Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/ScriptClusterTimelineView.js
Source/WebInspectorUI/UserInterface/Views/ScriptDetailsTimelineView.js
Source/WebInspectorUI/UserInterface/Views/ScriptTreeElement.js
Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/SearchTabContentView.js
Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js
Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js
Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js
Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js
Source/WebInspectorUI/UserInterface/Views/StorageTabContentView.js
Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js
Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js
Source/WebInspectorUI/UserInterface/Views/Toolbar.js
Source/WebInspectorUI/UserInterface/Views/WebSocketContentView.js
Source/WebInspectorUI/UserInterface/Views/WorkerTreeElement.js
Source/WebInspectorUI/Versions/Inspector-iOS-10.0.json
Source/WebInspectorUI/Versions/Inspector-iOS-10.3.json
Source/WebInspectorUI/Versions/Inspector-iOS-11.0.json
Source/WebInspectorUI/Versions/Inspector-iOS-11.3.json
Source/WebInspectorUI/Versions/Inspector-iOS-12.0.json
Source/WebInspectorUI/Versions/Inspector-iOS-12.2.json
Source/WebInspectorUI/Versions/Inspector-iOS-13.0.json
Source/WebInspectorUI/Versions/Inspector-iOS-8.0.json
Source/WebInspectorUI/Versions/Inspector-iOS-9.0.json
Source/WebInspectorUI/Versions/Inspector-iOS-9.3.json
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h
Source/WebKit/UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm
Source/WebKit/UIProcess/WebPageDebuggable.h
Source/WebKit/UIProcess/glib/RemoteInspectorClient.cpp
Source/WebKit/WebProcess/WebPage/RemoteWebInspectorUI.h
Source/WebKit/WebProcess/WebPage/WebInspectorUI.h
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/WebInspectorClient.h
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebCoreSupport/WebInspectorClient.h

index 2155eed..e15c380 100644 (file)
@@ -1,3 +1,44 @@
+2019-10-17  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: rework frontend agent construction to allow commands/events to be controlled by the related target's type
+        https://bugs.webkit.org/show_bug.cgi?id=200384
+        <rdar://problem/53850352>
+
+        Reviewed by Joseph Pecoraro.
+
+        * inspector/canvas/requestShaderSource-webgl.html:
+        * inspector/canvas/updateShader-webgl:
+        * inspector/page/overrideSetting.html:
+        * inspector/page/overrideSetting-ICECandidateFilteringEnabled.html:
+        * inspector/page/overrideSetting-MockCaptureDevicesEnabled.html:
+        * inspector/runtime/parse.html:
+        Replace all instances of `DomainAgent.Enum` with `InspectorBackend.domains.Domain.Enum`.
+
+        * inspector/audit/run.html:
+        * inspector/audit/version.html:
+        * inspector/recording/version.html:
+        Use new `InspectorBackend` methods.
+
+        * inspector/unit-tests/target-manager.html:
+        * inspector/unit-tests/target-manager-expected.txt:
+        * inspector/worker/console-basic.html:
+        * inspector/worker/debugger-pause.html:
+        * inspector/worker/debugger-scripts.html:
+        * inspector/worker/debugger-shared-breakpoint.html:
+        * inspector/worker/resources-in-worker.html:
+        * inspector/worker/resources/dom-debugger-utilities.js:
+        * inspector/worker/runtime-basic.html:
+        * http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts.html:
+        Replace `WI.Target.Type` with `WI.TargetType`.
+
+        * inspector/dom/inspect.html:
+        * inspector/dom/inspect-expected.txt:
+        Rewrite test since faking events from the backend now requires a target.
+
+        * inspector/unit-tests/set-utilities.html:
+        * inspector/unit-tests/set-utilities-expected.txt:
+        Add tests for `Set.prototype.addAll`.
+
 2019-10-16  Chris Dumez  <cdumez@apple.com>
 
         Rename PageCache to BackForwardCache
index 0bef833..fa2afd7 100644 (file)
@@ -62,7 +62,7 @@ function test()
             WI.targetManager.singleFireEventListener(WI.TargetManager.Event.TargetAdded, (event) => {
                 workerTarget = event.data.target;
                 InspectorTest.assert(workerTarget instanceof WI.Target);
-                InspectorTest.expectEqual(workerTarget.type, WI.Target.Type.Worker, "Added Target should have Worker type.");
+                InspectorTest.expectEqual(workerTarget.type, WI.TargetType.Worker, "Added Target should have Worker type.");
             });
 
             let seen = 0;
index 2cf355a..c9529a0 100644 (file)
@@ -109,7 +109,7 @@ function test()
         async test() {
             await InspectorTest.Audit.setupAudit();
             await auditRun(`function() { return WebInspectorAudit.Version; }`, (result) => {
-                InspectorTest.expectEqual(result.value, InspectorBackend.domains.Audit.VERSION, "The injected WebInspectorAudit should hold the current Audit::Version.");
+                InspectorTest.expectEqual(result.value, InspectorBackend.getVersion("Audit"), "The injected WebInspectorAudit should hold the current Audit::Version.");
             });
             await InspectorTest.Audit.teardownAudit();
         },
index 57de58b..0693586 100644 (file)
@@ -11,7 +11,7 @@ function test()
         name: "Audit.VERSION.MatchesFrontend",
         description: "Check that the audit system version is in sync with the frontend version.",
         test() {
-            InspectorTest.expectEqual(InspectorBackend.domains.Audit.VERSION, WI.AuditTestBase.Version, "The audit system version should match the frontend version.");
+            InspectorTest.expectEqual(InspectorBackend.getVersion("Audit"), WI.AuditTestBase.Version, "The audit system version should match the frontend version.");
             return true;
         },
     });
index 0b2b750..eb8cecb 100644 (file)
@@ -36,7 +36,7 @@ function test() {
                 return;
             }
 
-            CanvasAgent.requestShaderSource(shaderProgram.identifier, CanvasAgent.ShaderType.Vertex)
+            CanvasAgent.requestShaderSource(shaderProgram.identifier, WI.ShaderProgram.ShaderType.Vertex)
             .then(({source}) => InspectorTest.log(source))
             .then(resolve, reject);
         }
@@ -52,7 +52,7 @@ function test() {
                 return;
             }
 
-            CanvasAgent.requestShaderSource(shaderProgram.identifier, CanvasAgent.ShaderType.Fragment)
+            CanvasAgent.requestShaderSource(shaderProgram.identifier, WI.ShaderProgram.ShaderType.Fragment)
             .then(({source}) => InspectorTest.log(source))
             .then(resolve, reject);
         }
index fd578e4..8cf3eeb 100644 (file)
@@ -48,7 +48,7 @@ function test() {
 
     validSourceTest({
         name: "Canvas.updateShader.WebGL.Vertex.Valid",
-        shaderType: CanvasAgent.ShaderType.Vertex,
+        shaderType: WI.ShaderProgram.ShaderType.Vertex,
         source: `
     void main(void) {
         gl_Position = vec4(1, 2, 3, 4);
@@ -58,7 +58,7 @@ function test() {
 
     validSourceTest({
         name: "Canvas.updateShader.WebGL.Fragment.Valid",
-        shaderType: CanvasAgent.ShaderType.Fragment,
+        shaderType: WI.ShaderProgram.ShaderType.Fragment,
         source: `
     precision mediump float;
 
@@ -89,13 +89,13 @@ function test() {
 
     invalidSourceTest({
         name: "Canvas.updateShader.WebGL.Vertex.Invalid",
-        shaderType: CanvasAgent.ShaderType.Vertex,
+        shaderType: WI.ShaderProgram.ShaderType.Vertex,
         source: "INVALID",
     });
 
     invalidSourceTest({
         name: "Canvas.updateShader.WebGL.Fragment.Invalid",
-        shaderType: CanvasAgent.ShaderType.Fragment,
+        shaderType: WI.ShaderProgram.ShaderType.Fragment,
         source: "INVALID",
     });
 
index 7c0acac..46a74d3 100644 (file)
@@ -1,10 +1,8 @@
-Test for DOM.inspect.
+Test for basic DOM.events.inspect functionality.
 
-
-== Running test suite: DOM.inspect
--- Running test case: DOM.inspect.valid
-PASS: DOMNodeWasInspected event
-
--- Running test case: DOM.inspect.invalid
-PASS: No error
+PASS: Got document.
+PASS: Queryied for target node.
+PASS: Set $0 to the target node.
+PASS: Evaluate $0.
+PASS: Id of $0 is "target".
 
index 54e4ae6..e45cb4c 100644 (file)
@@ -1,55 +1,47 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script src="../../http/tests/inspector/resources/protocol-test.js"></script>
 <script>
 function test()
 {
-    let documentNode;
+    function assertResponse(response, message) {
+        InspectorProtocol.checkForError(response);
+        ProtocolTest.log("PASS: " + message);
+    }
 
-    function dispatchDOMInspectEvent(nodeId) {
-        WI.dispatchMessageFromBackend({
-            "method": "DOM.inspect",
-            "params": {"nodeId": nodeId},
+    function evaluate$0() {
+        InspectorProtocol.sendCommand("Runtime.evaluate", {"expression": "$0.id", "includeCommandLineAPI": true}, (response) => {
+            assertResponse(response, "Evaluate $0.");
+            ProtocolTest.expectEqual(response.result.result.value, "target", "Id of $0 is \"target\".");
+            ProtocolTest.completeTest();
         });
     }
 
-    let suite = InspectorTest.createAsyncSuite("DOM.inspect");
-
-    suite.addTestCase({
-        name: "DOM.inspect.valid",
-        description: "Event given a valid nodeId should select it.",
-        test(resolve, reject) {
-            WI.domManager.querySelector(documentNode.id, "#element-to-select", (nodeId) => {
-                dispatchDOMInspectEvent(nodeId);
-            });
-            WI.domManager.awaitEvent(WI.DOMManager.Event.DOMNodeWasInspected).then((event) => {
-                InspectorTest.pass("DOMNodeWasInspected event");
-                resolve();
-            });
-        }
-    });
+    function setInspectedNode(nodeId) {
+        InspectorProtocol.sendCommand("DOM.setInspectedNode", {nodeId}, (response) => {
+            assertResponse(response, "Set $0 to the target node.");
+            evaluate$0();
+        });
+    }
 
-    suite.addTestCase({
-        name: "DOM.inspect.invalid",
-        description: "Event given an ivalid nodeId should not cause an exception.",
-        test(resolve, reject) {
-            dispatchDOMInspectEvent("DOES_NOT_EXIST");
-            setTimeout(() => {
-                InspectorTest.pass("No error");
-                resolve()
-            });
-        }
-    });
+    function queryForTarget(nodeId) {
+        InspectorProtocol.sendCommand("DOM.querySelector", {nodeId, selector: "#target"}, (response) => {
+            assertResponse(response, "Queryied for target node.");
+            setInspectedNode(response.result.nodeId);
+        });
+    }
 
-    WI.domManager.requestDocument((node) => {
-        documentNode = node;
-        suite.runTestCasesAndFinish();
+    InspectorProtocol.sendCommand("DOM.getDocument", {}, (response) => {
+        assertResponse(response, "Got document.");
+        queryForTarget(response.result.root.nodeId);
     });
 }
+
 </script>
 </head>
 <body onload="runTest()">
-<p id="element-to-select">Test for DOM.inspect.</p>
+<p>Test for basic DOM.events.inspect functionality.</p>
+<div id="target"></div>
 </body>
 </html>
index bdb1ff8..3d01906 100644 (file)
@@ -50,7 +50,7 @@ function test()
         description: "Test that changing whether ice candidate filtering is enabled has an effect.",
         async test() {
             InspectorTest.log("Overriding ICECandidateFilteringEnabled to false...");
-            await PageAgent.overrideSetting(PageAgent.Setting.ICECandidateFilteringEnabled, false);
+            await PageAgent.overrideSetting(InspectorBackend.Enum.Page.Setting.ICECandidateFilteringEnabled, false);
 
             let [overriddenResult] = await Promise.all([
                 InspectorTest.awaitEvent("DataChannel"),
index cb92e59..4278733 100644 (file)
@@ -28,7 +28,7 @@ function test()
             InspectorTest.log("Expected Error: " + defaultResult.data.error);
 
             InspectorTest.log("Overriding MockCaptureDevicesEnabled to true...");
-            await PageAgent.overrideSetting(PageAgent.Setting.MockCaptureDevicesEnabled, true);
+            await PageAgent.overrideSetting(InspectorBackend.Enum.Page.Setting.MockCaptureDevicesEnabled, true);
 
             let [overriddenResult] = await Promise.all([
                 InspectorTest.awaitEvent("GetUserMedia"),
@@ -37,7 +37,7 @@ function test()
             InspectorTest.expectTrue(overriddenResult.data.success, "getUserMedia should not fail when no devices are available");
 
             InspectorTest.log("Removing MockCaptureDevicesEnabled override...");
-            await PageAgent.overrideSetting(PageAgent.Setting.MockCaptureDevicesEnabled);
+            await PageAgent.overrideSetting(InspectorBackend.Enum.Page.Setting.MockCaptureDevicesEnabled);
 
             let [originalResult] = await Promise.all([
                 InspectorTest.awaitEvent("GetUserMedia"),
index d75df88..170780b 100644 (file)
@@ -21,12 +21,12 @@ function test()
             await InspectorTest.evaluateInPage(`printStyleProperty("color")`);
 
             InspectorTest.log("Overriding AuthorAndUserStylesEnabled to false...");
-            await PageAgent.overrideSetting(PageAgent.Setting.AuthorAndUserStylesEnabled, false);
+            await PageAgent.overrideSetting(InspectorBackend.Enum.Page.Setting.AuthorAndUserStylesEnabled, false);
 
             await InspectorTest.evaluateInPage(`printStyleProperty("color")`);
 
             InspectorTest.log("Removing AuthorAndUserStylesEnabled override...");
-            await PageAgent.overrideSetting(PageAgent.Setting.AuthorAndUserStylesEnabled);
+            await PageAgent.overrideSetting(InspectorBackend.Enum.Page.Setting.AuthorAndUserStylesEnabled);
 
             await InspectorTest.evaluateInPage(`printStyleProperty("color")`);
         },
index 5f04981..ad8e116 100644 (file)
@@ -11,7 +11,7 @@ function test()
         name: "Recording.VERSION.MatchesFrontend",
         description: "Check that the recording system version is in sync with the frontend version.",
         test() {
-            InspectorTest.expectEqual(RecordingAgent.VERSION, WI.Recording.Version, "The recording system version should match the frontend version.");
+            InspectorTest.expectEqual(InspectorBackend.getVersion("Recording"), WI.Recording.Version, "The recording system version should match the frontend version.");
             return true;
         },
     });
index 98d8ab1..68a1544 100644 (file)
@@ -22,7 +22,7 @@ function test()
             function testSource(source) {
                 RuntimeAgent.parse(source, (error, result, message, range) => {
                     InspectorTest.assert(!error, "Should not be a protocol error.");
-                    InspectorTest.expectThat(result === RuntimeAgent.SyntaxErrorType.None, "Should be SyntaxErrorType None.");
+                    InspectorTest.expectThat(result === InspectorBackend.Enum.Runtime.SyntaxErrorType.None, "Should be SyntaxErrorType None.");
                     InspectorTest.log("Source: " + source);
                     InspectorTest.assert(!message);
                     InspectorTest.assert(!range);
@@ -50,7 +50,7 @@ function test()
             function testSource(source) {
                 RuntimeAgent.parse(source, (error, result, message, range) => {
                     InspectorTest.assert(!error, "Should not be a protocol error.");
-                    InspectorTest.expectThat(result === RuntimeAgent.SyntaxErrorType.UnterminatedLiteral, "Should be SyntaxErrorType UnterminatedLiteral.");
+                    InspectorTest.expectThat(result === InspectorBackend.Enum.Runtime.SyntaxErrorType.UnterminatedLiteral, "Should be SyntaxErrorType UnterminatedLiteral.");
                     InspectorTest.log("Source: " + source);
                     outputErrorSourceRange(range);
                     InspectorTest.log("Error Message: " + message);
@@ -79,7 +79,7 @@ function test()
             function testSource(source) {
                 RuntimeAgent.parse(source, (error, result, message, range) => {
                     InspectorTest.assert(!error, "Should not be a protocol error.");
-                    InspectorTest.expectThat(result === RuntimeAgent.SyntaxErrorType.Recoverable, "Should be SyntaxErrorType Recoverable.");
+                    InspectorTest.expectThat(result === InspectorBackend.Enum.Runtime.SyntaxErrorType.Recoverable, "Should be SyntaxErrorType Recoverable.");
                     InspectorTest.log("Source: " + source);
                     outputErrorSourceRange(range);
                     InspectorTest.log("Error Message: " + message);
@@ -159,7 +159,7 @@ function test()
             function testSource(source) {
                 RuntimeAgent.parse(source, (error, result, message, range) => {
                     InspectorTest.assert(!error, "Should not be a protocol error.");
-                    InspectorTest.expectThat(result === RuntimeAgent.SyntaxErrorType.Irrecoverable, "Should be SyntaxErrorType Irrecoverable.");
+                    InspectorTest.expectThat(result === InspectorBackend.Enum.Runtime.SyntaxErrorType.Irrecoverable, "Should be SyntaxErrorType Irrecoverable.");
                     InspectorTest.log("Source: " + source);
                     outputErrorSourceRange(range);
                     InspectorTest.log("Error Message: " + message);
index c127acb..4990a8b 100644 (file)
@@ -1,5 +1,37 @@
 
 == Running test suite: Set
+-- Running test case: Set.prototype.pushAll
+Array:
+[1,2] => [1,2,"a1","a2"]
+
+Set:
+[1,2] => [1,2,"s1","s2"]
+[1,2] => [1,2,["s1","s1"],["s2","s2"]]
+[1,2] => [1,2,"s1","s2"]
+[1,2] => [1,2,"s1","s2"]
+
+Map:
+[1,2] => [1,2,["m1k","m1v"],["m2k","m2v"]]
+[1,2] => [1,2,["m1k","m1v"],["m2k","m2v"]]
+[1,2] => [1,2,"m1k","m2k"]
+[1,2] => [1,2,"m1v","m2v"]
+
+Object:
+[1,2] => [1,2,["o1k","o1v"],["o2k","o2v"]]
+[1,2] => [1,2,"o1k","o2k"]
+[1,2] => [1,2,"o1v","o2v"]
+
+Generator:
+[1,2] => [1,2,"g1","g2"]
+
+Node:
+[1,2] => [1,2,<n1>,<n2>]
+[1,2] => [1,2,<n1>,<n2>]
+
+Object (doesn't have [Symbol.iterator]):
+PASS: Should produce an exception.
+TypeError: undefined is not a function (near '...item of iterable...')
+
 -- Running test case: Set.prototype.take
 PASS: Set can take `key`.
 PASS: Set no longer has `key`.
index c708aa0..c82a525 100644 (file)
@@ -8,6 +8,88 @@ function test()
     let suite = InspectorTest.createSyncSuite("Set");
 
     suite.addTestCase({
+        name: "Set.prototype.pushAll",
+        test() {
+            function test(iterable) {
+                let set = new Set([1, 2]);
+
+                function stringify(object)
+                {
+                    let string = JSON.stringify(Array.from(object), function(key, value) {
+                        if (value instanceof Node)
+                            return "<" + value.localName + ">";
+                        return value;
+                    });
+                    return string.replace(/"(<[^>]*>)"/g, "$1");
+                }
+
+                let before = stringify(set);
+                set.addAll(iterable);
+                let after = stringify(set);
+
+                InspectorTest.log(before + " => " + after);
+            }
+
+            InspectorTest.log("Array:");
+            test(["a1", "a2"]);
+
+            InspectorTest.newline();
+
+            InspectorTest.log("Set:");
+            const set = new Set(["s1", "s2"]);
+            test(set);
+            test(set.entries());
+            test(set.keys());
+            test(set.values());
+
+            InspectorTest.newline();
+
+            InspectorTest.log("Map:");
+            const map = new Map([["m1k", "m1v"], ["m2k", "m2v"]]);
+            test(map);
+            test(map.entries());
+            test(map.keys());
+            test(map.values());
+
+            InspectorTest.newline();
+
+            InspectorTest.log("Object:");
+            const object = {
+                o1k: "o1v",
+                o2k: "o2v",
+            };
+            test(Object.entries(object));
+            test(Object.keys(object));
+            test(Object.values(object));
+
+            InspectorTest.newline();
+
+            InspectorTest.log("Generator:");
+            function* generator() {
+                yield "g1";
+                yield "g2";
+            }
+            test(generator());
+
+            InspectorTest.newline();
+
+            InspectorTest.log("Node:");
+            const node = document.createElement("div");
+            node.appendChild(document.createElement("n1"));
+            node.appendChild(document.createElement("n2"));
+            test(node.children);
+            test(node.querySelectorAll("*"));
+
+            InspectorTest.newline();
+
+            InspectorTest.log("Object (doesn't have [Symbol.iterator]):");
+            InspectorTest.expectException(() => {
+                test(object);
+            });
+        },
+    });
+
+    suite.addTestCase({
         name: "Set.prototype.take",
         test() {
             const key = "key";
index a673a28..256f8a4 100644 (file)
@@ -7,17 +7,17 @@ PASS: Targets list should always start out with the main target.
 PASS: Target list should always contain the main target.
 PASS: Main target should have an ExecutionContext.
 PASS: Main target should have the page target's RuntimeAgent.
-Target - Symbol(page) - Page
+Target - page - Page
 
 -- Running test case: TargetManager.WorkerTarget.Create
 PASS: Added Target should have Worker type.
 PASS: Added Target should have an ExecutionContext.
 PASS: Added Target should have a RuntimeAgent.
 PASS: Added Target RuntimeAgent should not be the global RuntimeAgent.
-Target - Symbol(page) - Page
-Target - Symbol(worker) - worker-1.js
+Target - page - Page
+Target - worker - worker-1.js
 
 -- Running test case: TargetManager.WorkerTarget.Remove
 PASS: Removed Target should have Worker type.
-Target - Symbol(page) - Page
+Target - page - Page
 
index 9a2219b..70bd81f 100644 (file)
@@ -43,7 +43,7 @@ function test()
             let event = await WI.targetManager.awaitEvent(WI.TargetManager.Event.TargetAdded);
             let target = event.data.target;
             InspectorTest.assert(target instanceof WI.Target);
-            InspectorTest.expectEqual(target.type, WI.Target.Type.Worker, "Added Target should have Worker type.");
+            InspectorTest.expectEqual(target.type, WI.TargetType.Worker, "Added Target should have Worker type.");
             InspectorTest.expectNotNull(target.executionContext, "Added Target should have an ExecutionContext.");
             InspectorTest.expectNotNull(target.RuntimeAgent, "Added Target should have a RuntimeAgent.");
             InspectorTest.expectNotEqual(target.RuntimeAgent, RuntimeAgent, "Added Target RuntimeAgent should not be the global RuntimeAgent.");
@@ -59,7 +59,7 @@ function test()
             let event = await WI.targetManager.awaitEvent(WI.TargetManager.Event.TargetRemoved);
             let target = event.data.target;
             InspectorTest.assert(target instanceof WI.Target);
-            InspectorTest.expectEqual(target.type, WI.Target.Type.Worker, "Removed Target should have Worker type.");
+            InspectorTest.expectEqual(target.type, WI.TargetType.Worker, "Removed Target should have Worker type.");
             dumpTargets();
         }
     });
index a1e0c5c..15d04b9 100644 (file)
@@ -37,7 +37,7 @@ function test()
     });
 
     let mainTarget = WI.mainTarget;
-    let workerTarget = Array.from(WI.targets).find((target) => target.type === WI.Target.Type.Worker);
+    let workerTarget = Array.from(WI.targets).find((target) => target.type === WI.TargetType.Worker);
     if (!workerTarget) {
         InspectorTest.fail("Missing Worker Target");
         InspectorTest.completeTest();
index 59cd709..ee3a125 100644 (file)
@@ -12,7 +12,7 @@ let worker = new Worker("resources/worker-debugger-pause.js");
 
 function test()
 {
-    let workerTarget = Array.from(WI.targets).find((target) => target.type === WI.Target.Type.Worker);
+    let workerTarget = Array.from(WI.targets).find((target) => target.type === WI.TargetType.Worker);
     let workerDebuggerData = WI.debuggerManager.dataForTarget(workerTarget);
     if (!workerTarget) {
         InspectorTest.fail("Missing Worker Target");
index 800d0ec..3f95f0b 100644 (file)
@@ -9,7 +9,7 @@ let worker = new Worker("resources/worker-scripts.js");
 function test()
 {
     let mainTarget = WI.mainTarget;
-    let workerTarget = Array.from(WI.targets).find((target) => target.type === WI.Target.Type.Worker);
+    let workerTarget = Array.from(WI.targets).find((target) => target.type === WI.TargetType.Worker);
     let mainDebuggerData = WI.debuggerManager.dataForTarget(mainTarget);
     let workerDebuggerData = WI.debuggerManager.dataForTarget(workerTarget);
     if (!workerTarget) {
index 01672bc..a3b334c 100644 (file)
@@ -105,7 +105,7 @@ function test()
                     let targetData = WI.debuggerManager.dataForTarget(target);
 
                     InspectorTest.pass("All Targets paused.");
-                    InspectorTest.expectEqual(target.type, WI.Target.Type.Worker, "Active CalleFrame should be in a Worker.");
+                    InspectorTest.expectEqual(target.type, WI.TargetType.Worker, "Active CalleFrame should be in a Worker.");
                     InspectorTest.expectEqual(targetData.pauseReason, WI.DebuggerManager.PauseReason.Breakpoint, "Pause reason should be a breakpoint.");
                     window.loadLinesFromSourceCode(target.mainResource).then(() => {
                         logPauseLocation();
index 3da23d8..cd1fa57 100644 (file)
@@ -65,7 +65,7 @@ function test()
             WI.targetManager.singleFireEventListener(WI.TargetManager.Event.TargetAdded, (event) => {
                 workerTarget = event.data.target;
                 InspectorTest.assert(workerTarget instanceof WI.Target);
-                InspectorTest.expectEqual(workerTarget.type, WI.Target.Type.Worker, "Added Target should have Worker type.");
+                InspectorTest.expectEqual(workerTarget.type, WI.TargetType.Worker, "Added Target should have Worker type.");
                 workerTargetIsSet = true;
                 attemptResolve();
             });
index 073bef5..935000c 100644 (file)
@@ -10,7 +10,7 @@ TestPage.registerInitializer(() => {
     InspectorTest.Worker.DOMDebugger.createWorkerTarget = function(callback) {
         let listener = WI.targetManager.addEventListener(WI.TargetManager.Event.TargetAdded, (event) => {
             let {target} = event.data;
-            if (target.type !== WI.Target.Type.Worker)
+            if (target.type !== WI.TargetType.Worker)
                 return;
 
             WI.targetManager.removeEventListener(WI.TargetManager.Event.TargetAdded, listener);
index f2ba60d..3ffaf3e 100644 (file)
@@ -9,7 +9,7 @@ let worker = new Worker("resources/worker-1.js");
 function test()
 {
     let mainTarget = WI.mainTarget;
-    let workerTarget = Array.from(WI.targets).find((target) => target.type === WI.Target.Type.Worker);
+    let workerTarget = Array.from(WI.targets).find((target) => target.type === WI.TargetType.Worker);
     if (!workerTarget) {
         InspectorTest.fail("Missing Worker Target");
         InspectorTest.completeTest();
index 5cdb66c..b1cd180 100644 (file)
@@ -1,3 +1,121 @@
+2019-10-17  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: rework frontend agent construction to allow commands/events to be controlled by the related target's type
+        https://bugs.webkit.org/show_bug.cgi?id=200384
+        <rdar://problem/53850352>
+
+        Reviewed by Joseph Pecoraro.
+
+        * inspector/scripts/codegen/generate_js_backend_commands.py:
+        (JSBackendCommandsGenerator.generate_domain):
+        (JSBackendCommandsGenerator.generate_domain.generate_parameter_object):
+        * inspector/scripts/codegen/models.py:
+        (validate_target_types): Added.
+        (Protocol.parse_domain):
+        (Protocol.parse_command):
+        (Protocol.parse_event):
+        (Domain.__init__):
+        (Domains):
+        (Command.__init__):
+        (Event.__init__):
+        * inspector/protocol/ApplicationCache.json:
+        * inspector/protocol/Audit.json:
+        * inspector/protocol/CPUProfiler.json:
+        * inspector/protocol/CSS.json:
+        * inspector/protocol/Canvas.json:
+        * inspector/protocol/Console.json:
+        * inspector/protocol/DOM.json:
+        * inspector/protocol/DOMDebugger.json:
+        * inspector/protocol/DOMStorage.json:
+        * inspector/protocol/Database.json:
+        * inspector/protocol/Debugger.json:
+        * inspector/protocol/Heap.json:
+        * inspector/protocol/IndexedDB.json:
+        * inspector/protocol/Inspector.json:
+        * inspector/protocol/LayerTree.json:
+        * inspector/protocol/Memory.json:
+        * inspector/protocol/Network.json:
+        * inspector/protocol/Page.json:
+        * inspector/protocol/Recording.json:
+        * inspector/protocol/Runtime.json:
+        * inspector/protocol/ScriptProfiler.json:
+        * inspector/protocol/Security.json:
+        * inspector/protocol/ServiceWorker.json:
+        * inspector/protocol/Target.json:
+        * inspector/protocol/Timeline.json:
+        * inspector/protocol/Worker.json:
+        Add `debuggableTypes` and `targetTypes` arrays to domains/commands/events that are used when
+        generating InspectorBackendCommands.js for more accurate compatibility checks.
+
+        * inspector/InspectorTarget.h:
+        * inspector/agents/InspectorTargetAgent.h:
+        * inspector/agents/InspectorTargetAgent.cpp:
+        (Inspector::targetTypeToProtocolType):
+        (Inspector::InspectorTargetAgent::exists): Deleted.
+        Remove `Target.exists` now that the frontend can do proper feature checking.
+
+        * inspector/remote/RemoteControllableTarget.h:
+        * inspector/remote/RemoteInspectionTarget.h:
+        * inspector/remote/RemoteInspectorConstants.h:
+        * inspector/remote/cocoa/RemoteInspectorCocoa.mm:
+        (Inspector::RemoteInspector::listingForInspectionTarget const):
+        * inspector/remote/glib/RemoteInspectorGlib.cpp:
+        (Inspector::RemoteInspector::listingForInspectionTarget const):
+        * inspector/remote/socket/RemoteInspectorSocket.cpp:
+        (Inspector::RemoteInspector::listingForInspectionTarget const):
+        Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).
+
+        * inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result:
+        * inspector/scripts/tests/generic/command-targetType-matching-domain-debuggableType.json: Added.
+        * inspector/scripts/tests/generic/domain-availability.json: Removed.
+        * inspector/scripts/tests/generic/domain-debuggableTypes.json: Added.
+        * inspector/scripts/tests/generic/domain-targetType-matching-domain-debuggableType.json: Added.
+        * inspector/scripts/tests/generic/domain-targetTypes.json: Added.
+        * inspector/scripts/tests/generic/event-targetType-matching-domain-debuggableType.json: Added.
+        * inspector/scripts/tests/generic/expected/command-targetType-matching-domain-debuggableType.json-result: Added.
+        * inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result:
+        * inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result:
+        * inspector/scripts/tests/generic/expected/domain-debuggableTypes.json-result: Added.
+        * inspector/scripts/tests/generic/expected/domain-targetType-matching-domain-debuggableType.json-result: Added.
+        * inspector/scripts/tests/generic/expected/domain-targetTypes.json-result: Added.
+        * inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result:
+        * inspector/scripts/tests/generic/expected/enum-values.json-result:
+        * inspector/scripts/tests/generic/expected/event-targetType-matching-domain-debuggableType.json-result: Added.
+        * inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result:
+        * inspector/scripts/tests/generic/expected/fail-on-command-targetType-matching-domain-debuggableType.json-error: Added.
+        * inspector/scripts/tests/generic/expected/fail-on-command-targetTypes-type.json-error: Added.
+        * inspector/scripts/tests/generic/expected/fail-on-command-targetTypes-value.json-error: Added.
+        * inspector/scripts/tests/generic/expected/fail-on-domain-availability-type.json-error: Removed.
+        * inspector/scripts/tests/generic/expected/fail-on-domain-availability-value.json-error: Removed.
+        * inspector/scripts/tests/generic/expected/fail-on-domain-availability.json-error: Removed.
+        * inspector/scripts/tests/generic/expected/fail-on-domain-debuggableTypes-type.json-error: Added.
+        * inspector/scripts/tests/generic/expected/fail-on-domain-debuggableTypes-value.json-error: Added.
+        * inspector/scripts/tests/generic/expected/fail-on-domain-targetType-matching-domain-debuggableType.json-error: Added.
+        * inspector/scripts/tests/generic/expected/fail-on-domain-targetTypes-type.json-error: Added.
+        * inspector/scripts/tests/generic/expected/fail-on-domain-targetTypes-value.json-error: Added.
+        * inspector/scripts/tests/generic/expected/fail-on-event-targetType-matching-domain-debuggableType.json-error: Added.
+        * inspector/scripts/tests/generic/expected/fail-on-event-targetTypes-type.json-error: Added.
+        * inspector/scripts/tests/generic/expected/fail-on-event-targetTypes-value.json-error: Added.
+        * inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result:
+        * inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result:
+        * inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result:
+        * inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result:
+        * inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result:
+        * inspector/scripts/tests/generic/expected/version.json-result:
+        * inspector/scripts/tests/generic/fail-on-command-targetType-matching-domain-debuggableType.json: Added.
+        * inspector/scripts/tests/generic/fail-on-command-targetTypes-type.json: Added.
+        * inspector/scripts/tests/generic/fail-on-command-targetTypes-value.json: Added.
+        * inspector/scripts/tests/generic/fail-on-domain-debuggableTypes-type.json: Added.
+        * inspector/scripts/tests/generic/fail-on-domain-debuggableTypes-value.json: Added.
+        * inspector/scripts/tests/generic/fail-on-domain-targetType-matching-domain-debuggableType.json: Added.
+        * inspector/scripts/tests/generic/fail-on-domain-targetTypes-type.json: Added.
+        * inspector/scripts/tests/generic/fail-on-domain-targetTypes-value.json: Added.
+        * inspector/scripts/tests/generic/fail-on-event-targetType-matching-domain-debuggableType.json: Added.
+        * inspector/scripts/tests/generic/fail-on-event-targetTypes-type.json: Added.
+        * inspector/scripts/tests/generic/fail-on-event-targetTypes-value.json: Added.
+        * inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result:
+        Update test results, as well as added new tests for `debuggableTypes` and `targetTypes`.
+
 2019-10-16  Mark Lam  <mark.lam@apple.com>
 
         Reduce the amount of memory needed to store Options.
index 9edaa1f..be11ce3 100644 (file)
@@ -33,7 +33,6 @@ namespace Inspector {
 // FIXME: Add DedicatedWorker Inspector Targets
 // FIXME: Add ServiceWorker Inspector Targets
 enum class InspectorTargetType : uint8_t {
-    JavaScriptContext,
     Page,
     DedicatedWorker,
     ServiceWorker,
@@ -60,7 +59,6 @@ namespace WTF {
 template<> struct EnumTraits<Inspector::InspectorTargetType> {
     using values = EnumValues<
         Inspector::InspectorTargetType,
-        Inspector::InspectorTargetType::JavaScriptContext,
         Inspector::InspectorTargetType::Page,
         Inspector::InspectorTargetType::DedicatedWorker,
         Inspector::InspectorTargetType::ServiceWorker
index c6c6bf8..c809606 100644 (file)
@@ -53,12 +53,6 @@ void InspectorTargetAgent::willDestroyFrontendAndBackend(DisconnectReason)
     m_isConnected = false;
 }
 
-void InspectorTargetAgent::exists(ErrorString&)
-{
-    // Intentionally do nothing to return success.
-    // FIXME: Remove this when the local inspector has switched over to the modern path.
-}
-
 void InspectorTargetAgent::sendMessageToTarget(ErrorString& errorString, const String& targetId, const String& message)
 {
     InspectorTarget* target = m_targets.get(targetId);
@@ -80,8 +74,6 @@ void InspectorTargetAgent::sendMessageFromTargetToFrontend(const String& targetI
 static Protocol::Target::TargetInfo::Type targetTypeToProtocolType(InspectorTargetType type)
 {
     switch (type) {
-    case InspectorTargetType::JavaScriptContext:
-        return Protocol::Target::TargetInfo::Type::JavaScript;
     case InspectorTargetType::Page:
         return Protocol::Target::TargetInfo::Type::Page;
     case InspectorTargetType::DedicatedWorker:
@@ -91,7 +83,7 @@ static Protocol::Target::TargetInfo::Type targetTypeToProtocolType(InspectorTarg
     }
 
     ASSERT_NOT_REACHED();
-    return Protocol::Target::TargetInfo::Type::JavaScript;
+    return Protocol::Target::TargetInfo::Type::Page;
 }
 
 static Ref<Protocol::Target::TargetInfo> buildTargetInfoObject(const InspectorTarget& target)
index 312eb60..0b1a04e 100644 (file)
@@ -47,7 +47,6 @@ public:
     void willDestroyFrontendAndBackend(DisconnectReason) final;
 
     // TargetBackendDispatcherHandler
-    void exists(ErrorString&) final;
     void sendMessageToTarget(ErrorString&, const String& targetId, const String& message) final;
 
     // Target lifecycle.
index 9740474..8721bb6 100644 (file)
@@ -1,6 +1,7 @@
 {
     "domain": "ApplicationCache",
-    "availability": ["web"],
+    "debuggableTypes": ["page", "web-page"],
+    "targetTypes": ["page"],
     "types": [
         {
             "id": "ApplicationCacheResource",
index e41e2b8..12a28bc 100644 (file)
@@ -2,6 +2,7 @@
     "domain": "Audit",
     "description": "",
     "version": 3,
+    "targetTypes": ["javascript", "page", "service-worker", "worker"],
     "commands": [
         {
             "name": "setup",
index 1f60d9d..cfacd01 100644 (file)
@@ -2,7 +2,8 @@
     "domain": "CPUProfiler",
     "description": "CPUProfiler domain exposes cpu usage tracking.",
     "featureGuard": "ENABLE(RESOURCE_USAGE)",
-    "availability": ["web"],
+    "debuggableTypes": ["page", "web-page"],
+    "targetTypes": ["page"],
     "types": [
         {
             "id": "ThreadInfo",
index cda3175..fd12116 100644 (file)
@@ -1,7 +1,8 @@
 {
     "domain": "CSS",
     "description": "This domain exposes CSS read/write operations. All CSS objects, like stylesheets, rules, and styles, have an associated <code>id</code> used in subsequent operations on the related object. Each object type has a specific <code>id</code> structure, and those are not interchangeable between objects of different kinds. CSS objects can be loaded using the <code>get*ForNode()</code> calls (which accept a DOM node id). Alternatively, a client can discover all the existing stylesheets with the <code>getAllStyleSheets()</code> method and subsequently load the required stylesheet contents using the <code>getStyleSheet[Text]()</code> methods.",
-    "availability": ["web"],
+    "debuggableTypes": ["page", "web-page"],
+    "targetTypes": ["page"],
     "types": [
         {
             "id": "StyleSheetId",
index 175ff40..ab54440 100644 (file)
@@ -1,7 +1,8 @@
 {
     "domain": "Canvas",
-    "availability": ["web"],
     "description": "Canvas domain allows tracking of canvases that have an associated graphics context. Tracks canvases in the DOM and CSS canvases created with -webkit-canvas.",
+    "debuggableTypes": ["page", "web-page"],
+    "targetTypes": ["page"],
     "types": [
         {
             "id": "CanvasId",
index f3adc8f..cb50bc0 100644 (file)
@@ -1,6 +1,7 @@
 {
     "domain": "Console",
     "description": "Console domain defines methods and events for interaction with the JavaScript console. Console collects messages created by means of the <a href='http://getfirebug.com/wiki/index.php/Console_API'>JavaScript Console API</a>. One needs to enable this domain using <code>enable</code> command in order to start receiving the console messages. Browser collects messages issued while console domain is not enabled as well and reports them using <code>messageAdded</code> notification upon enabling.",
+    "targetTypes": ["javascript", "page", "service-worker", "worker"],
     "types": [
         {
             "id": "ChannelSource",
index b3674e7..be47129 100644 (file)
@@ -1,7 +1,8 @@
 {
     "domain": "DOM",
     "description": "This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object that has an <code>id</code>. This <code>id</code> can be used to get additional information on the Node, resolve it into the JavaScript object wrapper, etc. It is important that client receives DOM events only for the nodes that are known to the client. Backend keeps track of the nodes that were sent to the client and never sends the same node twice. It is client's responsibility to collect information about the nodes that were sent to the client.<p>Note that <code>iframe</code> owner elements will return corresponding document elements as their child nodes.</p>",
-    "availability": ["web"],
+    "debuggableTypes": ["page", "web-page"],
+    "targetTypes": ["page"],
     "types": [
         {
             "id": "NodeId",
index c22a37b..5a18976 100644 (file)
@@ -1,7 +1,8 @@
 {
     "domain": "DOMDebugger",
     "description": "DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScript execution will stop on these operations as if there was a regular breakpoint set.",
-    "availability": ["web", "worker"],
+    "debuggableTypes": ["page", "web-page"],
+    "targetTypes": ["page", "worker"],
     "types": [
         {
             "id": "DOMBreakpointType",
index 2bf98fb..c4423b4 100644 (file)
@@ -1,7 +1,8 @@
 {
     "domain": "DOMStorage",
     "description": "Query and modify DOM storage.",
-    "availability": ["web"],
+    "debuggableTypes": ["page", "web-page"],
+    "targetTypes": ["page"],
     "types": [
         {
             "id": "StorageId",
index e6ddabc..bb22d34 100644 (file)
@@ -1,6 +1,7 @@
 {
     "domain": "Database",
-    "availability": ["web"],
+    "debuggableTypes": ["page", "web-page"],
+    "targetTypes": ["page"],
     "types": [
         {
             "id": "DatabaseId",
index 8ddc4fd..88287a1 100644 (file)
@@ -1,6 +1,7 @@
 {
     "domain": "Debugger",
     "description": "Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.",
+    "targetTypes": ["javascript", "page", "service-worker", "worker"],
     "types": [
         {
             "id": "BreakpointId",
index c76e33f..2f37f75 100644 (file)
@@ -1,6 +1,7 @@
 {
     "domain": "Heap",
     "description": "Heap domain exposes JavaScript heap attributes and capabilities.",
+    "targetTypes": ["javascript", "page", "service-worker", "worker"],
     "types": [
         {
             "id": "GarbageCollection",
index 069e6ed..9d23008 100644 (file)
@@ -1,7 +1,8 @@
 {
     "domain": "IndexedDB",
     "featureGuard": "ENABLE(INDEXED_DATABASE)",
-    "availability": ["web"],
+    "debuggableTypes": ["page", "web-page"],
+    "targetTypes": ["page"],
     "types": [
         {
             "id": "DatabaseWithObjectStores",
index b17ce87..2bb8d62 100644 (file)
@@ -1,6 +1,7 @@
 {
     "domain": "Inspector",
-    "availability": ["javascript", "web"],
+    "debuggableTypes": ["javascript", "page", "web-page"],
+    "targetTypes": ["javascript", "page"],
     "commands": [
         {
             "name": "enable",
index fd59115..d96d28e 100644 (file)
@@ -1,6 +1,7 @@
 {
     "domain": "LayerTree",
-    "availability": ["web"],
+    "debuggableTypes": ["page", "web-page"],
+    "targetTypes": ["page"],
     "types": [
         {
             "id": "LayerId",
index 1c3d01b..0c3d914 100644 (file)
@@ -2,7 +2,8 @@
     "domain": "Memory",
     "description": "Memory domain exposes page memory tracking.",
     "featureGuard": "ENABLE(RESOURCE_USAGE)",
-    "availability": ["web"],
+    "debuggableTypes": ["page", "web-page"],
+    "targetTypes": ["page"],
     "types": [
         {
             "id": "Event",
index b712107..546bbfd 100644 (file)
@@ -1,7 +1,8 @@
 {
     "domain": "Network",
     "description": "Network domain allows tracking network activities of the page. It exposes information about http, file, data and other requests and responses, their headers, bodies, timing, etc.",
-    "availability": ["web", "service-worker"],
+    "debuggableTypes": ["page", "service-worker", "web-page"],
+    "targetTypes": ["page", "service-worker"],
     "types": [
         {
             "id": "LoaderId",
index f3e6a20..ea90c2f 100644 (file)
@@ -1,7 +1,8 @@
 {
     "domain": "Page",
     "description": "Actions and events related to the inspected page belong to the page domain.",
-    "availability": ["web"],
+    "debuggableTypes": ["page", "web-page"],
+    "targetTypes": ["page"],
     "types": [
         {
             "id": "Setting",
index bc3ddf9..0453dee 100644 (file)
@@ -1,7 +1,8 @@
 {
     "domain": "Recording",
     "description": "General types used for recordings of actions performed in the inspected page.",
-    "availability": ["web"],
+    "debuggableTypes": ["page", "web-page"],
+    "targetTypes": ["page"],
     "version": 1,
     "types": [
         {
index 70c07c3..c790c42 100644 (file)
@@ -1,6 +1,7 @@
 {
     "domain": "Runtime",
     "description": "Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.",
+    "targetTypes": ["javascript", "page", "service-worker", "worker"],
     "types": [
         {
             "id": "RemoteObjectId",
index 60ca687..d7136cc 100644 (file)
@@ -1,7 +1,8 @@
 {
     "domain": "ScriptProfiler",
     "description": "Profiler domain exposes JavaScript evaluation timing and profiling.",
-    "availability": ["javascript", "web"],
+    "debuggableTypes": ["javascript", "page", "web-page"],
+    "targetTypes": ["javascript", "page"],
     "types": [
         {
             "id": "EventType",
index 4c16135..97bcb1c 100644 (file)
@@ -1,6 +1,8 @@
 {
     "domain": "Security",
     "description": "Security domain allows the frontend to query for information relating to the security of the page (e.g. HTTPS info, TLS info, user activity, etc.).",
+    "debuggableTypes": ["page", "service-worker", "web-page"],
+    "targetTypes": ["page", "service-worker"],
     "types": [
         {
             "id": "Connection",
index 8113068..8ac3d4f 100644 (file)
@@ -1,7 +1,8 @@
 {
     "domain": "ServiceWorker",
     "description": "Actions and events related to the inspected service worker.",
-    "availability": ["service-worker"],
+    "debuggableTypes": ["service-worker"],
+    "targetTypes": ["service-worker"],
     "types": [
         {
             "id": "Configuration",
index 61ad269..394fedd 100644 (file)
@@ -1,6 +1,7 @@
 {
     "domain": "Target",
-    "availability": ["web"],
+    "debuggableTypes": ["web-page"],
+    "targetTypes": ["web-page"],
     "types": [
         {
             "id": "TargetInfo",
@@ -8,16 +9,12 @@
             "description": "Description of a target.",
             "properties": [
                 { "name": "targetId", "type": "string", "description": "Unique identifier for the target." },
-                { "name": "type", "type": "string", "enum": ["javascript", "page", "worker", "serviceworker"] }
+                { "name": "type", "type": "string", "enum": ["page", "service-worker", "worker"] }
             ]
         }
     ],
     "commands": [
         {
-            "name": "exists",
-            "description": "FIXME: Remove this when the local inspector has switched over to the modern path."
-        },
-        {
             "name": "sendMessageToTarget",
             "description": "Send an Inspector Protocol message to be dispatched to a Target's agents.",
             "parameters": [
index 8c71682..b0d3d00 100644 (file)
@@ -1,7 +1,8 @@
 {
     "domain": "Timeline",
     "description": "Timeline provides its clients with instrumentation records that are generated during the page runtime. Timeline instrumentation can be started and stopped using corresponding commands. While timeline is started, it is generating timeline event records.",
-    "availability": ["web"],
+    "debuggableTypes": ["page", "web-page"],
+    "targetTypes": ["page"],
     "types": [
         {
             "id": "EventType",
index 44c59c3..9e2bee9 100644 (file)
@@ -1,6 +1,7 @@
 {
     "domain": "Worker",
-    "availability": ["web"],
+    "debuggableTypes": ["page", "web-page"],
+    "targetTypes": ["page"],
     "commands": [
         {
             "name": "enable",
index 54f23a5..e715966 100644 (file)
@@ -53,7 +53,13 @@ public:
     TargetID targetIdentifier() const { return m_identifier; }
     void setTargetIdentifier(TargetID identifier) { m_identifier = identifier; }
 
-    enum class Type { JavaScript, ServiceWorker, Web, Automation };
+    enum class Type {
+        Automation,
+        JavaScript,
+        Page,
+        ServiceWorker,
+        WebPage,
+    };
     virtual Type type() const = 0;
     virtual bool remoteControlAllowed() const = 0;
     virtual void dispatchMessageFromRemote(const String& message) = 0;
index 7a939e5..83b87f9 100644 (file)
@@ -68,12 +68,10 @@ private:
 
 } // namespace Inspector
 
-SPECIALIZE_TYPE_TRAITS_BEGIN(Inspector::RemoteInspectionTarget) \
-    static bool isType(const Inspector::RemoteControllableTarget& target) \
-    { \
-        return target.type() == Inspector::RemoteControllableTarget::Type::JavaScript \
-            || target.type() == Inspector::RemoteControllableTarget::Type::ServiceWorker \
-            || target.type() == Inspector::RemoteControllableTarget::Type::Web; \
+SPECIALIZE_TYPE_TRAITS_BEGIN(Inspector::RemoteInspectionTarget)
+    static bool isType(const Inspector::RemoteControllableTarget& target)
+    {
+        return target.type() != Inspector::RemoteControllableTarget::Type::Automation;
     }
 SPECIALIZE_TYPE_TRAITS_END()
 
index 9cb01a3..9215beb 100644 (file)
 #define WIRDestinationKey                       @"WIRDestinationKey"
 #define WIRConnectionDiedMessage                @"WIRConnectionDiedMessage"
 #define WIRTypeKey                              @"WIRTypeKey"
+#define WIRTypeAutomation                       @"WIRTypeAutomation"
 #define WIRTypeJavaScript                       @"WIRTypeJavaScript"
+#define WIRTypePage                             @"WIRTypePage"
 #define WIRTypeServiceWorker                    @"WIRTypeServiceWorker"
-#define WIRTypeWeb                              @"WIRTypeWeb"
-#define WIRTypeAutomation                       @"WIRTypeAutomation"
+#define WIRTypeWeb                              @"WIRTypeWeb" // COMPATIBILITY (iOS 13): "Web" was split into "Page" (WebCore::Page) and "WebPage" (WebKit::WebPageProxy).
+#define WIRTypeWebPage                          @"WIRTypeWebPage"
 #define WIRAutomaticallyPause                   @"WIRAutomaticallyPause"
 
 // Allowed values for WIRAutomationAvailabilityKey.
index 2bb96ec..17cd5f2 100644 (file)
@@ -382,15 +382,20 @@ RetainPtr<NSDictionary> RemoteInspector::listingForInspectionTarget(const Remote
         [listing setObject:target.name() forKey:WIRTitleKey];
         [listing setObject:WIRTypeJavaScript forKey:WIRTypeKey];
         break;
+    case RemoteInspectionTarget::Type::Page:
+        [listing setObject:target.url() forKey:WIRURLKey];
+        [listing setObject:target.name() forKey:WIRTitleKey];
+        [listing setObject:WIRTypePage forKey:WIRTypeKey];
+        break;
     case RemoteInspectionTarget::Type::ServiceWorker:
         [listing setObject:target.url() forKey:WIRURLKey];
         [listing setObject:target.name() forKey:WIRTitleKey];
         [listing setObject:WIRTypeServiceWorker forKey:WIRTypeKey];
         break;
-    case RemoteInspectionTarget::Type::Web:
+    case RemoteInspectionTarget::Type::WebPage:
         [listing setObject:target.url() forKey:WIRURLKey];
         [listing setObject:target.name() forKey:WIRTitleKey];
-        [listing setObject:WIRTypeWeb forKey:WIRTypeKey];
+        [listing setObject:WIRTypeWebPage forKey:WIRTypeKey];
         break;
     default:
         ASSERT_NOT_REACHED();
index d771ff7..ebbaf71 100644 (file)
@@ -190,10 +190,10 @@ TargetListing RemoteInspector::listingForInspectionTarget(const RemoteInspection
     if (target.type() == RemoteInspectionTarget::Type::ServiceWorker)
         return nullptr;
 
-    ASSERT(target.type() == RemoteInspectionTarget::Type::Web || target.type() == RemoteInspectionTarget::Type::JavaScript);
+    ASSERT(target.type() == RemoteInspectionTarget::Type::JavaScript || target.type() == RemoteInspectionTarget::Type::Page || target.type() == RemoteInspectionTarget::Type::WebPage);
     return g_variant_new("(tsssb)", static_cast<guint64>(target.targetIdentifier()),
-        target.type() == RemoteInspectionTarget::Type::Web ? "Web" : "JavaScript",
-        target.name().utf8().data(), target.type() == RemoteInspectionTarget::Type::Web ? target.url().utf8().data() : "null",
+        target.type() == RemoteInspectionTarget::Type::JavaScript ? "JavaScript" : "Web",
+        target.name().utf8().data(), target.type() == RemoteInspectionTarget::Type::JavaScript ? "null" : target.url().utf8().data(),
         target.hasLocalDebugger());
 }
 
index eeb5fc4..e99e874 100644 (file)
@@ -123,8 +123,10 @@ TargetListing RemoteInspector::listingForInspectionTarget(const RemoteInspection
     targetListing->setString("url"_s, target.url());
     targetListing->setInteger("targetID"_s, target.targetIdentifier());
     targetListing->setBoolean("hasLocalDebugger"_s, target.hasLocalDebugger());
-    if (target.type() == RemoteInspectionTarget::Type::Web)
-        targetListing->setString("type"_s, "web"_s);
+    if (target.type() == RemoteInspectionTarget::Type::WebPage)
+        targetListing->setString("type"_s, "web-page"_s);
+    else if (target.type() == RemoteInspectionTarget::Type::Page)
+        targetListing->setString("type"_s, "page"_s);
     else if (target.type() == RemoteInspectionTarget::Type::JavaScript)
         targetListing->setString("type"_s, "javascript"_s);
     else if (target.type() == RemoteInspectionTarget::Type::ServiceWorker)
index d974ea2..bbf76f9 100755 (executable)
@@ -65,91 +65,99 @@ class JSBackendCommandsGenerator(Generator):
 
     def generate_domain(self, domain):
         lines = []
-        args = {
-            'domain': domain.domain_name
-        }
 
-        lines.append('// %(domain)s.' % args)
+        comment_args = {
+            'domainName': domain.domain_name,
+        }
+        lines.append('// %(domainName)s' % comment_args)
 
         version = self.version_for_domain(domain)
         type_declarations = self.type_declarations_for_domain(domain)
         commands = self.commands_for_domain(domain)
         events = self.events_for_domain(domain)
 
-        has_async_commands = any([command.is_async for command in commands])
-        if len(events) > 0 or has_async_commands:
-            lines.append('InspectorBackend.register%(domain)sDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "%(domain)s");' % args)
+        domain_args = {
+            'domainName': domain.domain_name,
+            'targetTypes': json.dumps(domain.target_types),
+        }
+        lines.append('InspectorBackend.registerDomain("%(domainName)s", %(targetTypes)s);' % domain_args)
 
         if isinstance(version, int):
             version_args = {
-                'domain': domain.domain_name,
+                'domainName': domain.domain_name,
                 'version': version
             }
-            lines.append('InspectorBackend.registerVersion("%(domain)s", %(version)s);' % version_args)
+            lines.append('InspectorBackend.registerVersion("%(domainName)s", %(version)s);' % version_args)
 
         for declaration in type_declarations:
             if declaration.type.is_enum():
                 enum_args = {
-                    'domain': domain.domain_name,
+                    'domainName': domain.domain_name,
                     'enumName': declaration.type_name,
                     'enumMap': ", ".join(['%s: "%s"' % (Generator.stylized_name_for_enum_value(enum_value), enum_value) for enum_value in declaration.type.enum_values()])
                 }
-                lines.append('InspectorBackend.registerEnum("%(domain)s.%(enumName)s", {%(enumMap)s});' % enum_args)
+                lines.append('InspectorBackend.registerEnum("%(domainName)s.%(enumName)s", {%(enumMap)s});' % enum_args)
 
             def is_anonymous_enum_member(type_member):
                 return isinstance(type_member.type, EnumType) and type_member.type.is_anonymous
 
             for _member in filter(is_anonymous_enum_member, declaration.type_members):
                 enum_args = {
-                    'domain': domain.domain_name,
+                    'domainName': domain.domain_name,
                     'enumName': '%s%s' % (declaration.type_name, ucfirst(_member.member_name)),
                     'enumMap': ", ".join(['%s: "%s"' % (Generator.stylized_name_for_enum_value(enum_value), enum_value) for enum_value in _member.type.enum_values()])
                 }
-                lines.append('InspectorBackend.registerEnum("%(domain)s.%(enumName)s", {%(enumMap)s});' % enum_args)
+                lines.append('InspectorBackend.registerEnum("%(domainName)s.%(enumName)s", {%(enumMap)s});' % enum_args)
 
         def is_anonymous_enum_param(param):
             return isinstance(param.type, EnumType) and param.type.is_anonymous
 
-        for event in events:
-            for param in filter(is_anonymous_enum_param, event.event_parameters):
-                enum_args = {
-                    'domain': domain.domain_name,
-                    'enumName': '%s%s' % (ucfirst(event.event_name), ucfirst(param.parameter_name)),
-                    'enumMap': ", ".join(['%s: "%s"' % (Generator.stylized_name_for_enum_value(enum_value), enum_value) for enum_value in param.type.enum_values()])
-                }
-                lines.append('InspectorBackend.registerEnum("%(domain)s.%(enumName)s", {%(enumMap)s});' % enum_args)
-
-            event_args = {
-                'domain': domain.domain_name,
-                'eventName': event.event_name,
-                'params': ", ".join(['"%s"' % parameter.parameter_name for parameter in event.event_parameters])
-            }
-            lines.append('InspectorBackend.registerEvent("%(domain)s.%(eventName)s", [%(params)s]);' % event_args)
-
         for command in commands:
             def generate_parameter_object(parameter):
-                optional_string = "true" if parameter.is_optional else "false"
                 pairs = []
                 pairs.append('"name": "%s"' % parameter.parameter_name)
                 pairs.append('"type": "%s"' % Generator.js_name_for_parameter_type(parameter.type))
-                pairs.append('"optional": %s' % optional_string)
+                if parameter.is_optional:
+                    pairs.append('"optional": true')
                 return "{%s}" % ", ".join(pairs)
 
             command_args = {
-                'domain': domain.domain_name,
+                'domainName': domain.domain_name,
                 'commandName': command.command_name,
+                'targetTypes': json.dumps(command.target_types),
                 'callParams': ", ".join([generate_parameter_object(parameter) for parameter in command.call_parameters]),
                 'returnParams': ", ".join(['"%s"' % parameter.parameter_name for parameter in command.return_parameters]),
             }
-            lines.append('InspectorBackend.registerCommand("%(domain)s.%(commandName)s", [%(callParams)s], [%(returnParams)s]);' % command_args)
+            lines.append('InspectorBackend.registerCommand("%(domainName)s.%(commandName)s", %(targetTypes)s, [%(callParams)s], [%(returnParams)s]);' % command_args)
+
+        for event in events:
+            for param in filter(is_anonymous_enum_param, event.event_parameters):
+                enum_args = {
+                    'domainName': domain.domain_name,
+                    'enumName': '%s%s' % (ucfirst(event.event_name), ucfirst(param.parameter_name)),
+                    'enumMap': ", ".join(['%s: "%s"' % (Generator.stylized_name_for_enum_value(enum_value), enum_value) for enum_value in param.type.enum_values()]),
+                }
+                lines.append('InspectorBackend.registerEnum("%(domainName)s.%(enumName)s", {%(enumMap)s});' % enum_args)
+
+            event_args = {
+                'domainName': domain.domain_name,
+                'eventName': event.event_name,
+                'targetTypes': json.dumps(event.target_types),
+                'params': ", ".join(['"%s"' % parameter.parameter_name for parameter in event.event_parameters]),
+            }
+            lines.append('InspectorBackend.registerEvent("%(domainName)s.%(eventName)s", %(targetTypes)s, [%(params)s]);' % event_args)
+
+        has_async_commands = any([command.is_async for command in commands])
+        if len(events) > 0 or has_async_commands:
+            dispatcher_args = {
+                'domainName': domain.domain_name,
+            }
+            lines.append('InspectorBackend.register%(domainName)sDispatcher = InspectorBackend.registerDispatcher.bind(InspectorBackend, "%(domainName)s");' % dispatcher_args)
 
         activate_args = {
-            'domain': domain.domain_name,
-            'availability': json.dumps(domain.availability) if domain.availability else '',
+            'domainName': domain.domain_name,
+            'debuggableTypes': json.dumps(domain.debuggable_types),
         }
-        if domain.availability:
-            lines.append('InspectorBackend.activateDomain("%(domain)s", %(availability)s);' % activate_args)
-        else:
-            lines.append('InspectorBackend.activateDomain("%(domain)s");' % activate_args)
+        lines.append('InspectorBackend.activateDomain("%(domainName)s", %(debuggableTypes)s);' % activate_args)
 
         return "\n".join(lines)
index 0ff92bd..6d97a09 100755 (executable)
@@ -38,6 +38,24 @@ def find_duplicates(l):
     return [key for key, count in list(collections.Counter(l).items()) if count > 1]
 
 
+def validate_target_types(debuggable_types, target_types):
+    for target_type in target_types:
+        required_debuggable_types = set()
+        if target_type == 'javascript':
+            if not 'javascript' in debuggable_types:
+                return False
+        elif target_type == 'page' or target_type == 'worker':
+            if not 'page' in debuggable_types:
+                return False
+        elif target_type == 'service-worker':
+            if not 'service-worker' in debuggable_types:
+                return False
+        elif target_type == 'web-page':
+            if not 'web-page' in debuggable_types:
+                return False
+    return True
+
+
 _FRAMEWORK_CONFIG_MAP = {
     "Global": {
     },
@@ -66,6 +84,9 @@ _FRAMEWORK_CONFIG_MAP = {
     }
 }
 
+_ALLOWED_DEBUGGABLE_TYPE_STRINGS = frozenset(['javascript', 'page', 'service-worker', 'web-page'])
+_ALLOWED_TARGET_TYPE_STRINGS = frozenset(['javascript', 'page', 'service-worker', 'web-page', 'worker'])
+
 
 class ParseException(Exception):
     pass
@@ -368,11 +389,36 @@ class Protocol:
         check_for_required_properties(['domain'], json, "domain")
         log.debug("parse domain " + json['domain'])
 
+        debuggable_types = None
+        target_types = None
         version = None
         types = []
         commands = []
         events = []
 
+        if 'debuggableTypes' in json:
+            if not isinstance(json['debuggableTypes'], list):
+                raise ParseException("Malformed domain specification: debuggableTypes for domain %s is not an array" % json['domain'])
+
+            for debuggable_types in json['debuggableTypes']:
+                if debuggable_types not in _ALLOWED_DEBUGGABLE_TYPE_STRINGS:
+                    raise ParseException('Malformed domain specification: debuggableTypes for domain %s is an unsupported string. Was: "%s", Allowed values: %s' % (json['domain'], json['debuggableTypes'], ', '.join(_ALLOWED_DEBUGGABLE_TYPE_STRINGS)))
+
+            debuggable_types = json.get('debuggableTypes')
+
+        if 'targetTypes' in json:
+            if not isinstance(json['targetTypes'], list):
+                raise ParseException("Malformed domain specification: targetTypes for domain %s is not an array" % json['domain'])
+
+            for target_types in json['targetTypes']:
+                if target_types not in _ALLOWED_TARGET_TYPE_STRINGS:
+                    raise ParseException('Malformed domain specification: targetTypes for domain %s is an unsupported string. Was: "%s", Allowed values: %s' % (json['domain'], json['targetTypes'], ', '.join(_ALLOWED_TARGET_TYPE_STRINGS)))
+
+            target_types = json.get('targetTypes')
+
+            if debuggable_types and not validate_target_types(debuggable_types, target_types):
+                raise ParseException('Malformed domain specification: domain %s has an item in targetTypes "%s" that is not supported by any value in debuggableTypes "%s".' % (json['domain'], target_types, debuggable_types))
+
         if 'version' in json:
             if not isinstance(json['version'], int):
                 raise ParseException("Malformed domain specification: version is not a number or string")
@@ -386,22 +432,14 @@ class Protocol:
         if 'commands' in json:
             if not isinstance(json['commands'], list):
                 raise ParseException("Malformed domain specification: commands is not an array")
-            commands.extend([self.parse_command(command) for command in json['commands']])
+            commands.extend([self.parse_command(command, debuggable_types) for command in json['commands']])
 
         if 'events' in json:
             if not isinstance(json['events'], list):
                 raise ParseException("Malformed domain specification: events is not an array")
-            events.extend([self.parse_event(event) for event in json['events']])
+            events.extend([self.parse_event(event, debuggable_types) for event in json['events']])
 
-        if 'availability' in json:
-            if not isinstance(json['availability'], list):
-                raise ParseException("Malformed domain specification: availability is not an array")
-            allowed_activation_strings = set(['javascript', 'web', 'worker', 'service-worker'])
-            for availability_type in json['availability']:
-                if availability_type not in allowed_activation_strings:
-                    raise ParseException('Malformed domain specification: availability is an unsupported string. Was: "%s", Allowed values: %s' % (json['availability'], ', '.join(allowed_activation_strings)))
-
-        self.domains.append(Domain(json['domain'], json.get('description', ''), json.get('featureGuard'), json.get('availability'), isSupplemental, version, types, commands, events))
+        self.domains.append(Domain(json['domain'], json.get('description', ''), json.get('featureGuard'), debuggable_types, target_types, isSupplemental, version, types, commands, events))
 
     def parse_type_declaration(self, json):
         check_for_required_properties(['id', 'type'], json, "type")
@@ -429,13 +467,30 @@ class Protocol:
         type_ref = TypeReference(json.get('type'), json.get('$ref'), json.get('enum'), json.get('items'))
         return TypeMember(json['name'], type_ref, json.get('optional', False), json.get('description', ""))
 
-    def parse_command(self, json):
+    def parse_command(self, json, debuggable_types):
         check_for_required_properties(['name'], json, "command")
         log.debug("parse command %s" % json['name'])
 
+        target_types = None
         call_parameters = []
         return_parameters = []
 
+        if 'targetTypes' in json:
+            if not isinstance(json['targetTypes'], list):
+                raise ParseException("Malformed domain specification: targetTypes list for command %s is not an array" % json['name'])
+            target_types = json['targetTypes']
+
+            for target_type in target_types:
+                if target_type not in _ALLOWED_TARGET_TYPE_STRINGS:
+                    raise ParseException('Malformed domain specification: targetTypes list for command %s is an unsupported string. Was: "%s", Allowed values: %s' % (json['name'], json['targetTypes'], ', '.join(_ALLOWED_TARGET_TYPE_STRINGS)))
+
+            duplicate_types = find_duplicates(target_types)
+            if len(duplicate_types) > 0:
+                raise ParseException("Malformed domain specification: targetTypes list for command %s has duplicate items" % json['name'])
+
+            if debuggable_types and not validate_target_types(debuggable_types, target_types):
+                raise ParseException('Malformed domain specification: command %s has an item in targetTypes "%s" that is not supported by any value in debuggableTypes "%s".' % (json['name'], target_types, debuggable_types))
+
         if 'parameters' in json:
             if not isinstance(json['parameters'], list):
                 raise ParseException("Malformed command specification: parameters is not an array")
@@ -455,14 +510,31 @@ class Protocol:
                 raise ParseException("Malformed domain specification: return parameter list for command %s has duplicate parameter names" % json['name'])
 
         platform = Platform.fromString(json.get('platform', 'generic'))
-        return Command(json['name'], call_parameters, return_parameters, json.get('description', ""), platform, json.get('async', False))
+        return Command(json['name'], target_types, call_parameters, return_parameters, json.get('description', ""), platform, json.get('async', False))
 
-    def parse_event(self, json):
+    def parse_event(self, json, debuggable_types):
         check_for_required_properties(['name'], json, "event")
         log.debug("parse event %s" % json['name'])
 
+        target_types = None
         event_parameters = []
 
+        if 'targetTypes' in json:
+            if not isinstance(json['targetTypes'], list):
+                raise ParseException("Malformed domain specification: targetTypes for event %s is not an array" % json['name'])
+            target_types = json['targetTypes']
+
+            for target_type in target_types:
+                if target_type not in _ALLOWED_TARGET_TYPE_STRINGS:
+                    raise ParseException('Malformed domain specification: targetTypes for event %s is an unsupported string. Was: "%s", Allowed values: %s' % (json['name'], json['targetTypes'], ', '.join(_ALLOWED_TARGET_TYPE_STRINGS)))
+
+            duplicate_types = find_duplicates(target_types)
+            if len(duplicate_types) > 0:
+                raise ParseException("Malformed domain specification: targetTypes list for event %s has duplicate items" % json['name'])
+
+            if debuggable_types and not validate_target_types(debuggable_types, target_types):
+                raise ParseException('Malformed domain specification: event %s has an item in targetTypes "%s" that is not supported by any value in debuggableTypes "%s".' % (json['name'], target_types, debuggable_types))
+
         if 'parameters' in json:
             if not isinstance(json['parameters'], list):
                 raise ParseException("Malformed event specification: parameters is not an array")
@@ -473,7 +545,7 @@ class Protocol:
                 raise ParseException("Malformed domain specification: parameter list for event %s has duplicate parameter names" % json['name'])
 
         platform = Platform.fromString(json.get('platform', 'generic'))
-        return Event(json['name'], event_parameters, json.get('description', ""), platform)
+        return Event(json['name'], target_types, event_parameters, json.get('description', ""), platform)
 
     def parse_call_or_return_parameter(self, json):
         check_for_required_properties(['name'], json, "parameter")
@@ -571,11 +643,12 @@ class Protocol:
 
 
 class Domain:
-    def __init__(self, domain_name, description, feature_guard, availability, isSupplemental, version, type_declarations, commands, events):
+    def __init__(self, domain_name, description, feature_guard, debuggable_types, target_types, isSupplemental, version, type_declarations, commands, events):
         self.domain_name = domain_name
         self.description = description
         self.feature_guard = feature_guard
-        self.availability = availability
+        self.debuggable_types = debuggable_types
+        self.target_types = target_types
         self.is_supplemental = isSupplemental
         self._version = version
         self._type_declarations = type_declarations
@@ -609,7 +682,7 @@ class Domain:
 
 
 class Domains:
-    GLOBAL = Domain("", "The global domain, in which primitive types are implicitly declared.", None, None, False, None, [], [], [])
+    GLOBAL = Domain("", "The global domain, in which primitive types are implicitly declared.", None, None, None, False, None, [], [], [])
 
 
 class TypeDeclaration:
@@ -661,8 +734,9 @@ class Parameter:
 
 
 class Command:
-    def __init__(self, command_name, call_parameters, return_parameters, description, platform, is_async):
+    def __init__(self, command_name, target_types, call_parameters, return_parameters, description, platform, is_async):
         self.command_name = command_name
+        self.target_types = target_types
         self.call_parameters = call_parameters
         self.return_parameters = return_parameters
         self.description = description
@@ -680,8 +754,9 @@ class Command:
 
 
 class Event:
-    def __init__(self, event_name, event_parameters, description, platform):
+    def __init__(self, event_name, target_types, event_parameters, description, platform):
         self.event_name = event_name
+        self.target_types = target_types
         self.event_parameters = event_parameters
         self.description = description
         self.platform = platform
index 3497592..4977786 100644 (file)
 // DO NOT EDIT THIS FILE. It is automatically generated from definitions-with-mac-platform.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
-// Network.
-InspectorBackend.registerNetworkDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Network");
-InspectorBackend.registerEvent("Network.resourceLoaded", []);
-InspectorBackend.registerCommand("Network.loadResource", [], []);
-InspectorBackend.activateDomain("Network");
+// Network
+InspectorBackend.registerDomain("Network", null);
+InspectorBackend.registerCommand("Network.loadResource", null, [], []);
+InspectorBackend.registerEvent("Network.resourceLoaded", null, []);
+InspectorBackend.registerNetworkDispatcher = InspectorBackend.registerDispatcher.bind(InspectorBackend, "Network");
+InspectorBackend.activateDomain("Network", null);
 ### End File: InspectorBackendCommands.js
 
 ### Begin File: TestAlternateBackendDispatchers.h
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/command-targetType-matching-domain-debuggableType.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/command-targetType-matching-domain-debuggableType.json
new file mode 100644 (file)
index 0000000..d27ab65
--- /dev/null
@@ -0,0 +1,9 @@
+[
+{
+    "domain": "Domain",
+    "debuggableTypes": ["page"],
+    "targetTypes": ["page", "worker"],
+    "commands": [{"name": "Command"}],
+    "events": [{"name": "Event"}]
+}
+]
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/domain-availability.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/domain-availability.json
deleted file mode 100644 (file)
index e69646b..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-[
-{
-    "domain": "DomainA",
-    "availability": ["web"],
-    "commands": [{"name": "enable"}]
-},
-{
-    "domain": "DomainB",
-    "commands": [{"name": "enable"}]
-}
-]
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/domain-debuggableTypes.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/domain-debuggableTypes.json
new file mode 100644 (file)
index 0000000..1feb0c9
--- /dev/null
@@ -0,0 +1,8 @@
+[
+{
+    "domain": "Domain",
+    "debuggableTypes": ["web-page"],
+    "commands": [{"name": "Command"}],
+    "events": [{"name": "Event"}]
+}
+]
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/domain-targetType-matching-domain-debuggableType.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/domain-targetType-matching-domain-debuggableType.json
new file mode 100644 (file)
index 0000000..f62fb38
--- /dev/null
@@ -0,0 +1,8 @@
+[
+{
+    "domain": "Domain",
+    "debuggableTypes": ["page"],
+    "commands": [{"name": "Command", "targetTypes": ["page", "worker"]}],
+    "events": [{"name": "Event"}]
+}
+]
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/domain-targetTypes.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/domain-targetTypes.json
new file mode 100644 (file)
index 0000000..6a6e40d
--- /dev/null
@@ -0,0 +1,8 @@
+[
+{
+    "domain": "Domain",
+    "targetTypes": ["page"],
+    "commands": [{"name": "Command", "targetTypes": ["page"]}],
+    "events": [{"name": "Event", "targetTypes": ["page"]}]
+}
+]
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/event-targetType-matching-domain-debuggableType.json b/Source/JavaScriptCore/inspector/scripts/tests/generic/event-targetType-matching-domain-debuggableType.json
new file mode 100644 (file)
index 0000000..4dfed41
--- /dev/null
@@ -0,0 +1,8 @@
+[
+{
+    "domain": "Domain",
+    "debuggableTypes": ["page"],
+    "commands": [{"name": "Command"}],
+    "events": [{"name": "Event", "targetTypes": ["page", "worker"]}]
+}
+]
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/command-targetType-matching-domain-debuggableType.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/command-targetType-matching-domain-debuggableType.json-result
new file mode 100644 (file)
index 0000000..e98df71
--- /dev/null
@@ -0,0 +1,1057 @@
+### Begin File: InspectorBackendCommands.js
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from command-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+// Domain
+InspectorBackend.registerDomain("Domain", ["page", "worker"]);
+InspectorBackend.registerCommand("Domain.Command", null, [], []);
+InspectorBackend.registerEvent("Domain.Event", null, []);
+InspectorBackend.registerDomainDispatcher = InspectorBackend.registerDispatcher.bind(InspectorBackend, "Domain");
+InspectorBackend.activateDomain("Domain", ["page"]);
+### End File: InspectorBackendCommands.js
+
+### Begin File: TestAlternateBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from command-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#pragma once
+
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+
+#include "TestProtocolTypes.h"
+#include <JavaScriptCore/InspectorBackendDispatcher.h>
+#include <JavaScriptCore/InspectorFrontendRouter.h>
+
+namespace Inspector {
+
+class AlternateBackendDispatcher {
+public:
+    void setBackendDispatcher(RefPtr<BackendDispatcher>&& dispatcher) { m_backendDispatcher = WTFMove(dispatcher); }
+    BackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
+private:
+    RefPtr<BackendDispatcher> m_backendDispatcher;
+};
+
+
+class AlternateDomainBackendDispatcher : public AlternateBackendDispatcher {
+public:
+    virtual ~AlternateDomainBackendDispatcher() { }
+    virtual void Command(long callId) = 0;
+};
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+### End File: TestAlternateBackendDispatchers.h
+
+### Begin File: TestBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from command-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#pragma once
+
+#include "TestProtocolObjects.h"
+#include <JavaScriptCore/InspectorBackendDispatcher.h>
+#include <wtf/text/WTFString.h>
+
+namespace Inspector {
+
+typedef String ErrorString;
+
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+class AlternateDomainBackendDispatcher;
+#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+
+class DomainBackendDispatcherHandler {
+public:
+    virtual void Command(ErrorString&) = 0;
+protected:
+    virtual ~DomainBackendDispatcherHandler();
+};
+
+class DomainBackendDispatcher final : public SupplementalBackendDispatcher {
+public:
+    static Ref<DomainBackendDispatcher> create(BackendDispatcher&, DomainBackendDispatcherHandler*);
+    void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
+private:
+    void Command(long requestId, RefPtr<JSON::Object>&& parameters);
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+public:
+    void setAlternateDispatcher(AlternateDomainBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
+private:
+    AlternateDomainBackendDispatcher* m_alternateDispatcher { nullptr };
+#endif
+private:
+    DomainBackendDispatcher(BackendDispatcher&, DomainBackendDispatcherHandler*);
+    DomainBackendDispatcherHandler* m_agent { nullptr };
+};
+
+} // namespace Inspector
+### End File: TestBackendDispatchers.h
+
+### Begin File: TestBackendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from command-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#include "config.h"
+#include "TestBackendDispatchers.h"
+
+#include <JavaScriptCore/InspectorFrontendRouter.h>
+#include <wtf/JSONValues.h>
+#include <wtf/NeverDestroyed.h>
+#include <wtf/text/CString.h>
+
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+#include "TestAlternateBackendDispatchers.h"
+#endif
+
+namespace Inspector {
+
+DomainBackendDispatcherHandler::~DomainBackendDispatcherHandler() { }
+
+Ref<DomainBackendDispatcher> DomainBackendDispatcher::create(BackendDispatcher& backendDispatcher, DomainBackendDispatcherHandler* agent)
+{
+    return adoptRef(*new DomainBackendDispatcher(backendDispatcher, agent));
+}
+
+DomainBackendDispatcher::DomainBackendDispatcher(BackendDispatcher& backendDispatcher, DomainBackendDispatcherHandler* agent)
+    : SupplementalBackendDispatcher(backendDispatcher)
+    , m_agent(agent)
+{
+    m_backendDispatcher->registerDispatcherForDomain("Domain"_s, this);
+}
+
+void DomainBackendDispatcher::dispatch(long requestId, const String& method, Ref<JSON::Object>&& message)
+{
+    Ref<DomainBackendDispatcher> protect(*this);
+
+    RefPtr<JSON::Object> parameters;
+    message->getObject("params"_s, parameters);
+
+    if (method == "Command")
+        Command(requestId, WTFMove(parameters));
+    else
+        m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, "'Domain." + method + "' was not found");
+}
+
+void DomainBackendDispatcher::Command(long requestId, RefPtr<JSON::Object>&&)
+{
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+    if (m_alternateDispatcher) {
+        m_alternateDispatcher->Command(requestId);
+        return;
+    }
+#endif
+
+    ErrorString error;
+    Ref<JSON::Object> result = JSON::Object::create();
+    m_agent->Command(error);
+
+    if (!error.length())
+        m_backendDispatcher->sendResponse(requestId, WTFMove(result), false);
+    else
+        m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error));
+}
+
+} // namespace Inspector
+
+### End File: TestBackendDispatchers.cpp
+
+### Begin File: TestFrontendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from command-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#pragma once
+
+#include "TestProtocolObjects.h"
+#include <wtf/JSONValues.h>
+#include <wtf/text/WTFString.h>
+
+namespace Inspector {
+
+class FrontendRouter;
+
+class DomainFrontendDispatcher {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    DomainFrontendDispatcher(FrontendRouter& frontendRouter) : m_frontendRouter(frontendRouter) { }
+    void Event();
+private:
+    FrontendRouter& m_frontendRouter;
+};
+
+} // namespace Inspector
+### End File: TestFrontendDispatchers.h
+
+### Begin File: TestFrontendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from command-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#include "config.h"
+#include "TestFrontendDispatchers.h"
+
+#include <JavaScriptCore/InspectorFrontendRouter.h>
+#include <wtf/text/CString.h>
+
+namespace Inspector {
+
+void DomainFrontendDispatcher::Event()
+{
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
+    jsonMessage->setString("method"_s, "Domain.Event"_s);
+
+    m_frontendRouter.sendEvent(jsonMessage->toJSONString());
+}
+
+} // namespace Inspector
+
+### End File: TestFrontendDispatchers.cpp
+
+### Begin File: TestProtocolObjects.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from command-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#pragma once
+
+#include <JavaScriptCore/InspectorProtocolTypes.h>
+#include <wtf/Assertions.h>
+
+namespace Inspector {
+
+
+
+namespace Protocol {
+
+
+
+
+
+
+
+
+
+} // namespace Protocol
+
+} // namespace Inspector
+### End File: TestProtocolObjects.h
+
+### Begin File: TestProtocolObjects.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from command-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#include "config.h"
+#include "TestProtocolObjects.h"
+
+#include <wtf/Optional.h>
+#include <wtf/text/CString.h>
+
+namespace Inspector {
+
+namespace Protocol {
+
+
+
+} // namespace Protocol
+
+} // namespace Inspector
+
+### End File: TestProtocolObjects.cpp
+
+### Begin File: TestProtocolBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from command-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#include <JavaScriptCore/InspectorAlternateBackendDispatchers.h>
+#include <wtf/RetainPtr.h>
+
+@protocol TestProtocolDomainDomainHandler;
+
+namespace Inspector {
+
+
+class ObjCInspectorDomainBackendDispatcher final : public AlternateDomainBackendDispatcher {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    ObjCInspectorDomainBackendDispatcher(id<TestProtocolDomainDomainHandler> handler) { m_delegate = handler; }
+    virtual void Command(long requestId) override;
+private:
+    RetainPtr<id<TestProtocolDomainDomainHandler>> m_delegate;
+};
+
+} // namespace Inspector
+
+### End File: TestProtocolBackendDispatchers.h
+
+### Begin File: TestProtocolBackendDispatchers.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from command-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "config.h"
+#import "TestProtocolBackendDispatchers.h"
+
+#include "TestProtocolInternal.h"
+#include "TestProtocolTypeConversions.h"
+#include <wtf/JSONValues.h>
+
+namespace Inspector {
+
+void ObjCInspectorDomainBackendDispatcher::Command(long requestId)
+{
+    id errorCallback = ^(NSString *error) {
+        backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error);
+        backendDispatcher()->sendPendingErrors();
+    };
+
+    id successCallback = ^{
+        backendDispatcher()->sendResponse(requestId, JSON::Object::create(), false);
+    };
+
+    [m_delegate CommandWithErrorCallback:errorCallback successCallback:successCallback];
+}
+
+
+} // namespace Inspector
+
+### End File: TestProtocolBackendDispatchers.mm
+
+### Begin File: TestProtocolConfiguration.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from command-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import <WebInspector/TestProtocol.h>
+
+__attribute__((visibility ("default")))
+@interface TestProtocolConfiguration : NSObject
+@property (nonatomic, retain, setter=setDomainHandler:) id<TestProtocolDomainDomainHandler> domainHandler;
+@property (nonatomic, readonly) TestProtocolDomainDomainEventDispatcher *domainEventDispatcher;
+@end
+
+
+### End File: TestProtocolConfiguration.h
+
+### Begin File: TestProtocolConfiguration.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from command-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "TestProtocolConfiguration.h"
+
+#import "TestProtocolInternal.h"
+#import "TestProtocolBackendDispatchers.h"
+#import <JavaScriptCore/AlternateDispatchableAgent.h>
+#import <JavaScriptCore/AugmentableInspectorController.h>
+#import <JavaScriptCore/InspectorAlternateBackendDispatchers.h>
+#import <JavaScriptCore/InspectorBackendDispatchers.h>
+
+using namespace Inspector;
+
+@implementation TestProtocolConfiguration
+{
+    AugmentableInspectorController* _controller;
+    id<TestProtocolDomainDomainHandler> _domainHandler;
+    TestProtocolDomainDomainEventDispatcher *_domainEventDispatcher;
+}
+
+- (instancetype)initWithController:(AugmentableInspectorController*)controller
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    ASSERT(controller);
+    _controller = controller;
+    return self;
+}
+
+- (void)dealloc
+{
+    [_domainHandler release];
+    [_domainEventDispatcher release];
+    [super dealloc];
+}
+
+- (void)setDomainHandler:(id<TestProtocolDomainDomainHandler>)handler
+{
+    if (handler == _domainHandler)
+        return;
+
+    [_domainHandler release];
+    _domainHandler = [handler retain];
+
+    auto alternateDispatcher = makeUnique<ObjCInspectorDomainBackendDispatcher>(handler);
+    auto alternateAgent = makeUnique<AlternateDispatchableAgent<DomainBackendDispatcher, AlternateDomainBackendDispatcher>>("Domain"_s, *_controller, WTFMove(alternateDispatcher));
+    _controller->appendExtraAgent(WTFMove(alternateAgent));
+}
+
+- (id<TestProtocolDomainDomainHandler>)domainHandler
+{
+    return _domainHandler;
+}
+
+- (TestProtocolDomainDomainEventDispatcher *)domainEventDispatcher
+{
+    if (!_domainEventDispatcher)
+        _domainEventDispatcher = [[TestProtocolDomainDomainEventDispatcher alloc] initWithController:_controller];
+    return _domainEventDispatcher;
+}
+
+@end
+
+
+### End File: TestProtocolConfiguration.mm
+
+### Begin File: TestProtocolEventDispatchers.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from command-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "TestProtocolInternal.h"
+
+#import "TestProtocolTypeConversions.h"
+#import <wtf/JSONValues.h>
+
+using namespace Inspector;
+
+@implementation TestProtocolDomainDomainEventDispatcher
+{
+    AugmentableInspectorController* _controller;
+}
+
+- (instancetype)initWithController:(AugmentableInspectorController*)controller
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    ASSERT(controller);
+    _controller = controller;
+    return self;
+}
+
+- (void)Event
+{
+    const FrontendRouter& router = _controller->frontendRouter();
+
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
+    jsonMessage->setString("method"_s, "Domain.Event"_s);
+    router.sendEvent(jsonMessage->toJSONString());
+}
+
+@end
+
+
+### End File: TestProtocolEventDispatchers.mm
+
+### Begin File: TestProtocol.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from command-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import <Foundation/Foundation.h>
+
+#import <WebInspector/RWIProtocolJSONObject.h>
+
+
+
+
+typedef NS_ENUM(NSInteger, TestProtocolPlatform) {
+    TestProtocolPlatformAll,
+    TestProtocolPlatformGeneric,
+    TestProtocolPlatformIOS,
+    TestProtocolPlatformMacOS,
+};
+
+
+
+
+
+@protocol TestProtocolDomainDomainHandler <NSObject>
+@required
+- (void)CommandWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(void))successCallback;
+@end
+
+__attribute__((visibility ("default")))
+@interface TestProtocolDomainDomainEventDispatcher : NSObject
+- (void)Event;
+@end
+
+
+#import <WebInspector/RWIProtocolBuildCompatibilityObjects.h>
+
+### End File: TestProtocol.h
+
+### Begin File: TestProtocolInternal.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from command-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "TestProtocol.h"
+#import "TestProtocolJSONObjectPrivate.h"
+#import <JavaScriptCore/AugmentableInspectorController.h>
+#import <wtf/JSONValues.h>
+
+@interface TestProtocolDomainDomainEventDispatcher (Private)
+- (instancetype)initWithController:(Inspector::AugmentableInspectorController*)controller;
+@end
+
+
+### End File: TestProtocolInternal.h
+
+### Begin File: TestProtocolTypeConversions.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from command-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "TestProtocol.h"
+#import <WebInspector/RWIProtocolArrayConversions.h>
+
+namespace Inspector {
+
+template<typename ObjCEnumType>
+Optional<ObjCEnumType> fromProtocolString(const String& value);
+
+inline String toProtocolString(TestProtocolPlatform value)
+{
+    switch(value) {
+    case TestProtocolPlatformAll:
+        return "all"_s;
+    case TestProtocolPlatformGeneric:
+        return "generic"_s;
+    case TestProtocolPlatformIOS:
+        return "ios"_s;
+    case TestProtocolPlatformMacOS:
+        return "macos"_s;
+    }
+}
+
+template<>
+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value)
+{
+    if (value == "all")
+        return TestProtocolPlatformAll;
+    if (value == "generic")
+        return TestProtocolPlatformGeneric;
+    if (value == "ios")
+        return TestProtocolPlatformIOS;
+    if (value == "macos")
+        return TestProtocolPlatformMacOS;
+    return WTF::nullopt;
+}
+
+} // namespace Inspector
+
+### End File: TestProtocolTypeConversions.h
+
+### Begin File: TestProtocolTypeConversions.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from command-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "TestProtocolTypeConversions.h"
+
+#import "TestProtocol.h"
+#import "TestProtocolTypeParser.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+
+using namespace Inspector;
+
+
+
+
+
+
+### End File: TestProtocolTypeConversions.mm
+
+### Begin File: TestProtocolTypes.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from command-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "TestProtocolInternal.h"
+
+#import "TestProtocolTypeConversions.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+#import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
+
+using namespace Inspector;
+
+
+### End File: TestProtocolTypes.mm
index 7eba016..f310fd6 100644 (file)
 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-async-attribute.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
-// Database.
-InspectorBackend.registerDatabaseDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "Database");
+// Database
+InspectorBackend.registerDomain("Database", null);
 InspectorBackend.registerEnum("Database.PrimaryColors", {Red: "red", Green: "green", Blue: "blue"});
-InspectorBackend.registerCommand("Database.executeSQLSyncOptionalReturnValues", [{"name": "databaseId", "type": "number", "optional": false}, {"name": "query", "type": "string", "optional": false}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]);
-InspectorBackend.registerCommand("Database.executeSQLAsyncOptionalReturnValues", [{"name": "databaseId", "type": "number", "optional": false}, {"name": "query", "type": "string", "optional": false}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]);
-InspectorBackend.registerCommand("Database.executeSQLSync", [{"name": "databaseId", "type": "number", "optional": false}, {"name": "query", "type": "string", "optional": false}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "alternateColors", "screenColor", "printColor"]);
-InspectorBackend.registerCommand("Database.executeSQLAsync", [{"name": "databaseId", "type": "number", "optional": false}, {"name": "query", "type": "string", "optional": false}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]);
-InspectorBackend.activateDomain("Database");
+InspectorBackend.registerCommand("Database.executeSQLSyncOptionalReturnValues", null, [{"name": "databaseId", "type": "number"}, {"name": "query", "type": "string"}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]);
+InspectorBackend.registerCommand("Database.executeSQLAsyncOptionalReturnValues", null, [{"name": "databaseId", "type": "number"}, {"name": "query", "type": "string"}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]);
+InspectorBackend.registerCommand("Database.executeSQLSync", null, [{"name": "databaseId", "type": "number"}, {"name": "query", "type": "string"}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "alternateColors", "screenColor", "printColor"]);
+InspectorBackend.registerCommand("Database.executeSQLAsync", null, [{"name": "databaseId", "type": "number"}, {"name": "query", "type": "string"}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]);
+InspectorBackend.registerDatabaseDispatcher = InspectorBackend.registerDispatcher.bind(InspectorBackend, "Database");
+InspectorBackend.activateDomain("Database", null);
 ### End File: InspectorBackendCommands.js
 
 ### Begin File: TestAlternateBackendDispatchers.h
index 16131dd..ade8c5f 100644 (file)
 // DO NOT EDIT THIS FILE. It is automatically generated from commands-with-optional-call-return-parameters.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
-// Database.
+// Database
+InspectorBackend.registerDomain("Database", null);
 InspectorBackend.registerEnum("Database.PrimaryColors", {Red: "red", Green: "green", Blue: "blue"});
-InspectorBackend.registerCommand("Database.executeAllOptionalParameters", [{"name": "columnNames", "type": "object", "optional": true}, {"name": "notes", "type": "string", "optional": true}, {"name": "timestamp", "type": "number", "optional": true}, {"name": "values", "type": "object", "optional": true}, {"name": "payload", "type": "object", "optional": true}, {"name": "databaseId", "type": "number", "optional": true}, {"name": "sqlError", "type": "object", "optional": true}, {"name": "screenColor", "type": "string", "optional": true}, {"name": "alternateColors", "type": "object", "optional": true}, {"name": "printColor", "type": "string", "optional": true}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]);
-InspectorBackend.registerCommand("Database.executeNoOptionalParameters", [{"name": "columnNames", "type": "object", "optional": false}, {"name": "notes", "type": "string", "optional": false}, {"name": "timestamp", "type": "number", "optional": false}, {"name": "values", "type": "object", "optional": false}, {"name": "payload", "type": "object", "optional": false}, {"name": "databaseId", "type": "number", "optional": false}, {"name": "sqlError", "type": "object", "optional": false}, {"name": "screenColor", "type": "string", "optional": false}, {"name": "alternateColors", "type": "object", "optional": false}, {"name": "printColor", "type": "string", "optional": false}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]);
-InspectorBackend.activateDomain("Database");
+InspectorBackend.registerCommand("Database.executeAllOptionalParameters", null, [{"name": "columnNames", "type": "object", "optional": true}, {"name": "notes", "type": "string", "optional": true}, {"name": "timestamp", "type": "number", "optional": true}, {"name": "values", "type": "object", "optional": true}, {"name": "payload", "type": "object", "optional": true}, {"name": "databaseId", "type": "number", "optional": true}, {"name": "sqlError", "type": "object", "optional": true}, {"name": "screenColor", "type": "string", "optional": true}, {"name": "alternateColors", "type": "object", "optional": true}, {"name": "printColor", "type": "string", "optional": true}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]);
+InspectorBackend.registerCommand("Database.executeNoOptionalParameters", null, [{"name": "columnNames", "type": "object"}, {"name": "notes", "type": "string"}, {"name": "timestamp", "type": "number"}, {"name": "values", "type": "object"}, {"name": "payload", "type": "object"}, {"name": "databaseId", "type": "number"}, {"name": "sqlError", "type": "object"}, {"name": "screenColor", "type": "string"}, {"name": "alternateColors", "type": "object"}, {"name": "printColor", "type": "string"}], ["columnNames", "notes", "timestamp", "values", "payload", "databaseId", "sqlError", "screenColor", "alternateColors", "printColor"]);
+InspectorBackend.activateDomain("Database", null);
 ### End File: InspectorBackendCommands.js
 
 ### Begin File: TestAlternateBackendDispatchers.h
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// DO NOT EDIT THIS FILE. It is automatically generated from domain-availability.json
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-debuggableTypes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
-// DomainA.
-InspectorBackend.registerCommand("DomainA.enable", [], []);
-InspectorBackend.activateDomain("DomainA", ["web"]);
-
-// DomainB.
-InspectorBackend.registerCommand("DomainB.enable", [], []);
-InspectorBackend.activateDomain("DomainB");
+// Domain
+InspectorBackend.registerDomain("Domain", null);
+InspectorBackend.registerCommand("Domain.Command", null, [], []);
+InspectorBackend.registerEvent("Domain.Event", null, []);
+InspectorBackend.registerDomainDispatcher = InspectorBackend.registerDispatcher.bind(InspectorBackend, "Domain");
+InspectorBackend.activateDomain("Domain", ["web-page"]);
 ### End File: InspectorBackendCommands.js
 
 ### Begin File: TestAlternateBackendDispatchers.h
@@ -66,7 +65,7 @@ InspectorBackend.activateDomain("DomainB");
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// DO NOT EDIT THIS FILE. It is automatically generated from domain-availability.json
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-debuggableTypes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #pragma once
@@ -88,15 +87,10 @@ private:
 };
 
 
-class AlternateDomainABackendDispatcher : public AlternateBackendDispatcher {
-public:
-    virtual ~AlternateDomainABackendDispatcher() { }
-    virtual void enable(long callId) = 0;
-};
-class AlternateDomainBBackendDispatcher : public AlternateBackendDispatcher {
+class AlternateDomainBackendDispatcher : public AlternateBackendDispatcher {
 public:
-    virtual ~AlternateDomainBBackendDispatcher() { }
-    virtual void enable(long callId) = 0;
+    virtual ~AlternateDomainBackendDispatcher() { }
+    virtual void Command(long callId) = 0;
 };
 
 } // namespace Inspector
@@ -132,7 +126,7 @@ public:
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// DO NOT EDIT THIS FILE. It is automatically generated from domain-availability.json
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-debuggableTypes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #pragma once
@@ -146,56 +140,31 @@ namespace Inspector {
 typedef String ErrorString;
 
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
-class AlternateDomainABackendDispatcher;
-class AlternateDomainBBackendDispatcher;
+class AlternateDomainBackendDispatcher;
 #endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 
-class DomainABackendDispatcherHandler {
-public:
-    virtual void enable(ErrorString&) = 0;
-protected:
-    virtual ~DomainABackendDispatcherHandler();
-};
-
-class DomainBBackendDispatcherHandler {
+class DomainBackendDispatcherHandler {
 public:
-    virtual void enable(ErrorString&) = 0;
+    virtual void Command(ErrorString&) = 0;
 protected:
-    virtual ~DomainBBackendDispatcherHandler();
-};
-
-class DomainABackendDispatcher final : public SupplementalBackendDispatcher {
-public:
-    static Ref<DomainABackendDispatcher> create(BackendDispatcher&, DomainABackendDispatcherHandler*);
-    void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
-private:
-    void enable(long requestId, RefPtr<JSON::Object>&& parameters);
-#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
-public:
-    void setAlternateDispatcher(AlternateDomainABackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
-private:
-    AlternateDomainABackendDispatcher* m_alternateDispatcher { nullptr };
-#endif
-private:
-    DomainABackendDispatcher(BackendDispatcher&, DomainABackendDispatcherHandler*);
-    DomainABackendDispatcherHandler* m_agent { nullptr };
+    virtual ~DomainBackendDispatcherHandler();
 };
 
-class DomainBBackendDispatcher final : public SupplementalBackendDispatcher {
+class DomainBackendDispatcher final : public SupplementalBackendDispatcher {
 public:
-    static Ref<DomainBBackendDispatcher> create(BackendDispatcher&, DomainBBackendDispatcherHandler*);
+    static Ref<DomainBackendDispatcher> create(BackendDispatcher&, DomainBackendDispatcherHandler*);
     void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
 private:
-    void enable(long requestId, RefPtr<JSON::Object>&& parameters);
+    void Command(long requestId, RefPtr<JSON::Object>&& parameters);
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
 public:
-    void setAlternateDispatcher(AlternateDomainBBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
+    void setAlternateDispatcher(AlternateDomainBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
 private:
-    AlternateDomainBBackendDispatcher* m_alternateDispatcher { nullptr };
+    AlternateDomainBackendDispatcher* m_alternateDispatcher { nullptr };
 #endif
 private:
-    DomainBBackendDispatcher(BackendDispatcher&, DomainBBackendDispatcherHandler*);
-    DomainBBackendDispatcherHandler* m_agent { nullptr };
+    DomainBackendDispatcher(BackendDispatcher&, DomainBackendDispatcherHandler*);
+    DomainBackendDispatcherHandler* m_agent { nullptr };
 };
 
 } // namespace Inspector
@@ -229,7 +198,7 @@ private:
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// DO NOT EDIT THIS FILE. It is automatically generated from domain-availability.json
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-debuggableTypes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #include "config.h"
@@ -246,90 +215,45 @@ private:
 
 namespace Inspector {
 
-DomainABackendDispatcherHandler::~DomainABackendDispatcherHandler() { }
-DomainBBackendDispatcherHandler::~DomainBBackendDispatcherHandler() { }
+DomainBackendDispatcherHandler::~DomainBackendDispatcherHandler() { }
 
-Ref<DomainABackendDispatcher> DomainABackendDispatcher::create(BackendDispatcher& backendDispatcher, DomainABackendDispatcherHandler* agent)
+Ref<DomainBackendDispatcher> DomainBackendDispatcher::create(BackendDispatcher& backendDispatcher, DomainBackendDispatcherHandler* agent)
 {
-    return adoptRef(*new DomainABackendDispatcher(backendDispatcher, agent));
+    return adoptRef(*new DomainBackendDispatcher(backendDispatcher, agent));
 }
 
-DomainABackendDispatcher::DomainABackendDispatcher(BackendDispatcher& backendDispatcher, DomainABackendDispatcherHandler* agent)
+DomainBackendDispatcher::DomainBackendDispatcher(BackendDispatcher& backendDispatcher, DomainBackendDispatcherHandler* agent)
     : SupplementalBackendDispatcher(backendDispatcher)
     , m_agent(agent)
 {
-    m_backendDispatcher->registerDispatcherForDomain("DomainA"_s, this);
+    m_backendDispatcher->registerDispatcherForDomain("Domain"_s, this);
 }
 
-void DomainABackendDispatcher::dispatch(long requestId, const String& method, Ref<JSON::Object>&& message)
+void DomainBackendDispatcher::dispatch(long requestId, const String& method, Ref<JSON::Object>&& message)
 {
-    Ref<DomainABackendDispatcher> protect(*this);
+    Ref<DomainBackendDispatcher> protect(*this);
 
     RefPtr<JSON::Object> parameters;
     message->getObject("params"_s, parameters);
 
-    if (method == "enable")
-        enable(requestId, WTFMove(parameters));
+    if (method == "Command")
+        Command(requestId, WTFMove(parameters));
     else
-        m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, "'DomainA." + method + "' was not found");
+        m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, "'Domain." + method + "' was not found");
 }
 
-void DomainABackendDispatcher::enable(long requestId, RefPtr<JSON::Object>&&)
+void DomainBackendDispatcher::Command(long requestId, RefPtr<JSON::Object>&&)
 {
 #if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
     if (m_alternateDispatcher) {
-        m_alternateDispatcher->enable(requestId);
+        m_alternateDispatcher->Command(requestId);
         return;
     }
 #endif
 
     ErrorString error;
     Ref<JSON::Object> result = JSON::Object::create();
-    m_agent->enable(error);
-
-    if (!error.length())
-        m_backendDispatcher->sendResponse(requestId, WTFMove(result), false);
-    else
-        m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error));
-}
-
-Ref<DomainBBackendDispatcher> DomainBBackendDispatcher::create(BackendDispatcher& backendDispatcher, DomainBBackendDispatcherHandler* agent)
-{
-    return adoptRef(*new DomainBBackendDispatcher(backendDispatcher, agent));
-}
-
-DomainBBackendDispatcher::DomainBBackendDispatcher(BackendDispatcher& backendDispatcher, DomainBBackendDispatcherHandler* agent)
-    : SupplementalBackendDispatcher(backendDispatcher)
-    , m_agent(agent)
-{
-    m_backendDispatcher->registerDispatcherForDomain("DomainB"_s, this);
-}
-
-void DomainBBackendDispatcher::dispatch(long requestId, const String& method, Ref<JSON::Object>&& message)
-{
-    Ref<DomainBBackendDispatcher> protect(*this);
-
-    RefPtr<JSON::Object> parameters;
-    message->getObject("params"_s, parameters);
-
-    if (method == "enable")
-        enable(requestId, WTFMove(parameters));
-    else
-        m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, "'DomainB." + method + "' was not found");
-}
-
-void DomainBBackendDispatcher::enable(long requestId, RefPtr<JSON::Object>&&)
-{
-#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
-    if (m_alternateDispatcher) {
-        m_alternateDispatcher->enable(requestId);
-        return;
-    }
-#endif
-
-    ErrorString error;
-    Ref<JSON::Object> result = JSON::Object::create();
-    m_agent->enable(error);
+    m_agent->Command(error);
 
     if (!error.length())
         m_backendDispatcher->sendResponse(requestId, WTFMove(result), false);
@@ -369,7 +293,7 @@ void DomainBBackendDispatcher::enable(long requestId, RefPtr<JSON::Object>&&)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// DO NOT EDIT THIS FILE. It is automatically generated from domain-availability.json
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-debuggableTypes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #pragma once
@@ -382,6 +306,15 @@ namespace Inspector {
 
 class FrontendRouter;
 
+class DomainFrontendDispatcher {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    DomainFrontendDispatcher(FrontendRouter& frontendRouter) : m_frontendRouter(frontendRouter) { }
+    void Event();
+private:
+    FrontendRouter& m_frontendRouter;
+};
+
 } // namespace Inspector
 ### End File: TestFrontendDispatchers.h
 
@@ -413,7 +346,7 @@ class FrontendRouter;
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// DO NOT EDIT THIS FILE. It is automatically generated from domain-availability.json
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-debuggableTypes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #include "config.h"
@@ -424,6 +357,14 @@ class FrontendRouter;
 
 namespace Inspector {
 
+void DomainFrontendDispatcher::Event()
+{
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
+    jsonMessage->setString("method"_s, "Domain.Event"_s);
+
+    m_frontendRouter.sendEvent(jsonMessage->toJSONString());
+}
+
 } // namespace Inspector
 
 ### End File: TestFrontendDispatchers.cpp
@@ -456,7 +397,7 @@ namespace Inspector {
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// DO NOT EDIT THIS FILE. It is automatically generated from domain-availability.json
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-debuggableTypes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #pragma once
@@ -511,7 +452,7 @@ namespace Protocol {
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// DO NOT EDIT THIS FILE. It is automatically generated from domain-availability.json
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-debuggableTypes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #include "config.h"
@@ -560,34 +501,24 @@ namespace Protocol {
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// DO NOT EDIT THIS FILE. It is automatically generated from domain-availability.json
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-debuggableTypes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #include <JavaScriptCore/InspectorAlternateBackendDispatchers.h>
 #include <wtf/RetainPtr.h>
 
-@protocol TestProtocolDomainADomainHandler;
-@protocol TestProtocolDomainBDomainHandler;
+@protocol TestProtocolDomainDomainHandler;
 
 namespace Inspector {
 
 
-class ObjCInspectorDomainABackendDispatcher final : public AlternateDomainABackendDispatcher {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    ObjCInspectorDomainABackendDispatcher(id<TestProtocolDomainADomainHandler> handler) { m_delegate = handler; }
-    virtual void enable(long requestId) override;
-private:
-    RetainPtr<id<TestProtocolDomainADomainHandler>> m_delegate;
-};
-
-class ObjCInspectorDomainBBackendDispatcher final : public AlternateDomainBBackendDispatcher {
+class ObjCInspectorDomainBackendDispatcher final : public AlternateDomainBackendDispatcher {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    ObjCInspectorDomainBBackendDispatcher(id<TestProtocolDomainBDomainHandler> handler) { m_delegate = handler; }
-    virtual void enable(long requestId) override;
+    ObjCInspectorDomainBackendDispatcher(id<TestProtocolDomainDomainHandler> handler) { m_delegate = handler; }
+    virtual void Command(long requestId) override;
 private:
-    RetainPtr<id<TestProtocolDomainBDomainHandler>> m_delegate;
+    RetainPtr<id<TestProtocolDomainDomainHandler>> m_delegate;
 };
 
 } // namespace Inspector
@@ -622,7 +553,7 @@ private:
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// DO NOT EDIT THIS FILE. It is automatically generated from domain-availability.json
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-debuggableTypes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "config.h"
@@ -634,7 +565,7 @@ private:
 
 namespace Inspector {
 
-void ObjCInspectorDomainABackendDispatcher::enable(long requestId)
+void ObjCInspectorDomainBackendDispatcher::Command(long requestId)
 {
     id errorCallback = ^(NSString *error) {
         backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error);
@@ -645,22 +576,7 @@ void ObjCInspectorDomainABackendDispatcher::enable(long requestId)
         backendDispatcher()->sendResponse(requestId, JSON::Object::create(), false);
     };
 
-    [m_delegate enableWithErrorCallback:errorCallback successCallback:successCallback];
-}
-
-
-void ObjCInspectorDomainBBackendDispatcher::enable(long requestId)
-{
-    id errorCallback = ^(NSString *error) {
-        backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error);
-        backendDispatcher()->sendPendingErrors();
-    };
-
-    id successCallback = ^{
-        backendDispatcher()->sendResponse(requestId, JSON::Object::create(), false);
-    };
-
-    [m_delegate enableWithErrorCallback:errorCallback successCallback:successCallback];
+    [m_delegate CommandWithErrorCallback:errorCallback successCallback:successCallback];
 }
 
 
@@ -696,15 +612,15 @@ void ObjCInspectorDomainBBackendDispatcher::enable(long requestId)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// DO NOT EDIT THIS FILE. It is automatically generated from domain-availability.json
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-debuggableTypes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import <WebInspector/TestProtocol.h>
 
 __attribute__((visibility ("default")))
 @interface TestProtocolConfiguration : NSObject
-@property (nonatomic, retain, setter=setDomainAHandler:) id<TestProtocolDomainADomainHandler> domainAHandler;
-@property (nonatomic, retain, setter=setDomainBHandler:) id<TestProtocolDomainBDomainHandler> domainBHandler;
+@property (nonatomic, retain, setter=setDomainHandler:) id<TestProtocolDomainDomainHandler> domainHandler;
+@property (nonatomic, readonly) TestProtocolDomainDomainEventDispatcher *domainEventDispatcher;
 @end
 
 
@@ -738,7 +654,7 @@ __attribute__((visibility ("default")))
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// DO NOT EDIT THIS FILE. It is automatically generated from domain-availability.json
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-debuggableTypes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "TestProtocolConfiguration.h"
@@ -755,8 +671,8 @@ using namespace Inspector;
 @implementation TestProtocolConfiguration
 {
     AugmentableInspectorController* _controller;
-    id<TestProtocolDomainADomainHandler> _domainAHandler;
-    id<TestProtocolDomainBDomainHandler> _domainBHandler;
+    id<TestProtocolDomainDomainHandler> _domainHandler;
+    TestProtocolDomainDomainEventDispatcher *_domainEventDispatcher;
 }
 
 - (instancetype)initWithController:(AugmentableInspectorController*)controller
@@ -771,45 +687,34 @@ using namespace Inspector;
 
 - (void)dealloc
 {
-    [_domainAHandler release];
-    [_domainBHandler release];
+    [_domainHandler release];
+    [_domainEventDispatcher release];
     [super dealloc];
 }
 
-- (void)setDomainAHandler:(id<TestProtocolDomainADomainHandler>)handler
+- (void)setDomainHandler:(id<TestProtocolDomainDomainHandler>)handler
 {
-    if (handler == _domainAHandler)
+    if (handler == _domainHandler)
         return;
 
-    [_domainAHandler release];
-    _domainAHandler = [handler retain];
+    [_domainHandler release];
+    _domainHandler = [handler retain];
 
-    auto alternateDispatcher = makeUnique<ObjCInspectorDomainABackendDispatcher>(handler);
-    auto alternateAgent = makeUnique<AlternateDispatchableAgent<DomainABackendDispatcher, AlternateDomainABackendDispatcher>>("DomainA"_s, *_controller, WTFMove(alternateDispatcher));
+    auto alternateDispatcher = makeUnique<ObjCInspectorDomainBackendDispatcher>(handler);
+    auto alternateAgent = makeUnique<AlternateDispatchableAgent<DomainBackendDispatcher, AlternateDomainBackendDispatcher>>("Domain"_s, *_controller, WTFMove(alternateDispatcher));
     _controller->appendExtraAgent(WTFMove(alternateAgent));
 }
 
-- (id<TestProtocolDomainADomainHandler>)domainAHandler
+- (id<TestProtocolDomainDomainHandler>)domainHandler
 {
-    return _domainAHandler;
-}
-
-- (void)setDomainBHandler:(id<TestProtocolDomainBDomainHandler>)handler
-{
-    if (handler == _domainBHandler)
-        return;
-
-    [_domainBHandler release];
-    _domainBHandler = [handler retain];
-
-    auto alternateDispatcher = makeUnique<ObjCInspectorDomainBBackendDispatcher>(handler);
-    auto alternateAgent = makeUnique<AlternateDispatchableAgent<DomainBBackendDispatcher, AlternateDomainBBackendDispatcher>>("DomainB"_s, *_controller, WTFMove(alternateDispatcher));
-    _controller->appendExtraAgent(WTFMove(alternateAgent));
+    return _domainHandler;
 }
 
-- (id<TestProtocolDomainBDomainHandler>)domainBHandler
+- (TestProtocolDomainDomainEventDispatcher *)domainEventDispatcher
 {
-    return _domainBHandler;
+    if (!_domainEventDispatcher)
+        _domainEventDispatcher = [[TestProtocolDomainDomainEventDispatcher alloc] initWithController:_controller];
+    return _domainEventDispatcher;
 }
 
 @end
@@ -845,7 +750,7 @@ using namespace Inspector;
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// DO NOT EDIT THIS FILE. It is automatically generated from domain-availability.json
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-debuggableTypes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "TestProtocolInternal.h"
@@ -855,6 +760,32 @@ using namespace Inspector;
 
 using namespace Inspector;
 
+@implementation TestProtocolDomainDomainEventDispatcher
+{
+    AugmentableInspectorController* _controller;
+}
+
+- (instancetype)initWithController:(AugmentableInspectorController*)controller
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    ASSERT(controller);
+    _controller = controller;
+    return self;
+}
+
+- (void)Event
+{
+    const FrontendRouter& router = _controller->frontendRouter();
+
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
+    jsonMessage->setString("method"_s, "Domain.Event"_s);
+    router.sendEvent(jsonMessage->toJSONString());
+}
+
+@end
+
 
 ### End File: TestProtocolEventDispatchers.mm
 
@@ -886,7 +817,7 @@ using namespace Inspector;
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// DO NOT EDIT THIS FILE. It is automatically generated from domain-availability.json
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-debuggableTypes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import <Foundation/Foundation.h>
@@ -907,19 +838,17 @@ typedef NS_ENUM(NSInteger, TestProtocolPlatform) {
 
 
 
-@protocol TestProtocolDomainADomainHandler <NSObject>
+@protocol TestProtocolDomainDomainHandler <NSObject>
 @required
-- (void)enableWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(void))successCallback;
+- (void)CommandWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(void))successCallback;
 @end
 
-@protocol TestProtocolDomainBDomainHandler <NSObject>
-@required
-- (void)enableWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(void))successCallback;
+__attribute__((visibility ("default")))
+@interface TestProtocolDomainDomainEventDispatcher : NSObject
+- (void)Event;
 @end
 
 
-
-
 #import <WebInspector/RWIProtocolBuildCompatibilityObjects.h>
 
 ### End File: TestProtocol.h
@@ -952,7 +881,7 @@ typedef NS_ENUM(NSInteger, TestProtocolPlatform) {
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// DO NOT EDIT THIS FILE. It is automatically generated from domain-availability.json
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-debuggableTypes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "TestProtocol.h"
@@ -960,7 +889,9 @@ typedef NS_ENUM(NSInteger, TestProtocolPlatform) {
 #import <JavaScriptCore/AugmentableInspectorController.h>
 #import <wtf/JSONValues.h>
 
-
+@interface TestProtocolDomainDomainEventDispatcher (Private)
+- (instancetype)initWithController:(Inspector::AugmentableInspectorController*)controller;
+@end
 
 
 ### End File: TestProtocolInternal.h
@@ -993,7 +924,7 @@ typedef NS_ENUM(NSInteger, TestProtocolPlatform) {
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// DO NOT EDIT THIS FILE. It is automatically generated from domain-availability.json
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-debuggableTypes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "TestProtocol.h"
@@ -1064,7 +995,7 @@ inline Optional<TestProtocolPlatform> fromProtocolString(const String& value)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// DO NOT EDIT THIS FILE. It is automatically generated from domain-availability.json
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-debuggableTypes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "TestProtocolTypeConversions.h"
@@ -1110,7 +1041,7 @@ using namespace Inspector;
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// DO NOT EDIT THIS FILE. It is automatically generated from domain-availability.json
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-debuggableTypes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
 #import "TestProtocolInternal.h"
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-targetType-matching-domain-debuggableType.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-targetType-matching-domain-debuggableType.json-result
new file mode 100644 (file)
index 0000000..8e2d7fd
--- /dev/null
@@ -0,0 +1,1057 @@
+### Begin File: InspectorBackendCommands.js
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+// Domain
+InspectorBackend.registerDomain("Domain", null);
+InspectorBackend.registerCommand("Domain.Command", ["page", "worker"], [], []);
+InspectorBackend.registerEvent("Domain.Event", null, []);
+InspectorBackend.registerDomainDispatcher = InspectorBackend.registerDispatcher.bind(InspectorBackend, "Domain");
+InspectorBackend.activateDomain("Domain", ["page"]);
+### End File: InspectorBackendCommands.js
+
+### Begin File: TestAlternateBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#pragma once
+
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+
+#include "TestProtocolTypes.h"
+#include <JavaScriptCore/InspectorBackendDispatcher.h>
+#include <JavaScriptCore/InspectorFrontendRouter.h>
+
+namespace Inspector {
+
+class AlternateBackendDispatcher {
+public:
+    void setBackendDispatcher(RefPtr<BackendDispatcher>&& dispatcher) { m_backendDispatcher = WTFMove(dispatcher); }
+    BackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
+private:
+    RefPtr<BackendDispatcher> m_backendDispatcher;
+};
+
+
+class AlternateDomainBackendDispatcher : public AlternateBackendDispatcher {
+public:
+    virtual ~AlternateDomainBackendDispatcher() { }
+    virtual void Command(long callId) = 0;
+};
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+### End File: TestAlternateBackendDispatchers.h
+
+### Begin File: TestBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#pragma once
+
+#include "TestProtocolObjects.h"
+#include <JavaScriptCore/InspectorBackendDispatcher.h>
+#include <wtf/text/WTFString.h>
+
+namespace Inspector {
+
+typedef String ErrorString;
+
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+class AlternateDomainBackendDispatcher;
+#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+
+class DomainBackendDispatcherHandler {
+public:
+    virtual void Command(ErrorString&) = 0;
+protected:
+    virtual ~DomainBackendDispatcherHandler();
+};
+
+class DomainBackendDispatcher final : public SupplementalBackendDispatcher {
+public:
+    static Ref<DomainBackendDispatcher> create(BackendDispatcher&, DomainBackendDispatcherHandler*);
+    void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
+private:
+    void Command(long requestId, RefPtr<JSON::Object>&& parameters);
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+public:
+    void setAlternateDispatcher(AlternateDomainBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
+private:
+    AlternateDomainBackendDispatcher* m_alternateDispatcher { nullptr };
+#endif
+private:
+    DomainBackendDispatcher(BackendDispatcher&, DomainBackendDispatcherHandler*);
+    DomainBackendDispatcherHandler* m_agent { nullptr };
+};
+
+} // namespace Inspector
+### End File: TestBackendDispatchers.h
+
+### Begin File: TestBackendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#include "config.h"
+#include "TestBackendDispatchers.h"
+
+#include <JavaScriptCore/InspectorFrontendRouter.h>
+#include <wtf/JSONValues.h>
+#include <wtf/NeverDestroyed.h>
+#include <wtf/text/CString.h>
+
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+#include "TestAlternateBackendDispatchers.h"
+#endif
+
+namespace Inspector {
+
+DomainBackendDispatcherHandler::~DomainBackendDispatcherHandler() { }
+
+Ref<DomainBackendDispatcher> DomainBackendDispatcher::create(BackendDispatcher& backendDispatcher, DomainBackendDispatcherHandler* agent)
+{
+    return adoptRef(*new DomainBackendDispatcher(backendDispatcher, agent));
+}
+
+DomainBackendDispatcher::DomainBackendDispatcher(BackendDispatcher& backendDispatcher, DomainBackendDispatcherHandler* agent)
+    : SupplementalBackendDispatcher(backendDispatcher)
+    , m_agent(agent)
+{
+    m_backendDispatcher->registerDispatcherForDomain("Domain"_s, this);
+}
+
+void DomainBackendDispatcher::dispatch(long requestId, const String& method, Ref<JSON::Object>&& message)
+{
+    Ref<DomainBackendDispatcher> protect(*this);
+
+    RefPtr<JSON::Object> parameters;
+    message->getObject("params"_s, parameters);
+
+    if (method == "Command")
+        Command(requestId, WTFMove(parameters));
+    else
+        m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, "'Domain." + method + "' was not found");
+}
+
+void DomainBackendDispatcher::Command(long requestId, RefPtr<JSON::Object>&&)
+{
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+    if (m_alternateDispatcher) {
+        m_alternateDispatcher->Command(requestId);
+        return;
+    }
+#endif
+
+    ErrorString error;
+    Ref<JSON::Object> result = JSON::Object::create();
+    m_agent->Command(error);
+
+    if (!error.length())
+        m_backendDispatcher->sendResponse(requestId, WTFMove(result), false);
+    else
+        m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error));
+}
+
+} // namespace Inspector
+
+### End File: TestBackendDispatchers.cpp
+
+### Begin File: TestFrontendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#pragma once
+
+#include "TestProtocolObjects.h"
+#include <wtf/JSONValues.h>
+#include <wtf/text/WTFString.h>
+
+namespace Inspector {
+
+class FrontendRouter;
+
+class DomainFrontendDispatcher {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    DomainFrontendDispatcher(FrontendRouter& frontendRouter) : m_frontendRouter(frontendRouter) { }
+    void Event();
+private:
+    FrontendRouter& m_frontendRouter;
+};
+
+} // namespace Inspector
+### End File: TestFrontendDispatchers.h
+
+### Begin File: TestFrontendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#include "config.h"
+#include "TestFrontendDispatchers.h"
+
+#include <JavaScriptCore/InspectorFrontendRouter.h>
+#include <wtf/text/CString.h>
+
+namespace Inspector {
+
+void DomainFrontendDispatcher::Event()
+{
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
+    jsonMessage->setString("method"_s, "Domain.Event"_s);
+
+    m_frontendRouter.sendEvent(jsonMessage->toJSONString());
+}
+
+} // namespace Inspector
+
+### End File: TestFrontendDispatchers.cpp
+
+### Begin File: TestProtocolObjects.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#pragma once
+
+#include <JavaScriptCore/InspectorProtocolTypes.h>
+#include <wtf/Assertions.h>
+
+namespace Inspector {
+
+
+
+namespace Protocol {
+
+
+
+
+
+
+
+
+
+} // namespace Protocol
+
+} // namespace Inspector
+### End File: TestProtocolObjects.h
+
+### Begin File: TestProtocolObjects.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#include "config.h"
+#include "TestProtocolObjects.h"
+
+#include <wtf/Optional.h>
+#include <wtf/text/CString.h>
+
+namespace Inspector {
+
+namespace Protocol {
+
+
+
+} // namespace Protocol
+
+} // namespace Inspector
+
+### End File: TestProtocolObjects.cpp
+
+### Begin File: TestProtocolBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#include <JavaScriptCore/InspectorAlternateBackendDispatchers.h>
+#include <wtf/RetainPtr.h>
+
+@protocol TestProtocolDomainDomainHandler;
+
+namespace Inspector {
+
+
+class ObjCInspectorDomainBackendDispatcher final : public AlternateDomainBackendDispatcher {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    ObjCInspectorDomainBackendDispatcher(id<TestProtocolDomainDomainHandler> handler) { m_delegate = handler; }
+    virtual void Command(long requestId) override;
+private:
+    RetainPtr<id<TestProtocolDomainDomainHandler>> m_delegate;
+};
+
+} // namespace Inspector
+
+### End File: TestProtocolBackendDispatchers.h
+
+### Begin File: TestProtocolBackendDispatchers.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "config.h"
+#import "TestProtocolBackendDispatchers.h"
+
+#include "TestProtocolInternal.h"
+#include "TestProtocolTypeConversions.h"
+#include <wtf/JSONValues.h>
+
+namespace Inspector {
+
+void ObjCInspectorDomainBackendDispatcher::Command(long requestId)
+{
+    id errorCallback = ^(NSString *error) {
+        backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error);
+        backendDispatcher()->sendPendingErrors();
+    };
+
+    id successCallback = ^{
+        backendDispatcher()->sendResponse(requestId, JSON::Object::create(), false);
+    };
+
+    [m_delegate CommandWithErrorCallback:errorCallback successCallback:successCallback];
+}
+
+
+} // namespace Inspector
+
+### End File: TestProtocolBackendDispatchers.mm
+
+### Begin File: TestProtocolConfiguration.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import <WebInspector/TestProtocol.h>
+
+__attribute__((visibility ("default")))
+@interface TestProtocolConfiguration : NSObject
+@property (nonatomic, retain, setter=setDomainHandler:) id<TestProtocolDomainDomainHandler> domainHandler;
+@property (nonatomic, readonly) TestProtocolDomainDomainEventDispatcher *domainEventDispatcher;
+@end
+
+
+### End File: TestProtocolConfiguration.h
+
+### Begin File: TestProtocolConfiguration.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "TestProtocolConfiguration.h"
+
+#import "TestProtocolInternal.h"
+#import "TestProtocolBackendDispatchers.h"
+#import <JavaScriptCore/AlternateDispatchableAgent.h>
+#import <JavaScriptCore/AugmentableInspectorController.h>
+#import <JavaScriptCore/InspectorAlternateBackendDispatchers.h>
+#import <JavaScriptCore/InspectorBackendDispatchers.h>
+
+using namespace Inspector;
+
+@implementation TestProtocolConfiguration
+{
+    AugmentableInspectorController* _controller;
+    id<TestProtocolDomainDomainHandler> _domainHandler;
+    TestProtocolDomainDomainEventDispatcher *_domainEventDispatcher;
+}
+
+- (instancetype)initWithController:(AugmentableInspectorController*)controller
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    ASSERT(controller);
+    _controller = controller;
+    return self;
+}
+
+- (void)dealloc
+{
+    [_domainHandler release];
+    [_domainEventDispatcher release];
+    [super dealloc];
+}
+
+- (void)setDomainHandler:(id<TestProtocolDomainDomainHandler>)handler
+{
+    if (handler == _domainHandler)
+        return;
+
+    [_domainHandler release];
+    _domainHandler = [handler retain];
+
+    auto alternateDispatcher = makeUnique<ObjCInspectorDomainBackendDispatcher>(handler);
+    auto alternateAgent = makeUnique<AlternateDispatchableAgent<DomainBackendDispatcher, AlternateDomainBackendDispatcher>>("Domain"_s, *_controller, WTFMove(alternateDispatcher));
+    _controller->appendExtraAgent(WTFMove(alternateAgent));
+}
+
+- (id<TestProtocolDomainDomainHandler>)domainHandler
+{
+    return _domainHandler;
+}
+
+- (TestProtocolDomainDomainEventDispatcher *)domainEventDispatcher
+{
+    if (!_domainEventDispatcher)
+        _domainEventDispatcher = [[TestProtocolDomainDomainEventDispatcher alloc] initWithController:_controller];
+    return _domainEventDispatcher;
+}
+
+@end
+
+
+### End File: TestProtocolConfiguration.mm
+
+### Begin File: TestProtocolEventDispatchers.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "TestProtocolInternal.h"
+
+#import "TestProtocolTypeConversions.h"
+#import <wtf/JSONValues.h>
+
+using namespace Inspector;
+
+@implementation TestProtocolDomainDomainEventDispatcher
+{
+    AugmentableInspectorController* _controller;
+}
+
+- (instancetype)initWithController:(AugmentableInspectorController*)controller
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    ASSERT(controller);
+    _controller = controller;
+    return self;
+}
+
+- (void)Event
+{
+    const FrontendRouter& router = _controller->frontendRouter();
+
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
+    jsonMessage->setString("method"_s, "Domain.Event"_s);
+    router.sendEvent(jsonMessage->toJSONString());
+}
+
+@end
+
+
+### End File: TestProtocolEventDispatchers.mm
+
+### Begin File: TestProtocol.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import <Foundation/Foundation.h>
+
+#import <WebInspector/RWIProtocolJSONObject.h>
+
+
+
+
+typedef NS_ENUM(NSInteger, TestProtocolPlatform) {
+    TestProtocolPlatformAll,
+    TestProtocolPlatformGeneric,
+    TestProtocolPlatformIOS,
+    TestProtocolPlatformMacOS,
+};
+
+
+
+
+
+@protocol TestProtocolDomainDomainHandler <NSObject>
+@required
+- (void)CommandWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(void))successCallback;
+@end
+
+__attribute__((visibility ("default")))
+@interface TestProtocolDomainDomainEventDispatcher : NSObject
+- (void)Event;
+@end
+
+
+#import <WebInspector/RWIProtocolBuildCompatibilityObjects.h>
+
+### End File: TestProtocol.h
+
+### Begin File: TestProtocolInternal.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "TestProtocol.h"
+#import "TestProtocolJSONObjectPrivate.h"
+#import <JavaScriptCore/AugmentableInspectorController.h>
+#import <wtf/JSONValues.h>
+
+@interface TestProtocolDomainDomainEventDispatcher (Private)
+- (instancetype)initWithController:(Inspector::AugmentableInspectorController*)controller;
+@end
+
+
+### End File: TestProtocolInternal.h
+
+### Begin File: TestProtocolTypeConversions.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "TestProtocol.h"
+#import <WebInspector/RWIProtocolArrayConversions.h>
+
+namespace Inspector {
+
+template<typename ObjCEnumType>
+Optional<ObjCEnumType> fromProtocolString(const String& value);
+
+inline String toProtocolString(TestProtocolPlatform value)
+{
+    switch(value) {
+    case TestProtocolPlatformAll:
+        return "all"_s;
+    case TestProtocolPlatformGeneric:
+        return "generic"_s;
+    case TestProtocolPlatformIOS:
+        return "ios"_s;
+    case TestProtocolPlatformMacOS:
+        return "macos"_s;
+    }
+}
+
+template<>
+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value)
+{
+    if (value == "all")
+        return TestProtocolPlatformAll;
+    if (value == "generic")
+        return TestProtocolPlatformGeneric;
+    if (value == "ios")
+        return TestProtocolPlatformIOS;
+    if (value == "macos")
+        return TestProtocolPlatformMacOS;
+    return WTF::nullopt;
+}
+
+} // namespace Inspector
+
+### End File: TestProtocolTypeConversions.h
+
+### Begin File: TestProtocolTypeConversions.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "TestProtocolTypeConversions.h"
+
+#import "TestProtocol.h"
+#import "TestProtocolTypeParser.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+
+using namespace Inspector;
+
+
+
+
+
+
+### End File: TestProtocolTypeConversions.mm
+
+### Begin File: TestProtocolTypes.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "TestProtocolInternal.h"
+
+#import "TestProtocolTypeConversions.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+#import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
+
+using namespace Inspector;
+
+
+### End File: TestProtocolTypes.mm
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-targetTypes.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-targetTypes.json-result
new file mode 100644 (file)
index 0000000..7bc8567
--- /dev/null
@@ -0,0 +1,1057 @@
+### Begin File: InspectorBackendCommands.js
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetTypes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+// Domain
+InspectorBackend.registerDomain("Domain", ["page"]);
+InspectorBackend.registerCommand("Domain.Command", ["page"], [], []);
+InspectorBackend.registerEvent("Domain.Event", ["page"], []);
+InspectorBackend.registerDomainDispatcher = InspectorBackend.registerDispatcher.bind(InspectorBackend, "Domain");
+InspectorBackend.activateDomain("Domain", null);
+### End File: InspectorBackendCommands.js
+
+### Begin File: TestAlternateBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetTypes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#pragma once
+
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+
+#include "TestProtocolTypes.h"
+#include <JavaScriptCore/InspectorBackendDispatcher.h>
+#include <JavaScriptCore/InspectorFrontendRouter.h>
+
+namespace Inspector {
+
+class AlternateBackendDispatcher {
+public:
+    void setBackendDispatcher(RefPtr<BackendDispatcher>&& dispatcher) { m_backendDispatcher = WTFMove(dispatcher); }
+    BackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
+private:
+    RefPtr<BackendDispatcher> m_backendDispatcher;
+};
+
+
+class AlternateDomainBackendDispatcher : public AlternateBackendDispatcher {
+public:
+    virtual ~AlternateDomainBackendDispatcher() { }
+    virtual void Command(long callId) = 0;
+};
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+### End File: TestAlternateBackendDispatchers.h
+
+### Begin File: TestBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetTypes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#pragma once
+
+#include "TestProtocolObjects.h"
+#include <JavaScriptCore/InspectorBackendDispatcher.h>
+#include <wtf/text/WTFString.h>
+
+namespace Inspector {
+
+typedef String ErrorString;
+
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+class AlternateDomainBackendDispatcher;
+#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+
+class DomainBackendDispatcherHandler {
+public:
+    virtual void Command(ErrorString&) = 0;
+protected:
+    virtual ~DomainBackendDispatcherHandler();
+};
+
+class DomainBackendDispatcher final : public SupplementalBackendDispatcher {
+public:
+    static Ref<DomainBackendDispatcher> create(BackendDispatcher&, DomainBackendDispatcherHandler*);
+    void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
+private:
+    void Command(long requestId, RefPtr<JSON::Object>&& parameters);
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+public:
+    void setAlternateDispatcher(AlternateDomainBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
+private:
+    AlternateDomainBackendDispatcher* m_alternateDispatcher { nullptr };
+#endif
+private:
+    DomainBackendDispatcher(BackendDispatcher&, DomainBackendDispatcherHandler*);
+    DomainBackendDispatcherHandler* m_agent { nullptr };
+};
+
+} // namespace Inspector
+### End File: TestBackendDispatchers.h
+
+### Begin File: TestBackendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetTypes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#include "config.h"
+#include "TestBackendDispatchers.h"
+
+#include <JavaScriptCore/InspectorFrontendRouter.h>
+#include <wtf/JSONValues.h>
+#include <wtf/NeverDestroyed.h>
+#include <wtf/text/CString.h>
+
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+#include "TestAlternateBackendDispatchers.h"
+#endif
+
+namespace Inspector {
+
+DomainBackendDispatcherHandler::~DomainBackendDispatcherHandler() { }
+
+Ref<DomainBackendDispatcher> DomainBackendDispatcher::create(BackendDispatcher& backendDispatcher, DomainBackendDispatcherHandler* agent)
+{
+    return adoptRef(*new DomainBackendDispatcher(backendDispatcher, agent));
+}
+
+DomainBackendDispatcher::DomainBackendDispatcher(BackendDispatcher& backendDispatcher, DomainBackendDispatcherHandler* agent)
+    : SupplementalBackendDispatcher(backendDispatcher)
+    , m_agent(agent)
+{
+    m_backendDispatcher->registerDispatcherForDomain("Domain"_s, this);
+}
+
+void DomainBackendDispatcher::dispatch(long requestId, const String& method, Ref<JSON::Object>&& message)
+{
+    Ref<DomainBackendDispatcher> protect(*this);
+
+    RefPtr<JSON::Object> parameters;
+    message->getObject("params"_s, parameters);
+
+    if (method == "Command")
+        Command(requestId, WTFMove(parameters));
+    else
+        m_backendDispatcher->reportProtocolError(BackendDispatcher::MethodNotFound, "'Domain." + method + "' was not found");
+}
+
+void DomainBackendDispatcher::Command(long requestId, RefPtr<JSON::Object>&&)
+{
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+    if (m_alternateDispatcher) {
+        m_alternateDispatcher->Command(requestId);
+        return;
+    }
+#endif
+
+    ErrorString error;
+    Ref<JSON::Object> result = JSON::Object::create();
+    m_agent->Command(error);
+
+    if (!error.length())
+        m_backendDispatcher->sendResponse(requestId, WTFMove(result), false);
+    else
+        m_backendDispatcher->reportProtocolError(BackendDispatcher::ServerError, WTFMove(error));
+}
+
+} // namespace Inspector
+
+### End File: TestBackendDispatchers.cpp
+
+### Begin File: TestFrontendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetTypes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#pragma once
+
+#include "TestProtocolObjects.h"
+#include <wtf/JSONValues.h>
+#include <wtf/text/WTFString.h>
+
+namespace Inspector {
+
+class FrontendRouter;
+
+class DomainFrontendDispatcher {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    DomainFrontendDispatcher(FrontendRouter& frontendRouter) : m_frontendRouter(frontendRouter) { }
+    void Event();
+private:
+    FrontendRouter& m_frontendRouter;
+};
+
+} // namespace Inspector
+### End File: TestFrontendDispatchers.h
+
+### Begin File: TestFrontendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetTypes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#include "config.h"
+#include "TestFrontendDispatchers.h"
+
+#include <JavaScriptCore/InspectorFrontendRouter.h>
+#include <wtf/text/CString.h>
+
+namespace Inspector {
+
+void DomainFrontendDispatcher::Event()
+{
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
+    jsonMessage->setString("method"_s, "Domain.Event"_s);
+
+    m_frontendRouter.sendEvent(jsonMessage->toJSONString());
+}
+
+} // namespace Inspector
+
+### End File: TestFrontendDispatchers.cpp
+
+### Begin File: TestProtocolObjects.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetTypes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#pragma once
+
+#include <JavaScriptCore/InspectorProtocolTypes.h>
+#include <wtf/Assertions.h>
+
+namespace Inspector {
+
+
+
+namespace Protocol {
+
+
+
+
+
+
+
+
+
+} // namespace Protocol
+
+} // namespace Inspector
+### End File: TestProtocolObjects.h
+
+### Begin File: TestProtocolObjects.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetTypes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#include "config.h"
+#include "TestProtocolObjects.h"
+
+#include <wtf/Optional.h>
+#include <wtf/text/CString.h>
+
+namespace Inspector {
+
+namespace Protocol {
+
+
+
+} // namespace Protocol
+
+} // namespace Inspector
+
+### End File: TestProtocolObjects.cpp
+
+### Begin File: TestProtocolBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetTypes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#include <JavaScriptCore/InspectorAlternateBackendDispatchers.h>
+#include <wtf/RetainPtr.h>
+
+@protocol TestProtocolDomainDomainHandler;
+
+namespace Inspector {
+
+
+class ObjCInspectorDomainBackendDispatcher final : public AlternateDomainBackendDispatcher {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    ObjCInspectorDomainBackendDispatcher(id<TestProtocolDomainDomainHandler> handler) { m_delegate = handler; }
+    virtual void Command(long requestId) override;
+private:
+    RetainPtr<id<TestProtocolDomainDomainHandler>> m_delegate;
+};
+
+} // namespace Inspector
+
+### End File: TestProtocolBackendDispatchers.h
+
+### Begin File: TestProtocolBackendDispatchers.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetTypes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "config.h"
+#import "TestProtocolBackendDispatchers.h"
+
+#include "TestProtocolInternal.h"
+#include "TestProtocolTypeConversions.h"
+#include <wtf/JSONValues.h>
+
+namespace Inspector {
+
+void ObjCInspectorDomainBackendDispatcher::Command(long requestId)
+{
+    id errorCallback = ^(NSString *error) {
+        backendDispatcher()->reportProtocolError(requestId, BackendDispatcher::ServerError, error);
+        backendDispatcher()->sendPendingErrors();
+    };
+
+    id successCallback = ^{
+        backendDispatcher()->sendResponse(requestId, JSON::Object::create(), false);
+    };
+
+    [m_delegate CommandWithErrorCallback:errorCallback successCallback:successCallback];
+}
+
+
+} // namespace Inspector
+
+### End File: TestProtocolBackendDispatchers.mm
+
+### Begin File: TestProtocolConfiguration.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetTypes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import <WebInspector/TestProtocol.h>
+
+__attribute__((visibility ("default")))
+@interface TestProtocolConfiguration : NSObject
+@property (nonatomic, retain, setter=setDomainHandler:) id<TestProtocolDomainDomainHandler> domainHandler;
+@property (nonatomic, readonly) TestProtocolDomainDomainEventDispatcher *domainEventDispatcher;
+@end
+
+
+### End File: TestProtocolConfiguration.h
+
+### Begin File: TestProtocolConfiguration.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetTypes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "TestProtocolConfiguration.h"
+
+#import "TestProtocolInternal.h"
+#import "TestProtocolBackendDispatchers.h"
+#import <JavaScriptCore/AlternateDispatchableAgent.h>
+#import <JavaScriptCore/AugmentableInspectorController.h>
+#import <JavaScriptCore/InspectorAlternateBackendDispatchers.h>
+#import <JavaScriptCore/InspectorBackendDispatchers.h>
+
+using namespace Inspector;
+
+@implementation TestProtocolConfiguration
+{
+    AugmentableInspectorController* _controller;
+    id<TestProtocolDomainDomainHandler> _domainHandler;
+    TestProtocolDomainDomainEventDispatcher *_domainEventDispatcher;
+}
+
+- (instancetype)initWithController:(AugmentableInspectorController*)controller
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    ASSERT(controller);
+    _controller = controller;
+    return self;
+}
+
+- (void)dealloc
+{
+    [_domainHandler release];
+    [_domainEventDispatcher release];
+    [super dealloc];
+}
+
+- (void)setDomainHandler:(id<TestProtocolDomainDomainHandler>)handler
+{
+    if (handler == _domainHandler)
+        return;
+
+    [_domainHandler release];
+    _domainHandler = [handler retain];
+
+    auto alternateDispatcher = makeUnique<ObjCInspectorDomainBackendDispatcher>(handler);
+    auto alternateAgent = makeUnique<AlternateDispatchableAgent<DomainBackendDispatcher, AlternateDomainBackendDispatcher>>("Domain"_s, *_controller, WTFMove(alternateDispatcher));
+    _controller->appendExtraAgent(WTFMove(alternateAgent));
+}
+
+- (id<TestProtocolDomainDomainHandler>)domainHandler
+{
+    return _domainHandler;
+}
+
+- (TestProtocolDomainDomainEventDispatcher *)domainEventDispatcher
+{
+    if (!_domainEventDispatcher)
+        _domainEventDispatcher = [[TestProtocolDomainDomainEventDispatcher alloc] initWithController:_controller];
+    return _domainEventDispatcher;
+}
+
+@end
+
+
+### End File: TestProtocolConfiguration.mm
+
+### Begin File: TestProtocolEventDispatchers.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetTypes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "TestProtocolInternal.h"
+
+#import "TestProtocolTypeConversions.h"
+#import <wtf/JSONValues.h>
+
+using namespace Inspector;
+
+@implementation TestProtocolDomainDomainEventDispatcher
+{
+    AugmentableInspectorController* _controller;
+}
+
+- (instancetype)initWithController:(AugmentableInspectorController*)controller
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    ASSERT(controller);
+    _controller = controller;
+    return self;
+}
+
+- (void)Event
+{
+    const FrontendRouter& router = _controller->frontendRouter();
+
+    Ref<JSON::Object> jsonMessage = JSON::Object::create();
+    jsonMessage->setString("method"_s, "Domain.Event"_s);
+    router.sendEvent(jsonMessage->toJSONString());
+}
+
+@end
+
+
+### End File: TestProtocolEventDispatchers.mm
+
+### Begin File: TestProtocol.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetTypes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import <Foundation/Foundation.h>
+
+#import <WebInspector/RWIProtocolJSONObject.h>
+
+
+
+
+typedef NS_ENUM(NSInteger, TestProtocolPlatform) {
+    TestProtocolPlatformAll,
+    TestProtocolPlatformGeneric,
+    TestProtocolPlatformIOS,
+    TestProtocolPlatformMacOS,
+};
+
+
+
+
+
+@protocol TestProtocolDomainDomainHandler <NSObject>
+@required
+- (void)CommandWithErrorCallback:(void(^)(NSString *error))errorCallback successCallback:(void(^)(void))successCallback;
+@end
+
+__attribute__((visibility ("default")))
+@interface TestProtocolDomainDomainEventDispatcher : NSObject
+- (void)Event;
+@end
+
+
+#import <WebInspector/RWIProtocolBuildCompatibilityObjects.h>
+
+### End File: TestProtocol.h
+
+### Begin File: TestProtocolInternal.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetTypes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "TestProtocol.h"
+#import "TestProtocolJSONObjectPrivate.h"
+#import <JavaScriptCore/AugmentableInspectorController.h>
+#import <wtf/JSONValues.h>
+
+@interface TestProtocolDomainDomainEventDispatcher (Private)
+- (instancetype)initWithController:(Inspector::AugmentableInspectorController*)controller;
+@end
+
+
+### End File: TestProtocolInternal.h
+
+### Begin File: TestProtocolTypeConversions.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetTypes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "TestProtocol.h"
+#import <WebInspector/RWIProtocolArrayConversions.h>
+
+namespace Inspector {
+
+template<typename ObjCEnumType>
+Optional<ObjCEnumType> fromProtocolString(const String& value);
+
+inline String toProtocolString(TestProtocolPlatform value)
+{
+    switch(value) {
+    case TestProtocolPlatformAll:
+        return "all"_s;
+    case TestProtocolPlatformGeneric:
+        return "generic"_s;
+    case TestProtocolPlatformIOS:
+        return "ios"_s;
+    case TestProtocolPlatformMacOS:
+        return "macos"_s;
+    }
+}
+
+template<>
+inline Optional<TestProtocolPlatform> fromProtocolString(const String& value)
+{
+    if (value == "all")
+        return TestProtocolPlatformAll;
+    if (value == "generic")
+        return TestProtocolPlatformGeneric;
+    if (value == "ios")
+        return TestProtocolPlatformIOS;
+    if (value == "macos")
+        return TestProtocolPlatformMacOS;
+    return WTF::nullopt;
+}
+
+} // namespace Inspector
+
+### End File: TestProtocolTypeConversions.h
+
+### Begin File: TestProtocolTypeConversions.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetTypes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "TestProtocolTypeConversions.h"
+
+#import "TestProtocol.h"
+#import "TestProtocolTypeParser.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+
+using namespace Inspector;
+
+
+
+
+
+
+### End File: TestProtocolTypeConversions.mm
+
+### Begin File: TestProtocolTypes.mm
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from domain-targetTypes.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#import "TestProtocolInternal.h"
+
+#import "TestProtocolTypeConversions.h"
+#import <WebInspector/RWIProtocolJSONObjectPrivate.h>
+#import <wtf/Assertions.h>
+#import <wtf/JSONValues.h>
+
+using namespace Inspector;
+
+
+### End File: TestProtocolTypes.mm
index 2be7309..aa6eda0 100644 (file)
 // DO NOT EDIT THIS FILE. It is automatically generated from domains-with-varying-command-sizes.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
-// Network1.
-InspectorBackend.registerCommand("Network1.loadResource1", [], []);
-InspectorBackend.activateDomain("Network1");
-
-// Network3.
-InspectorBackend.registerCommand("Network3.loadResource1", [], []);
-InspectorBackend.registerCommand("Network3.loadResource2", [], []);
-InspectorBackend.registerCommand("Network3.loadResource3", [], []);
-InspectorBackend.registerCommand("Network3.loadResource4", [], []);
-InspectorBackend.registerCommand("Network3.loadResource5", [], []);
-InspectorBackend.registerCommand("Network3.loadResource6", [], []);
-InspectorBackend.registerCommand("Network3.loadResource7", [], []);
-InspectorBackend.activateDomain("Network3");
+// Network1
+InspectorBackend.registerDomain("Network1", null);
+InspectorBackend.registerCommand("Network1.loadResource1", null, [], []);
+InspectorBackend.activateDomain("Network1", null);
+
+// Network3
+InspectorBackend.registerDomain("Network3", null);
+InspectorBackend.registerCommand("Network3.loadResource1", null, [], []);
+InspectorBackend.registerCommand("Network3.loadResource2", null, [], []);
+InspectorBackend.registerCommand("Network3.loadResource3", null, [], []);
+InspectorBackend.registerCommand("Network3.loadResource4", null, [], []);
+InspectorBackend.registerCommand("Network3.loadResource5", null, [], []);
+InspectorBackend.registerCommand("Network3.loadResource6", null, [], []);
+InspectorBackend.registerCommand("Network3.loadResource7", null, [], []);
+InspectorBackend.activateDomain("Network3", null);
 ### End File: InspectorBackendCommands.js
 
 ### Begin File: TestAlternateBackendDispatchers.h
index 79aa9ce..40a51d8 100644 (file)
 // DO NOT EDIT THIS FILE. It is automatically generated from enum-values.json
 // by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
 
-// TypeDomain.
+// TypeDomain
+InspectorBackend.registerDomain("TypeDomain", null);
 InspectorBackend.registerEnum("TypeDomain.TypeDomainEnum", {Shared: "shared", Red: "red", Green: "green", Blue: "blue"});
-InspectorBackend.activateDomain("TypeDomain");
+InspectorBackend.activateDomain("TypeDomain", null);
 
-// CommandDomain.
-InspectorBackend.registerCommand("CommandDomain.commandWithEnumReturnValue", [], ["returnValue"]);
-InspectorBackend.activateDomain("CommandDomain");
+// CommandDomain
+InspectorBackend.registerDomain("CommandDomain", null);
+InspectorBackend.registerCommand("CommandDomain.commandWithEnumReturnValue", null, [], ["returnValue"]);
+InspectorBackend.activateDomain("CommandDomain", null);
 
-// EventDomain.
-InspectorBackend.registerEventDomainDispatcher = InspectorBackend.registerDomainDispatcher.bind(InspectorBackend, "EventDomain");
+// EventDomain
+InspectorBackend.registerDomain("EventDomain", null);
 InspectorBackend.registerEnum("EventDomain.EventWithEnumParameterParameter", {Shared: "shared", Black: "black", White: "white"});
-InspectorBackend.registerEvent("EventDomain.eventWithEnumParameter", ["parameter"]);
-InspectorBackend.activateDomain("EventDomain");
+InspectorBackend.registerEvent("EventDomain.eventWithEnumParameter", null, ["parameter"]);
+InspectorBackend.registerEventDomainDispatcher = InspectorBackend.registerDispatcher.bind(InspectorBackend, "EventDomain");
+InspectorBackend.activateDomain("EventDomain", null);
 ### End File: InspectorBackendCommands.js
 
 ### Begin File: TestAlternateBackendDispatchers.h
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/event-targetType-matching-domain-debuggableType.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/event-targetType-matching-domain-debuggableType.json-result
new file mode 100644 (file)
index 0000000..045e164
--- /dev/null
@@ -0,0 +1,1057 @@
+### Begin File: InspectorBackendCommands.js
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from event-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+// Domain
+InspectorBackend.registerDomain("Domain", null);
+InspectorBackend.registerCommand("Domain.Command", null, [], []);
+InspectorBackend.registerEvent("Domain.Event", ["page", "worker"], []);
+InspectorBackend.registerDomainDispatcher = InspectorBackend.registerDispatcher.bind(InspectorBackend, "Domain");
+InspectorBackend.activateDomain("Domain", ["page"]);
+### End File: InspectorBackendCommands.js
+
+### Begin File: TestAlternateBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from event-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#pragma once
+
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+
+#include "TestProtocolTypes.h"
+#include <JavaScriptCore/InspectorBackendDispatcher.h>
+#include <JavaScriptCore/InspectorFrontendRouter.h>
+
+namespace Inspector {
+
+class AlternateBackendDispatcher {
+public:
+    void setBackendDispatcher(RefPtr<BackendDispatcher>&& dispatcher) { m_backendDispatcher = WTFMove(dispatcher); }
+    BackendDispatcher* backendDispatcher() const { return m_backendDispatcher.get(); }
+private:
+    RefPtr<BackendDispatcher> m_backendDispatcher;
+};
+
+
+class AlternateDomainBackendDispatcher : public AlternateBackendDispatcher {
+public:
+    virtual ~AlternateDomainBackendDispatcher() { }
+    virtual void Command(long callId) = 0;
+};
+
+} // namespace Inspector
+
+#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+### End File: TestAlternateBackendDispatchers.h
+
+### Begin File: TestBackendDispatchers.h
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2014 University of Washington. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// DO NOT EDIT THIS FILE. It is automatically generated from event-targetType-matching-domain-debuggableType.json
+// by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py
+
+#pragma once
+
+#include "TestProtocolObjects.h"
+#include <JavaScriptCore/InspectorBackendDispatcher.h>
+#include <wtf/text/WTFString.h>
+
+namespace Inspector {
+
+typedef String ErrorString;
+
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+class AlternateDomainBackendDispatcher;
+#endif // ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+
+class DomainBackendDispatcherHandler {
+public:
+    virtual void Command(ErrorString&) = 0;
+protected:
+    virtual ~DomainBackendDispatcherHandler();
+};
+
+class DomainBackendDispatcher final : public SupplementalBackendDispatcher {
+public:
+    static Ref<DomainBackendDispatcher> create(BackendDispatcher&, DomainBackendDispatcherHandler*);
+    void dispatch(long requestId, const String& method, Ref<JSON::Object>&& message) override;
+private:
+    void Command(long requestId, RefPtr<JSON::Object>&& parameters);
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+public:
+    void setAlternateDispatcher(AlternateDomainBackendDispatcher* alternateDispatcher) { m_alternateDispatcher = alternateDispatcher; }
+private:
+    AlternateDomainBackendDispatcher* m_alternateDispatcher { nullptr };
+#endif
+private:
+    DomainBackendDispatcher(BackendDispatcher&, DomainBackendDispatcherHandler*);
+    DomainBackendDispatcherHandler* m_agent { nullptr };
+};
+
+} // namespace Inspector
+### End File: TestBackendDispatchers.h
+
+### Begin File: TestBackendDispatchers.cpp
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.