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

Unified Diff: mojo/edk/system/channel_win.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_posix.cc ('k') | mojo/edk/system/node_channel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/channel_win.cc
diff --git a/mojo/edk/system/channel_win.cc b/mojo/edk/system/channel_win.cc
index a834d977b47c902a41ddb5614d598e0b605bf331..c989344f62b0daf68d6b0153084898c9f9b2f7fd 100644
--- a/mojo/edk/system/channel_win.cc
+++ b/mojo/edk/system/channel_win.cc
@@ -116,6 +116,11 @@ class ChannelWin : public Channel,
}
}
+ void LeakHandle() override {
+ DCHECK(io_task_runner_->RunsTasksOnCurrentThread());
+ leak_handle_ = true;
+ }
+
bool GetReadPlatformHandles(
size_t num_handles,
const void* extra_header,
@@ -191,6 +196,8 @@ class ChannelWin : public Channel,
// |handle_| should be valid at this point.
CHECK(handle_.is_valid());
CancelIo(handle_.get().handle);
+ if (leak_handle_)
+ ignore_result(handle_.release());
handle_.reset();
// May destroy the |this| if it was the last reference.
@@ -332,6 +339,8 @@ class ChannelWin : public Channel,
bool wait_for_connect_;
+ bool leak_handle_ = false;
+
DISALLOW_COPY_AND_ASSIGN(ChannelWin);
};
« no previous file with comments | « mojo/edk/system/channel_posix.cc ('k') | mojo/edk/system/node_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698