OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2010-2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2010-2011 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "wtf/Forward.h" | 42 #include "wtf/Forward.h" |
43 #include "wtf/HashMap.h" | 43 #include "wtf/HashMap.h" |
44 #include "wtf/HashSet.h" | 44 #include "wtf/HashSet.h" |
45 #include "wtf/PassRefPtr.h" | 45 #include "wtf/PassRefPtr.h" |
46 #include "wtf/Vector.h" | 46 #include "wtf/Vector.h" |
47 #include "wtf/text/StringHash.h" | 47 #include "wtf/text/StringHash.h" |
48 | 48 |
49 namespace blink { | 49 namespace blink { |
50 | 50 |
51 class AsyncCallChain; | 51 class AsyncCallChain; |
| 52 class AsyncCallStack; |
52 class ConsoleMessage; | 53 class ConsoleMessage; |
53 class InjectedScript; | 54 class InjectedScript; |
54 class InjectedScriptManager; | 55 class InjectedScriptManager; |
55 class JavaScriptCallFrame; | 56 class JavaScriptCallFrame; |
56 class JSONObject; | 57 class JSONObject; |
57 class ScriptAsyncCallStack; | 58 class ScriptAsyncCallStack; |
58 class ScriptDebugServer; | 59 class ScriptDebugServer; |
59 class ScriptRegexp; | 60 class ScriptRegexp; |
60 class ScriptSourceCode; | 61 class ScriptSourceCode; |
61 class V8AsyncCallTracker; | 62 class V8AsyncCallTracker; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 166 |
166 bool enabled(); | 167 bool enabled(); |
167 | 168 |
168 virtual ScriptDebugServer& scriptDebugServer() = 0; | 169 virtual ScriptDebugServer& scriptDebugServer() = 0; |
169 | 170 |
170 void setBreakpoint(const String& scriptId, int lineNumber, int columnNumber,
BreakpointSource, const String& condition = String()); | 171 void setBreakpoint(const String& scriptId, int lineNumber, int columnNumber,
BreakpointSource, const String& condition = String()); |
171 void removeBreakpoint(const String& scriptId, int lineNumber, int columnNumb
er, BreakpointSource); | 172 void removeBreakpoint(const String& scriptId, int lineNumber, int columnNumb
er, BreakpointSource); |
172 | 173 |
173 // Async call stacks implementation | 174 // Async call stacks implementation |
174 PassRefPtrWillBeRawPtr<ScriptAsyncCallStack> currentAsyncStackTraceForConsol
e(); | 175 PassRefPtrWillBeRawPtr<ScriptAsyncCallStack> currentAsyncStackTraceForConsol
e(); |
175 PassRefPtrWillBeRawPtr<AsyncCallChain> traceAsyncOperationStarting(const Str
ing& description); | 176 int traceAsyncOperationStarting(const String& description); |
176 void traceAsyncCallbackStarting(v8::Isolate*, PassRefPtrWillBeRawPtr<AsyncCa
llChain>); | 177 void traceAsyncCallbackStarting(v8::Isolate*, int operationId); |
177 const AsyncCallChain* currentAsyncCallChain() const; | 178 const AsyncCallChain* currentAsyncCallChain() const; |
178 void traceAsyncCallbackCompleted(); | 179 void traceAsyncCallbackCompleted(); |
179 void traceAsyncOperationCompleted(AsyncCallChain*); | 180 void traceAsyncOperationCompleted(int operationId); |
180 bool trackingAsyncCalls() const { return m_maxAsyncCallStackDepth; } | 181 bool trackingAsyncCalls() const { return m_maxAsyncCallStackDepth; } |
181 | 182 |
182 class AsyncCallTrackingListener : public WillBeGarbageCollectedMixin { | 183 class AsyncCallTrackingListener : public WillBeGarbageCollectedMixin { |
183 public: | 184 public: |
184 virtual ~AsyncCallTrackingListener() { } | 185 virtual ~AsyncCallTrackingListener() { } |
185 virtual void trace(Visitor*) { } | 186 virtual void trace(Visitor*) { } |
186 virtual void asyncCallTrackingStateChanged(bool tracking) = 0; | 187 virtual void asyncCallTrackingStateChanged(bool tracking) = 0; |
187 virtual void resetAsyncCallChains() = 0; | 188 virtual void resetAsyncCallChains() = 0; |
188 }; | 189 }; |
189 void addAsyncCallTrackingListener(AsyncCallTrackingListener*); | 190 void addAsyncCallTrackingListener(AsyncCallTrackingListener*); |
(...skipping 22 matching lines...) Expand all Loading... |
212 bool isTopCallFrameInFramework(); | 213 bool isTopCallFrameInFramework(); |
213 | 214 |
214 void schedulePauseOnNextStatementIfSteppingInto(); | 215 void schedulePauseOnNextStatementIfSteppingInto(); |
215 void cancelPauseOnNextStatement(); | 216 void cancelPauseOnNextStatement(); |
216 void addMessageToConsole(MessageSource, MessageType); | 217 void addMessageToConsole(MessageSource, MessageType); |
217 | 218 |
218 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCal
lFrames(); | 219 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCal
lFrames(); |
219 PassRefPtr<TypeBuilder::Debugger::StackTrace> currentAsyncStackTrace(); | 220 PassRefPtr<TypeBuilder::Debugger::StackTrace> currentAsyncStackTrace(); |
220 | 221 |
221 void resetAsyncCallTracker(); | 222 void resetAsyncCallTracker(); |
| 223 int createAsyncCallChain(PassRefPtrWillBeRawPtr<AsyncCallStack>); |
222 void didCreateAsyncCallChain(AsyncCallChain*); | 224 void didCreateAsyncCallChain(AsyncCallChain*); |
223 | 225 |
224 void changeJavaScriptRecursionLevel(int step); | 226 void changeJavaScriptRecursionLevel(int step); |
225 | 227 |
226 void didParseSource(const String& scriptId, const Script&, CompileResult) fi
nal; | 228 void didParseSource(const String& scriptId, const Script&, CompileResult) fi
nal; |
227 bool v8AsyncTaskEventsEnabled() const final; | 229 bool v8AsyncTaskEventsEnabled() const final; |
228 void didReceiveV8AsyncTaskEvent(ScriptState*, const String& eventType, const
String& eventName, int id) final; | 230 void didReceiveV8AsyncTaskEvent(ScriptState*, const String& eventType, const
String& eventName, int id) final; |
229 bool v8PromiseEventsEnabled() const final; | 231 bool v8PromiseEventsEnabled() const final; |
230 void didReceiveV8PromiseEvent(ScriptState*, v8::Local<v8::Object> promise, v
8::Local<v8::Value> parentPromise, int status) final; | 232 void didReceiveV8PromiseEvent(ScriptState*, v8::Local<v8::Object> promise, v
8::Local<v8::Value> parentPromise, int status) final; |
231 | 233 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 int m_skippedStepFrameCount; | 281 int m_skippedStepFrameCount; |
280 int m_recursionLevelForStepOut; | 282 int m_recursionLevelForStepOut; |
281 int m_recursionLevelForStepFrame; | 283 int m_recursionLevelForStepFrame; |
282 bool m_skipAllPauses; | 284 bool m_skipAllPauses; |
283 bool m_skipContentScripts; | 285 bool m_skipContentScripts; |
284 OwnPtr<ScriptRegexp> m_cachedSkipStackRegExp; | 286 OwnPtr<ScriptRegexp> m_cachedSkipStackRegExp; |
285 unsigned m_cachedSkipStackGeneration; | 287 unsigned m_cachedSkipStackGeneration; |
286 OwnPtrWillBeMember<V8AsyncCallTracker> m_v8AsyncCallTracker; | 288 OwnPtrWillBeMember<V8AsyncCallTracker> m_v8AsyncCallTracker; |
287 OwnPtrWillBeMember<PromiseTracker> m_promiseTracker; | 289 OwnPtrWillBeMember<PromiseTracker> m_promiseTracker; |
288 | 290 |
| 291 using AsyncOperationIdToAsyncCallChain = WillBeHeapHashMap<int, RefPtrWillBe
Member<AsyncCallChain>>; |
| 292 AsyncOperationIdToAsyncCallChain m_asyncOperations; |
| 293 int m_nextAsyncOperationId; |
289 WillBeHeapHashSet<RefPtrWillBeMember<AsyncCallChain> > m_asyncOperationsForS
tepInto; | 294 WillBeHeapHashSet<RefPtrWillBeMember<AsyncCallChain> > m_asyncOperationsForS
tepInto; |
290 unsigned m_maxAsyncCallStackDepth; | 295 unsigned m_maxAsyncCallStackDepth; |
291 RefPtrWillBeMember<AsyncCallChain> m_currentAsyncCallChain; | 296 RefPtrWillBeMember<AsyncCallChain> m_currentAsyncCallChain; |
292 unsigned m_nestedAsyncCallCount; | 297 unsigned m_nestedAsyncCallCount; |
293 bool m_performingAsyncStepIn; | 298 bool m_performingAsyncStepIn; |
294 WillBeHeapVector<RawPtrWillBeMember<AsyncCallTrackingListener>> m_asyncCallT
rackingListeners; | 299 WillBeHeapVector<RawPtrWillBeMember<AsyncCallTrackingListener>> m_asyncCallT
rackingListeners; |
295 }; | 300 }; |
296 | 301 |
297 } // namespace blink | 302 } // namespace blink |
298 | 303 |
299 | 304 |
300 #endif // InspectorDebuggerAgent_h | 305 #endif // InspectorDebuggerAgent_h |
OLD | NEW |