PageRuntimeAgent.h [plain text]
#ifndef PageRuntimeAgent_h
#define PageRuntimeAgent_h
#include <inspector/InspectorFrontendDispatchers.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::FrontendChannel*, Inspector::BackendDispatcher*) override;
virtual void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override;
virtual void enable(ErrorString&) override;
virtual void disable(ErrorString&) override;
void didCreateMainWorldContext(Frame&);
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::RuntimeFrontendDispatcher> m_frontendDispatcher;
RefPtr<Inspector::RuntimeBackendDispatcher> m_backendDispatcher;
bool m_mainWorldContextCreated;
};
}
#endif // !defined(InspectorPagerAgent_h)