| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 class ScriptDebugServer; | 67 class ScriptDebugServer; |
| 68 class ScriptRegexp; | 68 class ScriptRegexp; |
| 69 class ScriptSourceCode; | 69 class ScriptSourceCode; |
| 70 class ScriptValue; | 70 class ScriptValue; |
| 71 class ThreadableLoaderClient; | 71 class ThreadableLoaderClient; |
| 72 class XMLHttpRequest; | 72 class XMLHttpRequest; |
| 73 | 73 |
| 74 typedef String ErrorString; | 74 typedef String ErrorString; |
| 75 | 75 |
| 76 class InspectorDebuggerAgent : public InspectorBaseAgent<InspectorDebuggerAgent>
, public ScriptDebugListener, public InspectorBackendDispatcher::DebuggerCommand
Handler { | 76 class InspectorDebuggerAgent : public InspectorBaseAgent<InspectorDebuggerAgent>
, public ScriptDebugListener, public InspectorBackendDispatcher::DebuggerCommand
Handler { |
| 77 WTF_MAKE_NONCOPYABLE(InspectorDebuggerAgent); WTF_MAKE_FAST_ALLOCATED; | 77 WTF_MAKE_NONCOPYABLE(InspectorDebuggerAgent); |
| 78 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
| 78 public: | 79 public: |
| 79 enum BreakpointSource { | 80 enum BreakpointSource { |
| 80 UserBreakpointSource, | 81 UserBreakpointSource, |
| 81 DebugCommandBreakpointSource, | 82 DebugCommandBreakpointSource, |
| 82 MonitorCommandBreakpointSource | 83 MonitorCommandBreakpointSource |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 static const char backtraceObjectGroup[]; | 86 static const char backtraceObjectGroup[]; |
| 86 | 87 |
| 87 virtual ~InspectorDebuggerAgent(); | 88 virtual ~InspectorDebuggerAgent(); |
| 89 virtual void trace(Visitor*); |
| 88 | 90 |
| 89 virtual void canSetScriptSource(ErrorString*, bool* result) OVERRIDE FINAL {
*result = true; } | 91 virtual void canSetScriptSource(ErrorString*, bool* result) OVERRIDE FINAL {
*result = true; } |
| 90 | 92 |
| 91 virtual void init() OVERRIDE FINAL; | 93 virtual void init() OVERRIDE FINAL; |
| 92 virtual void setFrontend(InspectorFrontend*) OVERRIDE FINAL; | 94 virtual void setFrontend(InspectorFrontend*) OVERRIDE FINAL; |
| 93 virtual void clearFrontend() OVERRIDE FINAL; | 95 virtual void clearFrontend() OVERRIDE FINAL; |
| 94 virtual void restore() OVERRIDE FINAL; | 96 virtual void restore() OVERRIDE FINAL; |
| 95 | 97 |
| 96 bool isPaused(); | 98 bool isPaused(); |
| 97 bool runningNestedMessageLoop(); | 99 bool runningNestedMessageLoop(); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 void willDeliverMutationRecords(ExecutionContext*, MutationObserver*); | 163 void willDeliverMutationRecords(ExecutionContext*, MutationObserver*); |
| 162 void didDeliverMutationRecords(); | 164 void didDeliverMutationRecords(); |
| 163 void didPostExecutionContextTask(ExecutionContext*, ExecutionContextTask*); | 165 void didPostExecutionContextTask(ExecutionContext*, ExecutionContextTask*); |
| 164 void didKillAllExecutionContextTasks(ExecutionContext*); | 166 void didKillAllExecutionContextTasks(ExecutionContext*); |
| 165 void willPerformExecutionContextTask(ExecutionContext*, ExecutionContextTask
*); | 167 void willPerformExecutionContextTask(ExecutionContext*, ExecutionContextTask
*); |
| 166 void didPerformExecutionContextTask(); | 168 void didPerformExecutionContextTask(); |
| 167 bool canBreakProgram(); | 169 bool canBreakProgram(); |
| 168 void breakProgram(InspectorFrontend::Debugger::Reason::Enum breakReason, Pas
sRefPtr<JSONObject> data); | 170 void breakProgram(InspectorFrontend::Debugger::Reason::Enum breakReason, Pas
sRefPtr<JSONObject> data); |
| 169 void scriptExecutionBlockedByCSP(const String& directiveText); | 171 void scriptExecutionBlockedByCSP(const String& directiveText); |
| 170 | 172 |
| 171 class Listener { | 173 class Listener : public WillBeGarbageCollectedMixin { |
| 172 public: | 174 public: |
| 173 virtual ~Listener() { } | 175 virtual ~Listener() { } |
| 174 virtual void debuggerWasEnabled() = 0; | 176 virtual void debuggerWasEnabled() = 0; |
| 175 virtual void debuggerWasDisabled() = 0; | 177 virtual void debuggerWasDisabled() = 0; |
| 176 virtual void stepInto() = 0; | 178 virtual void stepInto() = 0; |
| 177 virtual void didPause() = 0; | 179 virtual void didPause() = 0; |
| 178 }; | 180 }; |
| 179 void setListener(Listener* listener) { m_listener = listener; } | 181 void setListener(Listener* listener) { m_listener = listener; } |
| 180 | 182 |
| 181 bool enabled(); | 183 bool enabled(); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 void clearBreakDetails(); | 230 void clearBreakDetails(); |
| 229 | 231 |
| 230 String sourceMapURLForScript(const Script&); | 232 String sourceMapURLForScript(const Script&); |
| 231 | 233 |
| 232 String scriptURL(JavaScriptCallFrame*); | 234 String scriptURL(JavaScriptCallFrame*); |
| 233 | 235 |
| 234 typedef HashMap<String, Script> ScriptsMap; | 236 typedef HashMap<String, Script> ScriptsMap; |
| 235 typedef HashMap<String, Vector<String> > BreakpointIdToDebugServerBreakpoint
IdsMap; | 237 typedef HashMap<String, Vector<String> > BreakpointIdToDebugServerBreakpoint
IdsMap; |
| 236 typedef HashMap<String, std::pair<String, BreakpointSource> > DebugServerBre
akpointToBreakpointIdAndSourceMap; | 238 typedef HashMap<String, std::pair<String, BreakpointSource> > DebugServerBre
akpointToBreakpointIdAndSourceMap; |
| 237 | 239 |
| 240 // FIXME: Oilpan: Move InjectedScriptManager to heap in follow-up CL. |
| 238 InjectedScriptManager* m_injectedScriptManager; | 241 InjectedScriptManager* m_injectedScriptManager; |
| 239 InspectorFrontend::Debugger* m_frontend; | 242 InspectorFrontend::Debugger* m_frontend; |
| 240 RefPtr<ScriptState> m_pausedScriptState; | 243 RefPtr<ScriptState> m_pausedScriptState; |
| 241 ScriptValue m_currentCallStack; | 244 ScriptValue m_currentCallStack; |
| 242 ScriptsMap m_scripts; | 245 ScriptsMap m_scripts; |
| 243 BreakpointIdToDebugServerBreakpointIdsMap m_breakpointIdToDebugServerBreakpo
intIds; | 246 BreakpointIdToDebugServerBreakpointIdsMap m_breakpointIdToDebugServerBreakpo
intIds; |
| 244 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; | 247 DebugServerBreakpointToBreakpointIdAndSourceMap m_serverBreakpoints; |
| 245 String m_continueToLocationBreakpointId; | 248 String m_continueToLocationBreakpointId; |
| 246 InspectorFrontend::Debugger::Reason::Enum m_breakReason; | 249 InspectorFrontend::Debugger::Reason::Enum m_breakReason; |
| 247 RefPtr<JSONObject> m_breakAuxData; | 250 RefPtr<JSONObject> m_breakAuxData; |
| 248 bool m_javaScriptPauseScheduled; | 251 bool m_javaScriptPauseScheduled; |
| 249 bool m_debuggerStepScheduled; | 252 bool m_debuggerStepScheduled; |
| 250 bool m_steppingFromFramework; | 253 bool m_steppingFromFramework; |
| 251 bool m_pausingOnNativeEvent; | 254 bool m_pausingOnNativeEvent; |
| 252 Listener* m_listener; | 255 RawPtrWillBeMember<Listener> m_listener; |
| 253 | 256 |
| 254 int m_skippedStepInCount; | 257 int m_skippedStepInCount; |
| 255 int m_minFrameCountForSkip; | 258 int m_minFrameCountForSkip; |
| 256 bool m_skipAllPauses; | 259 bool m_skipAllPauses; |
| 257 OwnPtr<ScriptRegexp> m_cachedSkipStackRegExp; | 260 OwnPtr<ScriptRegexp> m_cachedSkipStackRegExp; |
| 258 AsyncCallStackTracker m_asyncCallStackTracker; | 261 AsyncCallStackTracker m_asyncCallStackTracker; |
| 259 }; | 262 }; |
| 260 | 263 |
| 261 } // namespace WebCore | 264 } // namespace WebCore |
| 262 | 265 |
| 263 | 266 |
| 264 #endif // !defined(InspectorDebuggerAgent_h) | 267 #endif // !defined(InspectorDebuggerAgent_h) |
| OLD | NEW |