Index: components/nacl/browser/nacl_process_host.cc |
diff --git a/components/nacl/browser/nacl_process_host.cc b/components/nacl/browser/nacl_process_host.cc |
index afb430aabf7e5f73798bf266361b38d17eedd99e..3948e553ed4afc00337f576137c043eef282c53e 100644 |
--- a/components/nacl/browser/nacl_process_host.cc |
+++ b/components/nacl/browser/nacl_process_host.cc |
@@ -231,19 +231,56 @@ bool ShareHandleToSelLdr( |
unsigned NaClProcessHost::keepalive_throttle_interval_milliseconds_ = |
ppapi::kKeepaliveThrottleIntervalDefaultMilliseconds; |
-NaClProcessHost::NaClProcessHost(const GURL& manifest_url, |
- base::File nexe_file, |
- const NaClFileToken& nexe_token, |
- ppapi::PpapiPermissions permissions, |
- int render_view_id, |
- uint32 permission_bits, |
- bool uses_nonsfi_mode, |
- bool off_the_record, |
- NaClAppProcessType process_type, |
- const base::FilePath& profile_directory) |
+NaClProcessHost::ResourceFileInfo::ResourceFileInfo() |
+ : file_token_() { |
teravest
2014/11/10 20:36:11
Is this initializer necessary?
Yusuke Sato
2014/11/11 00:58:35
Since the struct does not have a constructor, I wa
|
+} |
+ |
+NaClProcessHost::ResourceFileInfo::ResourceFileInfo( |
+ base::File file, |
+ const NaClFileToken& file_token, |
+ const std::string& file_key) |
+ : file_(file.Pass()), |
+ file_token_(file_token), |
+ file_key_(file_key) { |
+} |
+ |
+NaClProcessHost::ResourceFileInfo::~ResourceFileInfo() { |
+} |
+ |
+NaClProcessHost::ResourceFileInfo::ResourceFileInfo(RValue other) |
+ : file_(other.object->file_.Pass()), |
+ file_token_(other.object->file_token()), |
+ file_key_(other.object->file_key()) { |
+} |
+ |
+NaClProcessHost::ResourceFileInfo& |
+NaClProcessHost::ResourceFileInfo::operator=(RValue other) { |
+ if (this != other.object) { |
+ file_ = other.object->file_.Pass(); |
+ file_token_ = other.object->file_token(); |
+ file_key_ = other.object->file_key(); |
+ } |
+ return *this; |
+} |
+ |
+NaClProcessHost::NaClProcessHost( |
+ const GURL& manifest_url, |
+ base::File nexe_file, |
+ const NaClFileToken& nexe_token, |
+ scoped_ptr<NaClProcessHost::ResourceFileInfo[]> resource_files_info, |
+ size_t resource_files_info_len, |
+ ppapi::PpapiPermissions permissions, |
+ int render_view_id, |
+ uint32 permission_bits, |
+ bool uses_nonsfi_mode, |
+ bool off_the_record, |
+ NaClAppProcessType process_type, |
+ const base::FilePath& profile_directory) |
: manifest_url_(manifest_url), |
nexe_file_(nexe_file.Pass()), |
nexe_token_(nexe_token), |
+ resource_files_info_(resource_files_info.Pass()), |
+ resource_files_info_len_(resource_files_info_len), |
permissions_(permissions), |
#if defined(OS_WIN) |
process_launched_by_broker_(false), |
@@ -881,6 +918,17 @@ bool NaClProcessHost::StartNaClExecution() { |
return false; |
} |
+ if (uses_nonsfi_mode_) { |
+ for (size_t i = 0; i < resource_files_info_len_; ++i) { |
+ IPC::PlatformFileForTransit file = IPC::TakeFileHandleForProcess( |
+ resource_files_info_[i].file().Pass(), process_->GetData().handle); |
+ std::string file_key = resource_files_info_[i].file_key(); |
+ params.resource_files.push_back( |
+ // Pass an empty base::FilePath since Non-SFI mode does not use it. |
+ NaClStartParams::ResourceFileInfo(file, base::FilePath(), file_key)); |
+ } |
+ } |
+ |
process_->Send(new NaClProcessMsg_Start(params)); |
return true; |
} |