Chromium Code Reviews| 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()); |
|
gab
2014/11/27 13:28:44
Is it possible that this fixes http://crbug.com/43
rvargas (doing something else)
2014/12/01 20:50:36
A handle should only keep alive the process object
|
| #endif |
| - process_handle_ = base::kNullProcessHandle; |
|
Finnur
2014/11/27 13:58:26
Is it possible that this is being nulled to preven
gab
2014/11/27 14:29:51
By doing process_.Pass() above, I'd assume |proces
Finnur
2014/11/27 16:41:59
Haven't used Pass() all that much, but if that's h
gab
2014/11/27 16:47:39
Process is a move-only type and .Pass() here invok
|
| } |
| } |