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

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

Issue 649603004: Non-SFI NaCl: Batch-open resource files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review Created 5 years, 10 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
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
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 kNativeNaClProcessType, 50 kNativeNaClProcessType,
51 // Runs user-provided code that is translated from *bitcode* by an 51 // Runs user-provided code that is translated from *bitcode* by an
52 // in-browser PNaCl translator. 52 // in-browser PNaCl translator.
53 kPNaClProcessType, 53 kPNaClProcessType,
54 // Runs pnacl-llc/linker *native* code. These nexes are browser-provided 54 // Runs pnacl-llc/linker *native* code. These nexes are browser-provided
55 // (not user-provided). 55 // (not user-provided).
56 kPNaClTranslatorProcessType, 56 kPNaClTranslatorProcessType,
57 kNumNaClProcessTypes 57 kNumNaClProcessTypes
58 }; 58 };
59 59
60 struct NaClFileInfo {
Mark Seaborn 2015/02/09 04:48:34 This is basically the same type as PP_NaClFileInfo
Yusuke Sato 2015/02/11 05:54:20 (This struct no longer exists)
61 NaClFileInfo();
62 NaClFileInfo(IPC::PlatformFileForTransit file,
63 uint64_t file_token_lo,
64 uint64_t file_token_hi);
65 ~NaClFileInfo();
66
67 IPC::PlatformFileForTransit file;
68 uint64_t file_token_lo;
69 uint64_t file_token_hi;
70 };
71
60 // Parameters sent to the NaCl process when we start it. 72 // Parameters sent to the NaCl process when we start it.
61 struct NaClStartParams { 73 struct NaClStartParams {
74 struct ResourceFileInfo {
Yusuke Sato 2015/02/11 05:54:21 Let me keep this one. Unlike renderer-browser IPC,
75 ResourceFileInfo();
76 ResourceFileInfo(IPC::PlatformFileForTransit file,
77 const base::FilePath& file_path,
78 const std::string& file_key);
79 ~ResourceFileInfo();
80
81 IPC::PlatformFileForTransit file;
82 base::FilePath file_path;
83 std::string file_key;
84 };
85
62 NaClStartParams(); 86 NaClStartParams();
63 ~NaClStartParams(); 87 ~NaClStartParams();
64 88
89 void CheckNumOfDescriptors();
90
65 IPC::PlatformFileForTransit nexe_file; 91 IPC::PlatformFileForTransit nexe_file;
66 // Used only as a key for validation caching. 92 // Used only as a key for validation caching.
67 base::FilePath nexe_file_path_metadata; 93 base::FilePath nexe_file_path_metadata;
68 94
95 std::vector<ResourceFileInfo> resource_files;
69 std::vector<FileDescriptor> handles; 96 std::vector<FileDescriptor> handles;
70 FileDescriptor debug_stub_server_bound_socket; 97 FileDescriptor debug_stub_server_bound_socket;
71 98
72 bool validation_cache_enabled; 99 bool validation_cache_enabled;
73 std::string validation_cache_key; 100 std::string validation_cache_key;
74 // Chrome version string. Sending the version string over IPC avoids linkage 101 // Chrome version string. Sending the version string over IPC avoids linkage
75 // issues in cases where NaCl is not compiled into the main Chromium 102 // issues in cases where NaCl is not compiled into the main Chromium
76 // executable or DLL. 103 // executable or DLL.
77 std::string version; 104 std::string version;
78 105
79 bool enable_debug_stub; 106 bool enable_debug_stub;
80 bool enable_ipc_proxy; 107 bool enable_ipc_proxy;
81 108
82 // Enables plugin code to use Mojo APIs. See mojo/nacl for details. 109 // Enables plugin code to use Mojo APIs. See mojo/nacl for details.
83 bool enable_mojo; 110 bool enable_mojo;
84 111
85 NaClAppProcessType process_type; 112 NaClAppProcessType process_type;
86 113
87 // For NaCl <-> renderer crash information reporting. 114 // For NaCl <-> renderer crash information reporting.
88 base::SharedMemoryHandle crash_info_shmem_handle; 115 base::SharedMemoryHandle crash_info_shmem_handle;
89 116
90 // NOTE: Any new fields added here must also be added to the IPC 117 // NOTE: Any new fields added here must also be added to the IPC
91 // serialization in nacl_messages.h and (for POD fields) the constructor 118 // serialization in nacl_messages.h and (for POD fields) the constructor
92 // in nacl_types.cc. 119 // in nacl_types.cc. Any new fields added for passing file handles must
120 // also be checked in NaClStartParams::CheckNumOfDescriptors().
93 }; 121 };
94 122
95 // Parameters sent to the browser process to have it launch a NaCl process. 123 // Parameters sent to the browser process to have it launch a NaCl process.
96 // 124 //
97 // If you change this, you will also need to update the IPC serialization in 125 // If you change this, you will also need to update the IPC serialization in
98 // nacl_host_messages.h. 126 // nacl_host_messages.h.
99 struct NaClLaunchParams { 127 struct NaClLaunchParams {
128 struct ResourceFileInfo {
Yusuke Sato 2015/02/11 05:54:21 removed
129 ResourceFileInfo();
130 ResourceFileInfo(NaClFileInfo file_info,
131 const std::string& file_key);
132 ~ResourceFileInfo();
133
134 NaClFileInfo file_info;
135 // This corresponds to a key in the "files" section of the NMF file.
136 std::string file_key;
137 };
138
100 NaClLaunchParams(); 139 NaClLaunchParams();
101 NaClLaunchParams(const std::string& manifest_url, 140 NaClLaunchParams(
102 const IPC::PlatformFileForTransit& nexe_file, 141 const std::string& manifest_url,
103 uint64_t nexe_token_lo, 142 const IPC::PlatformFileForTransit& nexe_file,
104 uint64_t nexe_token_hi, 143 uint64_t nexe_token_lo,
105 int render_view_id, 144 uint64_t nexe_token_hi,
106 uint32 permission_bits, 145 const std::vector<ResourceFileInfo>& resource_files,
107 bool uses_nonsfi_mode, 146 int render_view_id,
108 NaClAppProcessType process_type); 147 uint32 permission_bits,
148 bool uses_nonsfi_mode,
149 NaClAppProcessType process_type);
109 ~NaClLaunchParams(); 150 ~NaClLaunchParams();
110 151
111 std::string manifest_url; 152 std::string manifest_url;
112 // On Windows, the HANDLE passed here is valid in the renderer's context. 153 // 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 154 // It's the responsibility of the browser to duplicate this handle properly
114 // for passing it to the plugin. 155 // for passing it to the plugin.
115 IPC::PlatformFileForTransit nexe_file; 156 IPC::PlatformFileForTransit nexe_file;
116 uint64_t nexe_token_lo; 157 uint64_t nexe_token_lo;
117 uint64_t nexe_token_hi; 158 uint64_t nexe_token_hi;
159 std::vector<ResourceFileInfo> resource_files_info;
118 160
119 int render_view_id; 161 int render_view_id;
120 uint32 permission_bits; 162 uint32 permission_bits;
121 bool uses_nonsfi_mode; 163 bool uses_nonsfi_mode;
122 164
123 NaClAppProcessType process_type; 165 NaClAppProcessType process_type;
124 }; 166 };
125 167
126 struct NaClLaunchResult { 168 struct NaClLaunchResult {
127 NaClLaunchResult(); 169 NaClLaunchResult();
(...skipping 23 matching lines...) Expand all
151 base::ProcessId plugin_pid; 193 base::ProcessId plugin_pid;
152 int plugin_child_id; 194 int plugin_child_id;
153 195
154 // For NaCl <-> renderer crash information reporting. 196 // For NaCl <-> renderer crash information reporting.
155 base::SharedMemoryHandle crash_info_shmem_handle; 197 base::SharedMemoryHandle crash_info_shmem_handle;
156 }; 198 };
157 199
158 } // namespace nacl 200 } // namespace nacl
159 201
160 #endif // COMPONENTS_NACL_COMMON_NACL_TYPES_H_ 202 #endif // COMPONENTS_NACL_COMMON_NACL_TYPES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698