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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 class ScriptArguments; | 57 class ScriptArguments; |
58 class ScriptCallStack; | 58 class ScriptCallStack; |
59 class ScriptDebugServer; | 59 class ScriptDebugServer; |
60 class ScriptValue; | 60 class ScriptValue; |
61 | 61 |
62 typedef String ErrorString; | 62 typedef String ErrorString; |
63 | 63 |
64 class InspectorDebuggerAgent : public InspectorBaseAgent<InspectorDebuggerAgent>
, public ScriptDebugListener, public InspectorBackendDispatcher::DebuggerCommand
Handler { | 64 class InspectorDebuggerAgent : public InspectorBaseAgent<InspectorDebuggerAgent>
, public ScriptDebugListener, public InspectorBackendDispatcher::DebuggerCommand
Handler { |
65 WTF_MAKE_NONCOPYABLE(InspectorDebuggerAgent); WTF_MAKE_FAST_ALLOCATED; | 65 WTF_MAKE_NONCOPYABLE(InspectorDebuggerAgent); WTF_MAKE_FAST_ALLOCATED; |
66 public: | 66 public: |
| 67 enum BreakpointSource { |
| 68 UserBreakpointSource, |
| 69 DebugCommandBreakpointSource |
| 70 }; |
| 71 |
67 static const char* backtraceObjectGroup; | 72 static const char* backtraceObjectGroup; |
68 | 73 |
69 virtual ~InspectorDebuggerAgent(); | 74 virtual ~InspectorDebuggerAgent(); |
70 | 75 |
71 virtual void canSetScriptSource(ErrorString*, bool* result) { *result = true
; } | 76 virtual void canSetScriptSource(ErrorString*, bool* result) { *result = true
; } |
72 | 77 |
73 virtual void setFrontend(InspectorFrontend*); | 78 virtual void setFrontend(InspectorFrontend*); |
74 virtual void clearFrontend(); | 79 virtual void clearFrontend(); |
75 virtual void restore(); | 80 virtual void restore(); |
76 | 81 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 virtual void debuggerWasDisabled() = 0; | 133 virtual void debuggerWasDisabled() = 0; |
129 virtual void stepInto() = 0; | 134 virtual void stepInto() = 0; |
130 virtual void didPause() = 0; | 135 virtual void didPause() = 0; |
131 }; | 136 }; |
132 void setListener(Listener* listener) { m_listener = listener; } | 137 void setListener(Listener* listener) { m_listener = listener; } |
133 | 138 |
134 virtual ScriptDebugServer& scriptDebugServer() = 0; | 139 virtual ScriptDebugServer& scriptDebugServer() = 0; |
135 | 140 |
136 virtual void reportMemoryUsage(MemoryObjectInfo*) const; | 141 virtual void reportMemoryUsage(MemoryObjectInfo*) const; |
137 | 142 |
| 143 void setBreakpoint(const String& scriptId, int lineNumber, int columnNumber,
BreakpointSource); |
| 144 void removeBreakpoint(const String& scriptId, int lineNumber, int columnNumb
er, BreakpointSource); |
| 145 |
138 protected: | 146 protected: |
139 InspectorDebuggerAgent(InstrumentingAgents*, InspectorCompositeState*, Injec
tedScriptManager*); | 147 InspectorDebuggerAgent(InstrumentingAgents*, InspectorCompositeState*, Injec
tedScriptManager*); |
140 | 148 |
141 virtual void startListeningScriptDebugServer() = 0; | 149 virtual void startListeningScriptDebugServer() = 0; |
142 virtual void stopListeningScriptDebugServer() = 0; | 150 virtual void stopListeningScriptDebugServer() = 0; |
143 virtual void muteConsole() = 0; | 151 virtual void muteConsole() = 0; |
144 virtual void unmuteConsole() = 0; | 152 virtual void unmuteConsole() = 0; |
145 InjectedScriptManager* injectedScriptManager() { return m_injectedScriptMana
ger; } | 153 InjectedScriptManager* injectedScriptManager() { return m_injectedScriptMana
ger; } |
146 virtual InjectedScript injectedScriptForEval(ErrorString*, const int* execut
ionContextId) = 0; | 154 virtual InjectedScript injectedScriptForEval(ErrorString*, const int* execut
ionContextId) = 0; |
147 virtual void addConsoleMessage(MessageSource, MessageLevel, const String& me
ssage, const String& sourceURL) = 0; | 155 virtual void addConsoleMessage(MessageSource, MessageLevel, const String& me
ssage, const String& sourceURL) = 0; |
(...skipping 10 matching lines...) Expand all Loading... |
158 | 166 |
159 bool enabled(); | 167 bool enabled(); |
160 | 168 |
161 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCal
lFrames(); | 169 PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCal
lFrames(); |
162 | 170 |
163 virtual void didParseSource(const String& scriptId, const Script&); | 171 virtual void didParseSource(const String& scriptId, const Script&); |
164 virtual void failedToParseSource(const String& url, const String& data, int
firstLine, int errorLine, const String& errorMessage); | 172 virtual void failedToParseSource(const String& url, const String& data, int
firstLine, int errorLine, const String& errorMessage); |
165 | 173 |
166 void setPauseOnExceptionsImpl(ErrorString*, int); | 174 void setPauseOnExceptionsImpl(ErrorString*, int); |
167 | 175 |
168 PassRefPtr<TypeBuilder::Debugger::Location> resolveBreakpoint(const String&
breakpointId, const String& scriptId, const ScriptBreakpoint&); | 176 PassRefPtr<TypeBuilder::Debugger::Location> resolveBreakpoint(const String&
breakpointId, const String& scriptId, const ScriptBreakpoint&, BreakpointSource)
; |
| 177 void removeBreakpoint(const String& breakpointId); |
169 void clear(); | 178 void clear(); |
170 bool assertPaused(ErrorString*); | 179 bool assertPaused(ErrorString*); |
171 void clearBreakDetails(); | 180 void clearBreakDetails(); |
172 | 181 |
173 String sourceMapURLForScript(const Script&); | 182 String sourceMapURLForScript(const Script&); |
174 | 183 |
175 typedef HashMap<String, Script> ScriptsMap; | 184 typedef HashMap<String, Script> ScriptsMap; |
176 typedef HashMap<String, Vector<String> > BreakpointIdToDebugServerBreakpoint
IdsMap; | 185 typedef HashMap<String, Vector<String> > BreakpointIdToDebugServerBreakpoint
IdsMap; |
177 typedef HashMap<String, String> DebugServerBreakpointIdToBreakpointIdMap; | 186 typedef HashMap<String, std::pair<String, BreakpointSource> > DebugServerBre
akpointToBreakpointIdAndSourceMap; |
178 | 187 |
179 InjectedScriptManager* m_injectedScriptManager; | 188 InjectedScriptManager* m_injectedScriptManager; |
180 InspectorFrontend::Debugger* m_frontend; | 189 InspectorFrontend::Debugger* m_frontend; |
181 ScriptState* m_pausedScriptState; | 190 ScriptState* m_pausedScriptState; |
182 ScriptValue m_currentCallStack; | 191 ScriptValue m_currentCallStack; |
183 ScriptsMap m_scripts; | 192 ScriptsMap m_scripts; |
184 BreakpointIdToDebugServerBreakpointIdsMap m_breakpointIdToDebugServerBreakpo
intIds; | 193 BreakpointIdToDebugServerBreakpointIdsMap m_breakpointIdToDebugServerBreakpo
intIds; |
185 DebugServerBreakpointIdToBreakpointIdMap m_serverBreakpointIdToBreakpointId; | 194 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; |
186 String m_continueToLocationBreakpointId; | 195 String m_continueToLocationBreakpointId; |
187 InspectorFrontend::Debugger::Reason::Enum m_breakReason; | 196 InspectorFrontend::Debugger::Reason::Enum m_breakReason; |
188 RefPtr<InspectorObject> m_breakAuxData; | 197 RefPtr<InspectorObject> m_breakAuxData; |
189 bool m_javaScriptPauseScheduled; | 198 bool m_javaScriptPauseScheduled; |
190 Listener* m_listener; | 199 Listener* m_listener; |
191 }; | 200 }; |
192 | 201 |
193 } // namespace WebCore | 202 } // namespace WebCore |
194 | 203 |
195 | 204 |
196 #endif // !defined(InspectorDebuggerAgent_h) | 205 #endif // !defined(InspectorDebuggerAgent_h) |
OLD | NEW |