diff options
Diffstat (limited to 'chrome/browser/extensions/api/messaging/native_process_launcher_win.cc')
-rw-r--r-- | chrome/browser/extensions/api/messaging/native_process_launcher_win.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/chrome/browser/extensions/api/messaging/native_process_launcher_win.cc b/chrome/browser/extensions/api/messaging/native_process_launcher_win.cc index fd7345c..31fbdc8 100644 --- a/chrome/browser/extensions/api/messaging/native_process_launcher_win.cc +++ b/chrome/browser/extensions/api/messaging/native_process_launcher_win.cc @@ -136,7 +136,7 @@ bool NativeProcessLauncher::LaunchNativeProcess( base::LaunchOptions options; options.start_hidden = true; - base::ProcessHandle cmd_handle; + base::win::ScopedHandle cmd_handle; if (!base::LaunchProcess(command.c_str(), options, &cmd_handle)) { LOG(ERROR) << "Error launching process " << command_line.GetProgram().MaybeAsASCII(); @@ -148,14 +148,13 @@ bool NativeProcessLauncher::LaunchNativeProcess( bool stdin_connected = ConnectNamedPipe(stdin_pipe.Get(), NULL) ? TRUE : GetLastError() == ERROR_PIPE_CONNECTED; if (!stdout_connected || !stdin_connected) { - base::KillProcess(cmd_handle, 0, false); - base::CloseProcessHandle(cmd_handle); + base::KillProcess(cmd_handle.Get(), 0, false); LOG(ERROR) << "Failed to connect IO pipes when starting " << command_line.GetProgram().MaybeAsASCII(); return false; } - *process_handle = cmd_handle; + *process_handle = cmd_handle.Take(); *read_file = stdout_pipe.Take(); *write_file = stdin_pipe.Take(); |