OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8DebuggerAgentImpl_h | 5 #ifndef V8DebuggerAgentImpl_h |
6 #define V8DebuggerAgentImpl_h | 6 #define V8DebuggerAgentImpl_h |
7 | 7 |
8 #include "platform/inspector_protocol/Collections.h" | 8 #include "platform/inspector_protocol/Collections.h" |
9 #include "platform/inspector_protocol/Dispatcher.h" | 9 #include "platform/inspector_protocol/Dispatcher.h" |
10 #include "platform/inspector_protocol/Frontend.h" | 10 #include "platform/inspector_protocol/Frontend.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 const Maybe<bool>& generatePreview, | 125 const Maybe<bool>& generatePreview, |
126 OwnPtr<protocol::Runtime::RemoteObject>* result, | 126 OwnPtr<protocol::Runtime::RemoteObject>* result, |
127 Maybe<bool>* wasThrown, | 127 Maybe<bool>* wasThrown, |
128 Maybe<protocol::Runtime::ExceptionDetails>*) override; | 128 Maybe<protocol::Runtime::ExceptionDetails>*) override; |
129 void setVariableValue(ErrorString*, | 129 void setVariableValue(ErrorString*, |
130 int scopeNumber, | 130 int scopeNumber, |
131 const String16& variableName, | 131 const String16& variableName, |
132 PassOwnPtr<protocol::Runtime::CallArgument> newValue, | 132 PassOwnPtr<protocol::Runtime::CallArgument> newValue, |
133 const String16& callFrame) override; | 133 const String16& callFrame) override; |
134 void setAsyncCallStackDepth(ErrorString*, int depth) override; | 134 void setAsyncCallStackDepth(ErrorString*, int depth) override; |
135 void enablePromiseTracker(ErrorString*, | |
136 const Maybe<bool>& captureStacks) override; | |
137 void disablePromiseTracker(ErrorString*) override; | |
138 void getPromiseById(ErrorString*, | |
139 int promiseId, | |
140 const Maybe<String16>& objectGroup, | |
141 OwnPtr<protocol::Runtime::RemoteObject>* promise) override; | |
142 void flushAsyncOperationEvents(ErrorString*) override; | 135 void flushAsyncOperationEvents(ErrorString*) override; |
143 void setAsyncOperationBreakpoint(ErrorString*, int operationId) override; | 136 void setAsyncOperationBreakpoint(ErrorString*, int operationId) override; |
144 void removeAsyncOperationBreakpoint(ErrorString*, int operationId) override; | 137 void removeAsyncOperationBreakpoint(ErrorString*, int operationId) override; |
145 void setBlackboxedRanges(ErrorString*, | 138 void setBlackboxedRanges(ErrorString*, |
146 const String16& scriptId, | 139 const String16& scriptId, |
147 PassOwnPtr<protocol::Array<protocol::Debugger::ScriptPosition>> position
s) override; | 140 PassOwnPtr<protocol::Array<protocol::Debugger::ScriptPosition>> position
s) override; |
148 | 141 |
149 void schedulePauseOnNextStatement(const String16& breakReason, PassOwnPtr<pr
otocol::DictionaryValue> data) override; | 142 void schedulePauseOnNextStatement(const String16& breakReason, PassOwnPtr<pr
otocol::DictionaryValue> data) override; |
150 void cancelPauseOnNextStatement() override; | 143 void cancelPauseOnNextStatement() override; |
151 bool canBreakProgram() override; | 144 bool canBreakProgram() override; |
152 void breakProgram(const String16& breakReason, PassOwnPtr<protocol::Dictiona
ryValue> data) override; | 145 void breakProgram(const String16& breakReason, PassOwnPtr<protocol::Dictiona
ryValue> data) override; |
153 void breakProgramOnException(const String16& breakReason, PassOwnPtr<protoco
l::DictionaryValue> data) override; | 146 void breakProgramOnException(const String16& breakReason, PassOwnPtr<protoco
l::DictionaryValue> data) override; |
154 void willExecuteScript(int scriptId) override; | 147 void willExecuteScript(int scriptId) override; |
155 void didExecuteScript() override; | 148 void didExecuteScript() override; |
156 | 149 |
157 bool enabled() override; | 150 bool enabled() override; |
158 V8DebuggerImpl& debugger() override { return *m_debugger; } | 151 V8DebuggerImpl& debugger() override { return *m_debugger; } |
159 | 152 |
160 void setBreakpointAt(const String16& scriptId, int lineNumber, int columnNum
ber, BreakpointSource, const String16& condition = String16()); | 153 void setBreakpointAt(const String16& scriptId, int lineNumber, int columnNum
ber, BreakpointSource, const String16& condition = String16()); |
161 void removeBreakpointAt(const String16& scriptId, int lineNumber, int column
Number, BreakpointSource); | 154 void removeBreakpointAt(const String16& scriptId, int lineNumber, int column
Number, BreakpointSource); |
162 | 155 |
163 // Async call stacks implementation | 156 // Async call stacks implementation |
164 int traceAsyncOperationStarting(const String16& description) override; | 157 int traceAsyncOperationStarting(const String16& description) override; |
165 void traceAsyncCallbackStarting(int operationId) override; | 158 void traceAsyncCallbackStarting(int operationId) override; |
166 void traceAsyncCallbackCompleted() override; | 159 void traceAsyncCallbackCompleted() override; |
167 void traceAsyncOperationCompleted(int operationId) override; | 160 void traceAsyncOperationCompleted(int operationId) override; |
168 bool trackingAsyncCalls() const override { return m_maxAsyncCallStackDepth;
} | 161 bool trackingAsyncCalls() const override { return m_maxAsyncCallStackDepth;
} |
169 | 162 |
170 void didUpdatePromise(const String16& eventType, PassOwnPtr<protocol::Debugg
er::PromiseDetails>); | |
171 void reset(); | 163 void reset(); |
172 | 164 |
173 // Interface for V8DebuggerImpl | 165 // Interface for V8DebuggerImpl |
174 SkipPauseRequest didPause(v8::Local<v8::Context>, PassOwnPtr<JavaScriptCallF
rame> callFrames, v8::Local<v8::Value> exception, const protocol::Vector<String1
6>& hitBreakpoints, bool isPromiseRejection); | 166 SkipPauseRequest didPause(v8::Local<v8::Context>, PassOwnPtr<JavaScriptCallF
rame> callFrames, v8::Local<v8::Value> exception, const protocol::Vector<String1
6>& hitBreakpoints, bool isPromiseRejection); |
175 void didContinue(); | 167 void didContinue(); |
176 void didParseSource(const V8DebuggerParsedScript&); | 168 void didParseSource(const V8DebuggerParsedScript&); |
177 bool v8AsyncTaskEventsEnabled() const; | 169 bool v8AsyncTaskEventsEnabled() const; |
178 void didReceiveV8AsyncTaskEvent(v8::Local<v8::Context>, const String16& even
tType, const String16& eventName, int id); | 170 void didReceiveV8AsyncTaskEvent(v8::Local<v8::Context>, const String16& even
tType, const String16& eventName, int id); |
179 bool v8PromiseEventsEnabled() const; | |
180 void didReceiveV8PromiseEvent(v8::Local<v8::Context>, v8::Local<v8::Object>
promise, v8::Local<v8::Value> parentPromise, int status); | |
181 | 171 |
182 v8::Isolate* isolate() { return m_isolate; } | 172 v8::Isolate* isolate() { return m_isolate; } |
183 int maxAsyncCallChainDepth() { return m_maxAsyncCallStackDepth; } | 173 int maxAsyncCallChainDepth() { return m_maxAsyncCallStackDepth; } |
184 V8StackTraceImpl* currentAsyncCallChain(); | 174 V8StackTraceImpl* currentAsyncCallChain(); |
185 | 175 |
186 private: | 176 private: |
187 bool checkEnabled(ErrorString*); | 177 bool checkEnabled(ErrorString*); |
188 void enable(); | 178 void enable(); |
189 | 179 |
190 SkipPauseRequest shouldSkipExceptionPause(); | 180 SkipPauseRequest shouldSkipExceptionPause(); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 bool m_pausingOnNativeEvent; | 239 bool m_pausingOnNativeEvent; |
250 bool m_pausingOnAsyncOperation; | 240 bool m_pausingOnAsyncOperation; |
251 | 241 |
252 int m_skippedStepFrameCount; | 242 int m_skippedStepFrameCount; |
253 int m_recursionLevelForStepOut; | 243 int m_recursionLevelForStepOut; |
254 int m_recursionLevelForStepFrame; | 244 int m_recursionLevelForStepFrame; |
255 bool m_skipAllPauses; | 245 bool m_skipAllPauses; |
256 | 246 |
257 // This field must be destroyed before the listeners set above. | 247 // This field must be destroyed before the listeners set above. |
258 OwnPtr<V8AsyncCallTracker> m_v8AsyncCallTracker; | 248 OwnPtr<V8AsyncCallTracker> m_v8AsyncCallTracker; |
259 OwnPtr<PromiseTracker> m_promiseTracker; | |
260 | 249 |
261 using AsyncOperationIdToStackTrace = protocol::HashMap<int, OwnPtr<V8StackTr
aceImpl>>; | 250 using AsyncOperationIdToStackTrace = protocol::HashMap<int, OwnPtr<V8StackTr
aceImpl>>; |
262 AsyncOperationIdToStackTrace m_asyncOperations; | 251 AsyncOperationIdToStackTrace m_asyncOperations; |
263 int m_lastAsyncOperationId; | 252 int m_lastAsyncOperationId; |
264 protocol::HashSet<int> m_asyncOperationNotifications; | 253 protocol::HashSet<int> m_asyncOperationNotifications; |
265 protocol::HashSet<int> m_asyncOperationBreakpoints; | 254 protocol::HashSet<int> m_asyncOperationBreakpoints; |
266 protocol::HashSet<int> m_pausingAsyncOperations; | 255 protocol::HashSet<int> m_pausingAsyncOperations; |
267 int m_maxAsyncCallStackDepth; | 256 int m_maxAsyncCallStackDepth; |
268 OwnPtr<V8StackTraceImpl> m_currentAsyncCallChain; | 257 OwnPtr<V8StackTraceImpl> m_currentAsyncCallChain; |
269 unsigned m_nestedAsyncCallCount; | 258 unsigned m_nestedAsyncCallCount; |
270 int m_currentAsyncOperationId; | 259 int m_currentAsyncOperationId; |
271 bool m_pendingTraceAsyncOperationCompleted; | 260 bool m_pendingTraceAsyncOperationCompleted; |
272 bool m_startingStepIntoAsync; | 261 bool m_startingStepIntoAsync; |
273 protocol::HashMap<String16, protocol::Vector<std::pair<int, int>>> m_blackbo
xedPositions; | 262 protocol::HashMap<String16, protocol::Vector<std::pair<int, int>>> m_blackbo
xedPositions; |
274 }; | 263 }; |
275 | 264 |
276 } // namespace blink | 265 } // namespace blink |
277 | 266 |
278 | 267 |
279 #endif // V8DebuggerAgentImpl_h | 268 #endif // V8DebuggerAgentImpl_h |
OLD | NEW |