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 14 matching lines...) Expand all Loading... |
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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); |
128 | 130 |
129 void schedulePauseOnNextStatement(InspectorFrontend::Debugger::Reason::Enum
breakReason, PassRefPtr<JSONObject> data); | 131 void schedulePauseOnNextStatement(InspectorFrontend::Debugger::Reason::Enum
breakReason, PassRefPtr<JSONObject> data); |
| 132 void didInstallTimer(ExecutionContext*, int timerId, int timeout, bool singl
eShot); |
| 133 void didRemoveTimer(ExecutionContext*, int timerId); |
| 134 bool willFireTimer(ExecutionContext*, int timerId); |
130 void didFireTimer(); | 135 void didFireTimer(); |
| 136 void didRequestAnimationFrame(Document*, int callbackId); |
| 137 void didCancelAnimationFrame(Document*, int callbackId); |
| 138 bool willFireAnimationFrame(Document*, int callbackId); |
| 139 void didFireAnimationFrame(); |
131 void didHandleEvent(); | 140 void didHandleEvent(); |
132 bool canBreakProgram(); | 141 bool canBreakProgram(); |
133 void breakProgram(InspectorFrontend::Debugger::Reason::Enum breakReason, Pas
sRefPtr<JSONObject> data); | 142 void breakProgram(InspectorFrontend::Debugger::Reason::Enum breakReason, Pas
sRefPtr<JSONObject> data); |
134 virtual void scriptExecutionBlockedByCSP(const String& directiveText); | 143 virtual void scriptExecutionBlockedByCSP(const String& directiveText); |
135 | 144 |
136 class Listener { | 145 class Listener { |
137 public: | 146 public: |
138 virtual ~Listener() { } | 147 virtual ~Listener() { } |
139 virtual void debuggerWasEnabled() = 0; | 148 virtual void debuggerWasEnabled() = 0; |
140 virtual void debuggerWasDisabled() = 0; | 149 virtual void debuggerWasDisabled() = 0; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 private: | 181 private: |
173 void cancelPauseOnNextStatement(); | 182 void cancelPauseOnNextStatement(); |
174 void addMessageToConsole(MessageSource, MessageType); | 183 void addMessageToConsole(MessageSource, MessageType); |
175 | 184 |
176 bool enabled(); | 185 bool enabled(); |
177 | 186 |
178 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCal
lFrames(); | 187 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCal
lFrames(); |
179 | 188 |
180 virtual void didParseSource(const String& scriptId, const Script&); | 189 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); | 190 virtual void failedToParseSource(const String& url, const String& data, int
firstLine, int errorLine, const String& errorMessage); |
| 191 virtual void didRequestAsyncCallFrames(ScriptValue callFrames); |
182 | 192 |
183 void setPauseOnExceptionsImpl(ErrorString*, int); | 193 void setPauseOnExceptionsImpl(ErrorString*, int); |
184 | 194 |
185 PassRefPtr<TypeBuilder::Debugger::Location> resolveBreakpoint(const String&
breakpointId, const String& scriptId, const ScriptBreakpoint&, BreakpointSource)
; | 195 PassRefPtr<TypeBuilder::Debugger::Location> resolveBreakpoint(const String&
breakpointId, const String& scriptId, const ScriptBreakpoint&, BreakpointSource)
; |
186 void removeBreakpoint(const String& breakpointId); | 196 void removeBreakpoint(const String& breakpointId); |
187 void clear(); | 197 void clear(); |
188 bool assertPaused(ErrorString*); | 198 bool assertPaused(ErrorString*); |
189 void clearBreakDetails(); | 199 void clearBreakDetails(); |
| 200 void requestAsyncCallFramesIfNeeded(); |
190 | 201 |
191 String sourceMapURLForScript(const Script&); | 202 String sourceMapURLForScript(const Script&); |
192 | 203 |
193 String scriptURL(JavaScriptCallFrame*); | 204 String scriptURL(JavaScriptCallFrame*); |
194 | 205 |
195 ScriptValue resolveCallFrame(ErrorString*, const String* callFrameId); | 206 ScriptValue resolveCallFrame(ErrorString*, const String* callFrameId); |
196 | 207 |
197 typedef HashMap<String, Script> ScriptsMap; | 208 typedef HashMap<String, Script> ScriptsMap; |
198 typedef HashMap<String, Vector<String> > BreakpointIdToDebugServerBreakpoint
IdsMap; | 209 typedef HashMap<String, Vector<String> > BreakpointIdToDebugServerBreakpoint
IdsMap; |
199 typedef HashMap<String, std::pair<String, BreakpointSource> > DebugServerBre
akpointToBreakpointIdAndSourceMap; | 210 typedef HashMap<String, std::pair<String, BreakpointSource> > DebugServerBre
akpointToBreakpointIdAndSourceMap; |
200 | 211 |
201 InjectedScriptManager* m_injectedScriptManager; | 212 InjectedScriptManager* m_injectedScriptManager; |
202 InspectorFrontend::Debugger* m_frontend; | 213 InspectorFrontend::Debugger* m_frontend; |
203 ScriptState* m_pausedScriptState; | 214 ScriptState* m_pausedScriptState; |
204 ScriptValue m_currentCallStack; | 215 ScriptValue m_currentCallStack; |
205 ScriptsMap m_scripts; | 216 ScriptsMap m_scripts; |
206 BreakpointIdToDebugServerBreakpointIdsMap m_breakpointIdToDebugServerBreakpo
intIds; | 217 BreakpointIdToDebugServerBreakpointIdsMap m_breakpointIdToDebugServerBreakpo
intIds; |
207 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; | 218 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; |
208 String m_continueToLocationBreakpointId; | 219 String m_continueToLocationBreakpointId; |
209 InspectorFrontend::Debugger::Reason::Enum m_breakReason; | 220 InspectorFrontend::Debugger::Reason::Enum m_breakReason; |
210 RefPtr<JSONObject> m_breakAuxData; | 221 RefPtr<JSONObject> m_breakAuxData; |
211 bool m_javaScriptPauseScheduled; | 222 bool m_javaScriptPauseScheduled; |
212 Listener* m_listener; | 223 Listener* m_listener; |
213 | 224 |
214 int m_skipStepInCount; | 225 int m_skipStepInCount; |
215 bool m_skipAllPauses; | 226 bool m_skipAllPauses; |
216 OwnPtr<RegularExpression> m_cachedSkipStackRegExp; | 227 OwnPtr<RegularExpression> m_cachedSkipStackRegExp; |
| 228 AsyncCallStackTracker m_asyncCallStackTracker; |
217 }; | 229 }; |
218 | 230 |
219 } // namespace WebCore | 231 } // namespace WebCore |
220 | 232 |
221 | 233 |
222 #endif // !defined(InspectorDebuggerAgent_h) | 234 #endif // !defined(InspectorDebuggerAgent_h) |
OLD | NEW |