OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project 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 "src/inspector/V8ConsoleAgentImpl.h" | 5 #include "src/inspector/V8ConsoleAgentImpl.h" |
6 | 6 |
7 #include "src/inspector/V8ConsoleMessage.h" | 7 #include "src/inspector/V8ConsoleMessage.h" |
8 #include "src/inspector/V8InspectorImpl.h" | 8 #include "src/inspector/V8InspectorImpl.h" |
9 #include "src/inspector/V8InspectorSessionImpl.h" | 9 #include "src/inspector/V8InspectorSessionImpl.h" |
10 #include "src/inspector/V8StackTraceImpl.h" | 10 #include "src/inspector/V8StackTraceImpl.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 if (m_enabled) reportMessage(message, true); | 54 if (m_enabled) reportMessage(message, true); |
55 } | 55 } |
56 | 56 |
57 bool V8ConsoleAgentImpl::enabled() { return m_enabled; } | 57 bool V8ConsoleAgentImpl::enabled() { return m_enabled; } |
58 | 58 |
59 void V8ConsoleAgentImpl::reportAllMessages() { | 59 void V8ConsoleAgentImpl::reportAllMessages() { |
60 V8ConsoleMessageStorage* storage = | 60 V8ConsoleMessageStorage* storage = |
61 m_session->inspector()->ensureConsoleMessageStorage( | 61 m_session->inspector()->ensureConsoleMessageStorage( |
62 m_session->contextGroupId()); | 62 m_session->contextGroupId()); |
63 for (const auto& message : storage->messages()) { | 63 for (const auto& message : storage->messages()) { |
64 if (message->origin() == V8MessageOrigin::kConsole) | 64 if (message->origin() == V8MessageOrigin::kConsole) { |
65 reportMessage(message.get(), false); | 65 if (!reportMessage(message.get(), false)) return; |
| 66 } |
66 } | 67 } |
67 } | 68 } |
68 | 69 |
69 void V8ConsoleAgentImpl::reportMessage(V8ConsoleMessage* message, | 70 bool V8ConsoleAgentImpl::reportMessage(V8ConsoleMessage* message, |
70 bool generatePreview) { | 71 bool generatePreview) { |
71 DCHECK(message->origin() == V8MessageOrigin::kConsole); | 72 DCHECK(message->origin() == V8MessageOrigin::kConsole); |
72 message->reportToFrontend(&m_frontend); | 73 message->reportToFrontend(&m_frontend); |
73 m_frontend.flush(); | 74 m_frontend.flush(); |
| 75 return m_session->inspector()->hasConsoleMessageStorage( |
| 76 m_session->contextGroupId()); |
74 } | 77 } |
75 | 78 |
76 } // namespace v8_inspector | 79 } // namespace v8_inspector |
OLD | NEW |