OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include <v8-debug.h> | 45 #include <v8-debug.h> |
46 #include <v8.h> | 46 #include <v8.h> |
47 | 47 |
48 namespace WebCore { | 48 namespace WebCore { |
49 | 49 |
50 class ScriptState; | 50 class ScriptState; |
51 class ScriptController; | 51 class ScriptController; |
52 class ScriptDebugListener; | 52 class ScriptDebugListener; |
53 class ScriptSourceCode; | 53 class ScriptSourceCode; |
54 class ScriptValue; | 54 class ScriptValue; |
55 class StackTrace; | 55 class StackTraces; |
56 class ActivationFrame; | 56 class ActivationFrame; |
57 class JavaScriptCallFrame; | 57 class JavaScriptCallFrame; |
58 | 58 |
59 class ScriptDebugServerBase { | 59 class ScriptDebugServerBase { |
60 public: | 60 public: |
61 ScriptDebugServerBase() : m_peer(0) { } | 61 ScriptDebugServerBase() : m_peer(0) { } |
62 virtual String setBreakpoint(const String& sourceID, const ScriptBreakpoint&
, int* actualLineNumber, int* actualColumnNumber, bool interstatementLocation) =
0; | 62 virtual String setBreakpoint(const String& sourceID, const ScriptBreakpoint&
, int* actualLineNumber, int* actualColumnNumber, bool interstatementLocation) =
0; |
63 virtual void removeBreakpoint(const String& breakpointId) = 0; | 63 virtual void removeBreakpoint(const String& breakpointId) = 0; |
64 virtual void clearBreakpoints() = 0; | 64 virtual void clearBreakpoints() = 0; |
65 virtual void setBreakpointsActivated(bool) = 0; | 65 virtual void setBreakpointsActivated(bool) = 0; |
66 | 66 |
67 enum PauseOnExceptionsState { | 67 enum PauseOnExceptionsState { |
68 DontPauseOnExceptions, | 68 DontPauseOnExceptions, |
69 PauseOnAllExceptions, | 69 PauseOnAllExceptions, |
70 PauseOnUncaughtExceptions | 70 PauseOnUncaughtExceptions |
71 }; | 71 }; |
72 virtual PauseOnExceptionsState pauseOnExceptionsState() = 0; | 72 virtual PauseOnExceptionsState pauseOnExceptionsState() = 0; |
73 virtual void setPauseOnExceptionsState(PauseOnExceptionsState) = 0; | 73 virtual void setPauseOnExceptionsState(PauseOnExceptionsState) = 0; |
74 | 74 |
75 virtual void setPauseOnNextStatement(bool) = 0; | 75 virtual void setPauseOnNextStatement(bool) = 0; |
76 virtual bool canBreakProgram() = 0; | 76 virtual bool canBreakProgram() = 0; |
77 virtual void breakProgram() = 0; | 77 virtual void breakProgram() = 0; |
78 virtual void continueProgram() = 0; | 78 virtual void continueProgram() = 0; |
79 virtual void stepIntoStatement() = 0; | 79 virtual void stepIntoStatement() = 0; |
80 virtual void stepOverStatement() = 0; | 80 virtual void stepOverStatement() = 0; |
81 virtual void stepOutOfFunction() = 0; | 81 virtual void stepOutOfFunction() = 0; |
82 | 82 |
83 virtual bool setScriptSource(const String& sourceID, const String& newConten
t, bool preview, String* error, RefPtr<TypeBuilder::Debugger::SetScriptSourceErr
or>&, StackTrace* newCallFrames, RefPtr<JSONObject>* result) = 0; | 83 virtual bool setScriptSource(const String& sourceID, const String& newConten
t, bool preview, String* error, RefPtr<TypeBuilder::Debugger::SetScriptSourceErr
or>&, StackTraces* newCallFrames, RefPtr<JSONObject>* result) = 0; |
84 | 84 |
85 virtual ScriptCallFrame topCallFrameNoScopes() = 0; | 85 virtual ScriptCallFrame topCallFrameNoScopes() = 0; |
86 virtual int frameCount() = 0; | 86 virtual int frameCount() = 0; |
87 | 87 |
88 virtual StackTrace currentCallFrames() = 0; | 88 virtual StackTraces currentCallFrames() = 0; |
89 virtual StackTrace currentCallFramesForAsyncStack() = 0; | 89 virtual StackTraces currentCallFramesForAsyncStack() = 0; |
90 | 90 |
91 virtual bool isPaused() = 0; | 91 virtual bool isPaused() = 0; |
92 bool isAnyScriptPaused() { return isPaused() || (m_peer && m_peer->isPaused(
)); } | 92 bool isAnyScriptPaused() { return isPaused() || (m_peer && m_peer->isPaused(
)); } |
93 | 93 |
94 virtual bool runningNestedMessageLoop() = 0; | 94 virtual bool runningNestedMessageLoop() = 0; |
95 virtual void runPendingTasks() = 0; | 95 virtual void runPendingTasks() = 0; |
96 | 96 |
97 virtual void compileScript(ScriptState*, const String& expression, const Str
ing& sourceURL, String* scriptId, String* exceptionDetailsText, int* lineNumber,
int* columnNumber, RefPtrWillBeRawPtr<ScriptCallStack>* stackTrace) { }; | 97 virtual void compileScript(ScriptState*, const String& expression, const Str
ing& sourceURL, String* scriptId, String* exceptionDetailsText, int* lineNumber,
int* columnNumber, RefPtrWillBeRawPtr<ScriptCallStack>* stackTrace) { }; |
98 virtual void clearCompiledScripts() = 0; | 98 virtual void clearCompiledScripts() = 0; |
99 virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* re
sult, bool* wasThrown, String* exceptionDetailsText, int* lineNumber, int* colum
nNumber, RefPtrWillBeRawPtr<ScriptCallStack>* stackTrace) = 0; | 99 virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* re
sult, bool* wasThrown, String* exceptionDetailsText, int* lineNumber, int* colum
nNumber, RefPtrWillBeRawPtr<ScriptCallStack>* stackTrace) = 0; |
(...skipping 21 matching lines...) Expand all Loading... |
121 virtual bool canBreakProgram(); | 121 virtual bool canBreakProgram(); |
122 virtual void breakProgram(); | 122 virtual void breakProgram(); |
123 virtual void continueProgram(); | 123 virtual void continueProgram(); |
124 virtual void stepIntoStatement(); | 124 virtual void stepIntoStatement(); |
125 virtual void stepOverStatement(); | 125 virtual void stepOverStatement(); |
126 virtual void stepOutOfFunction(); | 126 virtual void stepOutOfFunction(); |
127 | 127 |
128 virtual PauseOnExceptionsState pauseOnExceptionsState(); | 128 virtual PauseOnExceptionsState pauseOnExceptionsState(); |
129 virtual void setPauseOnExceptionsState(PauseOnExceptionsState); | 129 virtual void setPauseOnExceptionsState(PauseOnExceptionsState); |
130 | 130 |
131 virtual bool setScriptSource(const String& sourceID, const String& newConten
t, bool preview, String* error, RefPtr<TypeBuilder::Debugger::SetScriptSourceErr
or>&, StackTrace* newCallFrames, RefPtr<JSONObject>* result); | 131 virtual bool setScriptSource(const String& sourceID, const String& newConten
t, bool preview, String* error, RefPtr<TypeBuilder::Debugger::SetScriptSourceErr
or>&, StackTraces* newCallFrames, RefPtr<JSONObject>* result); |
132 virtual ScriptCallFrame topCallFrameNoScopes(); | 132 virtual ScriptCallFrame topCallFrameNoScopes(); |
133 virtual int frameCount(); | 133 virtual int frameCount(); |
134 virtual StackTrace currentCallFrames(); | 134 virtual StackTraces currentCallFrames(); |
135 virtual StackTrace currentCallFramesForAsyncStack(); | 135 virtual StackTraces currentCallFramesForAsyncStack(); |
136 | 136 |
137 class Task { | 137 class Task { |
138 public: | 138 public: |
139 virtual ~Task() { } | 139 virtual ~Task() { } |
140 virtual void run() = 0; | 140 virtual void run() = 0; |
141 }; | 141 }; |
142 static void interruptAndRun(PassOwnPtr<Task>, v8::Isolate*); | 142 static void interruptAndRun(PassOwnPtr<Task>, v8::Isolate*); |
143 virtual void runPendingTasks(); | 143 virtual void runPendingTasks(); |
144 | 144 |
145 virtual bool isPaused(); | 145 virtual bool isPaused(); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 HashMap<String, OwnPtr<ScopedPersistent<v8::Script> > > m_compiledScripts; | 183 HashMap<String, OwnPtr<ScopedPersistent<v8::Script> > > m_compiledScripts; |
184 v8::Isolate* m_isolate; | 184 v8::Isolate* m_isolate; |
185 | 185 |
186 private: | 186 private: |
187 enum ScopeInfoDetails { | 187 enum ScopeInfoDetails { |
188 AllScopes, | 188 AllScopes, |
189 FastAsyncScopes, | 189 FastAsyncScopes, |
190 NoScopes // Should be the last option. | 190 NoScopes // Should be the last option. |
191 }; | 191 }; |
192 | 192 |
193 StackTrace currentCallFramesInner(ScopeInfoDetails); | 193 StackTraces currentCallFramesInner(ScopeInfoDetails); |
194 | 194 |
195 PassRefPtrWillBeRawPtr<JavaScriptCallFrame> wrapCallFrames(int maximumLimit,
ScopeInfoDetails); | 195 PassRefPtrWillBeRawPtr<JavaScriptCallFrame> wrapCallFrames(int maximumLimit,
ScopeInfoDetails); |
196 | 196 |
197 bool m_runningNestedMessageLoop; | 197 bool m_runningNestedMessageLoop; |
198 }; | 198 }; |
199 | 199 |
200 } // namespace WebCore | 200 } // namespace WebCore |
201 | 201 |
202 | 202 |
203 #endif // ScriptDebugServer_h | 203 #endif // ScriptDebugServer_h |
OLD | NEW |