Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: Source/core/inspector/InspectorDebuggerAgent.h

Issue 855383002: DevTools: use async operation id instead of AsyncCallChain (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comments Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 static const int unknownAsyncOperationId;
176 void traceAsyncCallbackStarting(v8::Isolate*, PassRefPtrWillBeRawPtr<AsyncCa llChain>); 177 int traceAsyncOperationStarting(const String& description);
178 void traceAsyncCallbackStarting(v8::Isolate*, int operationId);
177 const AsyncCallChain* currentAsyncCallChain() const; 179 const AsyncCallChain* currentAsyncCallChain() const;
178 void traceAsyncCallbackCompleted(); 180 void traceAsyncCallbackCompleted();
179 void traceAsyncOperationCompleted(AsyncCallChain*); 181 void traceAsyncOperationCompleted(int operationId);
180 bool trackingAsyncCalls() const { return m_maxAsyncCallStackDepth; } 182 bool trackingAsyncCalls() const { return m_maxAsyncCallStackDepth; }
181 183
182 class AsyncCallTrackingListener : public WillBeGarbageCollectedMixin { 184 class AsyncCallTrackingListener : public WillBeGarbageCollectedMixin {
183 public: 185 public:
184 virtual ~AsyncCallTrackingListener() { } 186 virtual ~AsyncCallTrackingListener() { }
185 virtual void trace(Visitor*) { } 187 virtual void trace(Visitor*) { }
186 virtual void asyncCallTrackingStateChanged(bool tracking) = 0; 188 virtual void asyncCallTrackingStateChanged(bool tracking) = 0;
187 virtual void resetAsyncCallChains() = 0; 189 virtual void resetAsyncCallChains() = 0;
188 }; 190 };
189 void addAsyncCallTrackingListener(AsyncCallTrackingListener*); 191 void addAsyncCallTrackingListener(AsyncCallTrackingListener*);
(...skipping 21 matching lines...) Expand all
211 SkipPauseRequest shouldSkipStepPause(); 213 SkipPauseRequest shouldSkipStepPause();
212 214
213 void schedulePauseOnNextStatementIfSteppingInto(); 215 void schedulePauseOnNextStatementIfSteppingInto();
214 void cancelPauseOnNextStatement(); 216 void cancelPauseOnNextStatement();
215 void addMessageToConsole(MessageSource, MessageType); 217 void addMessageToConsole(MessageSource, MessageType);
216 218
217 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCal lFrames(); 219 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCal lFrames();
218 PassRefPtr<TypeBuilder::Debugger::StackTrace> currentAsyncStackTrace(); 220 PassRefPtr<TypeBuilder::Debugger::StackTrace> currentAsyncStackTrace();
219 221
220 void resetAsyncCallTracker(); 222 void resetAsyncCallTracker();
221 void didCreateAsyncCallChain(AsyncCallChain*);
222 223
223 void changeJavaScriptRecursionLevel(int step); 224 void changeJavaScriptRecursionLevel(int step);
224 225
225 void didParseSource(const String& scriptId, const Script&, CompileResult) fi nal; 226 void didParseSource(const String& scriptId, const Script&, CompileResult) fi nal;
226 bool v8AsyncTaskEventsEnabled() const final; 227 bool v8AsyncTaskEventsEnabled() const final;
227 void didReceiveV8AsyncTaskEvent(ScriptState*, const String& eventType, const String& eventName, int id) final; 228 void didReceiveV8AsyncTaskEvent(ScriptState*, const String& eventType, const String& eventName, int id) final;
228 bool v8PromiseEventsEnabled() const final; 229 bool v8PromiseEventsEnabled() const final;
229 void didReceiveV8PromiseEvent(ScriptState*, v8::Local<v8::Object> promise, v 8::Local<v8::Value> parentPromise, int status) final; 230 void didReceiveV8PromiseEvent(ScriptState*, v8::Local<v8::Object> promise, v 8::Local<v8::Value> parentPromise, int status) final;
230 231
231 void setPauseOnExceptionsImpl(ErrorString*, int); 232 void setPauseOnExceptionsImpl(ErrorString*, int);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 int m_skippedStepFrameCount; 280 int m_skippedStepFrameCount;
280 int m_recursionLevelForStepOut; 281 int m_recursionLevelForStepOut;
281 int m_recursionLevelForStepFrame; 282 int m_recursionLevelForStepFrame;
282 bool m_skipAllPauses; 283 bool m_skipAllPauses;
283 bool m_skipContentScripts; 284 bool m_skipContentScripts;
284 OwnPtr<ScriptRegexp> m_cachedSkipStackRegExp; 285 OwnPtr<ScriptRegexp> m_cachedSkipStackRegExp;
285 unsigned m_cachedSkipStackGeneration; 286 unsigned m_cachedSkipStackGeneration;
286 OwnPtrWillBeMember<V8AsyncCallTracker> m_v8AsyncCallTracker; 287 OwnPtrWillBeMember<V8AsyncCallTracker> m_v8AsyncCallTracker;
287 OwnPtrWillBeMember<PromiseTracker> m_promiseTracker; 288 OwnPtrWillBeMember<PromiseTracker> m_promiseTracker;
288 289
289 WillBeHeapHashSet<RefPtrWillBeMember<AsyncCallChain> > m_asyncOperationsForS tepInto; 290 using AsyncOperationIdToAsyncCallChain = WillBeHeapHashMap<int, RefPtrWillBe Member<AsyncCallChain>>;
291 AsyncOperationIdToAsyncCallChain m_asyncOperations;
292 int m_lastAsyncOperationId;
293 WillBeHeapHashSet<int> m_asyncOperationsForStepInto;
290 unsigned m_maxAsyncCallStackDepth; 294 unsigned m_maxAsyncCallStackDepth;
291 RefPtrWillBeMember<AsyncCallChain> m_currentAsyncCallChain; 295 RefPtrWillBeMember<AsyncCallChain> m_currentAsyncCallChain;
292 unsigned m_nestedAsyncCallCount; 296 unsigned m_nestedAsyncCallCount;
293 bool m_performingAsyncStepIn; 297 bool m_performingAsyncStepIn;
294 WillBeHeapVector<RawPtrWillBeMember<AsyncCallTrackingListener>> m_asyncCallT rackingListeners; 298 WillBeHeapVector<RawPtrWillBeMember<AsyncCallTrackingListener>> m_asyncCallT rackingListeners;
295 }; 299 };
296 300
297 } // namespace blink 301 } // namespace blink
298 302
299 303
300 #endif // InspectorDebuggerAgent_h 304 #endif // InspectorDebuggerAgent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698