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_STATE_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <algorithm> // For |std::swap()|. | 9 #include <algorithm> // For |std::swap()|. |
10 #include <utility> | 10 #include <utility> |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 DCHECK(router_); | 280 DCHECK(router_); |
281 return router_->WaitForIncomingMessage(MOJO_DEADLINE_INDEFINITE); | 281 return router_->WaitForIncomingMessage(MOJO_DEADLINE_INDEFINITE); |
282 } | 282 } |
283 | 283 |
284 // After this method is called, the object is in an invalid state and | 284 // After this method is called, the object is in an invalid state and |
285 // shouldn't be reused. | 285 // shouldn't be reused. |
286 InterfacePtrInfo<GenericInterface> PassInterface() { | 286 InterfacePtrInfo<GenericInterface> PassInterface() { |
287 endpoint_client_.reset(); | 287 endpoint_client_.reset(); |
288 proxy_.reset(); | 288 proxy_.reset(); |
289 return InterfacePtrInfo<GenericInterface>( | 289 return InterfacePtrInfo<GenericInterface>( |
290 router_ ? router_->PassMessagePipe() : handle_.Pass(), version_); | 290 router_ ? router_->PassMessagePipe() : std::move(handle_), version_); |
291 } | 291 } |
292 | 292 |
293 bool is_bound() const { return handle_.is_valid() || endpoint_client_; } | 293 bool is_bound() const { return handle_.is_valid() || endpoint_client_; } |
294 | 294 |
295 bool encountered_error() const { | 295 bool encountered_error() const { |
296 return endpoint_client_ ? endpoint_client_->encountered_error() : false; | 296 return endpoint_client_ ? endpoint_client_->encountered_error() : false; |
297 } | 297 } |
298 | 298 |
299 void set_connection_error_handler(const Closure& error_handler) { | 299 void set_connection_error_handler(const Closure& error_handler) { |
300 ConfigureProxyIfNecessary(); | 300 ConfigureProxyIfNecessary(); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 | 357 |
358 uint32_t version_; | 358 uint32_t version_; |
359 | 359 |
360 DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); | 360 DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); |
361 }; | 361 }; |
362 | 362 |
363 } // namespace internal | 363 } // namespace internal |
364 } // namespace mojo | 364 } // namespace mojo |
365 | 365 |
366 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ | 366 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ |
OLD | NEW |