InjectedScriptBase.h [plain text]
#ifndef InjectedScriptBase_h
#define InjectedScriptBase_h
#include "InspectorEnvironment.h"
#include "InspectorProtocolObjects.h"
#include "bindings/ScriptObject.h"
#include <wtf/Forward.h>
#include <wtf/RefPtr.h>
namespace Deprecated {
class ScriptFunctionCall;
}
namespace Inspector {
typedef String ErrorString;
class JS_EXPORT_PRIVATE InjectedScriptBase {
public:
virtual ~InjectedScriptBase();
const String& name() const { return m_name; }
bool hasNoValue() const { return m_injectedScriptObject.hasNoValue(); }
JSC::ExecState* scriptState() const { return m_injectedScriptObject.scriptState(); }
protected:
InjectedScriptBase(const String& name);
InjectedScriptBase(const String& name, Deprecated::ScriptObject, InspectorEnvironment*);
InspectorEnvironment* inspectorEnvironment() const { return m_environment; }
void initialize(Deprecated::ScriptObject, InspectorEnvironment*);
bool hasAccessToInspectedScriptState() const;
const Deprecated::ScriptObject& injectedScriptObject() const;
Deprecated::ScriptValue callFunctionWithEvalEnabled(Deprecated::ScriptFunctionCall&, bool& hadException) const;
void makeCall(Deprecated::ScriptFunctionCall&, RefPtr<InspectorValue>* result);
void makeEvalCall(ErrorString&, Deprecated::ScriptFunctionCall&, RefPtr<Protocol::Runtime::RemoteObject>* result, Protocol::OptOutput<bool>* wasThrown, Protocol::OptOutput<int>* savedResult = nullptr);
private:
String m_name;
Deprecated::ScriptObject m_injectedScriptObject;
InspectorEnvironment* m_environment;
};
}
#endif // InjectedScriptBase_h