#ifndef InspectorAgent_h
#define InspectorAgent_h
#include "InspectorBackendDispatchers.h"
#include "InspectorFrontendDispatchers.h"
#include "inspector/InspectorAgentBase.h"
#include <wtf/Forward.h>
#include <wtf/Vector.h>
namespace Inspector {
class BackendDispatcher;
class InspectorEnvironment;
class InspectorObject;
typedef String ErrorString;
class JS_EXPORT_PRIVATE InspectorAgent final : public InspectorAgentBase, public InspectorBackendDispatcherHandler {
WTF_MAKE_NONCOPYABLE(InspectorAgent);
WTF_MAKE_FAST_ALLOCATED;
public:
InspectorAgent(AgentContext&);
virtual ~InspectorAgent();
void didCreateFrontendAndBackend(FrontendRouter*, BackendDispatcher*) override;
void willDestroyFrontendAndBackend(DisconnectReason) override;
void enable(ErrorString&) override;
void disable(ErrorString&) override;
void initialized(ErrorString&) override;
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:
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 };
};
}
#endif // !defined(InspectorAgent_h)