Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / components / nacl / common / nacl_types.h
index 6aea090..7ce6b3f 100644 (file)
@@ -9,6 +9,7 @@
 #include <vector>
 
 #include "base/basictypes.h"
+#include "base/memory/shared_memory.h"
 #include "base/process/process_handle.h"
 #include "build/build_config.h"
 #include "ipc/ipc_channel.h"
@@ -37,6 +38,10 @@ inline int ToNativeHandle(const FileDescriptor& desc) {
 }
 #endif
 
+// We allocate a page of shared memory for sharing crash information from
+// trusted code in the NaCl process to the renderer.
+static const int kNaClCrashInfoShmemSize = 4096;
+static const int kNaClCrashInfoMaxLogSize = 1024;
 
 // Parameters sent to the NaCl process when we start it.
 struct NaClStartParams {
@@ -63,6 +68,9 @@ struct NaClStartParams {
   bool uses_irt;
   bool enable_dyncode_syscalls;
 
+  // For NaCl <-> renderer crash information reporting.
+  base::SharedMemoryHandle crash_info_shmem_handle;
+
   // NOTE: Any new fields added here must also be added to the IPC
   // serialization in nacl_messages.h and (for POD fields) the constructor
   // in nacl_types.cc.
@@ -112,7 +120,8 @@ struct NaClLaunchResult {
       const IPC::ChannelHandle& trusted_ipc_channel_handle,
       const IPC::ChannelHandle& manifest_service_ipc_channel_handle,
       base::ProcessId plugin_pid,
-      int plugin_child_id);
+      int plugin_child_id,
+      base::SharedMemoryHandle crash_info_shmem_handle);
   ~NaClLaunchResult();
 
   // For plugin loader <-> renderer IMC communication.
@@ -130,6 +139,9 @@ struct NaClLaunchResult {
 
   base::ProcessId plugin_pid;
   int plugin_child_id;
+
+  // For NaCl <-> renderer crash information reporting.
+  base::SharedMemoryHandle crash_info_shmem_handle;
 };
 
 }  // namespace nacl