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_ASSOCIATED_INTERFACE_PTR_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "mojo/public/cpp/bindings/lib/multiplex_router.h" | 24 #include "mojo/public/cpp/bindings/lib/multiplex_router.h" |
25 #include "mojo/public/cpp/system/message_pipe.h" | 25 #include "mojo/public/cpp/system/message_pipe.h" |
26 | 26 |
27 namespace mojo { | 27 namespace mojo { |
28 | 28 |
29 // Represents the client side of an associated interface. It is similar to | 29 // Represents the client side of an associated interface. It is similar to |
30 // InterfacePtr, except that it doesn't own a message pipe handle. | 30 // InterfacePtr, except that it doesn't own a message pipe handle. |
31 template <typename Interface> | 31 template <typename Interface> |
32 class AssociatedInterfacePtr { | 32 class AssociatedInterfacePtr { |
33 public: | 33 public: |
| 34 using InterfaceType = Interface; |
| 35 using PtrInfoType = AssociatedInterfacePtrInfo<Interface>; |
| 36 |
34 // Constructs an unbound AssociatedInterfacePtr. | 37 // Constructs an unbound AssociatedInterfacePtr. |
35 AssociatedInterfacePtr() {} | 38 AssociatedInterfacePtr() {} |
36 AssociatedInterfacePtr(decltype(nullptr)) {} | 39 AssociatedInterfacePtr(decltype(nullptr)) {} |
37 | 40 |
38 AssociatedInterfacePtr(AssociatedInterfacePtr&& other) { | 41 AssociatedInterfacePtr(AssociatedInterfacePtr&& other) { |
39 internal_state_.Swap(&other.internal_state_); | 42 internal_state_.Swap(&other.internal_state_); |
40 } | 43 } |
41 | 44 |
42 AssociatedInterfacePtr& operator=(AssociatedInterfacePtr&& other) { | 45 AssociatedInterfacePtr& operator=(AssociatedInterfacePtr&& other) { |
43 reset(); | 46 reset(); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 Interface::Version_)); | 291 Interface::Version_)); |
289 | 292 |
290 AssociatedInterfaceRequest<Interface> request; | 293 AssociatedInterfaceRequest<Interface> request; |
291 request.Bind(std::move(endpoint1)); | 294 request.Bind(std::move(endpoint1)); |
292 return request; | 295 return request; |
293 } | 296 } |
294 | 297 |
295 } // namespace mojo | 298 } // namespace mojo |
296 | 299 |
297 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_H_ | 300 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_H_ |
OLD | NEW |