#ifndef InspectorRuntimeAgent_h
#define InspectorRuntimeAgent_h
#include "core/inspector/InspectorBaseAgent.h"
#include "wtf/Forward.h"
#include "wtf/Noncopyable.h"
namespace WebCore {
class InjectedScript;
class InjectedScriptManager;
class InstrumentingAgents;
class JSONArray;
class ScriptDebugServer;
typedef String ErrorString;
class InspectorRuntimeAgent : public InspectorBaseAgent<InspectorRuntimeAgent>, public InspectorBackendDispatcher::RuntimeCommandHandler {
WTF_MAKE_NONCOPYABLE(InspectorRuntimeAgent);
public:
virtual ~InspectorRuntimeAgent();
virtual void enable(ErrorString*) OVERRIDE { m_enabled = true; }
virtual void disable(ErrorString*) OVERRIDE { m_enabled = false; }
virtual void evaluate(ErrorString*,
const String& expression,
const String* objectGroup,
const bool* includeCommandLineAPI,
const bool* doNotPauseOnExceptionsAndMuteConsole,
const int* executionContextId,
const bool* returnByValue,
const bool* generatePreview,
RefPtr<TypeBuilder::Runtime::RemoteObject>& result,
TypeBuilder::OptOutput<bool>* wasThrown) OVERRIDE FINAL;
virtual void callFunctionOn(ErrorString*,
const String& objectId,
const String& expression,
const RefPtr<JSONArray>* optionalArguments,
const bool* doNotPauseOnExceptionsAndMuteConsole,
const bool* returnByValue,
const bool* generatePreview,
RefPtr<TypeBuilder::Runtime::RemoteObject>& result,
TypeBuilder::OptOutput<bool>* wasThrown) OVERRIDE FINAL;
virtual void releaseObject(ErrorString*, const String& objectId) OVERRIDE FINAL;
virtual void getProperties(ErrorString*, const String& objectId, const bool* ownProperties, const bool* accessorPropertiesOnly, RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::PropertyDescriptor> >& result, RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::InternalPropertyDescriptor> >& internalProperties) OVERRIDE FINAL;
virtual void releaseObjectGroup(ErrorString*, const String& objectGroup) OVERRIDE FINAL;
virtual void run(ErrorString*) OVERRIDE;
protected:
InspectorRuntimeAgent(InjectedScriptManager*, ScriptDebugServer*);
virtual InjectedScript injectedScriptForEval(ErrorString*, const int* executionContextId) = 0;
virtual void muteConsole() = 0;
virtual void unmuteConsole() = 0;
InjectedScriptManager* injectedScriptManager() { return m_injectedScriptManager; }
bool m_enabled;
private:
InjectedScriptManager* m_injectedScriptManager;
ScriptDebugServer* m_scriptDebugServer;
};
}
#endif