/*
 * 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 CombinedDomains.json by the script: Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py

#pragma once

#include <JavaScriptCore/InspectorProtocolObjects.h>
#include <wtf/CheckedRef.h>
#include <wtf/JSONValues.h>
#include <wtf/Noncopyable.h>
#include <wtf/Nonmovable.h>
#include <wtf/text/WTFString.h>

namespace Inspector {

class FrontendRouter;

class JS_EXPORT_PRIVATE AnimationFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(AnimationFrontendDispatcher);
public:
    AnimationFrontendDispatcher(FrontendRouter&);
    ~AnimationFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(AnimationFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(AnimationFrontendDispatcher);
    void animationCreated(Ref<Protocol::Animation::Animation>&& animation);
    void nameChanged(const String& animationId, const String& opt_name);
    void effectChanged(const String& animationId);
    void targetChanged(const String& animationId);
    void animationDestroyed(const String& animationId);
    void trackingStart(double timestamp);
    void trackingUpdate(double timestamp, Ref<Protocol::Animation::TrackingUpdate>&& event);
    void trackingComplete(double timestamp);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

class JS_EXPORT_PRIVATE BrowserFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(BrowserFrontendDispatcher);
public:
    BrowserFrontendDispatcher(FrontendRouter&);
    ~BrowserFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(BrowserFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(BrowserFrontendDispatcher);
    void extensionsEnabled(Ref<JSON::ArrayOf<Protocol::Browser::Extension>>&& extensions);
    void extensionsDisabled(Ref<JSON::ArrayOf<String>>&& extensionIds);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

#if defined(ENABLE_RESOURCE_USAGE) && ENABLE_RESOURCE_USAGE
class JS_EXPORT_PRIVATE CPUProfilerFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(CPUProfilerFrontendDispatcher);
public:
    CPUProfilerFrontendDispatcher(FrontendRouter&);
    ~CPUProfilerFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(CPUProfilerFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(CPUProfilerFrontendDispatcher);
    void trackingStart(double timestamp);
    void trackingUpdate(Ref<Protocol::CPUProfiler::Event>&& event);
    void trackingComplete(double timestamp);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};
#endif // defined(ENABLE_RESOURCE_USAGE) && ENABLE_RESOURCE_USAGE

class JS_EXPORT_PRIVATE CSSFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(CSSFrontendDispatcher);
public:
    CSSFrontendDispatcher(FrontendRouter&);
    ~CSSFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(CSSFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(CSSFrontendDispatcher);
    void mediaQueryResultChanged();
    void styleSheetChanged(const String& styleSheetId);
    void styleSheetAdded(Ref<Protocol::CSS::CSSStyleSheetHeader>&& header);
    void styleSheetRemoved(const String& styleSheetId);
    void nodeLayoutFlagsChanged(int nodeId, RefPtr<JSON::ArrayOf<String>>&& opt_layoutFlags);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

class JS_EXPORT_PRIVATE CanvasFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(CanvasFrontendDispatcher);
public:
    CanvasFrontendDispatcher(FrontendRouter&);
    ~CanvasFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(CanvasFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(CanvasFrontendDispatcher);
    void canvasAdded(Ref<Protocol::Canvas::Canvas>&& canvas);
    void canvasRemoved(const String& canvasId);
    void canvasSizeChanged(const String& canvasId, double width, double height);
    void canvasMemoryChanged(const String& canvasId, double memoryCost);
    void extensionEnabled(const String& canvasId, const String& extension);
    void clientNodesChanged(const String& canvasId);
    void recordingStarted(const String& canvasId, Protocol::Recording::Initiator initiator);
    void recordingProgress(const String& canvasId, Ref<JSON::ArrayOf<Protocol::Recording::Frame>>&& frames, int bufferUsed);
    void recordingFinished(const String& canvasId, RefPtr<Protocol::Recording::Recording>&& opt_recording);
#if defined(ENABLE_WEBGL) && ENABLE_WEBGL
    void programCreated(Ref<Protocol::Canvas::ShaderProgram>&& shaderProgram);
#endif // defined(ENABLE_WEBGL) && ENABLE_WEBGL
#if defined(ENABLE_WEBGL) && ENABLE_WEBGL
    void programDeleted(const String& programId);
#endif // defined(ENABLE_WEBGL) && ENABLE_WEBGL
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

class JS_EXPORT_PRIVATE ConsoleFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(ConsoleFrontendDispatcher);
public:
    ConsoleFrontendDispatcher(FrontendRouter&);
    ~ConsoleFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(ConsoleFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(ConsoleFrontendDispatcher);
    void messageAdded(Ref<Protocol::Console::ConsoleMessage>&& message);
    void messageRepeatCountUpdated(int count, std::optional<double>&& opt_timestamp);
    void messagesCleared(Protocol::Console::ClearReason reason);
    void heapSnapshot(double timestamp, const String& snapshotData, const String& opt_title);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

class JS_EXPORT_PRIVATE DOMFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(DOMFrontendDispatcher);
public:
    DOMFrontendDispatcher(FrontendRouter&);
    ~DOMFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(DOMFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(DOMFrontendDispatcher);
    void documentUpdated();
    void inspect(int nodeId);
    void setChildNodes(int parentId, Ref<JSON::ArrayOf<Protocol::DOM::Node>>&& nodes);
    void attributeModified(int nodeId, const String& name, const String& value);
    void attributeRemoved(int nodeId, const String& name);
    void inlineStyleInvalidated(Ref<JSON::ArrayOf<int>>&& nodeIds);
    void characterDataModified(int nodeId, const String& characterData);
    void childNodeCountUpdated(int nodeId, int childNodeCount);
    void childNodeInserted(int parentNodeId, int previousNodeId, Ref<Protocol::DOM::Node>&& node);
    void childNodeRemoved(int parentNodeId, int nodeId);
    void willDestroyDOMNode(int nodeId);
    void shadowRootPushed(int hostId, Ref<Protocol::DOM::Node>&& root);
    void shadowRootPopped(int hostId, int rootId);
    void customElementStateChanged(int nodeId, Protocol::DOM::CustomElementState customElementState);
    void pseudoElementAdded(int parentId, Ref<Protocol::DOM::Node>&& pseudoElement);
    void pseudoElementRemoved(int parentId, int pseudoElementId);
    void didAddEventListener(int nodeId);
    void willRemoveEventListener(int nodeId);
    void didFireEvent(int nodeId, const String& eventName, double timestamp, RefPtr<JSON::Object>&& opt_data);
#if defined(ENABLE_VIDEO) && ENABLE_VIDEO
    void powerEfficientPlaybackStateChanged(int nodeId, double timestamp, bool isPowerEfficient);
#endif // defined(ENABLE_VIDEO) && ENABLE_VIDEO
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

class JS_EXPORT_PRIVATE DOMStorageFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(DOMStorageFrontendDispatcher);
public:
    DOMStorageFrontendDispatcher(FrontendRouter&);
    ~DOMStorageFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(DOMStorageFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(DOMStorageFrontendDispatcher);
    void domStorageItemsCleared(Ref<Protocol::DOMStorage::StorageId>&& storageId);
    void domStorageItemRemoved(Ref<Protocol::DOMStorage::StorageId>&& storageId, const String& key);
    void domStorageItemAdded(Ref<Protocol::DOMStorage::StorageId>&& storageId, const String& key, const String& newValue);
    void domStorageItemUpdated(Ref<Protocol::DOMStorage::StorageId>&& storageId, const String& key, const String& oldValue, const String& newValue);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

class JS_EXPORT_PRIVATE DebuggerFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(DebuggerFrontendDispatcher);
public:
    DebuggerFrontendDispatcher(FrontendRouter&);
    ~DebuggerFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(DebuggerFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(DebuggerFrontendDispatcher);
    void globalObjectCleared();
    void scriptParsed(const String& scriptId, const String& url, int startLine, int startColumn, int endLine, int endColumn, std::optional<bool>&& opt_isContentScript, const String& opt_sourceURL, const String& opt_sourceMapURL, std::optional<bool>&& opt_module);
    void scriptFailedToParse(const String& url, const String& scriptSource, int startLine, int errorLine, const String& errorMessage);
    void breakpointResolved(const String& breakpointId, Ref<Protocol::Debugger::Location>&& location);
        // Named after parameter 'reason' while generating command/event paused.
        enum class Reason {
            URL = 315,
            DOM = 316,
            AnimationFrame = 317,
            Interval = 318,
            Listener = 319,
            Timeout = 216,
            Exception = 320,
            Assert = 121,
            CSPViolation = 321,
            DebuggerStatement = 322,
            Breakpoint = 323,
            PauseOnNextStatement = 324,
            Microtask = 281,
            FunctionCall = 299,
            BlackboxedScript = 325,
            Other = 102,
        }; // enum class Reason
    void paused(Ref<JSON::ArrayOf<Protocol::Debugger::CallFrame>>&& callFrames, const String& reason, RefPtr<JSON::Object>&& opt_data, RefPtr<Protocol::Console::StackTrace>&& opt_asyncStackTrace);
    void resumed();
    void didSampleProbe(Ref<Protocol::Debugger::ProbeSample>&& sample);
    void playBreakpointActionSound(int breakpointActionId);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

class JS_EXPORT_PRIVATE DialogFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(DialogFrontendDispatcher);
public:
    DialogFrontendDispatcher(FrontendRouter&);
    ~DialogFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(DialogFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(DialogFrontendDispatcher);
    void javascriptDialogOpening(const String& type, const String& message, const String& opt_defaultPrompt);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

class JS_EXPORT_PRIVATE HeapFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(HeapFrontendDispatcher);
public:
    HeapFrontendDispatcher(FrontendRouter&);
    ~HeapFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(HeapFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(HeapFrontendDispatcher);
    void garbageCollected(Ref<Protocol::Heap::GarbageCollection>&& collection);
    void trackingStart(double timestamp, const String& snapshotData);
    void trackingComplete(double timestamp, const String& snapshotData);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

class JS_EXPORT_PRIVATE InspectorFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(InspectorFrontendDispatcher);
public:
    InspectorFrontendDispatcher(FrontendRouter&);
    ~InspectorFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(InspectorFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(InspectorFrontendDispatcher);
    void evaluateForTestInFrontend(const String& script);
    void inspect(Ref<Protocol::Runtime::RemoteObject>&& object, Ref<JSON::Object>&& hints);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

class JS_EXPORT_PRIVATE LayerTreeFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(LayerTreeFrontendDispatcher);
public:
    LayerTreeFrontendDispatcher(FrontendRouter&);
    ~LayerTreeFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(LayerTreeFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(LayerTreeFrontendDispatcher);
    void layerTreeDidChange();
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

#if defined(ENABLE_RESOURCE_USAGE) && ENABLE_RESOURCE_USAGE
class JS_EXPORT_PRIVATE MemoryFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(MemoryFrontendDispatcher);
public:
    MemoryFrontendDispatcher(FrontendRouter&);
    ~MemoryFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(MemoryFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(MemoryFrontendDispatcher);
        // Named after parameter 'severity' while generating command/event memoryPressure.
        enum class Severity {
            Critical = 326,
            NonCritical = 327,
        }; // enum class Severity
    void memoryPressure(double timestamp, const String& severity);
    void trackingStart(double timestamp);
    void trackingUpdate(Ref<Protocol::Memory::Event>&& event);
    void trackingComplete(double timestamp);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};
#endif // defined(ENABLE_RESOURCE_USAGE) && ENABLE_RESOURCE_USAGE

class JS_EXPORT_PRIVATE NetworkFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(NetworkFrontendDispatcher);
public:
    NetworkFrontendDispatcher(FrontendRouter&);
    ~NetworkFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(NetworkFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(NetworkFrontendDispatcher);
    void requestWillBeSent(const String& requestId, const String& frameId, const String& loaderId, const String& documentURL, Ref<Protocol::Network::Request>&& request, double timestamp, double walltime, Ref<Protocol::Network::Initiator>&& initiator, RefPtr<Protocol::Network::Response>&& opt_redirectResponse, std::optional<Protocol::Page::ResourceType>&& opt_type, const String& opt_targetId);
    void responseReceived(const String& requestId, const String& frameId, const String& loaderId, double timestamp, Protocol::Page::ResourceType type, Ref<Protocol::Network::Response>&& response);
    void dataReceived(const String& requestId, double timestamp, int dataLength, int encodedDataLength);
    void loadingFinished(const String& requestId, double timestamp, const String& opt_sourceMapURL, RefPtr<Protocol::Network::Metrics>&& opt_metrics);
    void loadingFailed(const String& requestId, double timestamp, const String& errorText, std::optional<bool>&& opt_canceled);
    void requestServedFromMemoryCache(const String& requestId, const String& frameId, const String& loaderId, const String& documentURL, double timestamp, Ref<Protocol::Network::Initiator>&& initiator, Ref<Protocol::Network::CachedResource>&& resource);
    void requestIntercepted(const String& requestId, Ref<Protocol::Network::Request>&& request);
    void responseIntercepted(const String& requestId, Ref<Protocol::Network::Response>&& response);
    void webSocketWillSendHandshakeRequest(const String& requestId, double timestamp, double walltime, Ref<Protocol::Network::WebSocketRequest>&& request);
    void webSocketHandshakeResponseReceived(const String& requestId, double timestamp, Ref<Protocol::Network::WebSocketResponse>&& response);
    void webSocketCreated(const String& requestId, const String& url);
    void webSocketClosed(const String& requestId, double timestamp);
    void webSocketFrameReceived(const String& requestId, double timestamp, Ref<Protocol::Network::WebSocketFrame>&& response);
    void webSocketFrameError(const String& requestId, double timestamp, const String& errorMessage);
    void webSocketFrameSent(const String& requestId, double timestamp, Ref<Protocol::Network::WebSocketFrame>&& response);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

class JS_EXPORT_PRIVATE PageFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(PageFrontendDispatcher);
public:
    PageFrontendDispatcher(FrontendRouter&);
    ~PageFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(PageFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(PageFrontendDispatcher);
    void domContentEventFired(double timestamp, const String& frameId);
    void loadEventFired(double timestamp, const String& frameId);
    void frameNavigated(Ref<Protocol::Page::Frame>&& frame);
    void frameAttached(const String& frameId, const String& opt_parentFrameId);
    void frameDetached(const String& frameId);
    void navigatedWithinDocument(const String& frameId, const String& url);
    void defaultUserPreferencesDidChange(Ref<JSON::ArrayOf<Protocol::Page::UserPreference>>&& preferences);
    void willCheckNavigationPolicy(const String& frameId);
    void didCheckNavigationPolicy(const String& frameId, std::optional<bool>&& opt_cancel);
    void fileChooserOpened(const String& frameId, Ref<Protocol::Runtime::RemoteObject>&& element);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

class JS_EXPORT_PRIVATE PlaywrightFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(PlaywrightFrontendDispatcher);
public:
    PlaywrightFrontendDispatcher(FrontendRouter&);
    ~PlaywrightFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(PlaywrightFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(PlaywrightFrontendDispatcher);
    void pageProxyCreated(const String& browserContextId, const String& pageProxyId, const String& opt_openerId);
    void pageProxyDestroyed(const String& pageProxyId);
    void provisionalLoadFailed(const String& pageProxyId, const String& loaderId, const String& error);
    void windowOpen(const String& pageProxyId, const String& url, Ref<JSON::ArrayOf<String>>&& windowFeatures);
    void downloadCreated(const String& pageProxyId, const String& frameId, const String& uuid, const String& url);
    void downloadFilenameSuggested(const String& uuid, const String& suggestedFilename);
    void downloadFinished(const String& uuid, const String& error);
    void screencastFinished(const String& screencastId);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

class JS_EXPORT_PRIVATE RuntimeFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(RuntimeFrontendDispatcher);
public:
    RuntimeFrontendDispatcher(FrontendRouter&);
    ~RuntimeFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(RuntimeFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(RuntimeFrontendDispatcher);
    void executionContextCreated(Ref<Protocol::Runtime::ExecutionContextDescription>&& context);
    void bindingCalled(int contextId, const String& name, const String& argument);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

class JS_EXPORT_PRIVATE ScreencastFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(ScreencastFrontendDispatcher);
public:
    ScreencastFrontendDispatcher(FrontendRouter&);
    ~ScreencastFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(ScreencastFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(ScreencastFrontendDispatcher);
    void screencastFrame(const String& data, int deviceWidth, int deviceHeight);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

class JS_EXPORT_PRIVATE ScriptProfilerFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(ScriptProfilerFrontendDispatcher);
public:
    ScriptProfilerFrontendDispatcher(FrontendRouter&);
    ~ScriptProfilerFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(ScriptProfilerFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(ScriptProfilerFrontendDispatcher);
    void trackingStart(double timestamp);
    void trackingUpdate(Ref<Protocol::ScriptProfiler::Event>&& event);
    void trackingComplete(double timestamp, RefPtr<Protocol::ScriptProfiler::Samples>&& opt_samples);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

class JS_EXPORT_PRIVATE TargetFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(TargetFrontendDispatcher);
public:
    TargetFrontendDispatcher(FrontendRouter&);
    ~TargetFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(TargetFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(TargetFrontendDispatcher);
    void targetCreated(Ref<Protocol::Target::TargetInfo>&& targetInfo);
    void targetDestroyed(const String& targetId, bool crashed);
    void didCommitProvisionalTarget(const String& oldTargetId, const String& newTargetId);
    void dispatchMessageFromTarget(const String& targetId, const String& message);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

class JS_EXPORT_PRIVATE TimelineFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(TimelineFrontendDispatcher);
public:
    TimelineFrontendDispatcher(FrontendRouter&);
    ~TimelineFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(TimelineFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(TimelineFrontendDispatcher);
    void eventRecorded(Ref<Protocol::Timeline::TimelineEvent>&& record);
    void recordingStarted(double startTime);
    void recordingStopped(double endTime);
    void autoCaptureStarted();
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

class JS_EXPORT_PRIVATE WorkerFrontendDispatcher {
    WTF_DEPRECATED_MAKE_FAST_ALLOCATED(WorkerFrontendDispatcher);
public:
    WorkerFrontendDispatcher(FrontendRouter&);
    ~WorkerFrontendDispatcher();
    WTF_MAKE_NONCOPYABLE(WorkerFrontendDispatcher);
    WTF_MAKE_NONMOVABLE(WorkerFrontendDispatcher);
    void workerCreated(const String& workerId, const String& url, const String& name);
    void workerTerminated(const String& workerId);
    void dispatchMessageFromWorker(const String& workerId, const String& message);
private:
    const CheckedRef<FrontendRouter> m_frontendRouter;
};

} // namespace Inspector
