ServiceWorkerDebuggable.h [plain text]
#pragma once
#if ENABLE(REMOTE_INSPECTOR)
#if ENABLE(SERVICE_WORKER)
#include "ServiceWorkerContextData.h"
#include <JavaScriptCore/RemoteInspectionTarget.h>
#include <wtf/Noncopyable.h>
namespace WebCore {
class ServiceWorkerThreadProxy;
class ServiceWorkerDebuggable final : public Inspector::RemoteInspectionTarget {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_NONCOPYABLE(ServiceWorkerDebuggable);
public:
ServiceWorkerDebuggable(ServiceWorkerThreadProxy&, const ServiceWorkerContextData&);
~ServiceWorkerDebuggable() = default;
Inspector::RemoteControllableTarget::Type type() const final { return Inspector::RemoteControllableTarget::Type::ServiceWorker; }
String name() const final { return "ServiceWorker"_s; }
String url() const final { return m_scopeURL; }
bool hasLocalDebugger() const final { return false; }
void connect(Inspector::FrontendChannel&, bool isAutomaticConnection = false, bool immediatelyPause = false) final;
void disconnect(Inspector::FrontendChannel&) final;
void dispatchMessageFromRemote(const String& message) final;
private:
ServiceWorkerThreadProxy& m_serviceWorkerThreadProxy;
String m_scopeURL;
};
}
SPECIALIZE_TYPE_TRAITS_CONTROLLABLE_TARGET(WebCore::ServiceWorkerDebuggable, ServiceWorker);
#endif // ENABLE(SERVICE_WORKER)
#endif // ENABLE(REMOTE_INSPECTOR)