summaryrefslogtreecommitdiffstats
path: root/base/multiprocess_test.h
diff options
context:
space:
mode:
authorjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-17 20:11:50 +0000
committerjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-17 20:11:50 +0000
commit29ccac132a03315af30ee8dfc7b370a0f30d9661 (patch)
treecbd8426793301ad9d51a62e2a3321b410e7c5f04 /base/multiprocess_test.h
parent9360a522bce9026154a0417015b8680c45f7720f (diff)
downloadchromium_src-29ccac132a03315af30ee8dfc7b370a0f30d9661.zip
chromium_src-29ccac132a03315af30ee8dfc7b370a0f30d9661.tar.gz
chromium_src-29ccac132a03315af30ee8dfc7b370a0f30d9661.tar.bz2
* On POSIX, make sure we don't leak FDs when launching child Processes.
* Add a facility to LaunchProcess() to remap a given FD into a child process. This change is needed for 2 reasons: 1)We want to use a socketpair() for IPC, the child process needs a known FD # for it's side of the socket. 2)The OS X Sandbox doesn't close FDs. Review URL: http://codereview.chromium.org/14497 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7156 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/multiprocess_test.h')
-rw-r--r--base/multiprocess_test.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/base/multiprocess_test.h b/base/multiprocess_test.h
index a9c67d5..4cd5785 100644
--- a/base/multiprocess_test.h
+++ b/base/multiprocess_test.h
@@ -61,11 +61,20 @@ class MultiProcessTest : public PlatformTest {
// TODO(darin): re-enable this once we have base/debug_util.h
// ProcessDebugFlags(&cl, DebugUtil::UNKNOWN, false);
base::ProcessHandle SpawnChild(const std::wstring& procname) {
- return SpawnChild(procname, false);
+ base::file_handle_mapping_vector empty_file_list;
+ return SpawnChild(procname, empty_file_list, false);
}
base::ProcessHandle SpawnChild(const std::wstring& procname,
bool debug_on_start) {
+ base::file_handle_mapping_vector empty_file_list;
+ return SpawnChild(procname, empty_file_list, false);
+ }
+
+ base::ProcessHandle SpawnChild(
+ const std::wstring& procname,
+ const base::file_handle_mapping_vector& fds_to_map,
+ bool debug_on_start) {
CommandLine cl;
base::ProcessHandle handle = static_cast<base::ProcessHandle>(NULL);
@@ -89,7 +98,7 @@ class MultiProcessTest : public PlatformTest {
std::string switchstr = WideToUTF8(wswitchstr);
clvec.push_back(switchstr.c_str());
- base::LaunchApp(clvec, false, &handle);
+ base::LaunchApp(clvec, fds_to_map, false, &handle);
#endif
return handle;