Chromium Code Reviews| Index: Source/core/inspector/InjectedScript.h | 
| diff --git a/Source/core/inspector/InjectedScript.h b/Source/core/inspector/InjectedScript.h | 
| index 16ea58f2bb9c296b0f494c36668ca24d8864dde4..7180121ba338d636a905e0a7374416b2ba04c762 100644 | 
| --- a/Source/core/inspector/InjectedScript.h | 
| +++ b/Source/core/inspector/InjectedScript.h | 
| @@ -45,12 +45,73 @@ class InjectedScriptModule; | 
| class Node; | 
| class SerializedScriptValue; | 
| -class InjectedScript FINAL : public InjectedScriptBase { | 
| +class InjectedScript : public virtual InjectedScriptBase { | 
| 
 
vsm
2014/06/03 14:24:49
Should this class be moved to bindings?  Or, perha
 
 | 
| public: | 
| - InjectedScript(); | 
| virtual ~InjectedScript() { } | 
| - void evaluate( | 
| + virtual void evaluate(ErrorString*, | 
| + const String& expression, | 
| + const String& objectGroup, | 
| + bool includeCommandLineAPI, | 
| + bool returnByValue, | 
| + bool generatePreview, | 
| + RefPtr<TypeBuilder::Runtime::RemoteObject>* result, | 
| + TypeBuilder::OptOutput<bool>* wasThrown) = 0; | 
| + virtual void callFunctionOn(ErrorString*, | 
| + const String& objectId, | 
| + const String& expression, | 
| + const String& arguments, | 
| + bool returnByValue, | 
| + bool generatePreview, | 
| + RefPtr<TypeBuilder::Runtime::RemoteObject>* result, | 
| + TypeBuilder::OptOutput<bool>* wasThrown) = 0; | 
| + virtual void evaluateOnCallFrame( | 
| + ErrorString*, | 
| + const StackTrace& callFrames, | 
| + const Vector<StackTrace>& asyncCallStacks, | 
| + const String& callFrameId, | 
| + const String& expression, | 
| + const String& objectGroup, | 
| + bool includeCommandLineAPI, | 
| + bool returnByValue, | 
| + bool generatePreview, | 
| + RefPtr<TypeBuilder::Runtime::RemoteObject>* result, | 
| + TypeBuilder::OptOutput<bool>* wasThrown) = 0; | 
| + virtual void getCompletionsOnCallFrame( | 
| + ErrorString*, | 
| + const StackTrace& callFrames, | 
| + const Vector<StackTrace>& asyncCallStacks, | 
| + const String& callFrameId, | 
| + const String& expression, | 
| + RefPtr<TypeBuilder::Array<String> >* result) = 0; | 
| + virtual void restartFrame(ErrorString*, const StackTrace& callFrames, const String& callFrameId, RefPtr<JSONObject>* result) = 0; | 
| + virtual void getStepInPositions(ErrorString*, const StackTrace& callFrames, const String& callFrameId, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::Location> >& positions) = 0; | 
| + virtual void setVariableValue(ErrorString*, const StackTrace& callFrames, const String* callFrameIdOpt, const String* functionObjectIdOpt, int scopeNumber, const String& variableName, const String& newValueStr) = 0; | 
| + virtual void getFunctionDetails(ErrorString*, const String& functionId, RefPtr<TypeBuilder::Debugger::FunctionDetails>* result) = 0; | 
| + virtual void getCompletions(ErrorString*, const String& expression, RefPtr<TypeBuilder::Array<String> >* result) = 0; | 
| + virtual void getProperties(ErrorString*, const String& objectId, bool ownProperties, bool accessorPropertiesOnly, RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::PropertyDescriptor> >* result) = 0; | 
| + virtual void getInternalProperties(ErrorString*, const String& objectId, RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::InternalPropertyDescriptor> >* result) = 0; | 
| + virtual void getProperty(ErrorString*, const String& objectId, const RefPtr<JSONArray>& propertyPath, RefPtr<TypeBuilder::Runtime::RemoteObject>* result, TypeBuilder::OptOutput<bool>* wasThrown) = 0; | 
| + | 
| + virtual Node* nodeForObjectId(const String& objectId) = 0; | 
| + virtual void releaseObject(const String& objectId) = 0; | 
| + | 
| + virtual PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > wrapCallFrames(const StackTrace&, int asyncOrdinal) = 0; | 
| + | 
| + virtual PassRefPtr<TypeBuilder::Runtime::RemoteObject> wrapObject(const ScriptValue&, const String& groupName, bool generatePreview = false) = 0; | 
| + virtual PassRefPtr<TypeBuilder::Runtime::RemoteObject> wrapTable(const ScriptValue& table, const ScriptValue& columns) = 0; | 
| + | 
| + virtual ActivationFrame findCallFrameById(ErrorString*, const StackTrace& topCallFrame, const String& callFrameId) = 0; | 
| + | 
| + virtual void releaseObjectGroup(const String&) = 0; | 
| +}; | 
| + | 
| +class V8InjectedScript FINAL : public V8InjectedScriptBase, public InjectedScript { | 
| +public: | 
| + V8InjectedScript(); | 
| + virtual ~V8InjectedScript() { } | 
| + | 
| + virtual void evaluate( | 
| ErrorString*, | 
| const String& expression, | 
| const String& objectGroup, | 
| @@ -59,7 +120,7 @@ public: | 
| bool generatePreview, | 
| RefPtr<TypeBuilder::Runtime::RemoteObject>* result, | 
| TypeBuilder::OptOutput<bool>* wasThrown); | 
| - void callFunctionOn( | 
| + virtual void callFunctionOn( | 
| ErrorString*, | 
| const String& objectId, | 
| const String& expression, | 
| @@ -68,10 +129,10 @@ public: | 
| bool generatePreview, | 
| RefPtr<TypeBuilder::Runtime::RemoteObject>* result, | 
| TypeBuilder::OptOutput<bool>* wasThrown); | 
| - void evaluateOnCallFrame( | 
| + virtual void evaluateOnCallFrame( | 
| ErrorString*, | 
| - const ScriptValue& callFrames, | 
| - const Vector<ScriptValue>& asyncCallStacks, | 
| + const StackTrace& callFrames, | 
| + const Vector<StackTrace>& asyncCallStacks, | 
| const String& callFrameId, | 
| const String& expression, | 
| const String& objectGroup, | 
| @@ -80,35 +141,44 @@ public: | 
| bool generatePreview, | 
| RefPtr<TypeBuilder::Runtime::RemoteObject>* result, | 
| TypeBuilder::OptOutput<bool>* wasThrown); | 
| - void restartFrame(ErrorString*, const ScriptValue& callFrames, const String& callFrameId, RefPtr<JSONObject>* result); | 
| - void getStepInPositions(ErrorString*, const ScriptValue& callFrames, const String& callFrameId, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::Location> >& positions); | 
| - void setVariableValue(ErrorString*, const ScriptValue& callFrames, const String* callFrameIdOpt, const String* functionObjectIdOpt, int scopeNumber, const String& variableName, const String& newValueStr); | 
| - void getFunctionDetails(ErrorString*, const String& functionId, RefPtr<TypeBuilder::Debugger::FunctionDetails>* result); | 
| - void getProperties(ErrorString*, const String& objectId, bool ownProperties, bool accessorPropertiesOnly, RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::PropertyDescriptor> >* result); | 
| - void getInternalProperties(ErrorString*, const String& objectId, RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::InternalPropertyDescriptor> >* result); | 
| - Node* nodeForObjectId(const String& objectId); | 
| - void releaseObject(const String& objectId); | 
| - | 
| - PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > wrapCallFrames(const ScriptValue&, int asyncOrdinal); | 
| - | 
| - PassRefPtr<TypeBuilder::Runtime::RemoteObject> wrapObject(const ScriptValue&, const String& groupName, bool generatePreview = false) const; | 
| - PassRefPtr<TypeBuilder::Runtime::RemoteObject> wrapTable(const ScriptValue& table, const ScriptValue& columns) const; | 
| + virtual void getCompletionsOnCallFrame( | 
| + ErrorString*, | 
| + const StackTrace& callFrames, | 
| + const Vector<StackTrace>& asyncCallStacks, | 
| + const String& callFrameId, | 
| + const String& expression, | 
| + RefPtr<TypeBuilder::Array<String> >* result); | 
| + virtual void restartFrame(ErrorString*, const StackTrace& callFrames, const String& callFrameId, RefPtr<JSONObject>* result); | 
| + virtual void getStepInPositions(ErrorString*, const StackTrace& callFrames, const String& callFrameId, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::Location> >& positions); | 
| + virtual void setVariableValue(ErrorString*, const StackTrace& callFrames, const String* callFrameIdOpt, const String* functionObjectIdOpt, int scopeNumber, const String& variableName, const String& newValueStr); | 
| + virtual void getFunctionDetails(ErrorString*, const String& functionId, RefPtr<TypeBuilder::Debugger::FunctionDetails>* result); | 
| + virtual void getCompletions(ErrorString*, const String& expression, RefPtr<TypeBuilder::Array<String> >* out_result); | 
| + virtual void getProperties(ErrorString*, const String& objectId, bool ownProperties, bool accessorPropertiesOnly, RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::PropertyDescriptor> >* result); | 
| + virtual void getInternalProperties(ErrorString*, const String& objectId, RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::InternalPropertyDescriptor> >* result); | 
| + virtual void getProperty(ErrorString*, const String& objectId, const RefPtr<JSONArray>& propertyPath, RefPtr<TypeBuilder::Runtime::RemoteObject>* result, TypeBuilder::OptOutput<bool>* wasThrown); | 
| + virtual Node* nodeForObjectId(const String& objectId); | 
| + virtual void releaseObject(const String& objectId); | 
| + | 
| + virtual PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > wrapCallFrames(const StackTrace&, int asyncOrdinal); | 
| + | 
| + virtual PassRefPtr<TypeBuilder::Runtime::RemoteObject> wrapObject(const ScriptValue&, const String& groupName, bool generatePreview = false); | 
| + virtual PassRefPtr<TypeBuilder::Runtime::RemoteObject> wrapTable(const ScriptValue& table, const ScriptValue& columns); | 
| + | 
| PassRefPtr<TypeBuilder::Runtime::RemoteObject> wrapNode(Node*, const String& groupName); | 
| ScriptValue findObjectById(const String& objectId) const; | 
| - ScriptValue findCallFrameById(ErrorString*, const ScriptValue& topCallFrame, const String& callFrameId); | 
| + virtual ActivationFrame findCallFrameById(ErrorString*, const StackTrace& topCallFrame, const String& callFrameId); | 
| void inspectNode(Node*); | 
| - void releaseObjectGroup(const String&); | 
| + virtual void releaseObjectGroup(const String&); | 
| private: | 
| friend class InjectedScriptModule; | 
| - friend InjectedScript InjectedScriptManager::injectedScriptFor(ScriptState*); | 
| - InjectedScript(ScriptObject, InspectedStateAccessCheck); | 
| + friend InjectedScript& InjectedScriptManager::injectedScriptFor(ScriptState*); | 
| + V8InjectedScript(ScriptObject, InspectedStateAccessCheck); | 
| ScriptValue nodeAsScriptValue(Node*); | 
| }; | 
| - | 
| } // namespace WebCore | 
| #endif |