summaryrefslogtreecommitdiffstats
path: root/ipc/file_descriptor_set_posix.cc
Commit message (Collapse)AuthorAgeFilesLines
* IPC: Get rid of FileDescriptor usage from FileDescriptorSet and Messagemorrita2014-09-241-54/+65
| | | | | | | | | | | | | | | This is a step toward to killing FileDescriptor. This change lets FiileDescriptorSet have both Files (for owning fds) and PlatformFiles (for non-owning fds). Doing this, we no longer need FileDescriptor which provides |auto_close| flag. BUG=415294 TEST=ipc_tests, ipc_mojo_unittests R=agl@chromium.org, jam@hcromium.org, viettrungluu@chromium.org Review URL: https://codereview.chromium.org/583473002 Cr-Commit-Position: refs/heads/master@{#296498}
* Don't HANDLE_EINTR(close). Either IGNORE_EINTR(close) or just close.mark@chromium.org2013-12-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is incorrect to wrap close in HANDLE_EINTR on Linux. Correctness is generally undefined on Mac, but as of r223369, it is incorrect in Chrome on Mac. To avoid new offenders, a PRESUBMIT check ensures that HANDLE_EINTR is not used with close, and that IGNORE_EINTR is only used with close. Unnecessary #includes of eintr_wrapper.h are also removed. base/posix/einter_wrapper.h, PRESUBMIT.py, and ppapi/tests/test_broker.cc contain non-mechanical changes. Variable naming within the latter is updated per r178174. Missing #includes for <errno.h> in content/zygote/zygote_main_linux.cc and tools/android/common/daemon.cc were manually added. Mechanical changes were generated by running: sed -E -i '' \ -e 's/((=|if|return|CHECK|EXPECT|ASSERT).*)HANDLE(_EINTR\(.*close)/\1IGNORE\3/' \ -e 's/(ignore_result|void ?)\(HANDLE_EINTR\((.*close\(.*)\)\)/\2/' \ -e 's/(\(void\) ?)?HANDLE_EINTR\((.*close\(.*)\)/\2/' \ $(git grep -El 'HANDLE_EINTR.*close') sed -E -i '' -e '/#include.*eintr_wrapper\.h"/d' \ $(grep -EL '(HANDLE|IGNORE)_EINTR' \ $(git grep -El '#include.*eintr_wrapper\.h"')) BUG=269623 R=agl@chromium.org, jln@chromium.org TBR=OWNERS Review URL: https://codereview.chromium.org/100253002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238390 0039d316-1c4b-4281-b951-d872f2087c98
* Alternative workaround for mac kernel bug.hubbe@chromium.org2013-10-151-0/+10
| | | | | | | | | | BUG=298276 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=227999 Review URL: https://codereview.chromium.org/25325002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228569 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 227999 "Alternative workaround for mac kernel bug."benwells@chromium.org2013-10-111-10/+0
| | | | | | | | | | | | | | | | | > Alternative workaround for mac kernel bug. > > BUG=298276 > > Review URL: https://codereview.chromium.org/25325002 This change seemed to cause the Mac ASAN bot to timeout when running the ipc_tests. TBR=hubbe@chromium.org Review URL: https://codereview.chromium.org/26384003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228110 0039d316-1c4b-4281-b951-d872f2087c98
* Alternative workaround for mac kernel bug.hubbe@chromium.org2013-10-101-0/+10
| | | | | | | | BUG=298276 Review URL: https://codereview.chromium.org/25325002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227999 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 226555 "There is a bug in the mac kernel, which can cause..."morrita@chromium.org2013-10-031-30/+3
| | | | | | | | | | | | | | | | | | | > 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
* There is a bug in the mac kernel, which can cause a file descriptor to be closedhubbe@chromium.org2013-10-021-3/+30
| | | | | | | | | | | 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 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226555 0039d316-1c4b-4281-b951-d872f2087c98
* Increase maximum file descriptors per IPC message on POSIX from 5 to 7.tommycli@chromium.org2013-08-291-2/+6
| | | | | | | | | | | | | | On POSIX, the maximum number of file descriptors passable in an IPC message is controlled by a constant 'kMaxDescriptorsPerMessage'. It's currently set at 5. This patch makes it 7. The Picasa album table reader utility process (https://codereview.chromium.org/18986012/) needs to pass 7 files to the utility process. This works on Windows, but fails on POSIX (Mac), due to the aforementioned limit. This CL increases this limit to 7, as well as adds some DLOG messages to give better info to developers who hit this limit. ipc_channel_posix.cc seems to indicate adding extra file descriptors just makes the messages longer by an 'int' per file descriptor. Making the maximum even larger would be okay with me too. BUG= Review URL: https://chromiumcodereview.appspot.com/23534018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220371 0039d316-1c4b-4281-b951-d872f2087c98
* Move eintr_wrapper.h from base to base/posixbrettw@chromium.org2012-11-141-1/+1
| | | | | | Review URL: https://codereview.chromium.org/11366229 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167739 0039d316-1c4b-4281-b951-d872f2087c98
* Android IPC changes.jrg@chromium.org2011-11-041-0/+1
| | | | | | | | | | BUG= TEST= Review URL: http://codereview.chromium.org/8437033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108589 0039d316-1c4b-4281-b951-d872f2087c98
* Convert some constants declared as anonymous enums into static consts so ↵pkasting@chromium.org2011-09-011-5/+5
| | | | | | | | | | | | | | they have types. This defines the constants where they're declared to preserve the existing readability as well as allow us to do things like dimension arrays based on the values of the constants. The drawback to defining constants at their declaration point is that supplying them to a templated function, like what DCHECK_EQ() expands into, triggers an "undefined symbol" error on Mac/Linux (and adding explicit storage for them in the .cc file can cause duplicate symbol errors on Windows). Here I've worked around that by converting DCHECK_EQ(a, b) to DCHECK(b == a). The original motiviation for this change was to find a way to eliminate some cases of passing anonymous-typed values as template arguments (which happens when you use a value from the enum in e.g. EXPECT_EQ()), which is technically illegal in C++03, though we don't warn about it. Simply naming the enum would have done this, but in general naming enums used to declare constants like this is bizarre ("enum Constants { ... }"?). BUG=92247 TEST=Compiles Review URL: http://codereview.chromium.org/7817005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99087 0039d316-1c4b-4281-b951-d872f2087c98
* Clang: Do not ignore result of HANDLE_EINTR.thakis@chromium.org2010-06-231-2/+4
| | | | | | Review URL: http://codereview.chromium.org/2805026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50556 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 49989 - xthakis@chromium.org2010-06-161-4/+2
| | | | | | | TBR=thakis@chromium.org Review URL: http://codereview.chromium.org/2822013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49995 0039d316-1c4b-4281-b951-d872f2087c98
* xthakis@chromium.org2010-06-161-2/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49989 0039d316-1c4b-4281-b951-d872f2087c98
* POSIX: make sure that we never pass directory descriptors into the sandbox.agl@chromium.org2010-06-101-0/+15
| | | | | | | | BUG=43304 http://codereview.chromium.org/2733011/show git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49446 0039d316-1c4b-4281-b951-d872f2087c98
* Split the IPC code into ipc/agl@chromium.org2009-07-221-0/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This splits the ipc code from the common project. The 'common' project pulls in all of webkit, the v8 bindings, skia, googleurl, and a number of other projects which makes it very difficult to deal with especially for external projects wanting just to use some of Chromium's infrastructure. This puts the ipc code into its top-level ipc/ directory with a dependency only on base. The common project depends on the new ipc/ipc.gyp:ipc target so that all projects currently pulling common in to get the IPC code still have it available. This mostly follows agl's pre-gyp attempt to do this which was r13062. Known issues: - Currently a number of projects depend on chrome/chrome.gyp:common in order to use the IPC infrastructure. Rather than fixing all of these dependencies I have made common depend on ipc/ipc.gyp:ipc and added "ipc" to the include_rules section of DEPS so that checkdeps.py doesn't complain. Over time projects that need IPC should depend on the IPC project themselves and dependencies on common removed, although I don't think many projects that need IPC will be able to get away without common currently. - ipc/ipc_message_macros.h still has #include "chrome/common/..." inside of a ipc/ should not refer to files in chrome/... now. I'm not sure how to resolve this since it's really an IDE bug - the named pipe name (windows+linux) and the logging event name (all) + env variable (posix) refer explicitly to 'Chrome' which somewhat hurts the illusion of ipc/ being an independent library. I think this should be examined in a subsequent, much smaller patch. - I've eliminated the IPC.SendMsgCount counter since it was implemented in a way to create a dependency from ipc/ to chrome/common/chrome_counters. This is the same approach that r13062 took. http://codereview.chromium.org/155905 (Patch from James Robinson) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21342 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Move IPC code to ipc/"agl@chromium.org2009-04-031-118/+0
| | | | | | | This reverts commit r13062 which, unsurprisingly, broke the build. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13063 0039d316-1c4b-4281-b951-d872f2087c98
* Move IPC code to ipc/agl@chromium.org2009-04-031-0/+118
(No review URL: Rietvelt couldn't cope) git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13062 0039d316-1c4b-4281-b951-d872f2087c98