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 <algorithm> | 8 #include "base/logging.h" |
9 | |
10 #include "base/macros.h" | 9 #include "base/macros.h" |
11 #include "mojo/public/cpp/bindings/associated_group.h" | 10 #include "mojo/public/cpp/bindings/associated_group.h" |
12 #include "mojo/public/cpp/bindings/associated_interface_ptr_info.h" | 11 #include "mojo/public/cpp/bindings/associated_interface_ptr_info.h" |
13 #include "mojo/public/cpp/bindings/associated_interface_request.h" | 12 #include "mojo/public/cpp/bindings/associated_interface_request.h" |
14 #include "mojo/public/cpp/bindings/callback.h" | 13 #include "mojo/public/cpp/bindings/callback.h" |
15 #include "mojo/public/cpp/bindings/lib/associated_interface_ptr_internal.h" | 14 #include "mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h" |
16 | 15 |
17 namespace mojo { | 16 namespace mojo { |
18 | 17 |
19 // Represents the client side of an associated interface. It is similar to | 18 // Represents the client side of an associated interface. It is similar to |
20 // InterfacePtr, except that it doesn't own a message pipe handle. | 19 // InterfacePtr, except that it doesn't own a message pipe handle. |
21 template <typename Interface> | 20 template <typename Interface> |
22 class AssociatedInterfacePtr { | 21 class AssociatedInterfacePtr { |
23 MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(AssociatedInterfacePtr) | 22 MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(AssociatedInterfacePtr) |
24 | 23 |
25 public: | 24 public: |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 group->CreateAssociatedInterface(AssociatedGroup::WILL_PASS_REQUEST, | 181 group->CreateAssociatedInterface(AssociatedGroup::WILL_PASS_REQUEST, |
183 &ptr_info, &request); | 182 &ptr_info, &request); |
184 | 183 |
185 ptr->Bind(ptr_info.Pass()); | 184 ptr->Bind(ptr_info.Pass()); |
186 return request.Pass(); | 185 return request.Pass(); |
187 } | 186 } |
188 | 187 |
189 } // namespace mojo | 188 } // namespace mojo |
190 | 189 |
191 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_H_ | 190 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_H_ |
OLD | NEW |