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_BINDING_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_BINDING_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_BINDING_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_BINDING_H_ |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 MessagePipeHandle handle() const { return internal_state_.handle(); } | 241 MessagePipeHandle handle() const { return internal_state_.handle(); } |
242 | 242 |
243 // Returns the associated group that this object belongs to. Returns null if: | 243 // Returns the associated group that this object belongs to. Returns null if: |
244 // - this object is not bound; or | 244 // - this object is not bound; or |
245 // - the interface doesn't have methods to pass associated interface | 245 // - the interface doesn't have methods to pass associated interface |
246 // pointers or requests. | 246 // pointers or requests. |
247 AssociatedGroup* associated_group() { | 247 AssociatedGroup* associated_group() { |
248 return internal_state_.associated_group(); | 248 return internal_state_.associated_group(); |
249 } | 249 } |
250 | 250 |
| 251 // Sends a no-op message on the underlying message pipe and runs the current |
| 252 // message loop until its response is received. This can be used in tests to |
| 253 // verify that no message was sent on a message pipe in response to some |
| 254 // stimulus. |
| 255 void FlushForTesting() { internal_state_.FlushForTesting(); } |
| 256 |
251 // Exposed for testing, should not generally be used. | 257 // Exposed for testing, should not generally be used. |
252 void EnableTestingMode() { internal_state_.EnableTestingMode(); } | 258 void EnableTestingMode() { internal_state_.EnableTestingMode(); } |
253 | 259 |
254 private: | 260 private: |
255 internal::BindingState<Interface, Interface::PassesAssociatedKinds_> | 261 internal::BindingState<Interface, Interface::PassesAssociatedKinds_> |
256 internal_state_; | 262 internal_state_; |
257 | 263 |
258 DISALLOW_COPY_AND_ASSIGN(Binding); | 264 DISALLOW_COPY_AND_ASSIGN(Binding); |
259 }; | 265 }; |
260 | 266 |
261 } // namespace mojo | 267 } // namespace mojo |
262 | 268 |
263 #endif // MOJO_PUBLIC_CPP_BINDINGS_BINDING_H_ | 269 #endif // MOJO_PUBLIC_CPP_BINDINGS_BINDING_H_ |
OLD | NEW |