PageRuntimeAgent.h [plain text]
#ifndef PageRuntimeAgent_h
#define PageRuntimeAgent_h
#if ENABLE(INSPECTOR)
#include <inspector/InspectorJSFrontendDispatchers.h>
#include <inspector/agents/InspectorRuntimeAgent.h>
namespace JSC {
class ExecState;
}
namespace Inspector {
class InjectedScriptManager;
}
namespace WebCore {
class InspectorPageAgent;
class Frame;
class Page;
class SecurityOrigin;
typedef String ErrorString;
class PageRuntimeAgent final : public Inspector::InspectorRuntimeAgent {
WTF_MAKE_FAST_ALLOCATED;
public:
PageRuntimeAgent(Inspector::InjectedScriptManager*, Page*, InspectorPageAgent*);
virtual ~PageRuntimeAgent() { }
virtual void didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel*, Inspector::InspectorBackendDispatcher*) override;
virtual void willDestroyFrontendAndBackend(Inspector::InspectorDisconnectReason) override;
virtual void enable(ErrorString*) override;
virtual void disable(ErrorString*) override;
void didCreateMainWorldContext(Frame*);
void didCreateIsolatedContext(Frame*, JSC::ExecState*, SecurityOrigin*);
private:
virtual JSC::VM& globalVM() override;
virtual Inspector::InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId) override;
virtual void muteConsole() override;
virtual void unmuteConsole() override;
void reportExecutionContextCreation();
void notifyContextCreated(const String& frameId, JSC::ExecState*, SecurityOrigin*, bool isPageContext);
Page* m_inspectedPage;
InspectorPageAgent* m_pageAgent;
std::unique_ptr<Inspector::InspectorRuntimeFrontendDispatcher> m_frontendDispatcher;
RefPtr<Inspector::InspectorRuntimeBackendDispatcher> m_backendDispatcher;
bool m_mainWorldContextCreated;
};
}
#endif // ENABLE(INSPECTOR)
#endif // !defined(InspectorPagerAgent_h)