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

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

Issue 2065453004: Always leak the Mojo parent pipe handle on child process shutdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 6 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
« no previous file with comments | « mojo/edk/system/channel.h ('k') | mojo/edk/system/channel_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/channel_posix.cc
diff --git a/mojo/edk/system/channel_posix.cc b/mojo/edk/system/channel_posix.cc
index 211314b4f092158f67f9430c90d9665ea16c21aa..16a9304462f9c5d4e48d9632174cdc1923663d13 100644
--- a/mojo/edk/system/channel_posix.cc
+++ b/mojo/edk/system/channel_posix.cc
@@ -137,6 +137,11 @@ class ChannelPosix : public Channel,
}
}
+ void LeakHandle() override {
+ DCHECK(io_task_runner_->RunsTasksOnCurrentThread());
+ leak_handle_ = true;
+ }
+
bool GetReadPlatformHandles(
size_t num_handles,
const void* extra_header,
@@ -239,6 +244,8 @@ class ChannelPosix : public Channel,
read_watcher_.reset();
write_watcher_.reset();
+ if (leak_handle_)
+ ignore_result(handle_.release());
handle_.reset();
#if defined(OS_MACOSX)
handles_to_close_.reset();
@@ -489,6 +496,8 @@ class ChannelPosix : public Channel,
bool reject_writes_ = false;
std::deque<MessageView> outgoing_messages_;
+ bool leak_handle_ = false;
+
#if defined(OS_MACOSX)
base::Lock handles_to_close_lock_;
ScopedPlatformHandleVectorPtr handles_to_close_;
« no previous file with comments | « mojo/edk/system/channel.h ('k') | mojo/edk/system/channel_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698