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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 MOJO_DCHECK(!handle_.is_valid()); | 84 MOJO_DCHECK(!handle_.is_valid()); |
85 MOJO_DCHECK(!waiter_); | 85 MOJO_DCHECK(!waiter_); |
86 MOJO_DCHECK(version_ == 0u); | 86 MOJO_DCHECK(version_ == 0u); |
87 MOJO_DCHECK(info.is_valid()); | 87 MOJO_DCHECK(info.is_valid()); |
88 | 88 |
89 handle_ = info.PassHandle(); | 89 handle_ = info.PassHandle(); |
90 waiter_ = waiter; | 90 waiter_ = waiter; |
91 version_ = info.version(); | 91 version_ = info.version(); |
92 } | 92 } |
93 | 93 |
94 bool WaitForIncomingMethodCall() { | 94 bool WaitForIncomingResponse() { |
95 ConfigureProxyIfNecessary(); | 95 ConfigureProxyIfNecessary(); |
96 | 96 |
97 MOJO_DCHECK(router_); | 97 MOJO_DCHECK(router_); |
98 return router_->WaitForIncomingMessage(MOJO_DEADLINE_INDEFINITE); | 98 return router_->WaitForIncomingMessage(MOJO_DEADLINE_INDEFINITE); |
99 } | 99 } |
100 | 100 |
101 // After this method is called, the object is in an invalid state and | 101 // After this method is called, the object is in an invalid state and |
102 // shouldn't be reused. | 102 // shouldn't be reused. |
103 InterfacePtrInfo<Interface> PassInterface() { | 103 InterfacePtrInfo<Interface> PassInterface() { |
104 return InterfacePtrInfo<Interface>( | 104 return InterfacePtrInfo<Interface>( |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 uint32_t version_; | 160 uint32_t version_; |
161 | 161 |
162 MOJO_DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); | 162 MOJO_DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); |
163 }; | 163 }; |
164 | 164 |
165 } // namespace internal | 165 } // namespace internal |
166 } // namespace mojo | 166 } // namespace mojo |
167 | 167 |
168 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_ | 168 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_ |
OLD | NEW |