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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: components/nacl/common/nacl_types.h
diff --git a/components/nacl/common/nacl_types.h b/components/nacl/common/nacl_types.h
index 11aaeb9b4139156cc9f964994a9a4afcacfcd8e8..5c33f3472a064a1eb68eee6fb5a901242e6956be 100644
--- a/components/nacl/common/nacl_types.h
+++ b/components/nacl/common/nacl_types.h
@@ -57,15 +57,47 @@ enum NaClAppProcessType {
kNumNaClProcessTypes
};
+struct NaClResourceFileInfo {
+ NaClResourceFileInfo();
+ NaClResourceFileInfo(IPC::PlatformFileForTransit file,
+ uint64_t file_token_lo,
+ uint64_t file_token_hi);
+ NaClResourceFileInfo(IPC::PlatformFileForTransit file,
+ uint64_t file_token_lo,
+ uint64_t file_token_hi,
+ const std::string& key);
+ ~NaClResourceFileInfo();
+
+ IPC::PlatformFileForTransit file;
+ uint64_t file_token_lo;
Mark Seaborn 2015/02/12 03:57:33 Could you use NaClFileToken instead of two uint64_
Yusuke Sato 2015/02/13 23:01:17 Done (removed the class)
+ uint64_t file_token_hi;
+ std::string key; // a key for open_resource
+};
+
// Parameters sent to the NaCl process when we start it.
struct NaClStartParams {
+ struct ResourceFileInfo {
+ ResourceFileInfo();
+ ResourceFileInfo(IPC::PlatformFileForTransit file,
+ const base::FilePath& file_path,
+ const std::string& file_key);
+ ~ResourceFileInfo();
+
+ IPC::PlatformFileForTransit file;
+ base::FilePath file_path; // a key for validation caching
+ std::string file_key; // a key for open_resource
+ };
+
NaClStartParams();
~NaClStartParams();
+ void CheckNumOfDescriptors();
+
IPC::PlatformFileForTransit nexe_file;
// Used only as a key for validation caching.
base::FilePath nexe_file_path_metadata;
+ std::vector<ResourceFileInfo> resource_files;
Mark Seaborn 2015/02/12 03:57:33 How about "prefetched_resource_files"? There are
Yusuke Sato 2015/02/13 23:01:16 Done.
std::vector<FileDescriptor> handles;
FileDescriptor debug_stub_server_bound_socket;
@@ -89,7 +121,8 @@ struct NaClStartParams {
// 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.
+ // in nacl_types.cc. Any new fields added for passing file handles must
+ // also be checked in NaClStartParams::CheckNumOfDescriptors().
};
// Parameters sent to the browser process to have it launch a NaCl process.
@@ -98,14 +131,16 @@ struct NaClStartParams {
// nacl_host_messages.h.
struct NaClLaunchParams {
NaClLaunchParams();
- NaClLaunchParams(const std::string& manifest_url,
- const IPC::PlatformFileForTransit& nexe_file,
- uint64_t nexe_token_lo,
- uint64_t nexe_token_hi,
- int render_view_id,
- uint32 permission_bits,
- bool uses_nonsfi_mode,
- NaClAppProcessType process_type);
+ NaClLaunchParams(
+ const std::string& manifest_url,
+ const IPC::PlatformFileForTransit& nexe_file,
+ uint64_t nexe_token_lo,
+ uint64_t nexe_token_hi,
+ const std::vector<NaClResourceFileInfo>& resource_files,
+ int render_view_id,
+ uint32 permission_bits,
+ bool uses_nonsfi_mode,
+ NaClAppProcessType process_type);
~NaClLaunchParams();
std::string manifest_url;
@@ -115,6 +150,7 @@ struct NaClLaunchParams {
IPC::PlatformFileForTransit nexe_file;
uint64_t nexe_token_lo;
uint64_t nexe_token_hi;
+ std::vector<NaClResourceFileInfo> resource_files_info;
int render_view_id;
uint32 permission_bits;

Powered by Google App Engine
This is Rietveld 408576698