Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: mojo/public/cpp/bindings/lib/control_message_proxy.cc

Issue 2318793002: Mojo C++ bindings: support disconnect with a reason. (Closed)
Patch Set: . Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/public/cpp/bindings/lib/control_message_proxy.cc
diff --git a/mojo/public/cpp/bindings/lib/control_message_proxy.cc b/mojo/public/cpp/bindings/lib/control_message_proxy.cc
index 9570b5b6d0fe57076f3ec03833334c96049fc94e..d628c9814d0f142ad946e41ba48a2f8b622bc17f 100644
--- a/mojo/public/cpp/bindings/lib/control_message_proxy.cc
+++ b/mojo/public/cpp/bindings/lib/control_message_proxy.cc
@@ -163,6 +163,16 @@ void ControlMessageProxy::FlushForTesting() {
run_loop.Run();
}
+void ControlMessageProxy::SendDisconnectReason(uint32_t custom_reason,
+ const std::string& description) {
+ auto send_disconnect_reason = interface_control::SendDisconnectReason::New();
+ send_disconnect_reason->custom_reason = custom_reason;
+ send_disconnect_reason->description = description;
+ auto input_ptr = interface_control::RunOrClosePipeInput::New();
+ input_ptr->set_send_disconnect_reason(std::move(send_disconnect_reason));
+ SendRunOrClosePipeMessage(receiver_, std::move(input_ptr), &context_);
+}
+
void ControlMessageProxy::RunFlushForTestingClosure() {
DCHECK(!run_loop_quit_closure_.is_null());
base::ResetAndReturn(&run_loop_quit_closure_).Run();
« no previous file with comments | « mojo/public/cpp/bindings/lib/control_message_proxy.h ('k') | mojo/public/cpp/bindings/lib/interface_endpoint_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698