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 #ifndef HEADLESS_PUBLIC_INTERNAL_MESSAGE_DISPATCHER_H_ | 5 #ifndef HEADLESS_PUBLIC_INTERNAL_MESSAGE_DISPATCHER_H_ |
6 #define HEADLESS_PUBLIC_INTERNAL_MESSAGE_DISPATCHER_H_ | 6 #define HEADLESS_PUBLIC_INTERNAL_MESSAGE_DISPATCHER_H_ |
7 | 7 |
8 namespace headless { | 8 namespace headless { |
9 namespace internal { | 9 namespace internal { |
10 | 10 |
11 // An internal interface for sending DevTools messages from the domain agents. | 11 // An internal interface for sending DevTools messages from the domain agents. |
12 class MessageDispatcher { | 12 class MessageDispatcher { |
13 public: | 13 public: |
14 virtual void SendMessage( | 14 virtual void SendMessage( |
15 const char* method, | 15 const char* method, |
16 std::unique_ptr<base::Value> params, | 16 std::unique_ptr<base::Value> params, |
17 base::Callback<void(const base::Value&)> callback) = 0; | 17 base::Callback<void(const base::Value&)> callback) = 0; |
18 virtual void SendMessage(const char* method, | 18 virtual void SendMessage(const char* method, |
19 std::unique_ptr<base::Value> params, | 19 std::unique_ptr<base::Value> params, |
20 base::Callback<void()> callback) = 0; | 20 base::Callback<void()> callback) = 0; |
21 virtual void SendMessage( | 21 virtual void SendMessage( |
22 const char* method, | 22 const char* method, |
23 base::Callback<void(const base::Value&)> callback) = 0; | 23 base::Callback<void(const base::Value&)> callback) = 0; |
24 virtual void SendMessage(const char* method, | 24 virtual void SendMessage(const char* method, |
25 base::Callback<void()> callback) = 0; | 25 base::Callback<void()> callback) = 0; |
| 26 |
| 27 virtual void RegisterEventHandler( |
| 28 const char* method, |
| 29 base::Callback<void(const base::Value&)> callback) = 0; |
26 }; | 30 }; |
27 | 31 |
28 } // namespace internal | 32 } // namespace internal |
29 } // namespace headless | 33 } // namespace headless |
30 | 34 |
31 #endif // HEADLESS_PUBLIC_INTERNAL_MESSAGE_DISPATCHER_H_ | 35 #endif // HEADLESS_PUBLIC_INTERNAL_MESSAGE_DISPATCHER_H_ |
OLD | NEW |