| Index: chrome/installer/util/product.cc
|
| diff --git a/chrome/installer/util/product.cc b/chrome/installer/util/product.cc
|
| index f2ab2a788330963eebf10fb394c7a0296b1271c4..0e7bbdc6bdb5a631bcceb305fc1ad03f178ee2dd 100644
|
| --- a/chrome/installer/util/product.cc
|
| +++ b/chrome/installer/util/product.cc
|
| @@ -10,6 +10,7 @@
|
| #include "base/logging.h"
|
| #include "base/process_util.h"
|
| #include "base/win/registry.h"
|
| +#include "base/win/scoped_process_information.h"
|
| #include "chrome/installer/util/chrome_browser_operations.h"
|
| #include "chrome/installer/util/chrome_browser_sxs_operations.h"
|
| #include "chrome/installer/util/chrome_frame_operations.h"
|
| @@ -78,22 +79,20 @@ bool Product::LaunchChromeAndWait(const FilePath& application_path,
|
|
|
| bool success = false;
|
| STARTUPINFOW si = { sizeof(si) };
|
| - PROCESS_INFORMATION pi = {0};
|
| + base::win::ScopedProcessInformation pi;
|
| // Create a writable copy of the command line string, since CreateProcess may
|
| // modify the string (insert \0 to separate the program from the arguments).
|
| std::wstring writable_command_line_string(cmd.GetCommandLineString());
|
| if (!::CreateProcess(cmd.GetProgram().value().c_str(),
|
| &writable_command_line_string[0],
|
| NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL,
|
| - &si, &pi)) {
|
| + &si, pi.Receive())) {
|
| PLOG(ERROR) << "Failed to launch: " << cmd.GetCommandLineString();
|
| } else {
|
| - ::CloseHandle(pi.hThread);
|
| -
|
| - DWORD ret = ::WaitForSingleObject(pi.hProcess, INFINITE);
|
| + DWORD ret = ::WaitForSingleObject(pi.Get().hProcess, INFINITE);
|
| DLOG_IF(ERROR, ret != WAIT_OBJECT_0)
|
| << "Unexpected return value from WaitForSingleObject: " << ret;
|
| - if (::GetExitCodeProcess(pi.hProcess, &ret)) {
|
| + if (::GetExitCodeProcess(pi.Get().hProcess, &ret)) {
|
| DCHECK(ret != STILL_ACTIVE);
|
| success = true;
|
| if (exit_code)
|
| @@ -101,8 +100,6 @@ bool Product::LaunchChromeAndWait(const FilePath& application_path,
|
| } else {
|
| PLOG(ERROR) << "GetExitCodeProcess failed";
|
| }
|
| -
|
| - ::CloseHandle(pi.hProcess);
|
| }
|
|
|
| return success;
|
|
|