diff options
author | morrita@chromium.org <morrita@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-03 05:43:40 +0000 |
---|---|---|
committer | morrita@chromium.org <morrita@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-03 05:43:40 +0000 |
commit | a839d8faf27e052b458da47b9fdff07615a39272 (patch) | |
tree | f5cb1ac5a5f51ddd2dc5252eb7261e7673b35713 /ipc/file_descriptor_set_posix.cc | |
parent | 949d973c9368ffd30eb500cd85b82ed67ad1f09f (diff) | |
download | chromium_src-a839d8faf27e052b458da47b9fdff07615a39272.zip chromium_src-a839d8faf27e052b458da47b9fdff07615a39272.tar.gz chromium_src-a839d8faf27e052b458da47b9fdff07615a39272.tar.bz2 |
Revert 226555 "There is a bug in the mac kernel, which can cause..."
> There is a bug in the mac kernel, which can cause a file descriptor to be closed
> when sent multiple times between processes. By delaying the close on the sender side by
> a few second, we can eliminate this problem.
>
> BUG=279443, 298276
>
> Review URL: https://codereview.chromium.org/24365008
This is a speculative revert to fix Mac LayoutTests breakages.
See crbug.com/303487 for detail.
TBR=hubbe@chromium.org
Review URL: https://codereview.chromium.org/25660009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226693 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/file_descriptor_set_posix.cc')
-rw-r--r-- | ipc/file_descriptor_set_posix.cc | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/ipc/file_descriptor_set_posix.cc b/ipc/file_descriptor_set_posix.cc index 13356b7..584efec 100644 --- a/ipc/file_descriptor_set_posix.cc +++ b/ipc/file_descriptor_set_posix.cc @@ -8,19 +8,9 @@ #include <sys/stat.h> #include <unistd.h> -#include "base/bind.h" #include "base/logging.h" -#include "base/message_loop/message_loop.h" #include "base/posix/eintr_wrapper.h" -namespace { -// Used as callback. -static void CloseFD(int fd) { - if (HANDLE_EINTR(close(fd)) < 0) - PLOG(ERROR) << "close"; -} -} // namespace - FileDescriptorSet::FileDescriptorSet() : consumed_descriptor_highwater_(0) { } @@ -128,26 +118,9 @@ bool FileDescriptorSet::ContainsDirectoryDescriptor() const { void FileDescriptorSet::CommitAll() { for (std::vector<base::FileDescriptor>::iterator i = descriptors_.begin(); i != descriptors_.end(); ++i) { - if (i->auto_close) { -#if defined(OS_MACOSX) - // On mac, a sent file descriptor will sometimes get closed - // by a kernel garbage collector. By delaying the close by - // a few seconds, we can solve this once and for all. - // - but... - // - ONCE AND FOR ALL - // https://code.google.com/p/chromium/issues/detail?id=298276 - if (base::MessageLoop::current()) { - base::MessageLoop::current()->PostDelayedTask( - FROM_HERE, - base::Bind(&CloseFD, i->fd), - base::TimeDelta::FromSeconds(5)); - } else { - CloseFD(i->fd); - } -#else // OS_MACOSX - CloseFD(i->fd); -#endif // OS_MACOSX - } + if (i->auto_close) + if (HANDLE_EINTR(close(i->fd)) < 0) + PLOG(ERROR) << "close"; } descriptors_.clear(); consumed_descriptor_highwater_ = 0; |