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

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

Issue 1526563004: Fix shutdown assert with the new Mojo EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment 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/message_pipe_dispatcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/routed_raw_channel.cc
diff --git a/mojo/edk/system/routed_raw_channel.cc b/mojo/edk/system/routed_raw_channel.cc
index 825fc2fac30d36b2982b4a497fed78c98d07d893..5bb89a582e898801aa3625b486d5cd880fd2d767 100644
--- a/mojo/edk/system/routed_raw_channel.cc
+++ b/mojo/edk/system/routed_raw_channel.cc
@@ -131,9 +131,14 @@ void RoutedRawChannel::OnReadMessage(
void RoutedRawChannel::OnError(Error error) {
DCHECK(internal::g_io_thread_task_runner->RunsTasksOnCurrentThread());
+
+ // This needs to match non-multiplexed MessagePipeDispatcher's destruction of
+ // the channel only when read errors occur.
+ if (error != ERROR_WRITE) {
+ channel_->Shutdown();
+ channel_ = nullptr;
+ }
- channel_->Shutdown();
- channel_ = nullptr;
if (routes_.empty()) {
delete this;
return;
« no previous file with comments | « mojo/edk/system/message_pipe_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698