OLD | NEW |
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 <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 kNativeNaClProcessType, | 51 kNativeNaClProcessType, |
52 // Runs user-provided code that is translated from *bitcode* by an | 52 // Runs user-provided code that is translated from *bitcode* by an |
53 // in-browser PNaCl translator. | 53 // in-browser PNaCl translator. |
54 kPNaClProcessType, | 54 kPNaClProcessType, |
55 // Runs pnacl-llc/linker *native* code. These nexes are browser-provided | 55 // Runs pnacl-llc/linker *native* code. These nexes are browser-provided |
56 // (not user-provided). | 56 // (not user-provided). |
57 kPNaClTranslatorProcessType, | 57 kPNaClTranslatorProcessType, |
58 kNumNaClProcessTypes | 58 kNumNaClProcessTypes |
59 }; | 59 }; |
60 | 60 |
| 61 // Represents a request to prefetch a file that's listed in the "files" section |
| 62 // of a NaCl manifest file. |
| 63 struct NaClResourcePrefetchRequest { |
| 64 NaClResourcePrefetchRequest(); |
| 65 NaClResourcePrefetchRequest(const std::string& file_key, |
| 66 const std::string& resource_url); |
| 67 ~NaClResourcePrefetchRequest(); |
| 68 |
| 69 std::string file_key; // a key for open_resource. |
| 70 std::string resource_url; |
| 71 }; |
| 72 |
61 // Represents a single prefetched file that's listed in the "files" section of | 73 // Represents a single prefetched file that's listed in the "files" section of |
62 // a NaCl manifest file. | 74 // a NaCl manifest file. |
63 struct NaClResourceFileInfo { | 75 struct NaClResourcePrefetchResult { |
64 NaClResourceFileInfo(); | 76 NaClResourcePrefetchResult(); |
65 NaClResourceFileInfo(IPC::PlatformFileForTransit file, | 77 NaClResourcePrefetchResult(IPC::PlatformFileForTransit file, |
66 const base::FilePath& file_path, | 78 const base::FilePath& file_path, |
67 const std::string& file_key); | 79 const std::string& file_key); |
68 ~NaClResourceFileInfo(); | 80 ~NaClResourcePrefetchResult(); |
69 | 81 |
70 IPC::PlatformFileForTransit file; | 82 IPC::PlatformFileForTransit file; |
71 base::FilePath file_path_metadata; // a key for validation caching | 83 base::FilePath file_path_metadata; // a key for validation caching |
72 std::string file_key; // a key for open_resource | 84 std::string file_key; // a key for open_resource |
73 }; | 85 }; |
74 | 86 |
75 // Parameters sent to the NaCl process when we start it. | 87 // Parameters sent to the NaCl process when we start it. |
76 struct NaClStartParams { | 88 struct NaClStartParams { |
77 NaClStartParams(); | 89 NaClStartParams(); |
78 ~NaClStartParams(); | 90 ~NaClStartParams(); |
79 | 91 |
80 IPC::PlatformFileForTransit nexe_file; | 92 IPC::PlatformFileForTransit nexe_file; |
81 // Used only as a key for validation caching. | 93 // Used only as a key for validation caching. |
82 base::FilePath nexe_file_path_metadata; | 94 base::FilePath nexe_file_path_metadata; |
83 | 95 |
84 std::vector<NaClResourceFileInfo> prefetched_resource_files; | 96 std::vector<NaClResourcePrefetchResult> prefetched_resource_files; |
85 std::vector<FileDescriptor> handles; | 97 IPC::PlatformFileForTransit imc_bootstrap_handle; |
86 FileDescriptor debug_stub_server_bound_socket; | 98 IPC::PlatformFileForTransit irt_handle; |
| 99 #if defined(OS_MACOSX) |
| 100 IPC::PlatformFileForTransit mac_shm_fd; |
| 101 #endif |
| 102 #if defined(OS_POSIX) |
| 103 IPC::PlatformFileForTransit debug_stub_server_bound_socket; |
| 104 #endif |
87 | 105 |
88 bool validation_cache_enabled; | 106 bool validation_cache_enabled; |
89 std::string validation_cache_key; | 107 std::string validation_cache_key; |
90 // Chrome version string. Sending the version string over IPC avoids linkage | 108 // Chrome version string. Sending the version string over IPC avoids linkage |
91 // issues in cases where NaCl is not compiled into the main Chromium | 109 // issues in cases where NaCl is not compiled into the main Chromium |
92 // executable or DLL. | 110 // executable or DLL. |
93 std::string version; | 111 std::string version; |
94 | 112 |
95 bool enable_debug_stub; | 113 bool enable_debug_stub; |
96 bool enable_ipc_proxy; | 114 bool enable_ipc_proxy; |
(...skipping 12 matching lines...) Expand all Loading... |
109 // | 127 // |
110 // If you change this, you will also need to update the IPC serialization in | 128 // If you change this, you will also need to update the IPC serialization in |
111 // nacl_host_messages.h. | 129 // nacl_host_messages.h. |
112 struct NaClLaunchParams { | 130 struct NaClLaunchParams { |
113 NaClLaunchParams(); | 131 NaClLaunchParams(); |
114 NaClLaunchParams( | 132 NaClLaunchParams( |
115 const std::string& manifest_url, | 133 const std::string& manifest_url, |
116 const IPC::PlatformFileForTransit& nexe_file, | 134 const IPC::PlatformFileForTransit& nexe_file, |
117 uint64_t nexe_token_lo, | 135 uint64_t nexe_token_lo, |
118 uint64_t nexe_token_hi, | 136 uint64_t nexe_token_hi, |
119 // A pair of a manifest key and its resource URL. | |
120 const std::vector< | 137 const std::vector< |
121 std::pair<std::string, std::string> >& resource_files_to_prefetch, | 138 NaClResourcePrefetchRequest>& resource_prefetch_request_list, |
122 int render_view_id, | 139 int render_view_id, |
123 uint32 permission_bits, | 140 uint32 permission_bits, |
124 bool uses_nonsfi_mode, | 141 bool uses_nonsfi_mode, |
125 NaClAppProcessType process_type); | 142 NaClAppProcessType process_type); |
126 ~NaClLaunchParams(); | 143 ~NaClLaunchParams(); |
127 | 144 |
128 std::string manifest_url; | 145 std::string manifest_url; |
129 // On Windows, the HANDLE passed here is valid in the renderer's context. | 146 // On Windows, the HANDLE passed here is valid in the renderer's context. |
130 // It's the responsibility of the browser to duplicate this handle properly | 147 // It's the responsibility of the browser to duplicate this handle properly |
131 // for passing it to the plugin. | 148 // for passing it to the plugin. |
132 IPC::PlatformFileForTransit nexe_file; | 149 IPC::PlatformFileForTransit nexe_file; |
133 uint64_t nexe_token_lo; | 150 uint64_t nexe_token_lo; |
134 uint64_t nexe_token_hi; | 151 uint64_t nexe_token_hi; |
135 std::vector<std::pair<std::string, std::string> > resource_files_to_prefetch; | 152 std::vector<NaClResourcePrefetchRequest> resource_prefetch_request_list; |
136 | 153 |
137 int render_view_id; | 154 int render_view_id; |
138 uint32 permission_bits; | 155 uint32 permission_bits; |
139 bool uses_nonsfi_mode; | 156 bool uses_nonsfi_mode; |
140 | 157 |
141 NaClAppProcessType process_type; | 158 NaClAppProcessType process_type; |
142 }; | 159 }; |
143 | 160 |
144 struct NaClLaunchResult { | 161 struct NaClLaunchResult { |
145 NaClLaunchResult(); | 162 NaClLaunchResult(); |
(...skipping 23 matching lines...) Expand all Loading... |
169 base::ProcessId plugin_pid; | 186 base::ProcessId plugin_pid; |
170 int plugin_child_id; | 187 int plugin_child_id; |
171 | 188 |
172 // For NaCl <-> renderer crash information reporting. | 189 // For NaCl <-> renderer crash information reporting. |
173 base::SharedMemoryHandle crash_info_shmem_handle; | 190 base::SharedMemoryHandle crash_info_shmem_handle; |
174 }; | 191 }; |
175 | 192 |
176 } // namespace nacl | 193 } // namespace nacl |
177 | 194 |
178 #endif // COMPONENTS_NACL_COMMON_NACL_TYPES_H_ | 195 #endif // COMPONENTS_NACL_COMMON_NACL_TYPES_H_ |
OLD | NEW |