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

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

Issue 332463003: Pepper: Remove LOAD_MODULE SRPC call in SFI mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comment to forward declaration Created 6 years, 5 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
« no previous file with comments | « components/nacl/browser/DEPS ('k') | components/nacl/browser/nacl_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0b35afc93f081959336f87c315750fefd1d53cc4..095954e164e19f769b7c05af94f9a27e67097b67 100644
--- a/components/nacl/browser/nacl_host_message_filter.cc
+++ b/components/nacl/browser/nacl_host_message_filter.cc
@@ -15,6 +15,7 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "ipc/ipc_platform_file.h"
+#include "native_client/src/public/nacl_file_info.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
@@ -145,10 +146,40 @@ void NaClHostMessageFilter::LaunchNaClContinuation(
const nacl::NaClLaunchParams& launch_params,
IPC::Message* reply_msg,
ppapi::PpapiPermissions permissions) {
+ NaClFileToken nexe_token = {
+ launch_params.nexe_token_lo, // lo
+ launch_params.nexe_token_hi // hi
+ };
+
+ base::PlatformFile nexe_file;
+#if defined(OS_WIN)
+ // Duplicate the nexe file handle from the renderer process into the browser
+ // process.
+ if (!::DuplicateHandle(PeerHandle(),
+ launch_params.nexe_file,
+ base::GetCurrentProcessHandle(),
+ &nexe_file,
+ 0, // Unused, given DUPLICATE_SAME_ACCESS.
+ FALSE,
+ DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) {
+ NaClHostMsg_LaunchNaCl::WriteReplyParams(
+ reply_msg,
+ NaClLaunchResult(),
+ std::string("Failed to duplicate nexe file handle"));
+ Send(reply_msg);
+ return;
+ }
+#elif defined(OS_POSIX)
+ nexe_file =
+ IPC::PlatformFileForTransitToPlatformFile(launch_params.nexe_file);
+#else
+#error Unsupported platform.
+#endif
+
NaClProcessHost* host = new NaClProcessHost(
GURL(launch_params.manifest_url),
- base::File(
- IPC::PlatformFileForTransitToPlatformFile(launch_params.nexe_file)),
+ base::File(nexe_file),
+ nexe_token,
permissions,
launch_params.render_view_id,
launch_params.permission_bits,
« no previous file with comments | « components/nacl/browser/DEPS ('k') | components/nacl/browser/nacl_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698