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

Unified Diff: base/process/launch_posix.cc

Issue 799323003: Remove deprecated versions of LaunchProcess. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « base/process/launch.h ('k') | base/process/launch_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/launch_posix.cc
diff --git a/base/process/launch_posix.cc b/base/process/launch_posix.cc
index c475748849cb95da441b85e5ab383db88736bd5d..7bcd834ccbe8302bae1188181d7e0eed2362b486 100644
--- a/base/process/launch_posix.cc
+++ b/base/process/launch_posix.cc
@@ -277,9 +277,13 @@ void CloseSuperfluousFds(const base::InjectiveMultimap& saved_mapping) {
}
}
-bool LaunchProcess(const std::vector<std::string>& argv,
- const LaunchOptions& options,
- ProcessHandle* process_handle) {
+Process LaunchProcess(const CommandLine& cmdline,
+ const LaunchOptions& options) {
+ return LaunchProcess(cmdline.argv(), options);
+}
+
+Process LaunchProcess(const std::vector<std::string>& argv,
+ const LaunchOptions& options) {
size_t fd_shuffle_size = 0;
if (options.fds_to_remap) {
fd_shuffle_size = options.fds_to_remap->size();
@@ -335,7 +339,7 @@ bool LaunchProcess(const std::vector<std::string>& argv,
if (pid < 0) {
DPLOG(ERROR) << "fork";
- return false;
+ return Process();
} else if (pid == 0) {
// Child process
@@ -475,37 +479,9 @@ bool LaunchProcess(const std::vector<std::string>& argv,
pid_t ret = HANDLE_EINTR(waitpid(pid, 0, 0));
DPCHECK(ret > 0);
}
-
- if (process_handle)
- *process_handle = pid;
}
- return true;
-}
-
-Process LaunchProcess(const std::vector<std::string>& argv,
- const LaunchOptions& options) {
- ProcessHandle process_handle;
- if (LaunchProcess(argv, options, &process_handle))
- return Process(process_handle);
-
- return Process();
-}
-
-
-bool LaunchProcess(const CommandLine& cmdline,
- const LaunchOptions& options,
- ProcessHandle* process_handle) {
- return LaunchProcess(cmdline.argv(), options, process_handle);
-}
-
-Process LaunchProcess(const CommandLine& cmdline,
- const LaunchOptions& options) {
- ProcessHandle process_handle;
- if (LaunchProcess(cmdline, options, &process_handle))
- return Process(process_handle);
-
- return Process();
+ return Process(pid);
}
void RaiseProcessToHighPriority() {
« no previous file with comments | « base/process/launch.h ('k') | base/process/launch_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698