Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: mojo/public/cpp/bindings/associated_interface_ptr.h

Issue 2668153003: Mojo C++ Bindings: Eliminate unbound ThreadSafeInterfacePtr (Closed)
Patch Set: format and rebase... Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ipc/ipc_mojo_bootstrap_unittest.cc ('k') | mojo/public/cpp/bindings/interface_ptr.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « ipc/ipc_mojo_bootstrap_unittest.cc ('k') | mojo/public/cpp/bindings/interface_ptr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698