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 "bindings/core/v8/ScriptState.h" | 8 #include "bindings/core/v8/ScriptState.h" |
9 #include "bindings/core/v8/ScriptValue.h" | 9 #include "bindings/core/v8/ScriptValue.h" |
10 #include "core/CoreExport.h" | 10 #include "core/CoreExport.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 class JSONObject; | 33 class JSONObject; |
34 class RemoteCallFrameId; | 34 class RemoteCallFrameId; |
35 class ScriptAsyncCallStack; | 35 class ScriptAsyncCallStack; |
36 class ScriptRegexp; | 36 class ScriptRegexp; |
37 class V8AsyncCallTracker; | 37 class V8AsyncCallTracker; |
38 class V8Debugger; | 38 class V8Debugger; |
39 | 39 |
40 typedef String ErrorString; | 40 typedef String ErrorString; |
41 | 41 |
42 class CORE_EXPORT V8DebuggerAgentImpl | 42 class CORE_EXPORT V8DebuggerAgentImpl |
43 : public NoBaseWillBeGarbageCollectedFinalized<V8DebuggerAgentImpl> | 43 : public V8DebuggerAgent |
44 , public V8DebuggerAgent | |
45 , public V8DebuggerListener | 44 , public V8DebuggerListener |
46 , public InspectorBackendDispatcher::DebuggerCommandHandler | 45 , public InspectorBackendDispatcher::DebuggerCommandHandler |
47 , public PromiseTracker::Listener { | 46 , public PromiseTracker::Listener { |
48 WTF_MAKE_NONCOPYABLE(V8DebuggerAgentImpl); | 47 WTF_MAKE_NONCOPYABLE(V8DebuggerAgentImpl); |
49 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(V8DebuggerAgentImpl); | 48 WTF_MAKE_FAST_ALLOCATED(V8DebuggerAgentImpl); |
50 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(V8DebuggerAgentImpl); | |
51 public: | 49 public: |
52 V8DebuggerAgentImpl(InjectedScriptManager*, V8Debugger*, V8DebuggerAgent::Cl ient*, int contextGroupId); | 50 V8DebuggerAgentImpl(InjectedScriptManager*, V8Debugger*, V8DebuggerAgent::Cl ient*, int contextGroupId); |
53 ~V8DebuggerAgentImpl() override; | 51 ~V8DebuggerAgentImpl() override; |
54 DECLARE_TRACE(); | 52 DECLARE_TRACE(); |
55 | 53 |
56 void setInspectorState(InspectorState* state) override { m_state = state; } | 54 void setInspectorState(InspectorState* state) override { m_state = state; } |
57 void setFrontend(InspectorFrontend::Debugger* frontend) override { m_fronten d = frontend; } | 55 void setFrontend(InspectorFrontend::Debugger* frontend) override { m_fronten d = frontend; } |
58 void clearFrontend() override; | 56 void clearFrontend() override; |
59 void restore() override; | 57 void restore() override; |
60 void disable(ErrorString*) final; | 58 void disable(ErrorString*) final; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
187 typedef HashMap<String, Vector<String>> BreakpointIdToDebuggerBreakpointIdsM ap; | 185 typedef HashMap<String, Vector<String>> BreakpointIdToDebuggerBreakpointIdsM ap; |
188 typedef HashMap<String, std::pair<String, BreakpointSource>> DebugServerBrea kpointToBreakpointIdAndSourceMap; | 186 typedef HashMap<String, std::pair<String, BreakpointSource>> DebugServerBrea kpointToBreakpointIdAndSourceMap; |
189 | 187 |
190 enum DebuggerStep { | 188 enum DebuggerStep { |
191 NoStep = 0, | 189 NoStep = 0, |
192 StepInto, | 190 StepInto, |
193 StepOver, | 191 StepOver, |
194 StepOut | 192 StepOut |
195 }; | 193 }; |
196 | 194 |
197 RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager; | 195 RawPtrWillBePersistent<InjectedScriptManager> m_injectedScriptManager; |
sof
2015/09/29 13:03:05
This needs to be a WeakPersistent<> so as to avoid
| |
198 V8Debugger* m_debugger; | 196 V8Debugger* m_debugger; |
199 V8DebuggerAgent::Client* m_client; | 197 V8DebuggerAgent::Client* m_client; |
200 int m_contextGroupId; | 198 int m_contextGroupId; |
201 InspectorState* m_state; | 199 InspectorState* m_state; |
202 InspectorFrontend::Debugger* m_frontend; | 200 InspectorFrontend::Debugger* m_frontend; |
203 v8::Isolate* m_isolate; | 201 v8::Isolate* m_isolate; |
204 RefPtr<ScriptState> m_pausedScriptState; | 202 RefPtr<ScriptState> m_pausedScriptState; |
205 v8::Global<v8::Object> m_currentCallStack; | 203 v8::Global<v8::Object> m_currentCallStack; |
206 ScriptsMap m_scripts; | 204 ScriptsMap m_scripts; |
207 BreakpointIdToDebuggerBreakpointIdsMap m_breakpointIdToDebuggerBreakpointIds ; | 205 BreakpointIdToDebuggerBreakpointIdsMap m_breakpointIdToDebuggerBreakpointIds ; |
208 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; | 206 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; |
209 String m_continueToLocationBreakpointId; | 207 String m_continueToLocationBreakpointId; |
210 InspectorFrontend::Debugger::Reason::Enum m_breakReason; | 208 InspectorFrontend::Debugger::Reason::Enum m_breakReason; |
211 RefPtr<JSONObject> m_breakAuxData; | 209 RefPtr<JSONObject> m_breakAuxData; |
212 DebuggerStep m_scheduledDebuggerStep; | 210 DebuggerStep m_scheduledDebuggerStep; |
213 bool m_skipNextDebuggerStepOut; | 211 bool m_skipNextDebuggerStepOut; |
214 bool m_javaScriptPauseScheduled; | 212 bool m_javaScriptPauseScheduled; |
215 bool m_steppingFromFramework; | 213 bool m_steppingFromFramework; |
216 bool m_pausingOnNativeEvent; | 214 bool m_pausingOnNativeEvent; |
217 bool m_pausingOnAsyncOperation; | 215 bool m_pausingOnAsyncOperation; |
218 | 216 |
219 int m_skippedStepFrameCount; | 217 int m_skippedStepFrameCount; |
220 int m_recursionLevelForStepOut; | 218 int m_recursionLevelForStepOut; |
221 int m_recursionLevelForStepFrame; | 219 int m_recursionLevelForStepFrame; |
222 bool m_skipAllPauses; | 220 bool m_skipAllPauses; |
223 bool m_skipContentScripts; | 221 bool m_skipContentScripts; |
224 OwnPtr<ScriptRegexp> m_cachedSkipStackRegExp; | 222 OwnPtr<ScriptRegexp> m_cachedSkipStackRegExp; |
225 unsigned m_cachedSkipStackGeneration; | 223 unsigned m_cachedSkipStackGeneration; |
226 // This field must be destroyed before the listeners set above. | 224 // This field must be destroyed before the listeners set above. |
227 OwnPtrWillBeMember<V8AsyncCallTracker> m_v8AsyncCallTracker; | 225 OwnPtrWillBePersistent<V8AsyncCallTracker> m_v8AsyncCallTracker; |
228 OwnPtrWillBeMember<PromiseTracker> m_promiseTracker; | 226 OwnPtr<PromiseTracker> m_promiseTracker; |
229 | 227 |
230 using AsyncOperationIdToAsyncCallChain = WillBeHeapHashMap<int, RefPtrWillBe Member<AsyncCallChain>>; | 228 using AsyncOperationIdToAsyncCallChain = HashMap<int, RefPtr<AsyncCallChain> >; |
231 AsyncOperationIdToAsyncCallChain m_asyncOperations; | 229 AsyncOperationIdToAsyncCallChain m_asyncOperations; |
232 int m_lastAsyncOperationId; | 230 int m_lastAsyncOperationId; |
233 ListHashSet<int> m_asyncOperationNotifications; | 231 ListHashSet<int> m_asyncOperationNotifications; |
234 HashSet<int> m_asyncOperationBreakpoints; | 232 HashSet<int> m_asyncOperationBreakpoints; |
235 HashSet<int> m_pausingAsyncOperations; | 233 HashSet<int> m_pausingAsyncOperations; |
236 unsigned m_maxAsyncCallStackDepth; | 234 unsigned m_maxAsyncCallStackDepth; |
237 RefPtrWillBeMember<AsyncCallChain> m_currentAsyncCallChain; | 235 RefPtr<AsyncCallChain> m_currentAsyncCallChain; |
238 unsigned m_nestedAsyncCallCount; | 236 unsigned m_nestedAsyncCallCount; |
239 int m_currentAsyncOperationId; | 237 int m_currentAsyncOperationId; |
240 bool m_pendingTraceAsyncOperationCompleted; | 238 bool m_pendingTraceAsyncOperationCompleted; |
241 bool m_startingStepIntoAsync; | 239 bool m_startingStepIntoAsync; |
242 V8GlobalValueMap<String, v8::Script, v8::kNotWeak> m_compiledScripts; | 240 V8GlobalValueMap<String, v8::Script, v8::kNotWeak> m_compiledScripts; |
243 }; | 241 }; |
244 | 242 |
245 } // namespace blink | 243 } // namespace blink |
246 | 244 |
247 | 245 |
248 #endif // V8DebuggerAgentImpl_h | 246 #endif // V8DebuggerAgentImpl_h |
OLD | NEW |