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

Side by Side Diff: mojo/public/cpp/bindings/lib/interface_ptr_internal.h

Issue 1677753002: Mojo C++ bindings: InterfacePtr::PassInterface -> PassInterfaceHandle (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_LIB_INTERFACE_PTR_INTERNAL_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_
7 7
8 #include <algorithm> // For |std::swap()|. 8 #include <algorithm> // For |std::swap()|.
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 bool WaitForIncomingResponse( 96 bool WaitForIncomingResponse(
97 MojoDeadline deadline = MOJO_DEADLINE_INDEFINITE) { 97 MojoDeadline deadline = MOJO_DEADLINE_INDEFINITE) {
98 ConfigureProxyIfNecessary(); 98 ConfigureProxyIfNecessary();
99 99
100 MOJO_DCHECK(router_); 100 MOJO_DCHECK(router_);
101 return router_->WaitForIncomingMessage(deadline); 101 return router_->WaitForIncomingMessage(deadline);
102 } 102 }
103 103
104 // After this method is called, the object is in an invalid state and 104 // After this method is called, the object is in an invalid state and
105 // shouldn't be reused. 105 // shouldn't be reused.
106 InterfaceHandle<Interface> PassInterface() { 106 InterfaceHandle<Interface> PassInterfaceHandle() {
107 return InterfaceHandle<Interface>( 107 return InterfaceHandle<Interface>(
108 router_ ? router_->PassMessagePipe() : handle_.Pass(), version_); 108 router_ ? router_->PassMessagePipe() : handle_.Pass(), version_);
109 } 109 }
110 110
111 bool is_bound() const { return handle_.is_valid() || router_; } 111 bool is_bound() const { return handle_.is_valid() || router_; }
112 112
113 bool encountered_error() const { 113 bool encountered_error() const {
114 return router_ ? router_->encountered_error() : false; 114 return router_ ? router_->encountered_error() : false;
115 } 115 }
116 116
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 164
165 uint32_t version_; 165 uint32_t version_;
166 166
167 MOJO_DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); 167 MOJO_DISALLOW_COPY_AND_ASSIGN(InterfacePtrState);
168 }; 168 };
169 169
170 } // namespace internal 170 } // namespace internal
171 } // namespace mojo 171 } // namespace mojo
172 172
173 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_ 173 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/bindings_serialization.h ('k') | mojo/services/log/cpp/lib/log_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698