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_PIPE_CONTROL_MESSAGE_PROXY_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_PROXY_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_PROXY_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_PROXY_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "mojo/public/cpp/bindings/bindings_export.h" | 9 #include "mojo/public/cpp/bindings/bindings_export.h" |
10 #include "mojo/public/cpp/bindings/interface_id.h" | 10 #include "mojo/public/cpp/bindings/interface_id.h" |
11 #include "mojo/public/cpp/bindings/lib/serialization_context.h" | 11 #include "mojo/public/cpp/bindings/lib/serialization_context.h" |
12 | 12 |
13 namespace mojo { | 13 namespace mojo { |
14 | 14 |
15 class MessageReceiver; | 15 class MessageReceiver; |
16 | 16 |
17 // Proxy for request messages defined in pipe_control_messages.mojom. | 17 // Proxy for request messages defined in pipe_control_messages.mojom. |
| 18 // |
| 19 // NOTE: This object may be used from multiple threads. |
18 class MOJO_CPP_BINDINGS_EXPORT PipeControlMessageProxy { | 20 class MOJO_CPP_BINDINGS_EXPORT PipeControlMessageProxy { |
19 public: | 21 public: |
20 // Doesn't take ownership of |receiver|. It must outlive this object. | 22 // Doesn't take ownership of |receiver|. If This PipeControlMessageProxy will |
| 23 // be used from multiple threads, |receiver| must be thread-safe. |
21 explicit PipeControlMessageProxy(MessageReceiver* receiver); | 24 explicit PipeControlMessageProxy(MessageReceiver* receiver); |
22 | 25 |
23 void NotifyPeerEndpointClosed(InterfaceId id); | 26 void NotifyPeerEndpointClosed(InterfaceId id); |
24 void NotifyEndpointClosedBeforeSent(InterfaceId id); | 27 void NotifyEndpointClosedBeforeSent(InterfaceId id); |
25 | 28 |
26 private: | 29 private: |
27 // Not owned. | 30 // Not owned. |
28 MessageReceiver* receiver_; | 31 MessageReceiver* receiver_; |
29 internal::SerializationContext context_; | |
30 | 32 |
31 DISALLOW_COPY_AND_ASSIGN(PipeControlMessageProxy); | 33 DISALLOW_COPY_AND_ASSIGN(PipeControlMessageProxy); |
32 }; | 34 }; |
33 | 35 |
34 } // namespace mojo | 36 } // namespace mojo |
35 | 37 |
36 #endif // MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_PROXY_H_ | 38 #endif // MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_PROXY_H_ |
OLD | NEW |