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

Unified Diff: components/nacl/renderer/ppb_nacl_private_impl.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/loader/nacl_listener.cc ('k') | ppapi/native_client/src/trusted/plugin/plugin.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/renderer/ppb_nacl_private_impl.cc
diff --git a/components/nacl/renderer/ppb_nacl_private_impl.cc b/components/nacl/renderer/ppb_nacl_private_impl.cc
index 9ada43de3774f1284e3f421254621d9c99c50297..894f773c40b86e1ffbb5ca1d19b24e41b880ad27 100644
--- a/components/nacl/renderer/ppb_nacl_private_impl.cc
+++ b/components/nacl/renderer/ppb_nacl_private_impl.cc
@@ -346,12 +346,25 @@ void LaunchSelLdr(PP_Instance instance,
std::string error_message_string;
NaClLaunchResult launch_result;
- content::RendererPpapiHost* host =
- content::RendererPpapiHost::GetForPPInstance(instance);
+ IPC::PlatformFileForTransit nexe_for_transit =
+ IPC::InvalidPlatformFileForTransit();
+#if defined(OS_POSIX)
+ if (nexe_file_info->handle != PP_kInvalidFileHandle)
+ nexe_for_transit = base::FileDescriptor(nexe_file_info->handle, true);
+#elif defined(OS_WIN)
+ // Duplicate the handle on the browser side instead of the renderer.
+ // This is because BrokerGetFileForProcess isn't part of content/public, and
+ // it's simpler to do the duplication in the browser anyway.
+ nexe_for_transit = nexe_file_info->handle;
+#else
+#error Unsupported target platform.
+#endif
if (!sender->Send(new NaClHostMsg_LaunchNaCl(
NaClLaunchParams(
instance_info.url.spec(),
- host->ShareHandleWithRemote(nexe_file_info->handle, true),
+ nexe_for_transit,
+ nexe_file_info->token_lo,
+ nexe_file_info->token_hi,
routing_id,
perm_bits,
PP_ToBool(uses_irt),
« no previous file with comments | « components/nacl/loader/nacl_listener.cc ('k') | ppapi/native_client/src/trusted/plugin/plugin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698