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 <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
12 #include "base/memory/shared_memory.h" | 13 #include "base/memory/shared_memory.h" |
13 #include "base/process/process_handle.h" | 14 #include "base/process/process_handle.h" |
14 #include "build/build_config.h" | 15 #include "build/build_config.h" |
15 #include "ipc/ipc_channel.h" | 16 #include "ipc/ipc_channel.h" |
16 #include "ipc/ipc_platform_file.h" | 17 #include "ipc/ipc_platform_file.h" |
17 | 18 |
18 #if defined(OS_POSIX) | 19 #if defined(OS_POSIX) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 kNativeNaClProcessType, | 51 kNativeNaClProcessType, |
51 // Runs user-provided code that is translated from *bitcode* by an | 52 // Runs user-provided code that is translated from *bitcode* by an |
52 // in-browser PNaCl translator. | 53 // in-browser PNaCl translator. |
53 kPNaClProcessType, | 54 kPNaClProcessType, |
54 // Runs pnacl-llc/linker *native* code. These nexes are browser-provided | 55 // Runs pnacl-llc/linker *native* code. These nexes are browser-provided |
55 // (not user-provided). | 56 // (not user-provided). |
56 kPNaClTranslatorProcessType, | 57 kPNaClTranslatorProcessType, |
57 kNumNaClProcessTypes | 58 kNumNaClProcessTypes |
58 }; | 59 }; |
59 | 60 |
61 struct NaClResourceFileInfo { | |
Mark Seaborn
2015/02/25 20:01:24
Add comment: Represents a single prefetched file t
Yusuke Sato
2015/03/01 06:59:37
Done.
| |
62 NaClResourceFileInfo(); | |
63 NaClResourceFileInfo(IPC::PlatformFileForTransit file, | |
64 const base::FilePath& file_path, | |
65 const std::string& file_key); | |
66 ~NaClResourceFileInfo(); | |
67 | |
68 IPC::PlatformFileForTransit file; | |
69 base::FilePath file_path; // a key for validation caching | |
Mark Seaborn
2015/02/25 20:01:24
How about "file_path_metadata", to match the namin
Yusuke Sato
2015/03/01 06:59:37
Done.
| |
70 std::string file_key; // a key for open_resource | |
71 }; | |
72 | |
60 // Parameters sent to the NaCl process when we start it. | 73 // Parameters sent to the NaCl process when we start it. |
61 struct NaClStartParams { | 74 struct NaClStartParams { |
62 NaClStartParams(); | 75 NaClStartParams(); |
63 ~NaClStartParams(); | 76 ~NaClStartParams(); |
64 | 77 |
65 IPC::PlatformFileForTransit nexe_file; | 78 IPC::PlatformFileForTransit nexe_file; |
66 // Used only as a key for validation caching. | 79 // Used only as a key for validation caching. |
67 base::FilePath nexe_file_path_metadata; | 80 base::FilePath nexe_file_path_metadata; |
68 | 81 |
82 std::vector<NaClResourceFileInfo> prefetched_resource_files; | |
69 std::vector<FileDescriptor> handles; | 83 std::vector<FileDescriptor> handles; |
70 FileDescriptor debug_stub_server_bound_socket; | 84 FileDescriptor debug_stub_server_bound_socket; |
71 | 85 |
72 bool validation_cache_enabled; | 86 bool validation_cache_enabled; |
73 std::string validation_cache_key; | 87 std::string validation_cache_key; |
74 // Chrome version string. Sending the version string over IPC avoids linkage | 88 // Chrome version string. Sending the version string over IPC avoids linkage |
75 // issues in cases where NaCl is not compiled into the main Chromium | 89 // issues in cases where NaCl is not compiled into the main Chromium |
76 // executable or DLL. | 90 // executable or DLL. |
77 std::string version; | 91 std::string version; |
78 | 92 |
(...skipping 12 matching lines...) Expand all Loading... | |
91 // serialization in nacl_messages.h and (for POD fields) the constructor | 105 // serialization in nacl_messages.h and (for POD fields) the constructor |
92 // in nacl_types.cc. | 106 // in nacl_types.cc. |
93 }; | 107 }; |
94 | 108 |
95 // Parameters sent to the browser process to have it launch a NaCl process. | 109 // Parameters sent to the browser process to have it launch a NaCl process. |
96 // | 110 // |
97 // If you change this, you will also need to update the IPC serialization in | 111 // If you change this, you will also need to update the IPC serialization in |
98 // nacl_host_messages.h. | 112 // nacl_host_messages.h. |
99 struct NaClLaunchParams { | 113 struct NaClLaunchParams { |
100 NaClLaunchParams(); | 114 NaClLaunchParams(); |
101 NaClLaunchParams(const std::string& manifest_url, | 115 NaClLaunchParams( |
102 const IPC::PlatformFileForTransit& nexe_file, | 116 const std::string& manifest_url, |
103 uint64_t nexe_token_lo, | 117 const IPC::PlatformFileForTransit& nexe_file, |
104 uint64_t nexe_token_hi, | 118 uint64_t nexe_token_lo, |
105 int render_view_id, | 119 uint64_t nexe_token_hi, |
106 uint32 permission_bits, | 120 // A pair of resource URL and its manifest key. |
107 bool uses_nonsfi_mode, | 121 const std::vector< |
108 NaClAppProcessType process_type); | 122 std::pair<std::string, std::string> >& prefetched_resource_files, |
123 int render_view_id, | |
124 uint32 permission_bits, | |
125 bool uses_nonsfi_mode, | |
126 NaClAppProcessType process_type); | |
109 ~NaClLaunchParams(); | 127 ~NaClLaunchParams(); |
110 | 128 |
111 std::string manifest_url; | 129 std::string manifest_url; |
112 // On Windows, the HANDLE passed here is valid in the renderer's context. | 130 // On Windows, the HANDLE passed here is valid in the renderer's context. |
113 // It's the responsibility of the browser to duplicate this handle properly | 131 // It's the responsibility of the browser to duplicate this handle properly |
114 // for passing it to the plugin. | 132 // for passing it to the plugin. |
115 IPC::PlatformFileForTransit nexe_file; | 133 IPC::PlatformFileForTransit nexe_file; |
116 uint64_t nexe_token_lo; | 134 uint64_t nexe_token_lo; |
117 uint64_t nexe_token_hi; | 135 uint64_t nexe_token_hi; |
136 std::vector<std::pair<std::string, std::string> > prefetched_resource_files; | |
Mark Seaborn
2015/02/25 20:01:24
Maybe "resource_files_to_prefetch" (as in other co
Yusuke Sato
2015/03/01 06:59:37
Done.
| |
118 | 137 |
119 int render_view_id; | 138 int render_view_id; |
120 uint32 permission_bits; | 139 uint32 permission_bits; |
121 bool uses_nonsfi_mode; | 140 bool uses_nonsfi_mode; |
122 | 141 |
123 NaClAppProcessType process_type; | 142 NaClAppProcessType process_type; |
124 }; | 143 }; |
125 | 144 |
126 struct NaClLaunchResult { | 145 struct NaClLaunchResult { |
127 NaClLaunchResult(); | 146 NaClLaunchResult(); |
(...skipping 23 matching lines...) Expand all Loading... | |
151 base::ProcessId plugin_pid; | 170 base::ProcessId plugin_pid; |
152 int plugin_child_id; | 171 int plugin_child_id; |
153 | 172 |
154 // For NaCl <-> renderer crash information reporting. | 173 // For NaCl <-> renderer crash information reporting. |
155 base::SharedMemoryHandle crash_info_shmem_handle; | 174 base::SharedMemoryHandle crash_info_shmem_handle; |
156 }; | 175 }; |
157 | 176 |
158 } // namespace nacl | 177 } // namespace nacl |
159 | 178 |
160 #endif // COMPONENTS_NACL_COMMON_NACL_TYPES_H_ | 179 #endif // COMPONENTS_NACL_COMMON_NACL_TYPES_H_ |
OLD | NEW |