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

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: Remove ipc/ and mojo/ changes following Mark's suggestion Created 6 years 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 0a15d7b521f712d2d25b06ce246ce6501850baec..4da7eb8eebe81032c182d272188e9843881c00f6 100644
--- a/components/nacl/common/nacl_types.h
+++ b/components/nacl/common/nacl_types.h
@@ -6,6 +6,7 @@
#define COMPONENTS_NACL_COMMON_NACL_TYPES_H_
#include <string>
+#include <utility>
#include <vector>
#include "base/basictypes.h"
@@ -62,10 +63,25 @@ struct NaClStartParams {
NaClStartParams();
~NaClStartParams();
+ struct ResourceFileInfo {
hidehiko 2015/01/28 09:05:19 Move above? http://google-styleguide.googlecode.co
Yusuke Sato 2015/02/04 02:00:28 Done. Let me keep this inside the class to avoid n
+ ResourceFileInfo();
+ ResourceFileInfo(IPC::PlatformFileForTransit file,
+ const base::FilePath& file_path,
+ const std::string& file_key);
+ ~ResourceFileInfo();
+
+ IPC::PlatformFileForTransit file;
+ base::FilePath file_path;
+ std::string file_key;
+ };
+
+ 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;
std::vector<FileDescriptor> handles;
FileDescriptor debug_stub_server_bound_socket;
@@ -86,7 +102,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.
@@ -94,17 +111,35 @@ struct NaClStartParams {
// If you change this, you will also need to update the IPC serialization in
// nacl_host_messages.h.
struct NaClLaunchParams {
+ struct ResourceFileInfo;
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<ResourceFileInfo>& resource_files,
+ int render_view_id,
+ uint32 permission_bits,
+ bool uses_nonsfi_mode,
+ NaClAppProcessType process_type);
~NaClLaunchParams();
+ struct ResourceFileInfo {
hidehiko 2015/01/28 09:05:19 Move to above? http://google-styleguide.googlecod
Yusuke Sato 2015/02/04 02:00:28 Done.
+ ResourceFileInfo();
+ ResourceFileInfo(IPC::PlatformFileForTransit file,
+ uint64_t file_token_lo,
+ uint64_t file_token_hi,
+ const std::string& file_key);
+ ~ResourceFileInfo();
+
+ IPC::PlatformFileForTransit file;
hidehiko 2015/01/28 09:05:19 These three fields looks as same as NaClOpenExecut
Yusuke Sato 2015/02/04 02:00:28 Done.
+ uint64_t file_token_lo;
+ uint64_t file_token_hi;
+ // This corresponds to a key in the "files" section of the NMF file.
+ std::string file_key;
+ };
+
std::string manifest_url;
// On Windows, the HANDLE passed here is valid in the renderer's context.
// It's the responsibility of the browser to duplicate this handle properly
@@ -112,6 +147,7 @@ struct NaClLaunchParams {
IPC::PlatformFileForTransit nexe_file;
uint64_t nexe_token_lo;
uint64_t nexe_token_hi;
+ std::vector<ResourceFileInfo> resource_files_info;
int render_view_id;
uint32 permission_bits;
@@ -152,6 +188,29 @@ struct NaClLaunchResult {
base::SharedMemoryHandle crash_info_shmem_handle;
};
+struct NaClOpenExecutableResult {
+ struct FileInfo;
+ NaClOpenExecutableResult();
+ NaClOpenExecutableResult(const FileInfo& file_info,
+ const std::vector<FileInfo>& resource_files_info);
+ ~NaClOpenExecutableResult();
+
+ struct FileInfo {
+ FileInfo();
+ FileInfo(IPC::PlatformFileForTransit file,
+ uint64_t file_token_lo,
+ uint64_t file_token_hi);
+ ~FileInfo();
+
+ IPC::PlatformFileForTransit file;
+ uint64_t file_token_lo;
+ uint64_t file_token_hi;
+ };
+
+ FileInfo file_info;
+ std::vector<FileInfo> resource_files_info;
+};
+
} // namespace nacl
#endif // COMPONENTS_NACL_COMMON_NACL_TYPES_H_

Powered by Google App Engine
This is Rietveld 408576698