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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 enum BreakpointSource { | 75 enum BreakpointSource { |
76 UserBreakpointSource, | 76 UserBreakpointSource, |
77 DebugCommandBreakpointSource, | 77 DebugCommandBreakpointSource, |
78 MonitorCommandBreakpointSource | 78 MonitorCommandBreakpointSource |
79 }; | 79 }; |
80 | 80 |
81 static const char backtraceObjectGroup[]; | 81 static const char backtraceObjectGroup[]; |
82 | 82 |
83 virtual ~InspectorDebuggerAgent(); | 83 virtual ~InspectorDebuggerAgent(); |
84 | 84 |
85 virtual void canSetScriptSource(ErrorString*, bool* result) { *result = true
; } | 85 virtual void canSetScriptSource(ErrorString*, bool* result) OVERRIDE FINAL {
*result = true; } |
86 | 86 |
87 virtual void setFrontend(InspectorFrontend*); | 87 virtual void setFrontend(InspectorFrontend*) OVERRIDE FINAL; |
88 virtual void clearFrontend(); | 88 virtual void clearFrontend() OVERRIDE FINAL; |
89 virtual void restore(); | 89 virtual void restore() OVERRIDE FINAL; |
90 | 90 |
91 bool isPaused(); | 91 bool isPaused(); |
92 bool runningNestedMessageLoop(); | 92 bool runningNestedMessageLoop(); |
93 void addMessageToConsole(MessageSource, MessageType, MessageLevel, const Str
ing&, PassRefPtr<ScriptCallStack>, unsigned long); | 93 void addMessageToConsole(MessageSource, MessageType, MessageLevel, const Str
ing&, PassRefPtr<ScriptCallStack>, unsigned long); |
94 void addMessageToConsole(MessageSource, MessageType, MessageLevel, const Str
ing&, ScriptState*, PassRefPtr<ScriptArguments>, unsigned long); | 94 void addMessageToConsole(MessageSource, MessageType, MessageLevel, const Str
ing&, ScriptState*, PassRefPtr<ScriptArguments>, unsigned long); |
95 | 95 |
96 String preprocessEventListener(Frame*, const String& source, const String& u
rl, const String& functionName); | 96 String preprocessEventListener(Frame*, const String& source, const String& u
rl, const String& functionName); |
97 PassOwnPtr<ScriptSourceCode> preprocess(Frame*, const ScriptSourceCode&); | 97 PassOwnPtr<ScriptSourceCode> preprocess(Frame*, const ScriptSourceCode&); |
98 | 98 |
99 // Part of the protocol. | 99 // Part of the protocol. |
100 virtual void enable(ErrorString*); | 100 virtual void enable(ErrorString*) OVERRIDE FINAL; |
101 virtual void disable(ErrorString*); | 101 virtual void disable(ErrorString*) OVERRIDE FINAL; |
102 virtual void setBreakpointsActive(ErrorString*, bool active); | 102 virtual void setBreakpointsActive(ErrorString*, bool active) OVERRIDE FINAL; |
103 virtual void setSkipAllPauses(ErrorString*, bool skipped, const bool* untilR
eload); | 103 virtual void setSkipAllPauses(ErrorString*, bool skipped, const bool* untilR
eload) OVERRIDE FINAL; |
104 | 104 |
105 virtual void setBreakpointByUrl(ErrorString*, int lineNumber, const String*
optionalURL, const String* optionalURLRegex, const int* optionalColumnNumber, co
nst String* optionalCondition, const bool* isAntiBreakpoint, TypeBuilder::Debugg
er::BreakpointId*, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::Location> >&
locations); | 105 virtual void setBreakpointByUrl(ErrorString*, int lineNumber, const String*
optionalURL, const String* optionalURLRegex, const int* optionalColumnNumber, co
nst String* optionalCondition, const bool* isAntiBreakpoint, TypeBuilder::Debugg
er::BreakpointId*, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::Location> >&
locations) OVERRIDE FINAL; |
106 virtual void setBreakpoint(ErrorString*, const RefPtr<JSONObject>& location,
const String* optionalCondition, TypeBuilder::Debugger::BreakpointId*, RefPtr<T
ypeBuilder::Debugger::Location>& actualLocation); | 106 virtual void setBreakpoint(ErrorString*, const RefPtr<JSONObject>& location,
const String* optionalCondition, TypeBuilder::Debugger::BreakpointId*, RefPtr<T
ypeBuilder::Debugger::Location>& actualLocation) OVERRIDE FINAL; |
107 virtual void removeBreakpoint(ErrorString*, const String& breakpointId); | 107 virtual void removeBreakpoint(ErrorString*, const String& breakpointId) OVER
RIDE FINAL; |
108 virtual void continueToLocation(ErrorString*, const RefPtr<JSONObject>& loca
tion, const bool* interstateLocationOpt); | 108 virtual void continueToLocation(ErrorString*, const RefPtr<JSONObject>& loca
tion, const bool* interstateLocationOpt) OVERRIDE FINAL; |
109 virtual void getStepInPositions(ErrorString*, const String& callFrameId, Ref
Ptr<TypeBuilder::Array<TypeBuilder::Debugger::Location> >& positions); | 109 virtual void getStepInPositions(ErrorString*, const String& callFrameId, Ref
Ptr<TypeBuilder::Array<TypeBuilder::Debugger::Location> >& positions) OVERRIDE F
INAL; |
110 virtual void getBacktrace(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilde
r::Debugger::CallFrame> >&, RefPtr<TypeBuilder::Debugger::StackTrace>&); | 110 virtual void getBacktrace(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilde
r::Debugger::CallFrame> >&, RefPtr<TypeBuilder::Debugger::StackTrace>&) OVERRIDE
FINAL; |
111 | 111 |
112 virtual void searchInContent(ErrorString*, const String& scriptId, const Str
ing& query, const bool* optionalCaseSensitive, const bool* optionalIsRegex, RefP
tr<TypeBuilder::Array<TypeBuilder::Page::SearchMatch> >&); | 112 virtual void searchInContent(ErrorString*, const String& scriptId, const Str
ing& query, const bool* optionalCaseSensitive, const bool* optionalIsRegex, RefP
tr<TypeBuilder::Array<TypeBuilder::Page::SearchMatch> >&) OVERRIDE FINAL; |
113 virtual void setScriptSource(ErrorString*, RefPtr<TypeBuilder::Debugger::Set
ScriptSourceError>&, const String& scriptId, const String& newContent, const boo
l* preview, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> >& newCa
llFrames, RefPtr<JSONObject>& result, RefPtr<TypeBuilder::Debugger::StackTrace>&
asyncStackTrace); | 113 virtual void setScriptSource(ErrorString*, RefPtr<TypeBuilder::Debugger::Set
ScriptSourceError>&, const String& scriptId, const String& newContent, const boo
l* preview, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> >& newCa
llFrames, RefPtr<JSONObject>& result, RefPtr<TypeBuilder::Debugger::StackTrace>&
asyncStackTrace) OVERRIDE FINAL; |
114 virtual void restartFrame(ErrorString*, const String& callFrameId, RefPtr<Ty
peBuilder::Array<TypeBuilder::Debugger::CallFrame> >& newCallFrames, RefPtr<JSON
Object>& result, RefPtr<TypeBuilder::Debugger::StackTrace>& asyncStackTrace); | 114 virtual void restartFrame(ErrorString*, const String& callFrameId, RefPtr<Ty
peBuilder::Array<TypeBuilder::Debugger::CallFrame> >& newCallFrames, RefPtr<JSON
Object>& result, RefPtr<TypeBuilder::Debugger::StackTrace>& asyncStackTrace) OVE
RRIDE FINAL; |
115 virtual void getScriptSource(ErrorString*, const String& scriptId, String* s
criptSource); | 115 virtual void getScriptSource(ErrorString*, const String& scriptId, String* s
criptSource) OVERRIDE FINAL; |
116 virtual void getFunctionDetails(ErrorString*, const String& functionId, RefP
tr<TypeBuilder::Debugger::FunctionDetails>&); | 116 virtual void getFunctionDetails(ErrorString*, const String& functionId, RefP
tr<TypeBuilder::Debugger::FunctionDetails>&) OVERRIDE FINAL; |
117 virtual void pause(ErrorString*); | 117 virtual void pause(ErrorString*) OVERRIDE FINAL; |
118 virtual void resume(ErrorString*); | 118 virtual void resume(ErrorString*) OVERRIDE FINAL; |
119 virtual void stepOver(ErrorString*, const String* callFrameId); | 119 virtual void stepOver(ErrorString*, const String* callFrameId) OVERRIDE FINA
L; |
120 virtual void stepInto(ErrorString*); | 120 virtual void stepInto(ErrorString*) OVERRIDE FINAL; |
121 virtual void stepOut(ErrorString*, const String* callFrameId); | 121 virtual void stepOut(ErrorString*, const String* callFrameId) OVERRIDE FINAL
; |
122 virtual void setPauseOnExceptions(ErrorString*, const String& pauseState); | 122 virtual void setPauseOnExceptions(ErrorString*, const String& pauseState) OV
ERRIDE FINAL; |
123 virtual void evaluateOnCallFrame(ErrorString*, | 123 virtual void evaluateOnCallFrame(ErrorString*, |
124 const String& callFrameId, | 124 const String& callFrameId, |
125 const String& expression, | 125 const String& expression, |
126 const String* objectGroup, | 126 const String* objectGroup, |
127 const bool* includeCommandLineAPI, | 127 const bool* includeCommandLineAPI, |
128 const bool* doNotPauseOnExceptionsAndMuteConsole, | 128 const bool* doNotPauseOnExceptionsAndMuteConsole, |
129 const bool* returnByValue, | 129 const bool* returnByValue, |
130 const bool* generatePreview, | 130 const bool* generatePreview, |
131 RefPtr<TypeBuilder::Runtime::RemoteObject>& result, | 131 RefPtr<TypeBuilder::Runtime::RemoteObject>& result, |
132 TypeBuilder::OptOutput<bool>* wasThrown); | 132 TypeBuilder::OptOutput<bool>* wasThrown) OVERRIDE FINAL; |
133 void compileScript(ErrorString*, const String& expression, const String& sou
rceURL, TypeBuilder::OptOutput<TypeBuilder::Debugger::ScriptId>*, TypeBuilder::O
ptOutput<String>* syntaxErrorMessage); | 133 void compileScript(ErrorString*, const String& expression, const String& sou
rceURL, TypeBuilder::OptOutput<TypeBuilder::Debugger::ScriptId>*, TypeBuilder::O
ptOutput<String>* syntaxErrorMessage); |
134 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); | 134 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); |
135 virtual void setOverlayMessage(ErrorString*, const String*); | 135 virtual void setOverlayMessage(ErrorString*, const String*) OVERRIDE; |
136 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); | 136 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; |
137 virtual void skipStackFrames(ErrorString*, const String* pattern); | 137 virtual void skipStackFrames(ErrorString*, const String* pattern) OVERRIDE F
INAL; |
138 virtual void setAsyncCallStackDepth(ErrorString*, int depth); | 138 virtual void setAsyncCallStackDepth(ErrorString*, int depth) OVERRIDE FINAL; |
139 | 139 |
140 void schedulePauseOnNextStatement(InspectorFrontend::Debugger::Reason::Enum
breakReason, PassRefPtr<JSONObject> data); | 140 void schedulePauseOnNextStatement(InspectorFrontend::Debugger::Reason::Enum
breakReason, PassRefPtr<JSONObject> data); |
141 void didInstallTimer(ExecutionContext*, int timerId, int timeout, bool singl
eShot); | 141 void didInstallTimer(ExecutionContext*, int timerId, int timeout, bool singl
eShot); |
142 void didRemoveTimer(ExecutionContext*, int timerId); | 142 void didRemoveTimer(ExecutionContext*, int timerId); |
143 bool willFireTimer(ExecutionContext*, int timerId); | 143 bool willFireTimer(ExecutionContext*, int timerId); |
144 void didFireTimer(); | 144 void didFireTimer(); |
145 void didRequestAnimationFrame(Document*, int callbackId); | 145 void didRequestAnimationFrame(Document*, int callbackId); |
146 void didCancelAnimationFrame(Document*, int callbackId); | 146 void didCancelAnimationFrame(Document*, int callbackId); |
147 bool willFireAnimationFrame(Document*, int callbackId); | 147 bool willFireAnimationFrame(Document*, int callbackId); |
148 void didFireAnimationFrame(); | 148 void didFireAnimationFrame(); |
149 void didAddEventListener(EventTarget*, const AtomicString& eventType, EventL
istener*, bool useCapture); | 149 void didAddEventListener(EventTarget*, const AtomicString& eventType, EventL
istener*, bool useCapture); |
150 void didRemoveEventListener(EventTarget*, const AtomicString& eventType, Eve
ntListener*, bool useCapture); | 150 void didRemoveEventListener(EventTarget*, const AtomicString& eventType, Eve
ntListener*, bool useCapture); |
151 void didRemoveAllEventListeners(EventTarget*); | 151 void didRemoveAllEventListeners(EventTarget*); |
152 void willHandleEvent(EventTarget*, const AtomicString& eventType, EventListe
ner*, bool useCapture); | 152 void willHandleEvent(EventTarget*, const AtomicString& eventType, EventListe
ner*, bool useCapture); |
153 void didHandleEvent(); | 153 void didHandleEvent(); |
154 void willLoadXHR(XMLHttpRequest*, ThreadableLoaderClient*, const AtomicStrin
g& method, const KURL&, bool async, PassRefPtr<FormData> body, const HTTPHeaderM
ap& headers, bool includeCrendentials); | 154 void willLoadXHR(XMLHttpRequest*, ThreadableLoaderClient*, const AtomicStrin
g& method, const KURL&, bool async, PassRefPtr<FormData> body, const HTTPHeaderM
ap& headers, bool includeCrendentials); |
155 void didEnqueueMutationRecord(ExecutionContext*, MutationObserver*); | 155 void didEnqueueMutationRecord(ExecutionContext*, MutationObserver*); |
156 void didClearAllMutationRecords(ExecutionContext*, MutationObserver*); | 156 void didClearAllMutationRecords(ExecutionContext*, MutationObserver*); |
157 void willDeliverMutationRecords(ExecutionContext*, MutationObserver*); | 157 void willDeliverMutationRecords(ExecutionContext*, MutationObserver*); |
158 void didDeliverMutationRecords(); | 158 void didDeliverMutationRecords(); |
159 bool canBreakProgram(); | 159 bool canBreakProgram(); |
160 void breakProgram(InspectorFrontend::Debugger::Reason::Enum breakReason, Pas
sRefPtr<JSONObject> data); | 160 void breakProgram(InspectorFrontend::Debugger::Reason::Enum breakReason, Pas
sRefPtr<JSONObject> data); |
161 virtual void scriptExecutionBlockedByCSP(const String& directiveText); | 161 void scriptExecutionBlockedByCSP(const String& directiveText); |
162 | 162 |
163 class Listener { | 163 class Listener { |
164 public: | 164 public: |
165 virtual ~Listener() { } | 165 virtual ~Listener() { } |
166 virtual void debuggerWasEnabled() = 0; | 166 virtual void debuggerWasEnabled() = 0; |
167 virtual void debuggerWasDisabled() = 0; | 167 virtual void debuggerWasDisabled() = 0; |
168 virtual void stepInto() = 0; | 168 virtual void stepInto() = 0; |
169 virtual void didPause() = 0; | 169 virtual void didPause() = 0; |
170 }; | 170 }; |
171 void setListener(Listener* listener) { m_listener = listener; } | 171 void setListener(Listener* listener) { m_listener = listener; } |
172 | 172 |
173 virtual ScriptDebugServer& scriptDebugServer() = 0; | 173 virtual ScriptDebugServer& scriptDebugServer() = 0; |
174 | 174 |
175 void setBreakpoint(const String& scriptId, int lineNumber, int columnNumber,
BreakpointSource, const String& condition = String()); | 175 void setBreakpoint(const String& scriptId, int lineNumber, int columnNumber,
BreakpointSource, const String& condition = String()); |
176 void removeBreakpoint(const String& scriptId, int lineNumber, int columnNumb
er, BreakpointSource); | 176 void removeBreakpoint(const String& scriptId, int lineNumber, int columnNumb
er, BreakpointSource); |
177 | 177 |
178 SkipPauseRequest shouldSkipExceptionPause(RefPtr<JavaScriptCallFrame>& topFr
ame); | 178 virtual SkipPauseRequest shouldSkipExceptionPause(RefPtr<JavaScriptCallFrame
>& topFrame) OVERRIDE FINAL; |
179 SkipPauseRequest shouldSkipBreakpointPause(RefPtr<JavaScriptCallFrame>& topF
rame); | 179 virtual SkipPauseRequest shouldSkipBreakpointPause(RefPtr<JavaScriptCallFram
e>& topFrame) OVERRIDE FINAL; |
180 SkipPauseRequest shouldSkipStepPause(RefPtr<JavaScriptCallFrame>& topFrame); | 180 virtual SkipPauseRequest shouldSkipStepPause(RefPtr<JavaScriptCallFrame>& to
pFrame) OVERRIDE FINAL; |
181 | 181 |
182 protected: | 182 protected: |
183 InspectorDebuggerAgent(InstrumentingAgents*, InspectorCompositeState*, Injec
tedScriptManager*); | 183 InspectorDebuggerAgent(InstrumentingAgents*, InspectorCompositeState*, Injec
tedScriptManager*); |
184 | 184 |
185 virtual void startListeningScriptDebugServer() = 0; | 185 virtual void startListeningScriptDebugServer() = 0; |
186 virtual void stopListeningScriptDebugServer() = 0; | 186 virtual void stopListeningScriptDebugServer() = 0; |
187 virtual void muteConsole() = 0; | 187 virtual void muteConsole() = 0; |
188 virtual void unmuteConsole() = 0; | 188 virtual void unmuteConsole() = 0; |
189 InjectedScriptManager* injectedScriptManager() { return m_injectedScriptMana
ger; } | 189 InjectedScriptManager* injectedScriptManager() { return m_injectedScriptMana
ger; } |
190 virtual InjectedScript injectedScriptForEval(ErrorString*, const int* execut
ionContextId) = 0; | 190 virtual InjectedScript injectedScriptForEval(ErrorString*, const int* execut
ionContextId) = 0; |
191 | 191 |
192 virtual void enable(); | 192 virtual void enable(); |
193 virtual void disable(); | 193 virtual void disable(); |
194 virtual void didPause(ScriptState*, const ScriptValue& callFrames, const Scr
iptValue& exception, const Vector<String>& hitBreakpoints); | 194 virtual void didPause(ScriptState*, const ScriptValue& callFrames, const Scr
iptValue& exception, const Vector<String>& hitBreakpoints) OVERRIDE FINAL; |
195 virtual void didContinue(); | 195 virtual void didContinue() OVERRIDE FINAL; |
196 void reset(); | 196 void reset(); |
197 void pageDidCommitLoad(); | 197 void pageDidCommitLoad(); |
198 | 198 |
199 private: | 199 private: |
200 void cancelPauseOnNextStatement(); | 200 void cancelPauseOnNextStatement(); |
201 void addMessageToConsole(MessageSource, MessageType); | 201 void addMessageToConsole(MessageSource, MessageType); |
202 | 202 |
203 bool enabled(); | 203 bool enabled(); |
204 | 204 |
205 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCal
lFrames(); | 205 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCal
lFrames(); |
206 PassRefPtr<TypeBuilder::Debugger::StackTrace> currentAsyncStackTrace(); | 206 PassRefPtr<TypeBuilder::Debugger::StackTrace> currentAsyncStackTrace(); |
207 | 207 |
208 virtual void didParseSource(const String& scriptId, const Script&); | 208 virtual void didParseSource(const String& scriptId, const Script&) OVERRIDE
FINAL; |
209 virtual void failedToParseSource(const String& url, const String& data, int
firstLine, int errorLine, const String& errorMessage); | 209 virtual void failedToParseSource(const String& url, const String& data, int
firstLine, int errorLine, const String& errorMessage) OVERRIDE FINAL; |
210 | 210 |
211 void setPauseOnExceptionsImpl(ErrorString*, int); | 211 void setPauseOnExceptionsImpl(ErrorString*, int); |
212 | 212 |
213 PassRefPtr<TypeBuilder::Debugger::Location> resolveBreakpoint(const String&
breakpointId, const String& scriptId, const ScriptBreakpoint&, BreakpointSource)
; | 213 PassRefPtr<TypeBuilder::Debugger::Location> resolveBreakpoint(const String&
breakpointId, const String& scriptId, const ScriptBreakpoint&, BreakpointSource)
; |
214 void removeBreakpoint(const String& breakpointId); | 214 void removeBreakpoint(const String& breakpointId); |
215 void clear(); | 215 void clear(); |
216 bool assertPaused(ErrorString*); | 216 bool assertPaused(ErrorString*); |
217 void clearBreakDetails(); | 217 void clearBreakDetails(); |
218 | 218 |
219 String sourceMapURLForScript(const Script&); | 219 String sourceMapURLForScript(const Script&); |
(...skipping 22 matching lines...) Expand all Loading... |
242 int m_skipStepInCount; | 242 int m_skipStepInCount; |
243 bool m_skipAllPauses; | 243 bool m_skipAllPauses; |
244 OwnPtr<ScriptRegexp> m_cachedSkipStackRegExp; | 244 OwnPtr<ScriptRegexp> m_cachedSkipStackRegExp; |
245 AsyncCallStackTracker m_asyncCallStackTracker; | 245 AsyncCallStackTracker m_asyncCallStackTracker; |
246 }; | 246 }; |
247 | 247 |
248 } // namespace WebCore | 248 } // namespace WebCore |
249 | 249 |
250 | 250 |
251 #endif // !defined(InspectorDebuggerAgent_h) | 251 #endif // !defined(InspectorDebuggerAgent_h) |
OLD | NEW |