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 30 matching lines...) Expand all Loading... |
41 #include <v8.h> | 41 #include <v8.h> |
42 | 42 |
43 namespace blink { | 43 namespace blink { |
44 | 44 |
45 class ScriptState; | 45 class ScriptState; |
46 class ScriptDebugListener; | 46 class ScriptDebugListener; |
47 class ScriptSourceCode; | 47 class ScriptSourceCode; |
48 class ScriptValue; | 48 class ScriptValue; |
49 class JavaScriptCallFrame; | 49 class JavaScriptCallFrame; |
50 | 50 |
51 class ScriptDebugServer { | 51 class ScriptDebugServer : public NoBaseWillBeGarbageCollectedFinalized<ScriptDeb
ugServer> { |
52 WTF_MAKE_NONCOPYABLE(ScriptDebugServer); | 52 WTF_MAKE_NONCOPYABLE(ScriptDebugServer); |
53 public: | 53 public: |
| 54 virtual ~ScriptDebugServer(); |
| 55 virtual void trace(Visitor*); |
| 56 |
54 String setBreakpoint(const String& sourceID, const ScriptBreakpoint&, int* a
ctualLineNumber, int* actualColumnNumber, bool interstatementLocation); | 57 String setBreakpoint(const String& sourceID, const ScriptBreakpoint&, int* a
ctualLineNumber, int* actualColumnNumber, bool interstatementLocation); |
55 void removeBreakpoint(const String& breakpointId); | 58 void removeBreakpoint(const String& breakpointId); |
56 void clearBreakpoints(); | 59 void clearBreakpoints(); |
57 void setBreakpointsActivated(bool activated); | 60 void setBreakpointsActivated(bool activated); |
58 | 61 |
59 enum PauseOnExceptionsState { | 62 enum PauseOnExceptionsState { |
60 DontPauseOnExceptions, | 63 DontPauseOnExceptions, |
61 PauseOnAllExceptions, | 64 PauseOnAllExceptions, |
62 PauseOnUncaughtExceptions | 65 PauseOnUncaughtExceptions |
63 }; | 66 }; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 v8::Local<v8::Value> collectionEntries(v8::Handle<v8::Object>&); | 100 v8::Local<v8::Value> collectionEntries(v8::Handle<v8::Object>&); |
98 v8::Local<v8::Value> getInternalProperties(v8::Handle<v8::Object>&); | 101 v8::Local<v8::Value> getInternalProperties(v8::Handle<v8::Object>&); |
99 v8::Handle<v8::Value> setFunctionVariableValue(v8::Handle<v8::Value> functio
nValue, int scopeNumber, const String& variableName, v8::Handle<v8::Value> newVa
lue); | 102 v8::Handle<v8::Value> setFunctionVariableValue(v8::Handle<v8::Value> functio
nValue, int scopeNumber, const String& variableName, v8::Handle<v8::Value> newVa
lue); |
100 v8::Local<v8::Value> callDebuggerMethod(const char* functionName, int argc,
v8::Handle<v8::Value> argv[]); | 103 v8::Local<v8::Value> callDebuggerMethod(const char* functionName, int argc,
v8::Handle<v8::Value> argv[]); |
101 | 104 |
102 virtual void compileScript(ScriptState*, const String& expression, const Str
ing& sourceURL, String* scriptId, String* exceptionDetailsText, int* lineNumber,
int* columnNumber, RefPtrWillBeRawPtr<ScriptCallStack>* stackTrace); | 105 virtual void compileScript(ScriptState*, const String& expression, const Str
ing& sourceURL, String* scriptId, String* exceptionDetailsText, int* lineNumber,
int* columnNumber, RefPtrWillBeRawPtr<ScriptCallStack>* stackTrace); |
103 virtual void clearCompiledScripts(); | 106 virtual void clearCompiledScripts(); |
104 virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* re
sult, bool* wasThrown, String* exceptionDetailsText, int* lineNumber, int* colum
nNumber, RefPtrWillBeRawPtr<ScriptCallStack>* stackTrace); | 107 virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* re
sult, bool* wasThrown, String* exceptionDetailsText, int* lineNumber, int* colum
nNumber, RefPtrWillBeRawPtr<ScriptCallStack>* stackTrace); |
105 virtual void setPreprocessorSource(const String&) { } | 108 virtual void setPreprocessorSource(const String&) { } |
106 virtual void preprocessBeforeCompile(const v8::Debug::EventDetails&) { } | 109 virtual void preprocessBeforeCompile(const v8::Debug::EventDetails&) { } |
107 virtual PassOwnPtr<ScriptSourceCode> preprocess(LocalFrame*, const ScriptSou
rceCode&); | 110 virtual ScriptSourceCode preprocess(LocalFrame*, const ScriptSourceCode&); |
108 virtual String preprocessEventListener(LocalFrame*, const String& source, co
nst String& url, const String& functionName); | 111 virtual String preprocessEventListener(LocalFrame*, const String& source, co
nst String& url, const String& functionName); |
109 virtual void clearPreprocessor() { } | 112 virtual void clearPreprocessor() { } |
110 | 113 |
111 virtual void muteWarningsAndDeprecations() { } | 114 virtual void muteWarningsAndDeprecations() { } |
112 virtual void unmuteWarningsAndDeprecations() { } | 115 virtual void unmuteWarningsAndDeprecations() { } |
113 | 116 |
114 v8::Isolate* isolate() const { return m_isolate; } | 117 v8::Isolate* isolate() const { return m_isolate; } |
115 | 118 |
116 protected: | 119 protected: |
117 explicit ScriptDebugServer(v8::Isolate*); | 120 explicit ScriptDebugServer(v8::Isolate*); |
118 virtual ~ScriptDebugServer(); | |
119 | 121 |
120 virtual ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Conte
xt>) = 0; | 122 virtual ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Conte
xt>) = 0; |
121 virtual void runMessageLoopOnPause(v8::Handle<v8::Context>) = 0; | 123 virtual void runMessageLoopOnPause(v8::Handle<v8::Context>) = 0; |
122 virtual void quitMessageLoopOnPause() = 0; | 124 virtual void quitMessageLoopOnPause() = 0; |
123 | 125 |
124 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&)
; | 126 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&)
; |
125 void handleProgramBreak(ScriptState* pausedScriptState, v8::Handle<v8::Objec
t> executionState, v8::Handle<v8::Value> exception, v8::Handle<v8::Array> hitBre
akpoints, bool isPromiseRejection = false); | 127 void handleProgramBreak(ScriptState* pausedScriptState, v8::Handle<v8::Objec
t> executionState, v8::Handle<v8::Value> exception, v8::Handle<v8::Array> hitBre
akpoints, bool isPromiseRejection = false); |
126 | 128 |
127 static void v8DebugEventCallback(const v8::Debug::EventDetails& eventDetails
); | 129 static void v8DebugEventCallback(const v8::Debug::EventDetails& eventDetails
); |
128 void handleV8DebugEvent(const v8::Debug::EventDetails& eventDetails); | 130 void handleV8DebugEvent(const v8::Debug::EventDetails& eventDetails); |
(...skipping 27 matching lines...) Expand all Loading... |
156 | 158 |
157 void handleV8PromiseEvent(ScriptDebugListener*, ScriptState* pausedScriptSta
te, v8::Handle<v8::Object> executionState, v8::Handle<v8::Object> eventData); | 159 void handleV8PromiseEvent(ScriptDebugListener*, ScriptState* pausedScriptSta
te, v8::Handle<v8::Object> executionState, v8::Handle<v8::Object> eventData); |
158 | 160 |
159 bool m_runningNestedMessageLoop; | 161 bool m_runningNestedMessageLoop; |
160 }; | 162 }; |
161 | 163 |
162 } // namespace blink | 164 } // namespace blink |
163 | 165 |
164 | 166 |
165 #endif // ScriptDebugServer_h | 167 #endif // ScriptDebugServer_h |
OLD | NEW |