summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_channel_posix.cc
Commit message (Collapse)AuthorAgeFilesLines
* Introduce ChannelMojomorrita@chromium.org2014-08-041-1/+12
| | | | | | | | | | | | | | | | | | This CL introduces ChannelMojo IPC::Channel implementation and optionally applies it for renderer-browser IPC channel. Current stability is like 5-seconds browser and There are rough edges. It often closes the channel so needs to be more robust. Even though the level of stability, having it in the tree will helps team to try and improve it. BUG=377980 R=darin@chromium.org,jam@chromium.org,viettrungluu@chromium.org TEST=ipc_channel_mojo_unittest.cc Review URL: https://codereview.chromium.org/382333002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287402 0039d316-1c4b-4281-b951-d872f2087c98
* IPC::Channel: Reduce POSIX specific API surfacemorrita@chromium.org2014-06-071-2/+2
| | | | | | | | | | | | | | | This change is a simple cleanup: It removes some Channel API that is only used only in POSIX specific tests. These funtions still live in ChannelPosix. POSIX speicific tests now touch ChannelPosix instead of its superclass Channel. TEST=none R=darin@chromium.org, jam@chromium.org BUG=377980 Review URL: https://codereview.chromium.org/320433002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275632 0039d316-1c4b-4281-b951-d872f2087c98
* Make IPC::Channel polymorphicmorrita@chromium.org2014-06-061-85/+47
| | | | | | | | | | | | | | This change makes each platform specific ChannelImpl into a subclass of Channel: ChannelPosix, ChannelWin, ChannelNacl. delegated functions are now virtual. TEST=none BUG=377980 R=darin@chromium.org, jam@chromium.org Review URL: https://codereview.chromium.org/310293002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275505 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 260399 "Temporary CHECK version 2 in IPC::Channel::Send()..."viettrungluu@chromium.org2014-03-301-2/+0
| | | | | | | | | | | | | | | > Temporary CHECK version 2 in IPC::Channel::Send() to help track down crash. > > TBR=sievers@chromium.org, cpu@chromium.org > BUG=357915 > > Review URL: https://codereview.chromium.org/218433002 TBR=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/216933007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260419 0039d316-1c4b-4281-b951-d872f2087c98
* Temporary CHECK version 2 in IPC::Channel::Send() to help track down crash.viettrungluu@chromium.org2014-03-291-0/+2
| | | | | | | | | TBR=sievers@chromium.org, cpu@chromium.org BUG=357915 Review URL: https://codereview.chromium.org/218433002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260399 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 260373 "Add a temporary CHECK to IPC::Channel::Send() to ..."viettrungluu@chromium.org2014-03-291-1/+0
| | | | | | | | | | | | | | | > Add a temporary CHECK to IPC::Channel::Send() to help track down crash. > > TBR=cbentzel@chromium.org, cpu@chromium.org > BUG=357915 > > Review URL: https://codereview.chromium.org/216293008 TBR=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/217323004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260393 0039d316-1c4b-4281-b951-d872f2087c98
* Add a temporary CHECK to IPC::Channel::Send() to help track down crash.viettrungluu@chromium.org2014-03-291-0/+1
| | | | | | | | | TBR=cbentzel@chromium.org, cpu@chromium.org BUG=357915 Review URL: https://codereview.chromium.org/216293008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260373 0039d316-1c4b-4281-b951-d872f2087c98
* IPC: Make ipc_perftests run on Android.epenner@chromium.org2014-03-191-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There was several minor issues: - Base perf logging file location was off-limits on Android - Printf needs to be flushed to be visible on Android. - Android needs to reset the 'PipeMap' manually since we can't 'exec' after forking a test process. If we don't do this the Channel thinks we are in a single- process test and tries to open an FD which was closed during forking. - Android's base file descriptor needs to be increased to prevent stomping the android native logging file-descriptor with the default pipe. - The test took too long, so the 'exponent' is reduced from 5 to 3 - We need an APK With this patch the test runs like on other platforms, and lots of testing code is fixed such that it works the same way on all platforms. BUG=345471 Review URL: https://codereview.chromium.org/196343019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257877 0039d316-1c4b-4281-b951-d872f2087c98
* Fix posix IPC channel hanging problem.hubbe@chromium.org2014-02-211-4/+8
| | | | | | | | | | | | | | | | If a channel closes right before a send call, listeners might not be notified of the problem, which can cause hangs. This CL fixes that and adds a test that makes sure that this does not happen in the future. This is similar to cl/150893002, but takes a slightly different approach to how to make sure everything happens in the right order. In particular, it avoids closing the socket (and calling OnChannelError()) from Send(). BUG=338709 Review URL: https://codereview.chromium.org/172773002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252430 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of Fix posix IPC channel hanging problem. ↵hubbe@chromium.org2014-02-181-16/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/150893002/) Reason for revert: https://crash.corp.google.com/samples?q=reportid=%2702eaaf63ed6fdda9%27 https://crash.corp.google.com/samples?q=reportid=%272ac5bc4dd7c49ced%27 Original issue's description: > Fix posix IPC channel hanging problem. > > If a channel closes right before a send call, listeners might not be notified of > the problem, which can cause hangs. This CL fixes that and adds a test that makes > sure that this does not happen in the future. > > This is cl/30133002 + a memory leak fix. > > BUG=338709 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=250964 TBR=shess@chromium.org,cpu@chromium.org,hubbe@google.com NOTREECHECKS=true NOTRY=true BUG=338709 Review URL: https://codereview.chromium.org/170863002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251791 0039d316-1c4b-4281-b951-d872f2087c98
* Fix posix IPC channel hanging problem.hubbe@chromium.org2014-02-131-3/+16
| | | | | | | | | | | | | | If a channel closes right before a send call, listeners might not be notified of the problem, which can cause hangs. This CL fixes that and adds a test that makes sure that this does not happen in the future. This is cl/30133002 + a memory leak fix. BUG=338709 Review URL: https://codereview.chromium.org/150893002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250964 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of Fix posix IPC channel hanging problem. ↵hubbe@chromium.org2014-01-301-14/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/30133002/) Reason for revert: Seems to cause some leaks. Reverting while I investigate. http://build.chromium.org/p/chromium.memory/builders/Linux%20ASAN%20Tests%20%282%29/builds/22398 Original issue's description: > Fix posix IPC channel hanging problem. > > If a channel closes right before a send call, listeners might not be notified of > the problem, which can cause hangs. This CL fixes that and adds a test that makes > sure that this does not happen in the future. > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=248060 TBR=cpu@chromium.org,shess@chromium.org,hubbe@google.com NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/150883002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248067 0039d316-1c4b-4281-b951-d872f2087c98
* Fix posix IPC channel hanging problem.hubbe@chromium.org2014-01-301-3/+14
| | | | | | | | | | If a channel closes right before a send call, listeners might not be notified of the problem, which can cause hangs. This CL fixes that and adds a test that makes sure that this does not happen in the future. Review URL: https://codereview.chromium.org/30133002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248060 0039d316-1c4b-4281-b951-d872f2087c98
* Don't HANDLE_EINTR(close). Either IGNORE_EINTR(close) or just close.mark@chromium.org2013-12-031-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert https://src.chromium.org/viewvc/chrome?view=rev&revision=231330bbudge@chromium.org2013-11-041-2/+4
| | | | | | | | | | This is a speculative revert to see if it's the cause of hanging renderers. BUG=313112 Review URL: https://codereview.chromium.org/57783006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232819 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unused IPC::Message priority.bbudge@chromium.org2013-10-281-4/+2
| | | | | | | | | | | | | | | | | Removes the PriorityValue enum and field from IPC::Message. This doesn't appear to be used anywhere. Changes the data message ctor to take a size_t data_len parameter. This works around an ambiguity problem with the main ctor, which has a similar signature and would require lots of futzing with our test code to fix. To make this work, the matching Pickle constructor is also changed to take a size_t data_len parameter. BUG=194304 Review URL: https://codereview.chromium.org/35643005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231330 0039d316-1c4b-4281-b951-d872f2087c98
* Alternative workaround for mac kernel bug.hubbe@chromium.org2013-10-151-27/+109
| | | | | | | | | | 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-106/+26
| | | | | | | | | | | | | | | | | > 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-26/+106
| | | | | | | | 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
* Update include paths in ipc for base/process changes.rsesek@chromium.org2013-07-241-1/+1
| | | | | | | | | BUG=242290 R=cpu@chromium.org Review URL: https://chromiumcodereview.appspot.com/19525007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213349 0039d316-1c4b-4281-b951-d872f2087c98
* Move PathExists to base namespace.brettw@chromium.org2013-07-111-1/+1
| | | | | | | | | BUG= TBR=jam@chromium.org Review URL: https://codereview.chromium.org/18286004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211147 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of strings headers in ipc/, jingle/, media/.avi@chromium.org2013-06-111-1/+1
| | | | | | | | | | BUG=247723 TEST=none TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/16684003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205436 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: remove unmaintained SELinux code.phajdan.jr@chromium.org2013-05-171-5/+0
| | | | | | | | | | | | See https://groups.google.com/a/chromium.org/d/msg/chromium-dev/YpU7t2XaGRg/V9-diQZQQDwJ for discussion. BUG=none R=agl@chromium.org, jln@chromium.org Review URL: https://codereview.chromium.org/14771026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200838 0039d316-1c4b-4281-b951-d872f2087c98
* ipc: Use base::MessageLoop.xhwang@chromium.org2013-04-301-9/+6
| | | | | | | | | BUG=236029 R=agl@chromium.org Review URL: https://chromiumcodereview.appspot.com/14383024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197465 0039d316-1c4b-4281-b951-d872f2087c98
* Implement IPC::ChannelFactory, a class that accept()s on a UNIX socket.jeremya@chromium.org2013-03-131-170/+13
| | | | | | | | | | | | | | | IPC::ChannelFactory listens on a UNIX domain socket and notifies its delegate when a client connects. The delegate is expected to craft an IPC::Channel from the handle it is given. Previously committed: - https://src.chromium.org/viewvc/chrome?view=rev&revision=186912 - https://src.chromium.org/viewvc/chrome?view=rev&revision=187233 - https://src.chromium.org/viewvc/chrome?view=rev&revision=187554 Review URL: https://codereview.chromium.org/12386010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187772 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 187554 "Implement IPC::ChannelFactory, a class that accep..."falken@chromium.org2013-03-131-13/+170
| | | | | | | | | | | | | | | | | | | | | | Reverting because it seems to cause failures on ipc_tests (UnixDomainSocketUtil.Connect, UnixDomainSocketUtil.SendReceive) on Android. > Implement IPC::ChannelFactory, a class that accept()s on a UNIX socket. > > IPC::ChannelFactory listens on a UNIX domain socket and notifies its delegate > when a client connects. The delegate is expected to craft an IPC::Channel from > the handle it is given. > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=186912 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=187233 > > Review URL: https://chromiumcodereview.appspot.com/12386010 TBR=jeremya@chromium.org Review URL: https://codereview.chromium.org/12431017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187760 0039d316-1c4b-4281-b951-d872f2087c98
* Implement IPC::ChannelFactory, a class that accept()s on a UNIX socket.jeremya@chromium.org2013-03-121-170/+13
| | | | | | | | | | | | | | IPC::ChannelFactory listens on a UNIX domain socket and notifies its delegate when a client connects. The delegate is expected to craft an IPC::Channel from the handle it is given. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=186912 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=187233 Review URL: https://chromiumcodereview.appspot.com/12386010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187554 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 187233dmikurube@chromium.org2013-03-111-19/+170
| | | | | | | | | | | | | | | | | > Implement IPC::ChannelFactory, a class that accept()s on a UNIX socket. > > IPC::ChannelFactory listens on a UNIX domain socket and notifies its delegate > when a client connects. The delegate is expected to craft an IPC::Channel from > the handle it is given. > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=186912 > > Review URL: https://chromiumcodereview.appspot.com/12386010 TBR=jeremya@chromium.org Review URL: https://codereview.chromium.org/12761003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187240 0039d316-1c4b-4281-b951-d872f2087c98
* Implement IPC::ChannelFactory, a class that accept()s on a UNIX socket.jeremya@chromium.org2013-03-111-170/+19
| | | | | | | | | | | | IPC::ChannelFactory listens on a UNIX domain socket and notifies its delegate when a client connects. The delegate is expected to craft an IPC::Channel from the handle it is given. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=186912 Review URL: https://chromiumcodereview.appspot.com/12386010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187233 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 186912jeremya@chromium.org2013-03-081-19/+170
| | | | | | | | | | | | | | | > Implement IPC::ChannelFactory, a class that accept()s on a UNIX socket. > > IPC::ChannelFactory listens on a UNIX domain socket and notifies its delegate > when a client connects. The delegate is expected to craft an IPC::Channel from > the handle it is given. > > Review URL: https://codereview.chromium.org/12386010 TBR=jeremya@chromium.org Review URL: https://codereview.chromium.org/12510008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186919 0039d316-1c4b-4281-b951-d872f2087c98
* Implement IPC::ChannelFactory, a class that accept()s on a UNIX socket.jeremya@chromium.org2013-03-081-170/+19
| | | | | | | | | | IPC::ChannelFactory listens on a UNIX domain socket and notifies its delegate when a client connects. The delegate is expected to craft an IPC::Channel from the handle it is given. Review URL: https://codereview.chromium.org/12386010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186912 0039d316-1c4b-4281-b951-d872f2087c98
* Move file_path.h to base/files.brettw@chromium.org2013-02-241-3/+3
| | | | | | TBR=sky git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184344 0039d316-1c4b-4281-b951-d872f2087c98
* Rename FilePath -> base::FilePath in various toplevel directoriesbrettw@chromium.org2013-02-101-3/+3
| | | | | | Review URL: https://codereview.chromium.org/12211108 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181639 0039d316-1c4b-4281-b951-d872f2087c98
* Remove IPC::Channel::set_listener().viettrungluu@chromium.org2013-01-161-4/+0
| | | | | | | | | | It wasn't used anywhere other than in ipc_perftests (which, up till very recently, weren't even compiled) in a non-essential way. Review URL: https://chromiumcodereview.appspot.com/11964002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177192 0039d316-1c4b-4281-b951-d872f2087c98
* Add missing includes to ipc_listener.htfarina@chromium.org2012-11-151-2/+3
| | | | | | | | | | | This is TODO in ipc_channel.h that I'm working on. TBR=brettw@chromium.org Review URL: https://chromiumcodereview.appspot.com/11416016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168055 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
* Move global_descriptors to base/posix.brettw@chromium.org2012-11-091-1/+1
| | | | | | | | | | This file represents a posix-only concept. BUG= Review URL: https://codereview.chromium.org/11293210 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167008 0039d316-1c4b-4281-b951-d872f2087c98
* Trace PostTasks from post to run.jbates@chromium.org2012-09-181-1/+1
| | | | | | | | | | | | To do this properly, we need a new type of trace event "FLOW" which will be drawn as lines in about:tracing from BEGIN to END. Also instruments SequencedWorkerPool and ChannelReader::DispatchInputData, which were not currently traced. BUG=79942 Review URL: https://codereview.chromium.org/10913242 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157288 0039d316-1c4b-4281-b951-d872f2087c98
* Add async trace events to trace progress of IPC messagesjbates@chromium.org2012-09-041-0/+1
| | | | | | | | BUG=79942 Review URL: https://chromiumcodereview.appspot.com/10919023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154840 0039d316-1c4b-4281-b951-d872f2087c98
* Fixing gcc 4.7 building problems.shenhan@google.com2012-06-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | a) - gcc-4.7 improved the implicit headers that it includes. with <4.7, the gthr-default.h file always pulls in unistd.h. with >=4.7, they avoided that include when possible. so code that isn't including unistd.h itself but needs it now breaks. b) - narrowing conversion in initiliazation list now raises an 'ill-formed conversion' warning, which causes error when -Werror is given. [THIS PART IS NOW REVERTED IN THE PATCH} c) - included patches from pastebin - http://pastebin.com/raw.php?i=p3UKs7Cg Note - this may not be fixing all the gcc 4.7 build problems for all parts, but rather than submitting one big-fix-for-all CL, we'd better do it incrementally (given that all the modification is reasonable and minor) so that at least some parts get a successful gcc 4.7 build. BUG=None TEST=Built successfully using GCC-4.7 under chromium chroot Review URL: https://chromiumcodereview.appspot.com/10451068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140470 0039d316-1c4b-4281-b951-d872f2087c98
* PPAPI/NaCl: Fix leaky NaClIPCAdapter test.dmichael@chromium.org2012-05-161-1/+2
| | | | | | | | | | | | The NaClIPCAdapter was not leaking, but the Channel deletion is posted as a task that the test was not running. This makes all the NaClIPCAdapter test cases do RunAllPending on shutdown to delete stuff. Unfortunately, one of the tests results in calling "Close()" on the channel in one of these tasks, and that fails for IPC::TestSink, because IPC::Channel::Close dereferences channel_impl_ unconditionally, and the channel_impl_ is NULL for TestSink. So this patch also makes Channel::Close() do nothing if channel_impl_ is NULL. BUG=127954 TEST= Review URL: https://chromiumcodereview.appspot.com/10383167 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137471 0039d316-1c4b-4281-b951-d872f2087c98
* Prevent reading invalid memory in IPC code caused by assumption of ↵fischman@chromium.org2012-04-091-3/+6
| | | | | | | | | | | | | | | | | | contiguity in std::deque<>. std::vector<int> guarantees contiguous storage (as of C++2003, 23.2.4p1, although in practice this is true with all known STL implementations), but std::deque<> typically uses linked chains of array blocks, so specifically *doesn't* provide contiguity once its size grows above its basic block size (usually 512bytes on our linux systems). BUG=117341 TEST=test in bug stops reproducing with this. Review URL: http://codereview.chromium.org/10019018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131443 0039d316-1c4b-4281-b951-d872f2087c98
* Make IPC channels track their peer process IDjschuh@chromium.org2012-04-051-0/+6
| | | | | | | | | | BrokerDuplicateHandle() requires the target process ID on Windows. Rather than plumb this into every channel class independently, I'm adding it at the top. TEST=IPCSyncChannelTest.Verified Review URL: http://codereview.chromium.org/9968111 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130817 0039d316-1c4b-4281-b951-d872f2087c98
* Verify the child process with a secret hellojschuh@chromium.org2012-03-171-0/+14
| | | | | | | | | BUG=117627 TEST=IPCSyncChannelTest.Verified Review URL: http://codereview.chromium.org/9692035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127327 0039d316-1c4b-4281-b951-d872f2087c98
* Factor out the shared parts of IPC channel reading.brettw@chromium.org2012-03-081-80/+15
| | | | | | | | | | | | | This adds a new class+file ChannelReader that is responsible for management of the common parts of IPC channel reading. The existing platform-specific ChannelImpl classes derive from this and supply platform-specific reading features via virtual classes. This is to reduce code duplication between the Windows and Posix implementations of Channel. Review URL: http://codereview.chromium.org/9547009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125597 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor Pickle Read methods to use higher performance PickleIterator.jbates@chromium.org2012-03-071-1/+1
| | | | | | | | | | | | | | | | There was a lot of redundant error checking and initialization code in all Pickle Read methods because of the void** iterator type. This change replaces the void* iterator with PickleIterator, which encapsulates the read pointer so that less error checking and initialization code is needed for reading. PickleIterator has all the necessary data to do the actual reading. The advantage of having it provide Read methods (as opposed to leaving them solely in the Pickle interface) is that the callers do not need to pass around the const Pickle* once they have a PickleIterator. Followup CLs will refactor the call sites to remove const Pickle* arguments where they are now unnecessary. Then the Pickle::Read* methods can be removed entirely. The alternative approach would have been to change the Pickle::Read methods to non-const and remove the iterator parameter (making Read methods advance an internal read pointer). Unfortunately, the const Read with iterator design is entrenched throughout the chromium code, making this a much more complex change with the same performance outcome. BUG=13108 Review URL: https://chromiumcodereview.appspot.com/9447084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125447 0039d316-1c4b-4281-b951-d872f2087c98
* Separate out the platform-independent parts of Channel reading.brettw@chromium.org2012-03-011-69/+83
| | | | | | | | | | | | | | | | I'm planning on comsolidating the platform-independent management of the overflow buffer and message dispatch between the posix and windows channels. This patch separates out the behavior into the functions I'm planning on adding on the virtual interface. Basically, ProcessIncomingMessages and DispatchInputData will be the main shared code. In future patches, I'll refactor Windows in a similar way and then combine them into a shared base class. Review URL: http://codereview.chromium.org/9570001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124489 0039d316-1c4b-4281-b951-d872f2087c98
* This changes around our handling of file descriptors to reduce code ↵brettw@chromium.org2012-02-291-263/+222
| | | | | | | | | | | | | | | duplication and increase clarity. I tried to minimize actual changes and just move code. There are a few exceptions: The input file descriptor buffer is now a deque rather than a complicated fixed size buffer with extra overflow. This greatly simplifies some code. In practice, I don't think this will change the number of allocations we do in a practical way. I changed a few logging statements that seemed relevant to IPC developers only into the "D" variants. The msghdr struct used to be declared once at the top of ProcessOutgoingMessages and re-used for all calls to recvmsg. Now that the different callers are split out into sub functions, there is more initialization of the msghdr structs used in this call. I don't think this will be significant. Review URL: http://codereview.chromium.org/9533002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124272 0039d316-1c4b-4281-b951-d872f2087c98
* Fix warning so Android ipc_tests builds again. (-Werror turned on in ↵jrg@chromium.org2012-01-251-2/+2
| | | | | | | | | | | | http://codereview.chromium.org/9288008) BUG=None TEST= Review URL: http://codereview.chromium.org/9288030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119144 0039d316-1c4b-4281-b951-d872f2087c98
* Coverity: Fix leaks.jhawkins@chromium.org2011-12-211-0/+2
| | | | | | | | | | | | CID=2168,8197,8198,100251,100256,100820,101011,101982,101983,101984,101988, 102256 BUG=none TEST=none R=dpapad Review URL: http://codereview.chromium.org/8989036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115422 0039d316-1c4b-4281-b951-d872f2087c98