Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1706)

Unified Diff: base/test/multiprocess_test.cc

Issue 7346017: Clean up users of a deprecated base::LaunchApp API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cros Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/test/multiprocess_test.cc
diff --git a/base/test/multiprocess_test.cc b/base/test/multiprocess_test.cc
index a1a3bbee5ecd110d317076c27f7e59baf2e3828e..c691b5f1aa3f6adc8579fd01ccebd0a0d5daad4d 100644
--- a/base/test/multiprocess_test.cc
+++ b/base/test/multiprocess_test.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -19,12 +19,8 @@ MultiProcessTest::MultiProcessTest() {
ProcessHandle MultiProcessTest::SpawnChild(const std::string& procname,
bool debug_on_start) {
-#if defined(OS_WIN)
- return SpawnChildImpl(procname, debug_on_start);
-#elif defined(OS_POSIX)
file_handle_mapping_vector empty_file_list;
return SpawnChildImpl(procname, empty_file_list, debug_on_start);
-#endif
}
#if defined(OS_POSIX)
@@ -45,30 +41,20 @@ CommandLine MultiProcessTest::MakeCmdLine(const std::string& procname,
return cl;
}
-#if defined(OS_WIN)
-
-ProcessHandle MultiProcessTest::SpawnChildImpl(const std::string& procname,
- bool debug_on_start) {
- ProcessHandle handle = static_cast<ProcessHandle>(NULL);
- LaunchApp(MakeCmdLine(procname, debug_on_start),
- false, true, &handle);
- return handle;
-}
-
-#elif defined(OS_POSIX)
-
-// TODO(port): with the CommandLine refactoring, this code is very similar
-// to the Windows code. Investigate whether this can be made shorter.
ProcessHandle MultiProcessTest::SpawnChildImpl(
const std::string& procname,
const file_handle_mapping_vector& fds_to_map,
bool debug_on_start) {
ProcessHandle handle = kNullProcessHandle;
- LaunchApp(MakeCmdLine(procname, debug_on_start).argv(),
- fds_to_map, false, &handle);
+ base::LaunchOptions options;
+ options.process_handle = &handle;
+#if defined(OS_WIN)
+ options.start_hidden = true;
+#else
+ options.fds_to_remap = &fds_to_map;
+#endif
+ base::LaunchProcess(MakeCmdLine(procname, debug_on_start), options);
return handle;
}
-#endif
-
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698