Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(799)

Unified Diff: Source/core/inspector/InjectedScript.h

Issue 300393002: Merge DevTools Refactor CL to Blink36 (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/1985
Patch Set: PTAL Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/ConsoleMessage.cpp ('k') | Source/core/inspector/InjectedScript.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InjectedScript.h
diff --git a/Source/core/inspector/InjectedScript.h b/Source/core/inspector/InjectedScript.h
index 16ea58f2bb9c296b0f494c36668ca24d8864dde4..84265e5f9adce059d539feea6723b3a2fab1c58f 100644
--- a/Source/core/inspector/InjectedScript.h
+++ b/Source/core/inspector/InjectedScript.h
@@ -32,6 +32,7 @@
#define InjectedScript_h
#include "InspectorTypeBuilder.h"
+#include "bindings/common/StackTrace.h"
#include "bindings/v8/ScriptObject.h"
#include "core/inspector/InjectedScriptBase.h"
#include "core/inspector/InjectedScriptManager.h"
@@ -45,12 +46,73 @@ class InjectedScriptModule;
class Node;
class SerializedScriptValue;
-class InjectedScript FINAL : public InjectedScriptBase {
+class InjectedScript : public virtual InjectedScriptBase {
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 +121,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 +130,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 +142,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
« no previous file with comments | « Source/core/inspector/ConsoleMessage.cpp ('k') | Source/core/inspector/InjectedScript.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698