| 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) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 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 15 matching lines...) Expand all Loading... |
| 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 #include "config.h" | 30 #include "config.h" |
| 31 #include "core/inspector/InspectorDebuggerAgent.h" | 31 #include "core/inspector/InspectorDebuggerAgent.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 InspectorDebuggerAgent::InspectorDebuggerAgent(InjectedScriptManager* injectedSc
riptManager, V8Debugger* debugger) | 35 InspectorDebuggerAgent::InspectorDebuggerAgent(InjectedScriptManager* injectedSc
riptManager, V8Debugger* debugger) |
| 36 : V8DebuggerAgent(injectedScriptManager, debugger) | 36 : V8DebuggerAgent(injectedScriptManager, debugger, this) |
| 37 , m_listener(nullptr) |
| 37 { | 38 { |
| 38 } | 39 } |
| 39 | 40 |
| 40 InspectorDebuggerAgent::~InspectorDebuggerAgent() | 41 InspectorDebuggerAgent::~InspectorDebuggerAgent() |
| 41 { | 42 { |
| 42 #if !ENABLE(OILPAN) | 43 #if !ENABLE(OILPAN) |
| 43 ASSERT(!m_instrumentingAgents->inspectorDebuggerAgent()); | 44 ASSERT(!m_instrumentingAgents->inspectorDebuggerAgent()); |
| 44 #endif | 45 #endif |
| 45 } | 46 } |
| 46 | 47 |
| 48 DEFINE_TRACE(InspectorDebuggerAgent) |
| 49 { |
| 50 #if ENABLE(OILPAN) |
| 51 visitor->trace(m_listener); |
| 52 #endif |
| 53 V8DebuggerAgent::trace(visitor); |
| 54 } |
| 55 |
| 47 void InspectorDebuggerAgent::enable(ErrorString* errorString) | 56 void InspectorDebuggerAgent::enable(ErrorString* errorString) |
| 48 { | 57 { |
| 49 V8DebuggerAgent::enable(errorString); | 58 V8DebuggerAgent::enable(errorString); |
| 50 } | 59 } |
| 51 | 60 |
| 52 void InspectorDebuggerAgent::enable() | 61 void InspectorDebuggerAgent::startListeningV8Debugger() |
| 53 { | 62 { |
| 54 m_instrumentingAgents->setInspectorDebuggerAgent(this); | 63 m_instrumentingAgents->setInspectorDebuggerAgent(this); |
| 55 V8DebuggerAgent::enable(); | 64 if (m_listener) |
| 65 m_listener->debuggerWasEnabled(); |
| 56 } | 66 } |
| 57 | 67 |
| 58 void InspectorDebuggerAgent::disable() | 68 void InspectorDebuggerAgent::stopListeningV8Debugger() |
| 59 { | 69 { |
| 60 m_instrumentingAgents->setInspectorDebuggerAgent(nullptr); | 70 m_instrumentingAgents->setInspectorDebuggerAgent(nullptr); |
| 61 V8DebuggerAgent::disable(); | 71 if (m_listener) |
| 72 m_listener->debuggerWasDisabled(); |
| 73 } |
| 74 |
| 75 bool InspectorDebuggerAgent::canPauseOnPromiseEvent() |
| 76 { |
| 77 return m_listener && m_listener->canPauseOnPromiseEvent(); |
| 78 } |
| 79 |
| 80 void InspectorDebuggerAgent::didCreatePromise() |
| 81 { |
| 82 if (m_listener) |
| 83 m_listener->didCreatePromise(); |
| 84 } |
| 85 |
| 86 void InspectorDebuggerAgent::didResolvePromise() |
| 87 { |
| 88 if (m_listener) |
| 89 m_listener->didResolvePromise(); |
| 90 } |
| 91 |
| 92 void InspectorDebuggerAgent::didRejectPromise() |
| 93 { |
| 94 if (m_listener) |
| 95 m_listener->didRejectPromise(); |
| 62 } | 96 } |
| 63 | 97 |
| 64 } // namespace blink | 98 } // namespace blink |
| OLD | NEW |