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..c5784790b65df7c8f4103aebf473758ae702e858 100644 |
| --- a/components/nacl/browser/nacl_process_host.cc |
| +++ b/components/nacl/browser/nacl_process_host.cc |
| @@ -474,6 +474,10 @@ void NaClProcessHost::Launch( |
| SetCloseOnExec(pair[1]); |
| } |
| + // Create a shared memory region that the renderer and plugin share for |
| + // reporting crash information. |
| + crash_info_shmem_.CreateAnonymous(kNaClCrashInfoShmemSize); |
| + |
| // Launch the process |
| if (!LaunchSelLdr()) { |
| delete this; |
| @@ -736,13 +740,21 @@ bool NaClProcessHost::ReplyToRenderer( |
| #endif |
| const ChildProcessData& data = process_->GetData(); |
| + base::SharedMemoryHandle crash_info_shmem_renderer_handle; |
| + if (!crash_info_shmem_.ShareToProcess(nacl_host_message_filter_->PeerHandle(), |
| + &crash_info_shmem_renderer_handle)) { |
| + SendErrorToRenderer("ShareToProcess() failed"); |
| + return false; |
| + } |
|
Mark Seaborn
2014/08/18 19:04:08
How about doing
crash_info_shmem_.Close()
to unr
teravest
2014/08/19 19:58:16
Done.
|
| + |
| SendMessageToRenderer( |
| NaClLaunchResult(imc_handle_for_renderer, |
| ppapi_channel_handle, |
| 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; |
| return true; |
| @@ -899,6 +911,11 @@ bool NaClProcessHost::StartNaClExecution() { |
| params.nexe_file = IPC::TakeFileHandleForProcess(nexe_file_.Pass(), |
| process_->GetData().handle); |
| + if (!crash_info_shmem_.ShareToProcess(process_->GetData().handle, |
| + ¶ms.crash_info_shmem_handle)) { |
| + DLOG(ERROR) << "Failed to ShareToProcess() a shared memory buffer"; |
| + return false; |
| + } |
| process_->Send(new NaClProcessMsg_Start(params)); |
| return true; |