| 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 | 9 |
| 10 #include "mojo/public/cpp/bindings/interface_ptr_info.h" | 10 #include "mojo/public/cpp/bindings/interface_ptr_info.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 handle_ = info.PassHandle(); | 61 handle_ = info.PassHandle(); |
| 62 waiter_ = waiter; | 62 waiter_ = waiter; |
| 63 version_ = info.version(); | 63 version_ = info.version(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 bool WaitForIncomingMethodCall() { | 66 bool WaitForIncomingMethodCall() { |
| 67 ConfigureProxyIfNecessary(); | 67 ConfigureProxyIfNecessary(); |
| 68 | 68 |
| 69 MOJO_DCHECK(router_); | 69 MOJO_DCHECK(router_); |
| 70 return router_->WaitForIncomingMessage(); | 70 return router_->WaitForIncomingMessage(MOJO_DEADLINE_INDEFINITE); |
| 71 } | 71 } |
| 72 | 72 |
| 73 // After this method is called, the object is in an invalid state and | 73 // After this method is called, the object is in an invalid state and |
| 74 // shouldn't be reused. | 74 // shouldn't be reused. |
| 75 InterfacePtrInfo<Interface> PassInterface() { | 75 InterfacePtrInfo<Interface> PassInterface() { |
| 76 return InterfacePtrInfo<Interface>( | 76 return InterfacePtrInfo<Interface>( |
| 77 router_ ? router_->PassMessagePipe() : handle_.Pass(), version_); | 77 router_ ? router_->PassMessagePipe() : handle_.Pass(), version_); |
| 78 } | 78 } |
| 79 | 79 |
| 80 bool is_bound() const { return handle_.is_valid() || router_; } | 80 bool is_bound() const { return handle_.is_valid() || router_; } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 uint32_t version_; | 132 uint32_t version_; |
| 133 | 133 |
| 134 MOJO_DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); | 134 MOJO_DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 } // namespace internal | 137 } // namespace internal |
| 138 } // namespace mojo | 138 } // namespace mojo |
| 139 | 139 |
| 140 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_ | 140 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_ |
| OLD | NEW |