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

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

Issue 74063002: DevTools: Support asynchronous call stacks on backend. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Async call stacks are off by default, added Debugger.enableAsyncCallStacks protocol command Created 7 years, 1 month 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 14 matching lines...) Expand all
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
29 29
30 #ifndef InspectorDebuggerAgent_h 30 #ifndef InspectorDebuggerAgent_h
31 #define InspectorDebuggerAgent_h 31 #define InspectorDebuggerAgent_h
32 32
33 #include "InspectorFrontend.h" 33 #include "InspectorFrontend.h"
34 #include "bindings/v8/ScriptState.h" 34 #include "bindings/v8/ScriptState.h"
35 #include "core/inspector/AsyncCallStackTracker.h"
35 #include "core/inspector/ConsoleAPITypes.h" 36 #include "core/inspector/ConsoleAPITypes.h"
36 #include "core/inspector/InjectedScript.h" 37 #include "core/inspector/InjectedScript.h"
37 #include "core/inspector/InspectorBaseAgent.h" 38 #include "core/inspector/InspectorBaseAgent.h"
38 #include "core/inspector/ScriptBreakpoint.h" 39 #include "core/inspector/ScriptBreakpoint.h"
39 #include "core/inspector/ScriptDebugListener.h" 40 #include "core/inspector/ScriptDebugListener.h"
40 #include "core/frame/ConsoleTypes.h" 41 #include "core/frame/ConsoleTypes.h"
41 #include "wtf/Forward.h" 42 #include "wtf/Forward.h"
42 #include "wtf/HashMap.h" 43 #include "wtf/HashMap.h"
43 #include "wtf/PassRefPtr.h" 44 #include "wtf/PassRefPtr.h"
44 #include "wtf/Vector.h" 45 #include "wtf/Vector.h"
45 #include "wtf/text/StringHash.h" 46 #include "wtf/text/StringHash.h"
46 47
47 namespace WebCore { 48 namespace WebCore {
48 49
50 class Document;
49 class InjectedScriptManager; 51 class InjectedScriptManager;
50 class InspectorFrontend; 52 class InspectorFrontend;
51 class InstrumentingAgents; 53 class InstrumentingAgents;
52 class JSONObject; 54 class JSONObject;
53 class ScriptArguments; 55 class ScriptArguments;
54 class ScriptCallStack; 56 class ScriptCallStack;
55 class ScriptDebugServer; 57 class ScriptDebugServer;
56 class ScriptSourceCode; 58 class ScriptSourceCode;
57 class ScriptValue; 59 class ScriptValue;
58 class RegularExpression; 60 class RegularExpression;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 const bool* doNotPauseOnExceptionsAndMuteConsole, 120 const bool* doNotPauseOnExceptionsAndMuteConsole,
119 const bool* returnByValue, 121 const bool* returnByValue,
120 const bool* generatePreview, 122 const bool* generatePreview,
121 RefPtr<TypeBuilder::Runtime::RemoteObject>& result, 123 RefPtr<TypeBuilder::Runtime::RemoteObject>& result,
122 TypeBuilder::OptOutput<bool>* wasThrown); 124 TypeBuilder::OptOutput<bool>* wasThrown);
123 void compileScript(ErrorString*, const String& expression, const String& sou rceURL, TypeBuilder::OptOutput<TypeBuilder::Debugger::ScriptId>*, TypeBuilder::O ptOutput<String>* syntaxErrorMessage); 125 void compileScript(ErrorString*, const String& expression, const String& sou rceURL, TypeBuilder::OptOutput<TypeBuilder::Debugger::ScriptId>*, TypeBuilder::O ptOutput<String>* syntaxErrorMessage);
124 void runScript(ErrorString*, const TypeBuilder::Debugger::ScriptId&, const i nt* executionContextId, const String* objectGroup, const bool* doNotPauseOnExcep tionsAndMuteConsole, RefPtr<TypeBuilder::Runtime::RemoteObject>& result, TypeBui lder::OptOutput<bool>* wasThrown); 126 void runScript(ErrorString*, const TypeBuilder::Debugger::ScriptId&, const i nt* executionContextId, const String* objectGroup, const bool* doNotPauseOnExcep tionsAndMuteConsole, RefPtr<TypeBuilder::Runtime::RemoteObject>& result, TypeBui lder::OptOutput<bool>* wasThrown);
125 virtual void setOverlayMessage(ErrorString*, const String*); 127 virtual void setOverlayMessage(ErrorString*, const String*);
126 virtual void setVariableValue(ErrorString*, int in_scopeNumber, const String & in_variableName, const RefPtr<JSONObject>& in_newValue, const String* in_callF rame, const String* in_functionObjectId); 128 virtual void setVariableValue(ErrorString*, int in_scopeNumber, const String & in_variableName, const RefPtr<JSONObject>& in_newValue, const String* in_callF rame, const String* in_functionObjectId);
127 virtual void skipStackFrames(ErrorString*, const String* pattern); 129 virtual void skipStackFrames(ErrorString*, const String* pattern);
130 virtual void enableAsyncCallStacks(ErrorString*, int depth);
128 131
129 void schedulePauseOnNextStatement(InspectorFrontend::Debugger::Reason::Enum breakReason, PassRefPtr<JSONObject> data); 132 void schedulePauseOnNextStatement(InspectorFrontend::Debugger::Reason::Enum breakReason, PassRefPtr<JSONObject> data);
133 void didInstallTimer(ExecutionContext*, int timerId, int timeout, bool singl eShot);
134 void didRemoveTimer(ExecutionContext*, int timerId);
135 bool willFireTimer(ExecutionContext*, int timerId);
130 void didFireTimer(); 136 void didFireTimer();
137 void didRequestAnimationFrame(Document*, int callbackId);
138 void didCancelAnimationFrame(Document*, int callbackId);
139 bool willFireAnimationFrame(Document*, int callbackId);
140 void didFireAnimationFrame();
131 void didHandleEvent(); 141 void didHandleEvent();
132 bool canBreakProgram(); 142 bool canBreakProgram();
133 void breakProgram(InspectorFrontend::Debugger::Reason::Enum breakReason, Pas sRefPtr<JSONObject> data); 143 void breakProgram(InspectorFrontend::Debugger::Reason::Enum breakReason, Pas sRefPtr<JSONObject> data);
134 virtual void scriptExecutionBlockedByCSP(const String& directiveText); 144 virtual void scriptExecutionBlockedByCSP(const String& directiveText);
135 145
136 class Listener { 146 class Listener {
137 public: 147 public:
138 virtual ~Listener() { } 148 virtual ~Listener() { }
139 virtual void debuggerWasEnabled() = 0; 149 virtual void debuggerWasEnabled() = 0;
140 virtual void debuggerWasDisabled() = 0; 150 virtual void debuggerWasDisabled() = 0;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 private: 182 private:
173 void cancelPauseOnNextStatement(); 183 void cancelPauseOnNextStatement();
174 void addMessageToConsole(MessageSource, MessageType); 184 void addMessageToConsole(MessageSource, MessageType);
175 185
176 bool enabled(); 186 bool enabled();
177 187
178 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCal lFrames(); 188 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCal lFrames();
179 189
180 virtual void didParseSource(const String& scriptId, const Script&); 190 virtual void didParseSource(const String& scriptId, const Script&);
181 virtual void failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage); 191 virtual void failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage);
192 virtual void didRequestAsyncCallFrames(ScriptValue callFrames);
182 193
183 void setPauseOnExceptionsImpl(ErrorString*, int); 194 void setPauseOnExceptionsImpl(ErrorString*, int);
184 195
185 PassRefPtr<TypeBuilder::Debugger::Location> resolveBreakpoint(const String& breakpointId, const String& scriptId, const ScriptBreakpoint&, BreakpointSource) ; 196 PassRefPtr<TypeBuilder::Debugger::Location> resolveBreakpoint(const String& breakpointId, const String& scriptId, const ScriptBreakpoint&, BreakpointSource) ;
186 void removeBreakpoint(const String& breakpointId); 197 void removeBreakpoint(const String& breakpointId);
187 void clear(); 198 void clear();
188 bool assertPaused(ErrorString*); 199 bool assertPaused(ErrorString*);
189 void clearBreakDetails(); 200 void clearBreakDetails();
201 void requestAsyncCallFramesIfNeeded();
190 202
191 String sourceMapURLForScript(const Script&); 203 String sourceMapURLForScript(const Script&);
192 204
193 String scriptURL(JavaScriptCallFrame*); 205 String scriptURL(JavaScriptCallFrame*);
194 206
195 ScriptValue resolveCallFrame(ErrorString*, const String* callFrameId); 207 ScriptValue resolveCallFrame(ErrorString*, const String* callFrameId);
196 208
197 typedef HashMap<String, Script> ScriptsMap; 209 typedef HashMap<String, Script> ScriptsMap;
198 typedef HashMap<String, Vector<String> > BreakpointIdToDebugServerBreakpoint IdsMap; 210 typedef HashMap<String, Vector<String> > BreakpointIdToDebugServerBreakpoint IdsMap;
199 typedef HashMap<String, std::pair<String, BreakpointSource> > DebugServerBre akpointToBreakpointIdAndSourceMap; 211 typedef HashMap<String, std::pair<String, BreakpointSource> > DebugServerBre akpointToBreakpointIdAndSourceMap;
200 212
201 InjectedScriptManager* m_injectedScriptManager; 213 InjectedScriptManager* m_injectedScriptManager;
202 InspectorFrontend::Debugger* m_frontend; 214 InspectorFrontend::Debugger* m_frontend;
203 ScriptState* m_pausedScriptState; 215 ScriptState* m_pausedScriptState;
204 ScriptValue m_currentCallStack; 216 ScriptValue m_currentCallStack;
205 ScriptsMap m_scripts; 217 ScriptsMap m_scripts;
206 BreakpointIdToDebugServerBreakpointIdsMap m_breakpointIdToDebugServerBreakpo intIds; 218 BreakpointIdToDebugServerBreakpointIdsMap m_breakpointIdToDebugServerBreakpo intIds;
207 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; 219 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints;
208 String m_continueToLocationBreakpointId; 220 String m_continueToLocationBreakpointId;
209 InspectorFrontend::Debugger::Reason::Enum m_breakReason; 221 InspectorFrontend::Debugger::Reason::Enum m_breakReason;
210 RefPtr<JSONObject> m_breakAuxData; 222 RefPtr<JSONObject> m_breakAuxData;
211 bool m_javaScriptPauseScheduled; 223 bool m_javaScriptPauseScheduled;
212 Listener* m_listener; 224 Listener* m_listener;
213 225
214 int m_skipStepInCount; 226 int m_skipStepInCount;
215 bool m_skipAllPauses; 227 bool m_skipAllPauses;
216 OwnPtr<RegularExpression> m_cachedSkipStackRegExp; 228 OwnPtr<RegularExpression> m_cachedSkipStackRegExp;
229 AsyncCallStackTracker m_asyncCallStackTracker;
217 }; 230 };
218 231
219 } // namespace WebCore 232 } // namespace WebCore
220 233
221 234
222 #endif // !defined(InspectorDebuggerAgent_h) 235 #endif // !defined(InspectorDebuggerAgent_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698