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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 class CORE_EXPORT ScriptDebugServer : public NoBaseWillBeGarbageCollectedFinaliz
ed<ScriptDebugServer> { | 50 class CORE_EXPORT ScriptDebugServer : public NoBaseWillBeGarbageCollectedFinaliz
ed<ScriptDebugServer> { |
51 WTF_MAKE_NONCOPYABLE(ScriptDebugServer); | 51 WTF_MAKE_NONCOPYABLE(ScriptDebugServer); |
52 public: | 52 public: |
53 virtual ~ScriptDebugServer(); | 53 virtual ~ScriptDebugServer(); |
54 DECLARE_VIRTUAL_TRACE(); | 54 DECLARE_VIRTUAL_TRACE(); |
55 | 55 |
56 class Client { | 56 class Client { |
57 public: | 57 public: |
58 virtual ~Client() { } | 58 virtual ~Client() { } |
59 virtual v8::Local<v8::Object> compileDebuggerScript() = 0; | 59 virtual v8::Local<v8::Object> compileDebuggerScript() = 0; |
| 60 virtual ScriptDebugListener* getDebugListenerForContext(v8::Local<v8::Co
ntext>) = 0; |
| 61 virtual void runMessageLoopOnPause(v8::Local<v8::Context>) = 0; |
| 62 virtual void quitMessageLoopOnPause() = 0; |
60 }; | 63 }; |
61 | 64 |
62 void enable(); | 65 void enable(); |
63 void disable(); | 66 void disable(); |
64 bool enabled() const; | 67 bool enabled() const; |
65 | 68 |
66 static void setContextDebugData(v8::Local<v8::Context>, const String& contex
tDebugData); | 69 static void setContextDebugData(v8::Local<v8::Context>, const String& contex
tDebugData); |
67 // Each script inherits debug data from v8::Context where it has been compil
ed. | 70 // Each script inherits debug data from v8::Context where it has been compil
ed. |
68 // Only scripts whose debug data contains |contextDebugDataSubstring| substr
ing will be reported. | 71 // Only scripts whose debug data contains |contextDebugDataSubstring| substr
ing will be reported. |
69 // Passing empty string will result in reporting all scripts. | 72 // Passing empty string will result in reporting all scripts. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 114 |
112 bool isPaused(); | 115 bool isPaused(); |
113 | 116 |
114 v8::Local<v8::Value> functionScopes(v8::Local<v8::Function>); | 117 v8::Local<v8::Value> functionScopes(v8::Local<v8::Function>); |
115 v8::Local<v8::Value> generatorObjectDetails(v8::Local<v8::Object>&); | 118 v8::Local<v8::Value> generatorObjectDetails(v8::Local<v8::Object>&); |
116 v8::Local<v8::Value> collectionEntries(v8::Local<v8::Object>&); | 119 v8::Local<v8::Value> collectionEntries(v8::Local<v8::Object>&); |
117 v8::Local<v8::Value> getInternalProperties(v8::Local<v8::Object>&); | 120 v8::Local<v8::Value> getInternalProperties(v8::Local<v8::Object>&); |
118 v8::MaybeLocal<v8::Value> setFunctionVariableValue(v8::Local<v8::Value> func
tionValue, int scopeNumber, const String& variableName, v8::Local<v8::Value> new
Value); | 121 v8::MaybeLocal<v8::Value> setFunctionVariableValue(v8::Local<v8::Value> func
tionValue, int scopeNumber, const String& variableName, v8::Local<v8::Value> new
Value); |
119 | 122 |
120 v8::Isolate* isolate() const { return m_isolate; } | 123 v8::Isolate* isolate() const { return m_isolate; } |
121 | 124 explicit ScriptDebugServer(v8::Isolate*, Client*); |
122 protected: | |
123 ScriptDebugServer(v8::Isolate*, PassOwnPtr<Client>); | |
124 | |
125 virtual ScriptDebugListener* getDebugListenerForContext(v8::Local<v8::Contex
t>) = 0; | |
126 virtual void runMessageLoopOnPause(v8::Local<v8::Context>) = 0; | |
127 virtual void quitMessageLoopOnPause() = 0; | |
128 | 125 |
129 private: | 126 private: |
130 void compileDebuggerScript(); | 127 void compileDebuggerScript(); |
131 v8::MaybeLocal<v8::Value> callDebuggerMethod(const char* functionName, int a
rgc, v8::Local<v8::Value> argv[]); | 128 v8::MaybeLocal<v8::Value> callDebuggerMethod(const char* functionName, int a
rgc, v8::Local<v8::Value> argv[]); |
132 v8::Local<v8::Object> debuggerScriptLocal() const; | 129 v8::Local<v8::Object> debuggerScriptLocal() const; |
133 v8::Local<v8::Context> debuggerContext() const; | 130 v8::Local<v8::Context> debuggerContext() const; |
134 void clearBreakpoints(); | 131 void clearBreakpoints(); |
135 | 132 |
136 void dispatchDidParseSource(ScriptDebugListener*, v8::Local<v8::Object> sour
ceObject, CompileResult); | 133 void dispatchDidParseSource(ScriptDebugListener*, v8::Local<v8::Object> sour
ceObject, CompileResult); |
137 | 134 |
(...skipping 10 matching lines...) Expand all Loading... |
148 AllScopes, | 145 AllScopes, |
149 FastAsyncScopes, | 146 FastAsyncScopes, |
150 NoScopes // Should be the last option. | 147 NoScopes // Should be the last option. |
151 }; | 148 }; |
152 ScriptValue currentCallFramesInner(ScopeInfoDetails); | 149 ScriptValue currentCallFramesInner(ScopeInfoDetails); |
153 PassRefPtrWillBeRawPtr<JavaScriptCallFrame> wrapCallFrames(int maximumLimit,
ScopeInfoDetails); | 150 PassRefPtrWillBeRawPtr<JavaScriptCallFrame> wrapCallFrames(int maximumLimit,
ScopeInfoDetails); |
154 void handleV8AsyncTaskEvent(ScriptDebugListener*, ScriptState* pausedScriptS
tate, v8::Local<v8::Object> executionState, v8::Local<v8::Object> eventData); | 151 void handleV8AsyncTaskEvent(ScriptDebugListener*, ScriptState* pausedScriptS
tate, v8::Local<v8::Object> executionState, v8::Local<v8::Object> eventData); |
155 void handleV8PromiseEvent(ScriptDebugListener*, ScriptState* pausedScriptSta
te, v8::Local<v8::Object> executionState, v8::Local<v8::Object> eventData); | 152 void handleV8PromiseEvent(ScriptDebugListener*, ScriptState* pausedScriptSta
te, v8::Local<v8::Object> executionState, v8::Local<v8::Object> eventData); |
156 | 153 |
157 v8::Isolate* m_isolate; | 154 v8::Isolate* m_isolate; |
158 OwnPtr<Client> m_client; | 155 Client* m_client; |
159 bool m_breakpointsActivated; | 156 bool m_breakpointsActivated; |
160 v8::UniquePersistent<v8::FunctionTemplate> m_breakProgramCallbackTemplate; | 157 v8::UniquePersistent<v8::FunctionTemplate> m_breakProgramCallbackTemplate; |
161 v8::UniquePersistent<v8::Object> m_debuggerScript; | 158 v8::UniquePersistent<v8::Object> m_debuggerScript; |
162 v8::UniquePersistent<v8::Context> m_debuggerContext; | 159 v8::UniquePersistent<v8::Context> m_debuggerContext; |
163 v8::Local<v8::Object> m_executionState; | 160 v8::Local<v8::Object> m_executionState; |
164 RefPtr<ScriptState> m_pausedScriptState; | 161 RefPtr<ScriptState> m_pausedScriptState; |
165 bool m_runningNestedMessageLoop; | 162 bool m_runningNestedMessageLoop; |
166 class ThreadSafeTaskQueue; | 163 class ThreadSafeTaskQueue; |
167 OwnPtr<ThreadSafeTaskQueue> m_taskQueue; | 164 OwnPtr<ThreadSafeTaskQueue> m_taskQueue; |
168 }; | 165 }; |
169 | 166 |
170 } // namespace blink | 167 } // namespace blink |
171 | 168 |
172 | 169 |
173 #endif // ScriptDebugServer_h | 170 #endif // ScriptDebugServer_h |
OLD | NEW |