diff options
Diffstat (limited to 'Source/JavaScriptCore/inspector/agents/InspectorAgent.h')
-rw-r--r-- | Source/JavaScriptCore/inspector/agents/InspectorAgent.h | 55 |
1 files changed, 32 insertions, 23 deletions
diff --git a/Source/JavaScriptCore/inspector/agents/InspectorAgent.h b/Source/JavaScriptCore/inspector/agents/InspectorAgent.h index c7dc9ba5a..a9b039207 100644 --- a/Source/JavaScriptCore/inspector/agents/InspectorAgent.h +++ b/Source/JavaScriptCore/inspector/agents/InspectorAgent.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. + * Copyright (C) 2007-2010, 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 @@ -11,7 +11,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -27,46 +27,55 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef InspectorAgent_h -#define InspectorAgent_h +#pragma once -#include "InspectorJSBackendDispatchers.h" -#include "InspectorJSFrontendDispatchers.h" +#include "InspectorBackendDispatchers.h" +#include "InspectorFrontendDispatchers.h" #include "inspector/InspectorAgentBase.h" #include <wtf/Forward.h> -#include <wtf/PassOwnPtr.h> #include <wtf/Vector.h> namespace Inspector { +class BackendDispatcher; +class InspectorEnvironment; class InspectorObject; -class InstrumentingAgents; typedef String ErrorString; -class JS_EXPORT_PRIVATE InspectorAgent final : public InspectorAgentBase, public InspectorInspectorBackendDispatcherHandler { +class JS_EXPORT_PRIVATE InspectorAgent final : public InspectorAgentBase, public InspectorBackendDispatcherHandler { WTF_MAKE_NONCOPYABLE(InspectorAgent); + WTF_MAKE_FAST_ALLOCATED; public: - InspectorAgent(); + InspectorAgent(AgentContext&); virtual ~InspectorAgent(); - virtual void didCreateFrontendAndBackend(InspectorFrontendChannel*, InspectorBackendDispatcher*) override; - virtual void willDestroyFrontendAndBackend(InspectorDisconnectReason reason) override; + void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) override; + void willDestroyFrontendAndBackend(DisconnectReason) override; - virtual void enable(ErrorString*) override; - virtual void disable(ErrorString*) override; + void enable(ErrorString&) override; + void disable(ErrorString&) override; + void initialized(ErrorString&) override; - void inspect(PassRefPtr<TypeBuilder::Runtime::RemoteObject> objectToInspect, PassRefPtr<InspectorObject> hints); - void evaluateForTestInFrontend(long testCallId, const String& script); + void inspect(RefPtr<Protocol::Runtime::RemoteObject>&& objectToInspect, RefPtr<InspectorObject>&& hints); + void evaluateForTestInFrontend(const String& script); + +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + void activateExtraDomain(const String&); + void activateExtraDomains(const Vector<String>&); +#endif private: - std::unique_ptr<InspectorInspectorFrontendDispatcher> m_frontendDispatcher; - RefPtr<InspectorInspectorBackendDispatcher> m_backendDispatcher; - Vector<std::pair<long, String>> m_pendingEvaluateTestCommands; - std::pair<RefPtr<TypeBuilder::Runtime::RemoteObject>, RefPtr<InspectorObject>> m_pendingInspectData; - bool m_enabled; + InspectorEnvironment& m_environment; + std::unique_ptr<InspectorFrontendDispatcher> m_frontendDispatcher; + Ref<InspectorBackendDispatcher> m_backendDispatcher; + + Vector<String> m_pendingEvaluateTestCommands; + std::pair<RefPtr<Protocol::Runtime::RemoteObject>, RefPtr<InspectorObject>> m_pendingInspectData; +#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) + RefPtr<Inspector::Protocol::Array<String>> m_pendingExtraDomainsData; +#endif + bool m_enabled { false }; }; } // namespace Inspector - -#endif // !defined(InspectorAgent_h) |