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 98976a103bf4c9c14c3da1eb1ada08c304067f41..c28b233dea7333b39a2e885cab378926a1657e05 100644 |
--- a/chrome/browser/extensions/api/messaging/native_message_process_host.cc |
+++ b/chrome/browser/extensions/api/messaging/native_message_process_host.cc |
@@ -47,7 +47,6 @@ NativeMessageProcessHost::NativeMessageProcessHost( |
native_host_name_(native_host_name), |
launcher_(launcher.Pass()), |
closed_(false), |
- process_handle_(base::kNullProcessHandle), |
#if defined(OS_POSIX) |
read_file_(-1), |
#endif |
@@ -103,7 +102,7 @@ void NativeMessageProcessHost::LaunchHostProcess() { |
void NativeMessageProcessHost::OnHostProcessLaunched( |
NativeProcessLauncher::LaunchResult result, |
- base::ProcessHandle process_handle, |
+ base::Process process, |
base::File read_file, |
base::File write_file) { |
DCHECK(task_runner_->BelongsToCurrentThread()); |
@@ -125,7 +124,7 @@ void NativeMessageProcessHost::OnHostProcessLaunched( |
break; |
} |
- process_handle_ = process_handle; |
+ process_ = process.Pass(); |
#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(); |
@@ -349,17 +348,17 @@ void NativeMessageProcessHost::Close(const std::string& error_message) { |
client_->CloseChannel(error_message); |
} |
- if (process_handle_ != base::kNullProcessHandle) { |
+ if (process_.IsValid()) { |
// 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, process_handle_)); |
+ FROM_HERE, |
+ base::Bind(&base::EnsureProcessTerminated, Passed(&process_))); |
#else |
- base::EnsureProcessTerminated(process_handle_); |
+ base::EnsureProcessTerminated(process_.Pass()); |
#endif |
- process_handle_ = base::kNullProcessHandle; |
} |
} |