| Index: mojo/public/cpp/bindings/interface_ptr.h
|
| diff --git a/mojo/public/cpp/bindings/interface_ptr.h b/mojo/public/cpp/bindings/interface_ptr.h
|
| index 9b005eee815eeec57aea39b5563baf3d87bd705c..48815de710eefa68e75a79dcad181df818378d33 100644
|
| --- a/mojo/public/cpp/bindings/interface_ptr.h
|
| +++ b/mojo/public/cpp/bindings/interface_ptr.h
|
| @@ -173,6 +173,23 @@ class InterfacePtr {
|
| return internal_state_.associated_group();
|
| }
|
|
|
| + // Allows immediate, synchronous dispatch of any incoming response callback
|
| + // elicited by an event on the InterfacePtr's own thread. This is useful for
|
| + // efficiency when an InterfacePtr lives on the same thread that's running
|
| + // Mojo IPC Support (e.g. Chrome's IO thread) because there's no risk of an
|
| + // outgoing method call synchronously (and subtly) invoking its response
|
| + // callback.
|
| + //
|
| + // This may also be used in testing when, e.g., an InterfacePtr and Binding
|
| + // live on the same thread and you want synchronous behavior for messages that
|
| + // are asynchronous under normal conditions.
|
| + //
|
| + // Note that this option also affects all endpoints which are associated with
|
| + // this one and which live on the same thread.
|
| + void EnableImmediateDispatchOfEventsFromSameThread(bool enabled) {
|
| + internal_state_.EnableImmediateDispatchOfEventsFromSameThread(enabled);
|
| + }
|
| +
|
| // DO NOT USE. Exposed only for internal use and for testing.
|
| internal::InterfacePtrState<Interface, Interface::PassesAssociatedKinds_>*
|
| internal_state() {
|
|
|