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

Unified Diff: components/nacl/browser/nacl_process_host.cc

Issue 469423002: NaCl: Send fatal log messages via shared memory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove commented out line Created 6 years, 4 months 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
« no previous file with comments | « components/nacl/browser/nacl_process_host.h ('k') | components/nacl/common/nacl_host_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..56934bfc6ca1372da828c0e5cbf8d3986f020694 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,15 +740,27 @@ 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;
+ }
+
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;
+
+ // Now that the crash information shmem handles have been shared with the
+ // plugin and the renderer, the browser can close its handle.
+ crash_info_shmem_.Close();
return true;
}
@@ -899,6 +915,11 @@ bool NaClProcessHost::StartNaClExecution() {
params.nexe_file = IPC::TakeFileHandleForProcess(nexe_file_.Pass(),
process_->GetData().handle);
+ if (!crash_info_shmem_.ShareToProcess(process_->GetData().handle,
+ &params.crash_info_shmem_handle)) {
+ DLOG(ERROR) << "Failed to ShareToProcess() a shared memory buffer";
+ return false;
+ }
process_->Send(new NaClProcessMsg_Start(params));
return true;
« no previous file with comments | « components/nacl/browser/nacl_process_host.h ('k') | components/nacl/common/nacl_host_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698