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)); |
} |