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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 class FormData; | 55 class FormData; |
56 class HTTPHeaderMap; | 56 class HTTPHeaderMap; |
57 class InjectedScriptManager; | 57 class InjectedScriptManager; |
58 class InspectorFrontend; | 58 class InspectorFrontend; |
59 class InstrumentingAgents; | 59 class InstrumentingAgents; |
60 class JSONObject; | 60 class JSONObject; |
61 class KURL; | 61 class KURL; |
62 class MutationObserver; | 62 class MutationObserver; |
63 class ScriptArguments; | 63 class ScriptArguments; |
64 class ScriptCallStack; | 64 class ScriptCallStack; |
| 65 class ScriptCallFrame; |
65 class ScriptDebugServer; | 66 class ScriptDebugServer; |
| 67 class ScriptDebugServerBase; |
66 class ScriptRegexp; | 68 class ScriptRegexp; |
67 class ScriptSourceCode; | 69 class ScriptSourceCode; |
68 class ScriptValue; | 70 class ScriptValue; |
69 class ThreadableLoaderClient; | 71 class ThreadableLoaderClient; |
70 class XMLHttpRequest; | 72 class XMLHttpRequest; |
71 | 73 |
72 typedef String ErrorString; | 74 typedef String ErrorString; |
73 | 75 |
74 class InspectorDebuggerAgent : public InspectorBaseAgent<InspectorDebuggerAgent>
, public ScriptDebugListener, public InspectorBackendDispatcher::DebuggerCommand
Handler { | 76 class InspectorDebuggerAgent : public InspectorBaseAgent<InspectorDebuggerAgent>
, public ScriptDebugListener, public InspectorBackendDispatcher::DebuggerCommand
Handler { |
75 WTF_MAKE_NONCOPYABLE(InspectorDebuggerAgent); WTF_MAKE_FAST_ALLOCATED; | 77 WTF_MAKE_NONCOPYABLE(InspectorDebuggerAgent); WTF_MAKE_FAST_ALLOCATED; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 const String& callFrameId, | 129 const String& callFrameId, |
128 const String& expression, | 130 const String& expression, |
129 const String* objectGroup, | 131 const String* objectGroup, |
130 const bool* includeCommandLineAPI, | 132 const bool* includeCommandLineAPI, |
131 const bool* doNotPauseOnExceptionsAndMuteConsole, | 133 const bool* doNotPauseOnExceptionsAndMuteConsole, |
132 const bool* returnByValue, | 134 const bool* returnByValue, |
133 const bool* generatePreview, | 135 const bool* generatePreview, |
134 RefPtr<TypeBuilder::Runtime::RemoteObject>& result, | 136 RefPtr<TypeBuilder::Runtime::RemoteObject>& result, |
135 TypeBuilder::OptOutput<bool>* wasThrown) OVERRIDE FINAL; | 137 TypeBuilder::OptOutput<bool>* wasThrown) OVERRIDE FINAL; |
136 virtual void compileScript(ErrorString*, const String& expression, const Str
ing& sourceURL, const int* executionContextId, TypeBuilder::OptOutput<TypeBuilde
r::Debugger::ScriptId>*, TypeBuilder::OptOutput<String>* syntaxErrorMessage) OVE
RRIDE; | 138 virtual void compileScript(ErrorString*, const String& expression, const Str
ing& sourceURL, const int* executionContextId, TypeBuilder::OptOutput<TypeBuilde
r::Debugger::ScriptId>*, TypeBuilder::OptOutput<String>* syntaxErrorMessage) OVE
RRIDE; |
| 139 virtual void getCompletionsOnCallFrame(ErrorString*, |
| 140 const String& callFrameId, |
| 141 const String& expression, |
| 142 RefPtr<TypeBuilder::Array<String> >& result) OVERRIDE FINAL; |
| 143 |
137 virtual void runScript(ErrorString*, const TypeBuilder::Debugger::ScriptId&,
const int* executionContextId, const String* objectGroup, const bool* doNotPaus
eOnExceptionsAndMuteConsole, RefPtr<TypeBuilder::Runtime::RemoteObject>& result,
TypeBuilder::OptOutput<bool>* wasThrown) OVERRIDE; | 144 virtual void runScript(ErrorString*, const TypeBuilder::Debugger::ScriptId&,
const int* executionContextId, const String* objectGroup, const bool* doNotPaus
eOnExceptionsAndMuteConsole, RefPtr<TypeBuilder::Runtime::RemoteObject>& result,
TypeBuilder::OptOutput<bool>* wasThrown) OVERRIDE; |
138 virtual void setOverlayMessage(ErrorString*, const String*) OVERRIDE; | 145 virtual void setOverlayMessage(ErrorString*, const String*) OVERRIDE; |
139 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) OVERRIDE FINAL; | 146 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) OVERRIDE FINAL; |
140 virtual void skipStackFrames(ErrorString*, const String* pattern) OVERRIDE F
INAL; | 147 virtual void skipStackFrames(ErrorString*, const String* pattern) OVERRIDE F
INAL; |
141 virtual void setAsyncCallStackDepth(ErrorString*, int depth) OVERRIDE FINAL; | 148 virtual void setAsyncCallStackDepth(ErrorString*, int depth) OVERRIDE FINAL; |
142 | 149 |
143 void schedulePauseOnNextStatement(InspectorFrontend::Debugger::Reason::Enum
breakReason, PassRefPtr<JSONObject> data); | 150 void schedulePauseOnNextStatement(InspectorFrontend::Debugger::Reason::Enum
breakReason, PassRefPtr<JSONObject> data); |
144 void didInstallTimer(ExecutionContext*, int timerId, int timeout, bool singl
eShot); | 151 void didInstallTimer(ExecutionContext*, int timerId, int timeout, bool singl
eShot); |
145 void didRemoveTimer(ExecutionContext*, int timerId); | 152 void didRemoveTimer(ExecutionContext*, int timerId); |
146 bool willFireTimer(ExecutionContext*, int timerId); | 153 bool willFireTimer(ExecutionContext*, int timerId); |
(...skipping 26 matching lines...) Expand all Loading... |
173 class Listener { | 180 class Listener { |
174 public: | 181 public: |
175 virtual ~Listener() { } | 182 virtual ~Listener() { } |
176 virtual void debuggerWasEnabled() = 0; | 183 virtual void debuggerWasEnabled() = 0; |
177 virtual void debuggerWasDisabled() = 0; | 184 virtual void debuggerWasDisabled() = 0; |
178 virtual void stepInto() = 0; | 185 virtual void stepInto() = 0; |
179 virtual void didPause() = 0; | 186 virtual void didPause() = 0; |
180 }; | 187 }; |
181 void setListener(Listener* listener) { m_listener = listener; } | 188 void setListener(Listener* listener) { m_listener = listener; } |
182 | 189 |
183 virtual ScriptDebugServer& scriptDebugServer() = 0; | 190 virtual ScriptDebugServerBase& scriptDebugServer() = 0; |
184 | 191 |
185 void setBreakpoint(const String& scriptId, int lineNumber, int columnNumber,
BreakpointSource, const String& condition = String()); | 192 void setBreakpoint(const String& scriptId, int lineNumber, int columnNumber,
BreakpointSource, const String& condition = String()); |
186 void removeBreakpoint(const String& scriptId, int lineNumber, int columnNumb
er, BreakpointSource); | 193 void removeBreakpoint(const String& scriptId, int lineNumber, int columnNumb
er, BreakpointSource); |
187 | 194 |
188 virtual SkipPauseRequest shouldSkipExceptionPause(RefPtr<JavaScriptCallFrame
>& topFrame) OVERRIDE FINAL; | 195 virtual SkipPauseRequest shouldSkipExceptionPause(const ScriptCallFrame& top
Frame) OVERRIDE FINAL; |
189 virtual SkipPauseRequest shouldSkipBreakpointPause(RefPtr<JavaScriptCallFram
e>& topFrame) OVERRIDE FINAL; | 196 virtual SkipPauseRequest shouldSkipBreakpointPause(const ScriptCallFrame& to
pFrame) OVERRIDE FINAL; |
190 virtual SkipPauseRequest shouldSkipStepPause(RefPtr<JavaScriptCallFrame>& to
pFrame) OVERRIDE FINAL; | 197 virtual SkipPauseRequest shouldSkipStepPause(const ScriptCallFrame& topFrame
) OVERRIDE FINAL; |
191 | 198 |
192 protected: | 199 protected: |
193 explicit InspectorDebuggerAgent(InjectedScriptManager*); | 200 explicit InspectorDebuggerAgent(InjectedScriptManager*); |
194 | 201 |
195 virtual void startListeningScriptDebugServer() = 0; | 202 virtual void startListeningScriptDebugServer() = 0; |
196 virtual void stopListeningScriptDebugServer() = 0; | 203 virtual void stopListeningScriptDebugServer() = 0; |
197 virtual void muteConsole() = 0; | 204 virtual void muteConsole() = 0; |
198 virtual void unmuteConsole() = 0; | 205 virtual void unmuteConsole() = 0; |
199 InjectedScriptManager* injectedScriptManager() { return m_injectedScriptMana
ger; } | 206 InjectedScriptManager* injectedScriptManager() { return m_injectedScriptMana
ger; } |
200 virtual InjectedScript injectedScriptForEval(ErrorString*, const int* execut
ionContextId) = 0; | 207 virtual InjectedScript& injectedScriptForEval(ErrorString*, const int* execu
tionContextId) = 0; |
201 | 208 |
202 virtual void enable(); | 209 virtual void enable(); |
203 virtual void disable(); | 210 virtual void disable(); |
204 virtual void didPause(ScriptState*, const ScriptValue& callFrames, const Scr
iptValue& exception, const Vector<String>& hitBreakpoints) OVERRIDE FINAL; | 211 virtual void didPause(ScriptState*, const StackTrace& callFrames, const Scri
ptValue& exception, const Vector<String>& hitBreakpoints) OVERRIDE FINAL; |
205 virtual void didContinue() OVERRIDE FINAL; | 212 virtual void didContinue() OVERRIDE FINAL; |
206 void reset(); | 213 void reset(); |
207 void pageDidCommitLoad(); | 214 void pageDidCommitLoad(); |
208 | 215 |
209 private: | 216 private: |
210 void cancelPauseOnNextStatement(); | 217 void cancelPauseOnNextStatement(); |
211 void addMessageToConsole(MessageSource, MessageType); | 218 void addMessageToConsole(MessageSource, MessageType); |
212 | 219 |
213 bool enabled(); | 220 bool enabled(); |
214 | 221 |
215 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCal
lFrames(); | 222 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCal
lFrames(); |
216 PassRefPtr<TypeBuilder::Debugger::StackTrace> currentAsyncStackTrace(); | 223 PassRefPtr<TypeBuilder::Debugger::StackTrace> currentAsyncStackTrace(); |
217 | 224 |
218 virtual void didParseSource(const String& scriptId, const Script&) OVERRIDE
FINAL; | 225 virtual void didParseSource(const String& scriptId, const Script&) OVERRIDE
FINAL; |
219 virtual void failedToParseSource(const String& url, const String& data, int
firstLine, int errorLine, const String& errorMessage) OVERRIDE FINAL; | 226 virtual void failedToParseSource(const String& url, const String& data, int
firstLine, int errorLine, const String& errorMessage) OVERRIDE FINAL; |
220 | 227 |
221 void setPauseOnExceptionsImpl(ErrorString*, int); | 228 void setPauseOnExceptionsImpl(ErrorString*, int); |
222 | 229 |
223 PassRefPtr<TypeBuilder::Debugger::Location> resolveBreakpoint(const String&
breakpointId, const String& scriptId, const ScriptBreakpoint&, BreakpointSource)
; | 230 PassRefPtr<TypeBuilder::Debugger::Location> resolveBreakpoint(const String&
breakpointId, const String& scriptId, const ScriptBreakpoint&, BreakpointSource)
; |
224 void removeBreakpoint(const String& breakpointId); | 231 void removeBreakpoint(const String& breakpointId); |
225 void clear(); | 232 void clear(); |
226 bool assertPaused(ErrorString*); | 233 bool assertPaused(ErrorString*); |
227 void clearBreakDetails(); | 234 void clearBreakDetails(); |
228 | 235 |
229 String sourceMapURLForScript(const Script&); | 236 String sourceMapURLForScript(const Script&); |
230 | 237 |
231 String scriptURL(JavaScriptCallFrame*); | 238 ActivationFrame resolveCallFrame(ErrorString*, const String* callFrameId); |
232 | 239 void collectAsyncCallStacks(Vector<StackTrace>& asyncCallStacks); |
233 ScriptValue resolveCallFrame(ErrorString*, const String* callFrameId); | |
234 | 240 |
235 typedef HashMap<String, Script> ScriptsMap; | 241 typedef HashMap<String, Script> ScriptsMap; |
236 typedef HashMap<String, Vector<String> > BreakpointIdToDebugServerBreakpoint
IdsMap; | 242 typedef HashMap<String, Vector<String> > BreakpointIdToDebugServerBreakpoint
IdsMap; |
237 typedef HashMap<String, std::pair<String, BreakpointSource> > DebugServerBre
akpointToBreakpointIdAndSourceMap; | 243 typedef HashMap<String, std::pair<String, BreakpointSource> > DebugServerBre
akpointToBreakpointIdAndSourceMap; |
238 | 244 |
239 InjectedScriptManager* m_injectedScriptManager; | 245 InjectedScriptManager* m_injectedScriptManager; |
240 InspectorFrontend::Debugger* m_frontend; | 246 InspectorFrontend::Debugger* m_frontend; |
241 RefPtr<ScriptState> m_pausedScriptState; | 247 RefPtr<ScriptState> m_pausedScriptState; |
242 ScriptValue m_currentCallStack; | 248 StackTrace m_currentCallStack; |
243 ScriptsMap m_scripts; | 249 ScriptsMap m_scripts; |
244 BreakpointIdToDebugServerBreakpointIdsMap m_breakpointIdToDebugServerBreakpo
intIds; | 250 BreakpointIdToDebugServerBreakpointIdsMap m_breakpointIdToDebugServerBreakpo
intIds; |
245 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; | 251 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; |
246 String m_continueToLocationBreakpointId; | 252 String m_continueToLocationBreakpointId; |
247 InspectorFrontend::Debugger::Reason::Enum m_breakReason; | 253 InspectorFrontend::Debugger::Reason::Enum m_breakReason; |
248 RefPtr<JSONObject> m_breakAuxData; | 254 RefPtr<JSONObject> m_breakAuxData; |
249 bool m_javaScriptPauseScheduled; | 255 bool m_javaScriptPauseScheduled; |
250 Listener* m_listener; | 256 Listener* m_listener; |
251 | 257 |
252 int m_skipStepInCount; | 258 int m_skipStepInCount; |
253 bool m_skipAllPauses; | 259 bool m_skipAllPauses; |
254 OwnPtr<ScriptRegexp> m_cachedSkipStackRegExp; | 260 OwnPtr<ScriptRegexp> m_cachedSkipStackRegExp; |
255 AsyncCallStackTracker m_asyncCallStackTracker; | 261 AsyncCallStackTracker m_asyncCallStackTracker; |
256 PromiseTracker m_promiseTracker; | 262 PromiseTracker m_promiseTracker; |
257 }; | 263 }; |
258 | 264 |
259 } // namespace WebCore | 265 } // namespace WebCore |
260 | 266 |
261 | 267 |
262 #endif // !defined(InspectorDebuggerAgent_h) | 268 #endif // !defined(InspectorDebuggerAgent_h) |
OLD | NEW |