diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-06 10:21:42 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-06 10:21:42 +0000 |
commit | a715b604df8875bce81e613f7f4049ebdc5ccd64 (patch) | |
tree | a129d88039f037f6bdab3d5ed7b9d69d94b037e8 | |
parent | 90276a15a73ee17ee1ff5bb95036555dfda5328e (diff) | |
download | chromium_src-a715b604df8875bce81e613f7f4049ebdc5ccd64.zip chromium_src-a715b604df8875bce81e613f7f4049ebdc5ccd64.tar.gz chromium_src-a715b604df8875bce81e613f7f4049ebdc5ccd64.tar.bz2 |
Remove the MultiProcessTest::SpawnChild() that as an fds_to_map argument.
It's POSIX-only and redundant.
R=phajdan.jr@chromium.org
TBR=brettw@chromium.org,jam@chromium.org,gene@chromium.org
Review URL: https://codereview.chromium.org/187993002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255289 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/process/process_util_unittest.cc | 6 | ||||
-rw-r--r-- | base/test/multiprocess_test.cc | 11 | ||||
-rw-r--r-- | base/test/multiprocess_test.h | 8 | ||||
-rw-r--r-- | chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc | 4 | ||||
-rw-r--r-- | ipc/ipc_test_base.cc | 9 |
5 files changed, 11 insertions, 27 deletions
diff --git a/base/process/process_util_unittest.cc b/base/process/process_util_unittest.cc index 23d5181..f45efc9 100644 --- a/base/process/process_util_unittest.cc +++ b/base/process/process_util_unittest.cc @@ -505,8 +505,10 @@ int ProcessUtilTest::CountOpenFDsInChild() { base::FileHandleMappingVector fd_mapping_vec; fd_mapping_vec.push_back(std::pair<int, int>(fds[1], kChildPipe)); - base::ProcessHandle handle = this->SpawnChild( - "ProcessUtilsLeakFDChildProcess", fd_mapping_vec, false); + base::LaunchOptions options; + options.fds_to_remap = &fd_mapping_vec; + base::ProcessHandle handle = this->SpawnChildWithOptions( + "ProcessUtilsLeakFDChildProcess", options, false); CHECK(handle); int ret = IGNORE_EINTR(close(fds[1])); DPCHECK(ret == 0); diff --git a/base/test/multiprocess_test.cc b/base/test/multiprocess_test.cc index e1ce7f8..6be5c46 100644 --- a/base/test/multiprocess_test.cc +++ b/base/test/multiprocess_test.cc @@ -32,17 +32,6 @@ ProcessHandle MultiProcessTest::SpawnChildWithOptions( } #endif -#if defined(OS_POSIX) -ProcessHandle MultiProcessTest::SpawnChild( - const std::string& procname, - const FileHandleMappingVector& fds_to_map, - bool debug_on_start) { - LaunchOptions options; - options.fds_to_remap = &fds_to_map; - return SpawnChildWithOptions(procname, options, debug_on_start); -} -#endif - CommandLine MultiProcessTest::MakeCmdLine(const std::string& procname, bool debug_on_start) { CommandLine cl(*CommandLine::ForCurrentProcess()); diff --git a/base/test/multiprocess_test.h b/base/test/multiprocess_test.h index 4bf70ab..a5565cc 100644 --- a/base/test/multiprocess_test.h +++ b/base/test/multiprocess_test.h @@ -63,14 +63,6 @@ class MultiProcessTest : public PlatformTest { const LaunchOptions& options, bool debug_on_start); -#if defined(OS_POSIX) - // TODO(vtl): Remove this in favor of |SpawnChildWithOptions()|. Probably keep - // the no-options |SpawnChild()| around for ease-of-use. - ProcessHandle SpawnChild(const std::string& procname, - const FileHandleMappingVector& fds_to_map, - bool debug_on_start); -#endif - // Set up the command line used to spawn the child process. virtual CommandLine MakeCmdLine(const std::string& procname, bool debug_on_start); diff --git a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc index e5c8987..2d4e196 100644 --- a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc +++ b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc @@ -432,7 +432,9 @@ base::ProcessHandle CloudPrintProxyPolicyStartupTest::Launch( ipc_file_list.push_back(std::make_pair( startup_channel_->TakeClientFileDescriptor(), kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor)); - base::ProcessHandle handle = SpawnChild(name, ipc_file_list, false); + base::LaunchOptions options; + options.fds_to_remap = &ipc_file_list; + base::ProcessHandle handle = SpawnChildWithOptions(name, options, false); #else base::ProcessHandle handle = SpawnChild(name, false); #endif diff --git a/ipc/ipc_test_base.cc b/ipc/ipc_test_base.cc index ef050a7..b25f844 100644 --- a/ipc/ipc_test_base.cc +++ b/ipc/ipc_test_base.cc @@ -100,7 +100,7 @@ bool IPCTestBase::StartClient() { CommandLine::ForCurrentProcess()->HasSwitch(switches::kDebugChildren); #if defined(OS_WIN) - client_process_ = MultiProcessTest::SpawnChild(test_main, debug_on_start); + client_process_ = SpawnChild(test_main, debug_on_start); #elif defined(OS_POSIX) base::FileHandleMappingVector fds_to_map; const int ipcfd = channel_.get() ? channel_->GetClientFileDescriptor() : @@ -108,10 +108,9 @@ bool IPCTestBase::StartClient() { if (ipcfd > -1) fds_to_map.push_back(std::pair<int, int>(ipcfd, kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor)); - - client_process_ = MultiProcessTest::SpawnChild(test_main, - fds_to_map, - debug_on_start); + base::LaunchOptions options; + options.fds_to_remap = &fds_to_map; + client_process_ = SpawnChildWithOptions(test_main, options, debug_on_start); #endif return client_process_ != base::kNullProcessHandle; |