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

Unified Diff: ipc/ipc_channel_posix.cc

Issue 621613002: Refactoring: Make IPC::Channel::TakeClientFileDescriptor() a ScopedFD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing Mac build Created 6 years, 2 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
Index: ipc/ipc_channel_posix.cc
diff --git a/ipc/ipc_channel_posix.cc b/ipc/ipc_channel_posix.cc
index 2dfd17e6730cbd305d7a2046def6d90276dea172..c864db23869e123ea2e6700872ddfd41ea866409 100644
--- a/ipc/ipc_channel_posix.cc
+++ b/ipc/ipc_channel_posix.cc
@@ -557,12 +557,12 @@ int ChannelPosix::GetClientFileDescriptor() const {
return client_pipe_.get();
}
-int ChannelPosix::TakeClientFileDescriptor() {
+base::ScopedFD ChannelPosix::TakeClientFileDescriptor() {
base::AutoLock lock(client_pipe_lock_);
if (!client_pipe_.is_valid())
- return -1;
+ return base::ScopedFD();
PipeMap::GetInstance()->Remove(pipe_name_);
- return client_pipe_.release();
+ return client_pipe_.Pass();
}
void ChannelPosix::CloseClientFileDescriptor() {

Powered by Google App Engine
This is Rietveld 408576698