diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-01 21:44:24 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-01 21:44:24 +0000 |
commit | 84b2d1d81b8c1c39c3cadaf9771e2c78cc0c51c4 (patch) | |
tree | e4086b02a50d7cd8b4a149fc54f962f8d6d3f30c /base/process_util_unittest.cc | |
parent | 5efd22803abd20ef4230f5e95443e9fabe06c5d4 (diff) | |
download | chromium_src-84b2d1d81b8c1c39c3cadaf9771e2c78cc0c51c4.zip chromium_src-84b2d1d81b8c1c39c3cadaf9771e2c78cc0c51c4.tar.gz chromium_src-84b2d1d81b8c1c39c3cadaf9771e2c78cc0c51c4.tar.bz2 |
Synchronize the parent and child processes during launch, ensuring that the
child doesn't try to check in with the Mach broker before the parent is ready.
This resolves a race between the browser and its child processes.
base::LaunchOptions gets a new member, synchronize, currently Mac-only
although there's nothing Mac-specific about the implementation. When set,
it allows base::LaunchProcess clients to request that the child process block
until released by the new base::LaunchSynchronize call. When creating child
processes, the child process launcher now requests this new synchronization
behavior to give it a chance to set up the Mach broker to expect the child
before the child tries to check in with it.
BUG=94295
TEST=Chrome should work. You see fewer of this logged:
Unknown process (pid) is sending Mach IPC messages!
But you still might see some of these due to bug 94543.
Review URL: http://codereview.chromium.org/7740036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99245 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_unittest.cc')
-rw-r--r-- | base/process_util_unittest.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc index bcc1308..0403d7a 100644 --- a/base/process_util_unittest.cc +++ b/base/process_util_unittest.cc @@ -538,7 +538,11 @@ std::string TestLaunchProcess(const base::environment_vector& env_changes, options.wait = true; options.environ = &env_changes; options.fds_to_remap = &fds_to_remap; +#if defined(OS_LINUX) options.clone_flags = clone_flags; +#else + CHECK_EQ(0, clone_flags); +#endif // OS_LINUX EXPECT_TRUE(base::LaunchProcess(args, options, NULL)); PCHECK(HANDLE_EINTR(close(fds[1])) == 0); |