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

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

Issue 1501343002: Prepare chrome to use the new Mojo EDK by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disable turning on in this cl 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
Index: mojo/edk/system/message_pipe_dispatcher.cc
diff --git a/mojo/edk/system/message_pipe_dispatcher.cc b/mojo/edk/system/message_pipe_dispatcher.cc
index 2a53d642339192f34f8cc7a02e7af93e5047b922..eb9eaf6853ba53495f2bc907397793f55ccc12ef 100644
--- a/mojo/edk/system/message_pipe_dispatcher.cc
+++ b/mojo/edk/system/message_pipe_dispatcher.cc
@@ -418,10 +418,16 @@ MessagePipeDispatcher::~MessagePipeDispatcher() {
// exception is if they posted a task to run CloseOnIO but the IO thread shut
// down and so when it was deleting pending tasks it caused the last reference
// to destruct this object. In that case, safe to destroy the channel.
- if (channel_ && internal::g_io_thread_task_runner->RunsTasksOnCurrentThread())
- channel_->Shutdown();
- else
+ if (channel_ &&
+ internal::g_io_thread_task_runner->RunsTasksOnCurrentThread()) {
+ if (transferable_) {
+ channel_->Shutdown();
+ } else {
+ internal::g_broker->CloseMessagePipe(pipe_id_, this);
+ }
+ } else {
DCHECK(!channel_);
+ }
#if defined(OS_POSIX)
ClosePlatformHandles(&serialized_fds_);
#endif

Powered by Google App Engine
This is Rietveld 408576698