diff options
author | rvargas <rvargas@chromium.org> | 2014-12-03 14:24:06 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-03 22:24:46 +0000 |
commit | 6b687a5e232c80539772dc3dbe35b98095064c38 (patch) | |
tree | 152e59d10d89943e7ec0363b8f686b483c9d31be /chrome/installer/util | |
parent | e77e1c6d3ecf6398fdbd32fd262e6d6d5e00c4bd (diff) | |
download | chromium_src-6b687a5e232c80539772dc3dbe35b98095064c38.zip chromium_src-6b687a5e232c80539772dc3dbe35b98095064c38.tar.gz chromium_src-6b687a5e232c80539772dc3dbe35b98095064c38.tar.bz2 |
Upgrade the windows specific version of LaunchProcess to avoid raw handles.
This change implies that extensions::LaunchNativeProcess also changes to
return base::Process, and that requires base::EnsureProcessTerminated to
deal with base:Process (as it basically claims ownership of the process).
This CL fixes some leaks all around.
BUG=417532
Review URL: https://codereview.chromium.org/759903002
Cr-Commit-Position: refs/heads/master@{#306687}
Diffstat (limited to 'chrome/installer/util')
-rw-r--r-- | chrome/installer/util/google_update_util.cc | 8 | ||||
-rw-r--r-- | chrome/installer/util/install_util.cc | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/chrome/installer/util/google_update_util.cc b/chrome/installer/util/google_update_util.cc index 68e4675..db07f84 100644 --- a/chrome/installer/util/google_update_util.cc +++ b/chrome/installer/util/google_update_util.cc @@ -89,13 +89,13 @@ bool GetUserLevelGoogleUpdateInstallCommandLine(base::string16* cmd_string) { bool LaunchProcessAndWaitWithTimeout(const base::string16& cmd_string, base::TimeDelta timeout) { bool success = false; - base::win::ScopedHandle process; int exit_code = 0; VLOG(0) << "Launching: " << cmd_string; - if (!base::LaunchProcess(cmd_string, base::LaunchOptions(), - &process)) { + base::Process process = + base::LaunchProcess(cmd_string, base::LaunchOptions()); + if (!process.IsValid()) { PLOG(ERROR) << "Failed to launch (" << cmd_string << ")"; - } else if (!base::WaitForExitCodeWithTimeout(process.Get(), &exit_code, + } else if (!base::WaitForExitCodeWithTimeout(process.Handle(), &exit_code, timeout)) { // The GetExitCodeProcess failed or timed-out. LOG(ERROR) <<"Command (" << cmd_string << ") is taking more than " diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc index ae96bed..22905ef 100644 --- a/chrome/installer/util/install_util.cc +++ b/chrome/installer/util/install_util.cc @@ -156,7 +156,9 @@ void InstallUtil::TriggerActiveSetupCommand() { base::LaunchOptions launch_options; if (base::win::IsMetroProcess()) launch_options.force_breakaway_from_job_ = true; - if (!base::LaunchProcess(cmd.GetCommandLineString(), launch_options, NULL)) + base::Process process = + base::LaunchProcess(cmd.GetCommandLineString(), launch_options); + if (!process.IsValid()) PLOG(ERROR) << cmd.GetCommandLineString(); } |