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

Unified Diff: mojo/edk/system/child_broker_host.cc

Issue 1558643002: Fix Mojo broker crash on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « mojo/edk/system/child_broker_host.h ('k') | mojo/edk/system/message_pipe_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/child_broker_host.cc
diff --git a/mojo/edk/system/child_broker_host.cc b/mojo/edk/system/child_broker_host.cc
index 20a73d9589e7812da2cf5348c5dece9b682269bd..bf594c151bee122c39e625d0575032f5f0270019 100644
--- a/mojo/edk/system/child_broker_host.cc
+++ b/mojo/edk/system/child_broker_host.cc
@@ -105,6 +105,19 @@ void ChildBrokerHost::ConnectMessagePipe(uint64_t pipe_id,
child_channel_->channel()->WriteMessage(std::move(message));
}
+void ChildBrokerHost::PeerDied(uint64_t pipe_id) {
+ if (!child_channel_)
+ return; // Can happen at process shutdown on Windows.
+ PeerDiedMessage data;
+ memset(&data, 0, sizeof(data));
+ data.type = PEER_DIED;
+ data.pipe_id = pipe_id;
+ scoped_ptr<MessageInTransit> message(new MessageInTransit(
+ MessageInTransit::Type::MESSAGE, sizeof(data), &data));
+ message->set_route_id(kBrokerRouteId);
+ child_channel_->channel()->WriteMessage(std::move(message));
+}
+
ChildBrokerHost::~ChildBrokerHost() {
DCHECK(internal::g_io_thread_task_runner->RunsTasksOnCurrentThread());
BrokerState::GetInstance()->ChildBrokerHostDestructed(this);
« no previous file with comments | « mojo/edk/system/child_broker_host.h ('k') | mojo/edk/system/message_pipe_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698