| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/v8_inspector/V8ConsoleAgentImpl.h" | 5 #include "platform/v8_inspector/V8ConsoleAgentImpl.h" |
| 6 | 6 |
| 7 #include "platform/v8_inspector/V8ConsoleMessage.h" | 7 #include "platform/v8_inspector/V8ConsoleMessage.h" |
| 8 #include "platform/v8_inspector/V8DebuggerImpl.h" | 8 #include "platform/v8_inspector/V8DebuggerImpl.h" |
| 9 #include "platform/v8_inspector/V8InspectorSessionImpl.h" | 9 #include "platform/v8_inspector/V8InspectorSessionImpl.h" |
| 10 #include "platform/v8_inspector/V8StackTraceImpl.h" | 10 #include "platform/v8_inspector/V8StackTraceImpl.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 | 29 |
| 30 void V8ConsoleAgentImpl::enable(ErrorString* errorString) | 30 void V8ConsoleAgentImpl::enable(ErrorString* errorString) |
| 31 { | 31 { |
| 32 if (m_enabled) | 32 if (m_enabled) |
| 33 return; | 33 return; |
| 34 m_state->setBoolean(ConsoleAgentState::consoleEnabled, true); | 34 m_state->setBoolean(ConsoleAgentState::consoleEnabled, true); |
| 35 m_enabled = true; | 35 m_enabled = true; |
| 36 m_session->debugger()->enableStackCapturingIfNeeded(); | 36 m_session->debugger()->enableStackCapturingIfNeeded(); |
| 37 reportAllMessages(); | 37 reportAllMessages(); |
| 38 m_session->client()->consoleEnabled(); | |
| 39 } | 38 } |
| 40 | 39 |
| 41 void V8ConsoleAgentImpl::disable(ErrorString* errorString) | 40 void V8ConsoleAgentImpl::disable(ErrorString* errorString) |
| 42 { | 41 { |
| 43 if (!m_enabled) | 42 if (!m_enabled) |
| 44 return; | 43 return; |
| 45 m_session->debugger()->disableStackCapturingIfNeeded(); | 44 m_session->debugger()->disableStackCapturingIfNeeded(); |
| 46 m_state->setBoolean(ConsoleAgentState::consoleEnabled, false); | 45 m_state->setBoolean(ConsoleAgentState::consoleEnabled, false); |
| 47 m_enabled = false; | 46 m_enabled = false; |
| 48 } | 47 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 } | 101 } |
| 103 | 102 |
| 104 void V8ConsoleAgentImpl::reportMessage(V8ConsoleMessage* message, bool generateP
review) | 103 void V8ConsoleAgentImpl::reportMessage(V8ConsoleMessage* message, bool generateP
review) |
| 105 { | 104 { |
| 106 DCHECK_EQ(V8MessageOrigin::kConsole, message->origin()); | 105 DCHECK_EQ(V8MessageOrigin::kConsole, message->origin()); |
| 107 message->reportToFrontend(&m_frontend, m_session, generatePreview); | 106 message->reportToFrontend(&m_frontend, m_session, generatePreview); |
| 108 m_frontend.flush(); | 107 m_frontend.flush(); |
| 109 } | 108 } |
| 110 | 109 |
| 111 } // namespace blink | 110 } // namespace blink |
| OLD | NEW |