Index: Source/bindings/v8/ScriptDebugServer.h |
diff --git a/Source/bindings/v8/ScriptDebugServer.h b/Source/bindings/v8/ScriptDebugServer.h |
index 3eac298301676ed8131b9171724dcd2a229eb7c8..451599dff5d13d0cb0353dfa6ffa3214ad6b9688 100644 |
--- a/Source/bindings/v8/ScriptDebugServer.h |
+++ b/Source/bindings/v8/ScriptDebugServer.h |
@@ -48,41 +48,77 @@ namespace WebCore { |
class ScriptState; |
class ScriptController; |
class ScriptDebugListener; |
-class ScriptObject; |
class ScriptSourceCode; |
class ScriptValue; |
+class StackTrace; |
+class ActivationFrame; |
class JavaScriptCallFrame; |
-class ScriptDebugServer { |
- WTF_MAKE_NONCOPYABLE(ScriptDebugServer); |
+class ScriptDebugServerBase { |
public: |
- String setBreakpoint(const String& sourceID, const ScriptBreakpoint&, int* actualLineNumber, int* actualColumnNumber, bool interstatementLocation); |
- void removeBreakpoint(const String& breakpointId); |
- void clearBreakpoints(); |
- void setBreakpointsActivated(bool activated); |
+ virtual String setBreakpoint(const String& sourceID, const ScriptBreakpoint&, int* actualLineNumber, int* actualColumnNumber, bool interstatementLocation) = 0; |
+ virtual void removeBreakpoint(const String& breakpointId) = 0; |
+ virtual void clearBreakpoints() = 0; |
+ virtual void setBreakpointsActivated(bool) = 0; |
enum PauseOnExceptionsState { |
DontPauseOnExceptions, |
PauseOnAllExceptions, |
PauseOnUncaughtExceptions |
}; |
- PauseOnExceptionsState pauseOnExceptionsState(); |
- void setPauseOnExceptionsState(PauseOnExceptionsState pauseOnExceptionsState); |
- |
- void setPauseOnNextStatement(bool pause); |
- bool canBreakProgram(); |
- void breakProgram(); |
- void continueProgram(); |
- void stepIntoStatement(); |
- void stepOverStatement(const ScriptValue& frame); |
- void stepOutOfFunction(const ScriptValue& frame); |
+ virtual PauseOnExceptionsState pauseOnExceptionsState() = 0; |
+ virtual void setPauseOnExceptionsState(PauseOnExceptionsState) = 0; |
+ |
+ virtual void setPauseOnNextStatement(bool) = 0; |
+ virtual bool canBreakProgram() = 0; |
+ virtual void breakProgram() = 0; |
+ virtual void continueProgram() = 0; |
+ virtual void stepIntoStatement() = 0; |
+ virtual void stepOverStatement(const ActivationFrame&) = 0; |
+ virtual void stepOutOfFunction(const ActivationFrame&) = 0; |
+ |
+ virtual bool setScriptSource(const String& sourceID, const String& newContent, bool preview, String* error, RefPtr<TypeBuilder::Debugger::SetScriptSourceError>&, StackTrace* newCallFrames, RefPtr<JSONObject>& result) = 0; |
+ |
+ virtual StackTrace currentCallFrames() = 0; |
+ virtual StackTrace currentCallFramesForAsyncStack() = 0; |
+ |
+ virtual bool isPaused() = 0; |
+ virtual bool runningNestedMessageLoop() = 0; |
+ |
+ virtual void compileScript(ScriptState*, const String& expression, const String& sourceURL, String* scriptId, String* exceptionMessage) { }; |
+ virtual void clearCompiledScripts() = 0; |
+ virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* result, bool* wasThrown, String* exceptionMessage) = 0; |
+ virtual void setPreprocessorSource(const String&) { }; |
+ // FIXMEDART: refactor this method to not be V8 specific. |
+ virtual void preprocessBeforeCompile(const v8::Debug::EventDetails&) { } |
+ virtual PassOwnPtr<ScriptSourceCode> preprocess(LocalFrame*, const ScriptSourceCode&) = 0; |
+ virtual String preprocessEventListener(LocalFrame*, const String& source, const String& url, const String& functionName) = 0; |
- bool setScriptSource(const String& sourceID, const String& newContent, bool preview, String* error, RefPtr<TypeBuilder::Debugger::SetScriptSourceError>&, ScriptValue* newCallFrames, RefPtr<JSONObject>* result); |
- ScriptValue currentCallFrames(); |
- ScriptValue currentCallFramesForAsyncStack(); |
+ virtual void muteWarningsAndDeprecations() { } |
+ virtual void unmuteWarningsAndDeprecations() { } |
+}; |
- // FIXMEDART: moved to public to dispatch Dart debug events. |
- void handleV8DebugEvent(const v8::Debug::EventDetails& eventDetails); |
+class ScriptDebugServer : public ScriptDebugServerBase { |
+ WTF_MAKE_NONCOPYABLE(ScriptDebugServer); |
+public: |
+ virtual String setBreakpoint(const String& sourceID, const ScriptBreakpoint&, int* actualLineNumber, int* actualColumnNumber, bool interstatementLocation); |
+ virtual void removeBreakpoint(const String& breakpointId); |
+ virtual void clearBreakpoints(); |
+ virtual void setBreakpointsActivated(bool); |
+ virtual void setPauseOnNextStatement(bool); |
+ virtual bool canBreakProgram(); |
+ virtual void breakProgram(); |
+ virtual void continueProgram(); |
+ virtual void stepIntoStatement(); |
+ virtual void stepOverStatement(const ActivationFrame&); |
+ virtual void stepOutOfFunction(const ActivationFrame&); |
+ |
+ virtual PauseOnExceptionsState pauseOnExceptionsState(); |
+ virtual void setPauseOnExceptionsState(PauseOnExceptionsState); |
+ |
+ virtual bool setScriptSource(const String& sourceID, const String& newContent, bool preview, String* error, RefPtr<TypeBuilder::Debugger::SetScriptSourceError>&, StackTrace* newCallFrames, RefPtr<JSONObject>& result); |
+ virtual StackTrace currentCallFrames(); |
+ virtual StackTrace currentCallFramesForAsyncStack(); |
class Task { |
public: |
@@ -92,7 +128,7 @@ public: |
static void interruptAndRun(PassOwnPtr<Task>, v8::Isolate*); |
void runPendingTasks(); |
- bool isPaused(); |
+ virtual bool isPaused(); |
bool runningNestedMessageLoop() { return m_runningNestedMessageLoop; } |
v8::Local<v8::Value> functionScopes(v8::Handle<v8::Function>); |
@@ -103,14 +139,9 @@ public: |
virtual void compileScript(ScriptState*, const String& expression, const String& sourceURL, String* scriptId, String* exceptionMessage); |
virtual void clearCompiledScripts(); |
virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* result, bool* wasThrown, String* exceptionMessage); |
- virtual void setPreprocessorSource(const String&) { } |
- virtual void preprocessBeforeCompile(const v8::Debug::EventDetails&) { } |
virtual PassOwnPtr<ScriptSourceCode> preprocess(LocalFrame*, const ScriptSourceCode&); |
virtual String preprocessEventListener(LocalFrame*, const String& source, const String& url, const String& functionName); |
- virtual void muteWarningsAndDeprecations() { } |
- virtual void unmuteWarningsAndDeprecations() { } |
- |
protected: |
explicit ScriptDebugServer(v8::Isolate*); |
virtual ~ScriptDebugServer(); |
@@ -123,7 +154,8 @@ protected: |
void handleProgramBreak(v8::Handle<v8::Object> executionState, v8::Handle<v8::Value> exception, v8::Handle<v8::Array> hitBreakpoints); |
void handleProgramBreak(const v8::Debug::EventDetails&, v8::Handle<v8::Value> exception, v8::Handle<v8::Array> hitBreakpointNumbers); |
- static void v8DebugEventCallback(const v8::Debug::EventDetails& eventDetails); |
+ void handleV8DebugEvent(const v8::Debug::EventDetails&); |
+ static void v8DebugEventCallback(const v8::Debug::EventDetails&); |
void dispatchDidParseSource(ScriptDebugListener* listener, v8::Handle<v8::Object> sourceObject); |
@@ -145,7 +177,7 @@ private: |
NoScopes // Should be the last option. |
}; |
- ScriptValue currentCallFramesInner(ScopeInfoDetails); |
+ StackTrace currentCallFramesInner(ScopeInfoDetails); |
void stepCommandWithFrame(const char* functionName, const ScriptValue& frame); |
PassRefPtr<JavaScriptCallFrame> wrapCallFrames(v8::Handle<v8::Object> executionState, int maximumLimit, ScopeInfoDetails); |