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

Unified Diff: components/nacl/loader/nonsfi/nonsfi_listener.cc

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 6 years, 2 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/loader/nonsfi/nonsfi_listener.cc
diff --git a/components/nacl/loader/nonsfi/nonsfi_listener.cc b/components/nacl/loader/nonsfi/nonsfi_listener.cc
index dfa1dafaff833373a7791718816540ef95cf7168..573ca7868bf64ef08e6771c5680415a757f0a769 100644
--- a/components/nacl/loader/nonsfi/nonsfi_listener.cc
+++ b/components/nacl/loader/nonsfi/nonsfi_listener.cc
@@ -27,6 +27,9 @@
namespace nacl {
namespace nonsfi {
+void RegisterPreopenedDescriptors(const std::vector<std::string>& keys,
teravest 2014/10/24 16:18:06 Why is this defined in another file?
Yusuke Sato 2014/11/04 22:50:21 Because nacl::nonsfi::IrtOpenResource() in compone
+ const std::vector<int>& fds);
+
NonSfiListener::NonSfiListener() : io_thread_("NaCl_IOThread"),
shutdown_event_(true, false) {
io_thread_.StartWithOptions(
@@ -146,6 +149,14 @@ void NonSfiListener::OnStart(const nacl::NaClStartParams& params) {
CHECK(params.nexe_file != IPC::InvalidPlatformFileForTransit());
CHECK(params.nexe_file_path_metadata.empty());
+ CHECK(params.resource_keys.size() == params.resource_files.size());
+ std::vector<base::PlatformFile> fds;
+ for (size_t i = 0; i < params.resource_files.size(); ++i) {
+ fds.push_back(
+ IPC::PlatformFileForTransitToPlatformFile(params.resource_files[i]));
+ }
+ RegisterPreopenedDescriptors(params.resource_keys, fds);
+
MainStart(IPC::PlatformFileForTransitToPlatformFile(params.nexe_file));
}

Powered by Google App Engine
This is Rietveld 408576698