diff options
Diffstat (limited to 'Source/WebCore/inspector/PageRuntimeAgent.h')
-rw-r--r-- | Source/WebCore/inspector/PageRuntimeAgent.h | 52 |
1 files changed, 22 insertions, 30 deletions
diff --git a/Source/WebCore/inspector/PageRuntimeAgent.h b/Source/WebCore/inspector/PageRuntimeAgent.h index 02058d6f4..c6d2ee3d2 100644 --- a/Source/WebCore/inspector/PageRuntimeAgent.h +++ b/Source/WebCore/inspector/PageRuntimeAgent.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2011 Google Inc. All rights reserved. + * Copyright (C) 2015 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -28,23 +29,16 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef PageRuntimeAgent_h -#define PageRuntimeAgent_h +#pragma once -#if ENABLE(INSPECTOR) - -#include <inspector/InspectorJSFrontendDispatchers.h> +#include "InspectorWebAgentBase.h" +#include <inspector/InspectorFrontendDispatchers.h> #include <inspector/agents/InspectorRuntimeAgent.h> -#include <wtf/PassOwnPtr.h> namespace JSC { class ExecState; } -namespace Inspector { -class InjectedScriptManager; -} - namespace WebCore { class InspectorPageAgent; @@ -54,35 +48,33 @@ class SecurityOrigin; typedef String ErrorString; class PageRuntimeAgent final : public Inspector::InspectorRuntimeAgent { + WTF_MAKE_FAST_ALLOCATED; public: - PageRuntimeAgent(Inspector::InjectedScriptManager*, Page*, InspectorPageAgent*); + PageRuntimeAgent(PageAgentContext&, 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*); + void didCreateFrontendAndBackend(Inspector::FrontendRouter*, Inspector::BackendDispatcher*) override; + void willDestroyFrontendAndBackend(Inspector::DisconnectReason) override; + void enable(ErrorString&) override; + void disable(ErrorString&) override; + + // InspectorInstrumentation + 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; + Inspector::InjectedScript injectedScriptForEval(ErrorString&, const int* executionContextId) override; + void muteConsole() override; + void unmuteConsole() override; void reportExecutionContextCreation(); void notifyContextCreated(const String& frameId, JSC::ExecState*, SecurityOrigin*, bool isPageContext); - Page* m_inspectedPage; + std::unique_ptr<Inspector::RuntimeFrontendDispatcher> m_frontendDispatcher; + RefPtr<Inspector::RuntimeBackendDispatcher> m_backendDispatcher; InspectorPageAgent* m_pageAgent; - std::unique_ptr<Inspector::InspectorRuntimeFrontendDispatcher> m_frontendDispatcher; - RefPtr<Inspector::InspectorRuntimeBackendDispatcher> m_backendDispatcher; - bool m_mainWorldContextCreated; -}; -} // namespace WebCore + Page& m_inspectedPage; -#endif // ENABLE(INSPECTOR) + bool m_mainWorldContextCreated { false }; +}; -#endif // !defined(InspectorPagerAgent_h) +} // namespace WebCore |