WorkerInspectorController.h [plain text]
#ifndef WorkerInspectorController_h
#define WorkerInspectorController_h
#if ENABLE(INSPECTOR)
#include "InspectorInstrumentationCookie.h"
#include "InspectorWebAgentBase.h"
#include <inspector/InspectorAgentRegistry.h>
#include <inspector/InspectorEnvironment.h>
#include <wtf/FastMalloc.h>
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
namespace Inspector {
class InspectorBackendDispatcher;
}
namespace WebCore {
class InspectorInstrumentation;
class InstrumentingAgents;
class WebInjectedScriptManager;
class WorkerGlobalScope;
class WorkerRuntimeAgent;
class WorkerInspectorController final : public Inspector::InspectorEnvironment {
WTF_MAKE_NONCOPYABLE(WorkerInspectorController);
WTF_MAKE_FAST_ALLOCATED;
public:
explicit WorkerInspectorController(WorkerGlobalScope&);
~WorkerInspectorController();
void connectFrontend();
void disconnectFrontend(Inspector::InspectorDisconnectReason);
void dispatchMessageFromFrontend(const String&);
void resume();
virtual bool developerExtrasEnabled() const override { return true; }
virtual bool canAccessInspectedScriptState(JSC::ExecState*) const override { return true; }
virtual Inspector::InspectorFunctionCallHandler functionCallHandler() const override;
virtual Inspector::InspectorEvaluateHandler evaluateHandler() const override;
virtual void willCallInjectedScriptFunction(JSC::ExecState*, const String& scriptName, int scriptLine) override;
virtual void didCallInjectedScriptFunction(JSC::ExecState*) override;
private:
friend InstrumentingAgents* instrumentationForWorkerGlobalScope(WorkerGlobalScope*);
WorkerGlobalScope& m_workerGlobalScope;
RefPtr<InstrumentingAgents> m_instrumentingAgents;
std::unique_ptr<WebInjectedScriptManager> m_injectedScriptManager;
WorkerRuntimeAgent* m_runtimeAgent;
Inspector::InspectorAgentRegistry m_agents;
std::unique_ptr<InspectorFrontendChannel> m_frontendChannel;
RefPtr<Inspector::InspectorBackendDispatcher> m_backendDispatcher;
Vector<InspectorInstrumentationCookie, 2> m_injectedScriptInstrumentationCookies;
};
}
#endif // ENABLE(INSPECTOR)
#endif // !defined(WorkerInspectorController_h)