Index: mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h |
diff --git a/mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h b/mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h |
index 30a3c428e92ccbe21bdadbce7a6480417fa9546b..839978dbbaace1eb6efe4aa422b2b75c9c02a9a6 100644 |
--- a/mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h |
+++ b/mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h |
@@ -9,6 +9,7 @@ |
#include <algorithm> // For |std::swap()|. |
#include <memory> |
+#include <string> |
#include <utility> |
#include "base/bind.h" |
@@ -20,6 +21,7 @@ |
#include "mojo/public/cpp/bindings/associated_group.h" |
#include "mojo/public/cpp/bindings/associated_group_controller.h" |
#include "mojo/public/cpp/bindings/associated_interface_ptr_info.h" |
+#include "mojo/public/cpp/bindings/connection_error_callback.h" |
#include "mojo/public/cpp/bindings/interface_endpoint_client.h" |
#include "mojo/public/cpp/bindings/interface_id.h" |
#include "mojo/public/cpp/bindings/lib/control_message_handler.h" |
@@ -72,6 +74,12 @@ class AssociatedInterfacePtrState { |
endpoint_client_->control_message_proxy()->FlushForTesting(); |
} |
+ void SendDisconnectReason(uint32_t custom_reason, |
+ const std::string& description) { |
+ endpoint_client_->control_message_proxy()->SendDisconnectReason( |
+ custom_reason, description); |
+ } |
+ |
void Swap(AssociatedInterfacePtrState* other) { |
using std::swap; |
swap(other->endpoint_client_, endpoint_client_); |
@@ -118,6 +126,12 @@ class AssociatedInterfacePtrState { |
endpoint_client_->set_connection_error_handler(error_handler); |
} |
+ void set_connection_error_with_reason_handler( |
+ const ConnectionErrorWithReasonCallback& error_handler) { |
+ DCHECK(endpoint_client_); |
+ endpoint_client_->set_connection_error_with_reason_handler(error_handler); |
+ } |
+ |
// Returns true if bound and awaiting a response to a message. |
bool has_pending_callbacks() const { |
return endpoint_client_ && endpoint_client_->has_pending_responders(); |