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

Unified Diff: chrome/browser/extensions/api/messaging/native_process_launcher_win.cc

Issue 759903002: Upgrade the windows specific version of LaunchProcess to avoid raw handles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix chrome build Created 6 years 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
Index: chrome/browser/extensions/api/messaging/native_process_launcher_win.cc
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 59b1b39bb30b4e5896bf8d4ce72b6324d9e23722..d0ae6edba0c4682d6937a5de0ae0e5d494919d7c 100644
--- a/chrome/browser/extensions/api/messaging/native_process_launcher_win.cc
+++ b/chrome/browser/extensions/api/messaging/native_process_launcher_win.cc
@@ -89,7 +89,7 @@ base::FilePath NativeProcessLauncher::FindManifest(
// static
bool NativeProcessLauncher::LaunchNativeProcess(
const CommandLine& command_line,
- base::ProcessHandle* process_handle,
+ base::Process* process,
base::File* read_file,
base::File* write_file) {
// Timeout for the IO pipes.
@@ -151,8 +151,8 @@ bool NativeProcessLauncher::LaunchNativeProcess(
base::LaunchOptions options;
options.start_hidden = true;
- base::win::ScopedHandle cmd_handle;
- if (!base::LaunchProcess(command.c_str(), options, &cmd_handle)) {
+ base::Process cmd_process = base::LaunchProcess(command.c_str(), options);
+ if (!cmd_process.IsValid()) {
LOG(ERROR) << "Error launching process "
<< command_line.GetProgram().MaybeAsASCII();
return false;
@@ -163,13 +163,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.Get(), 0, false);
+ base::KillProcess(cmd_process.Handle(), 0, false);
LOG(ERROR) << "Failed to connect IO pipes when starting "
<< command_line.GetProgram().MaybeAsASCII();
return false;
}
- *process_handle = cmd_handle.Take();
+ *process = cmd_process.Pass();
*read_file = base::File(stdout_pipe.Take());
*write_file = base::File(stdin_pipe.Take());
« no previous file with comments | « chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc ('k') | chrome/browser/first_run/upgrade_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698