| Index: mojo/public/cpp/bindings/lib/interface_ptr_state.h
|
| diff --git a/mojo/public/cpp/bindings/lib/interface_ptr_state.h b/mojo/public/cpp/bindings/lib/interface_ptr_state.h
|
| index f4c63d2f022291ec748b1602c0a07fc46354c9bb..bb9113ba3c56fa3b22e94672aea8e4abfb75cdad 100644
|
| --- a/mojo/public/cpp/bindings/lib/interface_ptr_state.h
|
| +++ b/mojo/public/cpp/bindings/lib/interface_ptr_state.h
|
| @@ -149,6 +149,10 @@ class InterfacePtrState {
|
| return endpoint_client_ && endpoint_client_->has_pending_responders();
|
| }
|
|
|
| + size_t pending_callback_count() const {
|
| + return endpoint_client_ ? endpoint_client_->pending_responder_count() : 0;
|
| + }
|
| +
|
| AssociatedGroup* associated_group() {
|
| ConfigureProxyIfNecessary();
|
| return endpoint_client_->associated_group();
|
| @@ -170,6 +174,11 @@ class InterfacePtrState {
|
| endpoint_client_->AcceptWithResponder(&message, responder.release());
|
| }
|
|
|
| + void set_process_async_during_sync(bool value) {
|
| + DCHECK(!router_);
|
| + process_async_during_sync_ = value;
|
| + }
|
| +
|
| private:
|
| using Proxy = typename Interface::Proxy_;
|
|
|
| @@ -190,7 +199,11 @@ class InterfacePtrState {
|
| : (Interface::HasSyncMethods_
|
| ? MultiplexRouter::SINGLE_INTERFACE_WITH_SYNC_METHODS
|
| : MultiplexRouter::SINGLE_INTERFACE);
|
| - router_ = new MultiplexRouter(std::move(handle_), config, true, runner_);
|
| + router_ = new MultiplexRouter(
|
| + std::move(handle_), config, true, runner_,
|
| + process_async_during_sync_
|
| + ? MultiplexRouter::ALLOW_DIRECT_CLIENT_CALLS
|
| + : MultiplexRouter::ALLOW_DIRECT_CLIENT_CALLS_FOR_SYNC_MESSAGES);
|
| router_->SetMasterInterfaceName(Interface::Name_);
|
| endpoint_client_.reset(new InterfaceEndpointClient(
|
| router_->CreateLocalEndpointHandle(kMasterInterfaceId), nullptr,
|
| @@ -223,6 +236,8 @@ class InterfacePtrState {
|
|
|
| uint32_t version_;
|
|
|
| + bool process_async_during_sync_ = false;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(InterfacePtrState);
|
| };
|
|
|
|
|