OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |