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

Unified Diff: chrome/browser/extensions/api/messaging/native_process_launcher.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.cc
diff --git a/chrome/browser/extensions/api/messaging/native_process_launcher.cc b/chrome/browser/extensions/api/messaging/native_process_launcher.cc
index 484b3872dcfd99264382fff92b79c97967046ac4..14c01fb90b8dd0b33d77a1023b6751d1b1711d17 100644
--- a/chrome/browser/extensions/api/messaging/native_process_launcher.cc
+++ b/chrome/browser/extensions/api/messaging/native_process_launcher.cc
@@ -62,12 +62,12 @@ class NativeProcessLauncherImpl : public NativeProcessLauncher {
LaunchedCallback callback);
void PostErrorResult(const LaunchedCallback& callback, LaunchResult error);
void PostResult(const LaunchedCallback& callback,
- base::ProcessHandle process_handle,
+ base::Process process,
base::File read_file,
base::File write_file);
void CallCallbackOnIOThread(LaunchedCallback callback,
LaunchResult result,
- base::ProcessHandle process_handle,
+ base::Process process,
base::File read_file,
base::File write_file);
@@ -192,12 +192,12 @@ void NativeProcessLauncherImpl::Core::DoLaunchOnThreadPool(
base::Int64ToString(window_handle_));
#endif // !defined(OS_WIN)
- base::ProcessHandle process_handle;
+ base::Process process;
base::File read_file;
base::File write_file;
if (NativeProcessLauncher::LaunchNativeProcess(
- command_line, &process_handle, &read_file, &write_file)) {
- PostResult(callback, process_handle, read_file.Pass(), write_file.Pass());
+ command_line, &process, &read_file, &write_file)) {
+ PostResult(callback, process.Pass(), read_file.Pass(), write_file.Pass());
} else {
PostErrorResult(callback, RESULT_FAILED_TO_START);
}
@@ -206,14 +206,14 @@ void NativeProcessLauncherImpl::Core::DoLaunchOnThreadPool(
void NativeProcessLauncherImpl::Core::CallCallbackOnIOThread(
LaunchedCallback callback,
LaunchResult result,
- base::ProcessHandle process_handle,
+ base::Process process,
base::File read_file,
base::File write_file) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
if (detached_)
return;
- callback.Run(result, process_handle, read_file.Pass(), write_file.Pass());
+ callback.Run(result, process.Pass(), read_file.Pass(), write_file.Pass());
}
void NativeProcessLauncherImpl::Core::PostErrorResult(
@@ -222,20 +222,20 @@ void NativeProcessLauncherImpl::Core::PostErrorResult(
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&NativeProcessLauncherImpl::Core::CallCallbackOnIOThread, this,
- callback, error, base::kNullProcessHandle,
+ callback, error, Passed(base::Process()),
Passed(base::File()), Passed(base::File())));
}
void NativeProcessLauncherImpl::Core::PostResult(
const LaunchedCallback& callback,
- base::ProcessHandle process_handle,
+ base::Process process,
base::File read_file,
base::File write_file) {
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(&NativeProcessLauncherImpl::Core::CallCallbackOnIOThread, this,
- callback, RESULT_SUCCESS, process_handle,
- Passed(read_file.Pass()), Passed(write_file.Pass())));
+ callback, RESULT_SUCCESS, Passed(&process),
+ Passed(&read_file), Passed(&write_file)));
}
NativeProcessLauncherImpl::NativeProcessLauncherImpl(

Powered by Google App Engine
This is Rietveld 408576698