Chromium Code Reviews| Index: components/nacl/browser/nacl_host_message_filter.cc |
| diff --git a/components/nacl/browser/nacl_host_message_filter.cc b/components/nacl/browser/nacl_host_message_filter.cc |
| index e4737660ad3634a5b75480d48b640eea55089e7f..ac7941cfdc48a7fed473888c7a72764d9233382d 100644 |
| --- a/components/nacl/browser/nacl_host_message_filter.cc |
| +++ b/components/nacl/browser/nacl_host_message_filter.cc |
| @@ -98,8 +98,8 @@ bool NaClHostMessageFilter::OnMessageReceived(const IPC::Message& message) { |
| OnTranslationFinished) |
| IPC_MESSAGE_HANDLER(NaClHostMsg_MissingArchError, |
| OnMissingArchError) |
| - IPC_MESSAGE_HANDLER_DELAY_REPLY(NaClHostMsg_OpenNaClExecutable, |
| - OnOpenNaClExecutable) |
| + IPC_MESSAGE_HANDLER_DELAY_REPLY(NaClHostMsg_OpenNaClResources, |
| + OnOpenNaClResources) |
| IPC_MESSAGE_HANDLER(NaClHostMsg_NaClGetNumProcessors, |
| OnNaClGetNumProcessors) |
| IPC_MESSAGE_HANDLER(NaClHostMsg_NaClDebugEnabledForURL, |
| @@ -152,6 +152,7 @@ void NaClHostMessageFilter::LaunchNaClContinuation( |
| }; |
| base::PlatformFile nexe_file; |
| + scoped_ptr<nacl::NaClProcessHost::ResourceFileInfo[]> resource_files_info; |
| #if defined(OS_WIN) |
| // Duplicate the nexe file handle from the renderer process into the browser |
| // process. |
| @@ -169,9 +170,22 @@ void NaClHostMessageFilter::LaunchNaClContinuation( |
| Send(reply_msg); |
| return; |
| } |
| + // TODO(yusukes): Support pre-opening resource files. |
| #elif defined(OS_POSIX) |
| nexe_file = |
| IPC::PlatformFileForTransitToPlatformFile(launch_params.nexe_file); |
| + resource_files_info.reset(new nacl::NaClProcessHost::ResourceFileInfo[ |
|
teravest
2014/11/10 20:36:11
elsewhere in this change, you do a size check to p
Yusuke Sato
2014/11/11 00:58:35
Done.
|
| + launch_params.resource_files_info.size()]); |
| + for (size_t i = 0; i < launch_params.resource_files_info.size(); ++i) { |
| + base::File file(IPC::PlatformFileForTransitToPlatformFile( |
| + launch_params.resource_files_info[i].file)); |
| + NaClFileToken token = { |
| + launch_params.resource_files_info[i].file_token_lo, |
| + launch_params.resource_files_info[i].file_token_hi |
| + }; |
| + resource_files_info[i] = nacl::NaClProcessHost::ResourceFileInfo( |
| + file.Pass(), token, launch_params.resource_files_info[i].file_key); |
| + } |
| #else |
| #error Unsupported platform. |
| #endif |
| @@ -180,6 +194,8 @@ void NaClHostMessageFilter::LaunchNaClContinuation( |
| GURL(launch_params.manifest_url), |
| base::File(nexe_file), |
| nexe_token, |
| + resource_files_info.Pass(), |
| + launch_params.resource_files_info.size(), |
| permissions, |
| launch_params.render_view_id, |
| launch_params.permission_bits, |
| @@ -284,11 +300,13 @@ void NaClHostMessageFilter::OnMissingArchError(int render_view_id) { |
| ShowMissingArchInfobar(render_process_id_, render_view_id); |
| } |
| -void NaClHostMessageFilter::OnOpenNaClExecutable(int render_view_id, |
| - const GURL& file_url, |
| - IPC::Message* reply_msg) { |
| - nacl_file_host::OpenNaClExecutable(this, render_view_id, file_url, |
| - reply_msg); |
| +void NaClHostMessageFilter::OnOpenNaClResources( |
| + int render_view_id, |
| + const GURL& file_url, |
| + const std::vector<GURL>& resource_urls, |
| + IPC::Message* reply_msg) { |
| + nacl_file_host::OpenNaClResources(this, render_view_id, file_url, |
| + resource_urls, reply_msg); |
| } |
| void NaClHostMessageFilter::OnNaClDebugEnabledForURL(const GURL& nmf_url, |