| 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..ef49321ad6cc348733d410df66d870f0e572905e 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,24 @@ 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);
|
| + if (!launch_params.resource_files_info.empty()) {
|
| + resource_files_info.reset(new nacl::NaClProcessHost::ResourceFileInfo[
|
| + 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 +196,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 +302,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,
|
|
|