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

Side by Side Diff: components/nacl/common/nacl_types.h

Issue 469423002: NaCl: Send fatal log messages via shared memory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes for mseaborn 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_NACL_COMMON_NACL_TYPES_H_ 5 #ifndef COMPONENTS_NACL_COMMON_NACL_TYPES_H_
6 #define COMPONENTS_NACL_COMMON_NACL_TYPES_H_ 6 #define COMPONENTS_NACL_COMMON_NACL_TYPES_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/memory/shared_memory.h"
12 #include "base/process/process_handle.h" 13 #include "base/process/process_handle.h"
13 #include "build/build_config.h" 14 #include "build/build_config.h"
14 #include "ipc/ipc_channel.h" 15 #include "ipc/ipc_channel.h"
15 #include "ipc/ipc_platform_file.h" 16 #include "ipc/ipc_platform_file.h"
16 17
17 #if defined(OS_POSIX) 18 #if defined(OS_POSIX)
18 #include "base/file_descriptor_posix.h" 19 #include "base/file_descriptor_posix.h"
19 #endif 20 #endif
20 21
21 #if defined(OS_WIN) 22 #if defined(OS_WIN)
22 #include <windows.h> // for HANDLE 23 #include <windows.h> // for HANDLE
23 #endif 24 #endif
24 25
25 // TODO(gregoryd): add a Windows definition for base::FileDescriptor 26 // TODO(gregoryd): add a Windows definition for base::FileDescriptor
26 namespace nacl { 27 namespace nacl {
27 28
28 #if defined(OS_WIN) 29 #if defined(OS_WIN)
29 typedef HANDLE FileDescriptor; 30 typedef HANDLE FileDescriptor;
30 inline HANDLE ToNativeHandle(const FileDescriptor& desc) { 31 inline HANDLE ToNativeHandle(const FileDescriptor& desc) {
31 return desc; 32 return desc;
32 } 33 }
33 #elif defined(OS_POSIX) 34 #elif defined(OS_POSIX)
34 typedef base::FileDescriptor FileDescriptor; 35 typedef base::FileDescriptor FileDescriptor;
35 inline int ToNativeHandle(const FileDescriptor& desc) { 36 inline int ToNativeHandle(const FileDescriptor& desc) {
36 return desc.fd; 37 return desc.fd;
37 } 38 }
38 #endif 39 #endif
39 40
41 // We allocate a page of shared memory for sharing crash information between
42 // the plugin and the renderer.
Mark Seaborn 2014/08/18 19:04:08 How about: "from trusted code in the NaCl process
teravest 2014/08/19 19:58:16 Done.
43 static const int kNaClCrashInfoShmemSize = 4096;
44 static const int kNaClCrashInfoMaxLogSize = 1024;
40 45
41 // Parameters sent to the NaCl process when we start it. 46 // Parameters sent to the NaCl process when we start it.
42 struct NaClStartParams { 47 struct NaClStartParams {
43 NaClStartParams(); 48 NaClStartParams();
44 ~NaClStartParams(); 49 ~NaClStartParams();
45 50
46 IPC::PlatformFileForTransit nexe_file; 51 IPC::PlatformFileForTransit nexe_file;
47 uint64_t nexe_token_lo; 52 uint64_t nexe_token_lo;
48 uint64_t nexe_token_hi; 53 uint64_t nexe_token_hi;
49 54
50 std::vector<FileDescriptor> handles; 55 std::vector<FileDescriptor> handles;
51 FileDescriptor debug_stub_server_bound_socket; 56 FileDescriptor debug_stub_server_bound_socket;
52 57
53 bool validation_cache_enabled; 58 bool validation_cache_enabled;
54 std::string validation_cache_key; 59 std::string validation_cache_key;
55 // Chrome version string. Sending the version string over IPC avoids linkage 60 // Chrome version string. Sending the version string over IPC avoids linkage
56 // issues in cases where NaCl is not compiled into the main Chromium 61 // issues in cases where NaCl is not compiled into the main Chromium
57 // executable or DLL. 62 // executable or DLL.
58 std::string version; 63 std::string version;
59 64
60 bool enable_exception_handling; 65 bool enable_exception_handling;
61 bool enable_debug_stub; 66 bool enable_debug_stub;
62 bool enable_ipc_proxy; 67 bool enable_ipc_proxy;
63 bool uses_irt; 68 bool uses_irt;
64 bool enable_dyncode_syscalls; 69 bool enable_dyncode_syscalls;
65 70
71 // For plugin <-> renderer crash information reporting.
Mark Seaborn 2014/08/18 19:04:09 "NaCl -> renderer"
teravest 2014/08/19 19:58:16 Done.
72 base::SharedMemoryHandle crash_info_shmem_handle;
73
66 // NOTE: Any new fields added here must also be added to the IPC 74 // NOTE: Any new fields added here must also be added to the IPC
67 // serialization in nacl_messages.h and (for POD fields) the constructor 75 // serialization in nacl_messages.h and (for POD fields) the constructor
68 // in nacl_types.cc. 76 // in nacl_types.cc.
69 }; 77 };
70 78
71 // Parameters sent to the browser process to have it launch a NaCl process. 79 // Parameters sent to the browser process to have it launch a NaCl process.
72 // 80 //
73 // If you change this, you will also need to update the IPC serialization in 81 // If you change this, you will also need to update the IPC serialization in
74 // nacl_host_messages.h. 82 // nacl_host_messages.h.
75 struct NaClLaunchParams { 83 struct NaClLaunchParams {
(...skipping 29 matching lines...) Expand all
105 }; 113 };
106 114
107 struct NaClLaunchResult { 115 struct NaClLaunchResult {
108 NaClLaunchResult(); 116 NaClLaunchResult();
109 NaClLaunchResult( 117 NaClLaunchResult(
110 FileDescriptor imc_channel_handle, 118 FileDescriptor imc_channel_handle,
111 const IPC::ChannelHandle& ppapi_ipc_channel_handle, 119 const IPC::ChannelHandle& ppapi_ipc_channel_handle,
112 const IPC::ChannelHandle& trusted_ipc_channel_handle, 120 const IPC::ChannelHandle& trusted_ipc_channel_handle,
113 const IPC::ChannelHandle& manifest_service_ipc_channel_handle, 121 const IPC::ChannelHandle& manifest_service_ipc_channel_handle,
114 base::ProcessId plugin_pid, 122 base::ProcessId plugin_pid,
115 int plugin_child_id); 123 int plugin_child_id,
124 base::SharedMemoryHandle crash_info_shmem_handle);
116 ~NaClLaunchResult(); 125 ~NaClLaunchResult();
117 126
118 // For plugin loader <-> renderer IMC communication. 127 // For plugin loader <-> renderer IMC communication.
119 FileDescriptor imc_channel_handle; 128 FileDescriptor imc_channel_handle;
120 129
121 // For plugin <-> renderer PPAPI communication. 130 // For plugin <-> renderer PPAPI communication.
122 IPC::ChannelHandle ppapi_ipc_channel_handle; 131 IPC::ChannelHandle ppapi_ipc_channel_handle;
123 132
124 // For plugin loader <-> renderer control communication (loading and 133 // For plugin loader <-> renderer control communication (loading and
125 // starting nexe). 134 // starting nexe).
126 IPC::ChannelHandle trusted_ipc_channel_handle; 135 IPC::ChannelHandle trusted_ipc_channel_handle;
127 136
128 // For plugin <-> renderer ManifestService communication. 137 // For plugin <-> renderer ManifestService communication.
129 IPC::ChannelHandle manifest_service_ipc_channel_handle; 138 IPC::ChannelHandle manifest_service_ipc_channel_handle;
130 139
131 base::ProcessId plugin_pid; 140 base::ProcessId plugin_pid;
132 int plugin_child_id; 141 int plugin_child_id;
142
143 // For plugin <-> renderer crash information reporting.
Mark Seaborn 2014/08/18 19:04:08 Ditto
teravest 2014/08/19 19:58:16 Done.
144 base::SharedMemoryHandle crash_info_shmem_handle;
133 }; 145 };
134 146
135 } // namespace nacl 147 } // namespace nacl
136 148
137 #endif // COMPONENTS_NACL_COMMON_NACL_TYPES_H_ 149 #endif // COMPONENTS_NACL_COMMON_NACL_TYPES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698