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

Unified Diff: components/nacl/browser/nacl_process_host.cc

Issue 1010183002: SFI NaCl: Batch-open resource files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 5 years, 9 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
« no previous file with comments | « no previous file | components/nacl/loader/nacl_ipc_adapter.h » ('j') | components/nacl/loader/nacl_ipc_adapter.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a0c8e56c9a35f9452cb4c4f7f8ec5e3591462fb9..56961938900d7452435ebf096c0eb35501a1903b 100644
--- a/components/nacl/browser/nacl_process_host.cc
+++ b/components/nacl/browser/nacl_process_host.cc
@@ -898,21 +898,26 @@ bool NaClProcessHost::StartNaClExecution() {
return false;
}
+ // Pass the pre-opened resource files to the loader. We do not have to reopen
+ // resource files here even for SFI mode because the descriptors are not from
+ // a renderer.
+ for (size_t i = 0; i < prefetched_resource_files_info_.size(); ++i) {
+ params.prefetched_resource_files.push_back(
+ NaClResourceFileInfo(
+ prefetched_resource_files_info_[i].file,
+ // For the same reason as the comment below, always use an empty
+ // base::FilePath for non-SFI mode.
+ (uses_nonsfi_mode_ ? base::FilePath() :
+ prefetched_resource_files_info_[i].file_path_metadata),
+ prefetched_resource_files_info_[i].file_key));
+ }
+ prefetched_resource_files_info_.clear();
+
base::FilePath file_path;
if (uses_nonsfi_mode_) {
// Don't retrieve the file path when using nonsfi mode; there's no
// validation caching in that case, so it's unnecessary work, and would
// expose the file path to the plugin.
-
- // Pass the pre-opened resource files to the loader. For the same reason
- // as above, use an empty base::FilePath.
- for (size_t i = 0; i < prefetched_resource_files_info_.size(); ++i) {
- params.prefetched_resource_files.push_back(
- NaClResourceFileInfo(prefetched_resource_files_info_[i].file,
- base::FilePath(),
- prefetched_resource_files_info_[i].file_key));
- }
- prefetched_resource_files_info_.clear();
} else {
if (NaClBrowser::GetInstance()->GetFilePath(nexe_token_.lo,
nexe_token_.hi,
@@ -933,8 +938,6 @@ bool NaClProcessHost::StartNaClExecution() {
return true;
}
}
- // TODO(yusukes): Handle |prefetched_resource_files_info_| for SFI-NaCl.
- DCHECK(prefetched_resource_files_info_.empty());
}
params.nexe_file = IPC::TakeFileHandleForProcess(nexe_file_.Pass(),
« no previous file with comments | « no previous file | components/nacl/loader/nacl_ipc_adapter.h » ('j') | components/nacl/loader/nacl_ipc_adapter.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698