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

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

Issue 2649573004: Mojo bindings: merge the control messages of sending disconnect reason and notifying endpoint close… (Closed)
Patch Set: Created 3 years, 11 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/pipe_control_message_handler.cc
diff --git a/mojo/public/cpp/bindings/lib/pipe_control_message_handler.cc b/mojo/public/cpp/bindings/lib/pipe_control_message_handler.cc
index 39b31635a3d46640a2fad8bc5763a915fd54f5a6..db04c6dabc29bcd66ebab03f5ae50249c22b72e9 100644
--- a/mojo/public/cpp/bindings/lib/pipe_control_message_handler.cc
+++ b/mojo/public/cpp/bindings/lib/pipe_control_message_handler.cc
@@ -67,8 +67,15 @@ bool PipeControlMessageHandler::RunOrClosePipe(Message* message) {
params, &params_ptr, &context_);
if (params_ptr->input->is_peer_associated_endpoint_closed_event()) {
- return delegate_->OnPeerAssociatedEndpointClosed(
- params_ptr->input->get_peer_associated_endpoint_closed_event()->id);
+ const auto& event =
+ params_ptr->input->get_peer_associated_endpoint_closed_event();
+
+ base::Optional<DisconnectReason> reason;
+ if (event->disconnect_reason) {
+ reason.emplace(event->disconnect_reason->custom_reason,
+ event->disconnect_reason->description);
+ }
+ return delegate_->OnPeerAssociatedEndpointClosed(event->id, reason);
}
if (params_ptr->input->is_associated_endpoint_closed_before_sent_event()) {
return delegate_->OnAssociatedEndpointClosedBeforeSent(

Powered by Google App Engine
This is Rietveld 408576698