diff options
Diffstat (limited to 'Source/JavaScriptCore/inspector/InspectorAgentBase.h')
-rw-r--r-- | Source/JavaScriptCore/inspector/InspectorAgentBase.h | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/Source/JavaScriptCore/inspector/InspectorAgentBase.h b/Source/JavaScriptCore/inspector/InspectorAgentBase.h index f6b6c55cb..4edf78305 100644 --- a/Source/JavaScriptCore/inspector/InspectorAgentBase.h +++ b/Source/JavaScriptCore/inspector/InspectorAgentBase.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Apple Inc. All Rights Reserved. + * Copyright (C) 2013, 2015 Apple Inc. All Rights Reserved. * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,27 +24,53 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef InspectorAgentBase_h -#define InspectorAgentBase_h +#pragma once #include <wtf/text/WTFString.h> +namespace JSC { +class JSGlobalObject; +} + namespace Inspector { -class InspectorBackendDispatcher; -class InspectorFrontendChannel; +class BackendDispatcher; +class FrontendRouter; +class InjectedScriptManager; +class InspectorEnvironment; + +struct AgentContext { + InspectorEnvironment& environment; + InjectedScriptManager& injectedScriptManager; + FrontendRouter& frontendRouter; + BackendDispatcher& backendDispatcher; +}; + +struct JSAgentContext : public AgentContext { + JSAgentContext(AgentContext& context, JSC::JSGlobalObject& globalObject) + : AgentContext(context) + , inspectedGlobalObject(globalObject) + { + } -enum class InspectorDisconnectReason { + JSC::JSGlobalObject& inspectedGlobalObject; +}; + +enum class DisconnectReason { InspectedTargetDestroyed, InspectorDestroyed }; class InspectorAgentBase { + WTF_MAKE_FAST_ALLOCATED; public: virtual ~InspectorAgentBase() { } - virtual void didCreateFrontendAndBackend(InspectorFrontendChannel*, InspectorBackendDispatcher*) = 0; - virtual void willDestroyFrontendAndBackend(InspectorDisconnectReason reason) = 0; + String domainName() const { return m_name; } + + virtual void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) = 0; + virtual void willDestroyFrontendAndBackend(DisconnectReason) = 0; + virtual void discardValues() { } virtual void discardAgent() { } protected: @@ -55,7 +81,5 @@ protected: String m_name; }; - -} // namespace Inspector -#endif // !defined(InspectorAgentBase_h) +} // namespace Inspector |