summaryrefslogtreecommitdiffstats
path: root/chrome/installer/setup
diff options
context:
space:
mode:
authorrvargas <rvargas@chromium.org>2014-12-14 13:44:52 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-14 21:45:20 +0000
commit47c7523fbb3fc8c79965c2a207c8602a1f9e4993 (patch)
tree5222b0e401ff9a08d11553c434fc301148baa0db /chrome/installer/setup
parentbdcf05d84a94245a8e6dd0e7bcd08796a78a5a86 (diff)
downloadchromium_src-47c7523fbb3fc8c79965c2a207c8602a1f9e4993.zip
chromium_src-47c7523fbb3fc8c79965c2a207c8602a1f9e4993.tar.gz
chromium_src-47c7523fbb3fc8c79965c2a207c8602a1f9e4993.tar.bz2
Update installer to use the new version of LaunchProcess.
BUG=417532 Review URL: https://codereview.chromium.org/783523004 Cr-Commit-Position: refs/heads/master@{#308301}
Diffstat (limited to 'chrome/installer/setup')
-rw-r--r--chrome/installer/setup/setup_main.cc4
-rw-r--r--chrome/installer/setup/setup_util.cc6
-rw-r--r--chrome/installer/setup/setup_util_unittest.cc7
3 files changed, 8 insertions, 9 deletions
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc
index 0acc5fc..ce590b0 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.cc
@@ -587,7 +587,7 @@ bool CheckPreInstallConditions(const InstallationState& original_state,
cmd.AppendSwitch(switches::kForceFirstRun);
installer_state->WriteInstallerResult(*status, 0, NULL);
VLOG(1) << "Launching existing system-level chrome instead.";
- base::LaunchProcess(cmd, base::LaunchOptions(), NULL);
+ base::LaunchProcess(cmd, base::LaunchOptions());
}
} else {
// It's no longer possible for |product| to be anything other than
@@ -729,7 +729,7 @@ installer::InstallStatus UninstallProducts(
InstallUtil::TriggerActiveSetupCommand();
if (!system_level_cmd.GetProgram().empty())
- base::LaunchProcess(system_level_cmd, base::LaunchOptions(), NULL);
+ base::LaunchProcess(system_level_cmd, base::LaunchOptions());
// Tell Google Update that an uninstall has taken place.
// Ignore the return value: success or failure of Google Update
diff --git a/chrome/installer/setup/setup_util.cc b/chrome/installer/setup/setup_util.cc
index 3e0a3d9..f121fbf 100644
--- a/chrome/installer/setup/setup_util.cc
+++ b/chrome/installer/setup/setup_util.cc
@@ -70,13 +70,13 @@ bool LaunchAndWaitForExistingInstall(const base::FilePath& setup_exe,
// Launch the process and wait for it to exit.
VLOG(1) << "Launching existing installer with command: "
<< new_cl.GetCommandLineString();
- base::ProcessHandle handle = INVALID_HANDLE_VALUE;
- if (!base::LaunchProcess(new_cl, base::LaunchOptions(), &handle)) {
+ base::Process process = base::LaunchProcess(new_cl, base::LaunchOptions());
+ if (!process.IsValid()) {
PLOG(ERROR) << "Failed to launch existing installer with command: "
<< new_cl.GetCommandLineString();
return false;
}
- if (!base::WaitForExitCode(handle, exit_code)) {
+ if (!process.WaitForExit(exit_code)) {
PLOG(DFATAL) << "Failed to get exit code from existing installer";
*exit_code = WAIT_FOR_EXISTING_FAILED;
} else {
diff --git a/chrome/installer/setup/setup_util_unittest.cc b/chrome/installer/setup/setup_util_unittest.cc
index 9b92429..6c3430c 100644
--- a/chrome/installer/setup/setup_util_unittest.cc
+++ b/chrome/installer/setup/setup_util_unittest.cc
@@ -229,12 +229,11 @@ ScopedPriorityClass::~ScopedPriorityClass() {
PriorityClassChangeResult RelaunchAndDoProcessPriorityAdjustment() {
CommandLine cmd_line(*CommandLine::ForCurrentProcess());
cmd_line.AppendSwitch(kAdjustProcessPriority);
- base::ProcessHandle process_handle = NULL;
+ base::Process process = base::LaunchProcess(cmd_line, base::LaunchOptions());
int exit_code = 0;
- if (!base::LaunchProcess(cmd_line, base::LaunchOptions(),
- &process_handle)) {
+ if (!process.IsValid()) {
ADD_FAILURE() << " to launch subprocess.";
- } else if (!base::WaitForExitCode(process_handle, &exit_code)) {
+ } else if (!process.WaitForExit(&exit_code)) {
ADD_FAILURE() << " to wait for subprocess to exit.";
} else {
return static_cast<PriorityClassChangeResult>(exit_code);