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

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

Issue 649603004: Non-SFI NaCl: Batch-open resource files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove ipc/ and mojo/ changes following Mark's suggestion Created 6 years 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/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()) {
Mark Seaborn 2015/02/02 23:21:50 Nit: no need to conditionalise this, surely? Allo
Yusuke Sato 2015/02/04 02:00:28 Done.
+ 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,
hidehiko 2015/01/28 09:05:19 nit: indent?
Yusuke Sato 2015/02/04 02:00:28 Done.
+ 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,

Powered by Google App Engine
This is Rietveld 408576698