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

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

Issue 780653003: Revert of Upgrade the windows specific version of LaunchProcess to avoid raw handles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_message_process_host.cc
diff --git a/chrome/browser/extensions/api/messaging/native_message_process_host.cc b/chrome/browser/extensions/api/messaging/native_message_process_host.cc
index c28b233dea7333b39a2e885cab378926a1657e05..98976a103bf4c9c14c3da1eb1ada08c304067f41 100644
--- a/chrome/browser/extensions/api/messaging/native_message_process_host.cc
+++ b/chrome/browser/extensions/api/messaging/native_message_process_host.cc
@@ -47,6 +47,7 @@
native_host_name_(native_host_name),
launcher_(launcher.Pass()),
closed_(false),
+ process_handle_(base::kNullProcessHandle),
#if defined(OS_POSIX)
read_file_(-1),
#endif
@@ -102,7 +103,7 @@
void NativeMessageProcessHost::OnHostProcessLaunched(
NativeProcessLauncher::LaunchResult result,
- base::Process process,
+ base::ProcessHandle process_handle,
base::File read_file,
base::File write_file) {
DCHECK(task_runner_->BelongsToCurrentThread());
@@ -124,7 +125,7 @@
break;
}
- process_ = process.Pass();
+ process_handle_ = process_handle;
#if defined(OS_POSIX)
// This object is not the owner of the file so it should not keep an fd.
read_file_ = read_file.GetPlatformFile();
@@ -348,17 +349,17 @@
client_->CloseChannel(error_message);
}
- if (process_.IsValid()) {
+ if (process_handle_ != base::kNullProcessHandle) {
// Kill the host process if necessary to make sure we don't leave zombies.
// On OSX base::EnsureProcessTerminated() may block, so we have to post a
// task on the blocking pool.
#if defined(OS_MACOSX)
content::BrowserThread::PostBlockingPoolTask(
- FROM_HERE,
- base::Bind(&base::EnsureProcessTerminated, Passed(&process_)));
+ FROM_HERE, base::Bind(&base::EnsureProcessTerminated, process_handle_));
#else
- base::EnsureProcessTerminated(process_.Pass());
+ base::EnsureProcessTerminated(process_handle_);
#endif
+ process_handle_ = base::kNullProcessHandle;
}
}

Powered by Google App Engine
This is Rietveld 408576698