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 #ifndef V8_INSPECTOR_V8CONSOLEAGENTIMPL_H_ | 5 #ifndef V8_INSPECTOR_V8CONSOLEAGENTIMPL_H_ |
6 #define V8_INSPECTOR_V8CONSOLEAGENTIMPL_H_ | 6 #define V8_INSPECTOR_V8CONSOLEAGENTIMPL_H_ |
7 | 7 |
8 #include "src/base/macros.h" | 8 #include "src/base/macros.h" |
9 #include "src/inspector/protocol/Console.h" | 9 #include "src/inspector/protocol/Console.h" |
10 #include "src/inspector/protocol/Forward.h" | 10 #include "src/inspector/protocol/Forward.h" |
11 | 11 |
12 namespace v8_inspector { | 12 namespace v8_inspector { |
13 | 13 |
14 class V8ConsoleMessage; | 14 class V8ConsoleMessage; |
15 class V8InspectorSessionImpl; | 15 class V8InspectorSessionImpl; |
16 | 16 |
17 using protocol::ErrorString; | 17 using protocol::Response; |
18 | 18 |
19 class V8ConsoleAgentImpl : public protocol::Console::Backend { | 19 class V8ConsoleAgentImpl : public protocol::Console::Backend { |
20 public: | 20 public: |
21 V8ConsoleAgentImpl(V8InspectorSessionImpl*, protocol::FrontendChannel*, | 21 V8ConsoleAgentImpl(V8InspectorSessionImpl*, protocol::FrontendChannel*, |
22 protocol::DictionaryValue* state); | 22 protocol::DictionaryValue* state); |
23 ~V8ConsoleAgentImpl() override; | 23 ~V8ConsoleAgentImpl() override; |
24 | 24 |
25 void enable(ErrorString*) override; | 25 Response enable() override; |
26 void disable(ErrorString*) override; | 26 Response disable() override; |
27 void clearMessages(ErrorString*) override; | 27 Response clearMessages() override; |
28 | 28 |
29 void restore(); | 29 void restore(); |
30 void messageAdded(V8ConsoleMessage*); | 30 void messageAdded(V8ConsoleMessage*); |
31 void reset(); | 31 void reset(); |
32 bool enabled(); | 32 bool enabled(); |
33 | 33 |
34 private: | 34 private: |
35 void reportAllMessages(); | 35 void reportAllMessages(); |
36 bool reportMessage(V8ConsoleMessage*, bool generatePreview); | 36 bool reportMessage(V8ConsoleMessage*, bool generatePreview); |
37 | 37 |
38 V8InspectorSessionImpl* m_session; | 38 V8InspectorSessionImpl* m_session; |
39 protocol::DictionaryValue* m_state; | 39 protocol::DictionaryValue* m_state; |
40 protocol::Console::Frontend m_frontend; | 40 protocol::Console::Frontend m_frontend; |
41 bool m_enabled; | 41 bool m_enabled; |
42 | 42 |
43 DISALLOW_COPY_AND_ASSIGN(V8ConsoleAgentImpl); | 43 DISALLOW_COPY_AND_ASSIGN(V8ConsoleAgentImpl); |
44 }; | 44 }; |
45 | 45 |
46 } // namespace v8_inspector | 46 } // namespace v8_inspector |
47 | 47 |
48 #endif // V8_INSPECTOR_V8CONSOLEAGENTIMPL_H_ | 48 #endif // V8_INSPECTOR_V8CONSOLEAGENTIMPL_H_ |
OLD | NEW |