OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 MOJO_PUBLIC_CPP_BINDINGS_LIB_CONTROL_MESSAGE_HANDLER_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_CONTROL_MESSAGE_HANDLER_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_CONTROL_MESSAGE_HANDLER_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_CONTROL_MESSAGE_HANDLER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
| 12 #include "base/compiler_specific.h" |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "mojo/public/cpp/bindings/bindings_export.h" |
13 #include "mojo/public/cpp/bindings/lib/serialization_context.h" | 15 #include "mojo/public/cpp/bindings/lib/serialization_context.h" |
14 #include "mojo/public/cpp/bindings/message.h" | 16 #include "mojo/public/cpp/bindings/message.h" |
15 | 17 |
16 namespace mojo { | 18 namespace mojo { |
17 namespace internal { | 19 namespace internal { |
18 | 20 |
19 // Handlers for request messages defined in interface_control_messages.mojom. | 21 // Handlers for request messages defined in interface_control_messages.mojom. |
20 class ControlMessageHandler : public MessageReceiverWithResponderStatus { | 22 class MOJO_CPP_BINDINGS_EXPORT ControlMessageHandler |
| 23 : NON_EXPORTED_BASE(public MessageReceiverWithResponderStatus) { |
21 public: | 24 public: |
22 static bool IsControlMessage(const Message* message); | 25 static bool IsControlMessage(const Message* message); |
23 | 26 |
24 explicit ControlMessageHandler(uint32_t interface_version); | 27 explicit ControlMessageHandler(uint32_t interface_version); |
25 ~ControlMessageHandler() override; | 28 ~ControlMessageHandler() override; |
26 | 29 |
27 // Call the following methods only if IsControlMessage() returned true. | 30 // Call the following methods only if IsControlMessage() returned true. |
28 bool Accept(Message* message) override; | 31 bool Accept(Message* message) override; |
29 // Takes ownership of |responder|. | 32 // Takes ownership of |responder|. |
30 bool AcceptWithResponder(Message* message, | 33 bool AcceptWithResponder(Message* message, |
(...skipping 17 matching lines...) Expand all Loading... |
48 uint32_t disconnect_custom_reason_ = 0; | 51 uint32_t disconnect_custom_reason_ = 0; |
49 std::string disconnect_description_; | 52 std::string disconnect_description_; |
50 | 53 |
51 DISALLOW_COPY_AND_ASSIGN(ControlMessageHandler); | 54 DISALLOW_COPY_AND_ASSIGN(ControlMessageHandler); |
52 }; | 55 }; |
53 | 56 |
54 } // namespace internal | 57 } // namespace internal |
55 } // namespace mojo | 58 } // namespace mojo |
56 | 59 |
57 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_CONTROL_MESSAGE_HANDLER_H_ | 60 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_CONTROL_MESSAGE_HANDLER_H_ |
OLD | NEW |