Chromium Code Reviews| Index: components/nacl/browser/nacl_process_host.cc |
| diff --git a/components/nacl/browser/nacl_process_host.cc b/components/nacl/browser/nacl_process_host.cc |
| index 7005a664553fe995ebeae7f622af214b9ecfbe53..2da1995e14baa55ed8fbf644817247b8d3c2cafe 100644 |
| --- a/components/nacl/browser/nacl_process_host.cc |
| +++ b/components/nacl/browser/nacl_process_host.cc |
| @@ -336,6 +336,11 @@ NaClProcessHost::~NaClProcessHost() { |
| NaClBrokerService::GetInstance()->OnLoaderDied(); |
| } |
| #endif |
| + |
| + if (base::SharedMemory::IsHandleValid(crash_info_shmem_plugin_handle_)) |
| + base::SharedMemory::CloseHandle(crash_info_shmem_plugin_handle_); |
|
Mark Seaborn
2014/08/17 20:13:45
Is this a handle in another process's handle names
teravest
2014/08/18 16:16:26
Good point. I've changed this to only share the sh
|
| + if (base::SharedMemory::IsHandleValid(crash_info_shmem_renderer_handle_)) |
| + base::SharedMemory::CloseHandle(crash_info_shmem_renderer_handle_); |
| } |
| void NaClProcessHost::OnProcessCrashed(int exit_status) { |
| @@ -474,6 +479,18 @@ void NaClProcessHost::Launch( |
| SetCloseOnExec(pair[1]); |
| } |
| + // Create a shared memory region that the renderer and plugin share for |
| + // reporting crash information. |
| + { |
| + base::SharedMemory crash_info_shmem; |
| + if (crash_info_shmem.CreateAnonymous(kNaClCrashInfoShmemSize)) { |
| + crash_info_shmem.ShareToProcess(process_->GetData().handle, |
|
Mark Seaborn
2014/08/17 20:13:45
Should this check for an error?
teravest
2014/08/18 16:16:26
I've added error checking at the ShareToProcess()
|
| + &crash_info_shmem_plugin_handle_); |
| + crash_info_shmem.ShareToProcess(nacl_host_message_filter_->PeerHandle(), |
| + &crash_info_shmem_renderer_handle_); |
| + } |
| + } |
| + |
| // Launch the process |
| if (!LaunchSelLdr()) { |
| delete this; |
| @@ -742,9 +759,11 @@ bool NaClProcessHost::ReplyToRenderer( |
| trusted_channel_handle, |
| manifest_service_channel_handle, |
| base::GetProcId(data.handle), |
| - data.id), |
| + data.id, |
| + crash_info_shmem_renderer_handle_), |
| std::string() /* error_message */); |
| internal_->socket_for_renderer = NACL_INVALID_HANDLE; |
| + crash_info_shmem_renderer_handle_ = base::SharedMemory::NULLHandle(); |
| return true; |
| } |
| @@ -900,6 +919,9 @@ bool NaClProcessHost::StartNaClExecution() { |
| params.nexe_file = IPC::TakeFileHandleForProcess(nexe_file_.Pass(), |
| process_->GetData().handle); |
| + params.crash_info_shmem_handle = crash_info_shmem_plugin_handle_; |
| + crash_info_shmem_plugin_handle_ = base::SharedMemory::NULLHandle(); |
| + |
| process_->Send(new NaClProcessMsg_Start(params)); |
| return true; |
| } |