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_REQUEST_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_REQUEST_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_REQUEST_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_REQUEST_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "mojo/public/cpp/bindings/lib/scoped_interface_endpoint_handle.h" | 9 #include "mojo/public/cpp/bindings/lib/scoped_interface_endpoint_handle.h" |
10 | 10 |
11 namespace mojo { | 11 namespace mojo { |
12 | 12 |
13 namespace internal { | 13 namespace internal { |
14 class AssociatedInterfaceRequestHelper; | 14 class AssociatedInterfaceRequestHelper; |
15 } | 15 } |
16 | 16 |
17 // AssociatedInterfaceRequest represents an associated interface request. It is | 17 // AssociatedInterfaceRequest represents an associated interface request. It is |
18 // similar to InterfaceRequest except that it doesn't own a message pipe handle. | 18 // similar to InterfaceRequest except that it doesn't own a message pipe handle. |
19 template <typename Interface> | 19 template <typename Interface> |
20 class AssociatedInterfaceRequest { | 20 class AssociatedInterfaceRequest { |
21 MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(AssociatedInterfaceRequest); | 21 DISALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND(AssociatedInterfaceRequest); |
22 | 22 |
23 public: | 23 public: |
24 // Constructs an empty AssociatedInterfaceRequest, representing that the | 24 // Constructs an empty AssociatedInterfaceRequest, representing that the |
25 // client is not requesting an implementation of Interface. | 25 // client is not requesting an implementation of Interface. |
26 AssociatedInterfaceRequest() {} | 26 AssociatedInterfaceRequest() {} |
27 AssociatedInterfaceRequest(decltype(nullptr)) {} | 27 AssociatedInterfaceRequest(decltype(nullptr)) {} |
28 | 28 |
29 // Takes the interface endpoint handle from another | 29 // Takes the interface endpoint handle from another |
30 // AssociatedInterfaceRequest. | 30 // AssociatedInterfaceRequest. |
31 AssociatedInterfaceRequest(AssociatedInterfaceRequest&& other) { | 31 AssociatedInterfaceRequest(AssociatedInterfaceRequest&& other) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 static void SetHandle(AssociatedInterfaceRequest<Interface>* request, | 78 static void SetHandle(AssociatedInterfaceRequest<Interface>* request, |
79 ScopedInterfaceEndpointHandle handle) { | 79 ScopedInterfaceEndpointHandle handle) { |
80 request->handle_ = handle.Pass(); | 80 request->handle_ = handle.Pass(); |
81 } | 81 } |
82 }; | 82 }; |
83 | 83 |
84 } // namespace internal | 84 } // namespace internal |
85 } // namespace mojo | 85 } // namespace mojo |
86 | 86 |
87 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_REQUEST_H_ | 87 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_REQUEST_H_ |
OLD | NEW |