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

Unified Diff: ipc/ipc_channel_posix.cc

Issue 583473002: IPC: Get rid of FileDescriptor usage from FileDescriptorSet and Message (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Created 6 years, 3 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 7f0a1fe83896ba9a7ad0a054a5d0803d0b1175bd..cbfe4b7d8e3681c96be11fb0381db7aef37f6c45 100644
--- a/ipc/ipc_channel_posix.cc
+++ b/ipc/ipc_channel_posix.cc
@@ -769,8 +769,7 @@ void ChannelPosix::QueueHelloMessage() {
#if defined(IPC_USES_READWRITE)
scoped_ptr<Message> hello;
if (remote_fd_pipe_ != -1) {
- if (!msg->WriteFileDescriptor(base::FileDescriptor(remote_fd_pipe_,
- false))) {
+ if (!msg->WriteBorrowingFile(remote_fd_pipe_)) {
NOTREACHED() << "Unable to pickle hello message file descriptors";
}
DCHECK_EQ(msg->file_descriptor_set()->size(), 1U);
@@ -991,12 +990,11 @@ void ChannelPosix::HandleInternalMessage(const Message& msg) {
// server also contains the fd_pipe_, which will be used for all
// subsequent file descriptor passing.
DCHECK_EQ(msg.file_descriptor_set()->size(), 1U);
- base::FileDescriptor descriptor;
- if (!msg.ReadFileDescriptor(&iter, &descriptor)) {
+ base::File descriptor;
+ if (!msg.ReadFile(&iter, &descriptor)) {
NOTREACHED();
}
- fd_pipe_ = descriptor.fd;
- CHECK(descriptor.auto_close);
+ fd_pipe_ = descriptor.TakePlatformFile();
}
#endif // IPC_USES_READWRITE
peer_pid_ = pid;

Powered by Google App Engine
This is Rietveld 408576698