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

Unified Diff: content/renderer/pepper/pepper_plugin_delegate_impl.cc

Issue 11140046: Add a content API to connect a Native Client module to an out-of-process PPAPI proxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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 | « content/renderer/pepper/pepper_plugin_delegate_impl.h ('k') | webkit/plugins/ppapi/plugin_module.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_plugin_delegate_impl.cc
===================================================================
--- content/renderer/pepper/pepper_plugin_delegate_impl.cc (revision 161836)
+++ content/renderer/pepper/pepper_plugin_delegate_impl.cc (working copy)
@@ -415,6 +415,51 @@
}
scoped_refptr<webkit::ppapi::PluginModule>
+PepperPluginDelegateImpl::CreateNaClPluginModule(
brettw 2012/10/16 18:23:53 Let's call this "CreateExternalPluginModule" and p
bbudge 2012/10/16 21:03:38 Done.
+ webkit::ppapi::PluginInstance* plugin_instance,
+ ppapi::PpapiPermissions permissions,
+ const IPC::ChannelHandle& channel_handle,
+ int nacl_process_id) {
+ // Create a new module for each instance of the NaCl plugin that is using
+ // the IPC based out-of-process proxy. We can't use the existing module,
+ // because it is configured for the in-process NaCl plugin, and we must
+ // keep it that way to allow the page to create other instances.
+ webkit::ppapi::PluginModule* plugin_module = plugin_instance->module();
+ scoped_refptr<webkit::ppapi::PluginModule> nacl_plugin_module(
+ plugin_module->CreateModuleForNaClInstance());
+
+ scoped_refptr<PepperHungPluginFilter> hung_filter(
+ new PepperHungPluginFilter(
+ FilePath(FILE_PATH_LITERAL("NaCl")),
+ render_view_->routing_id(),
+ nacl_process_id));
+
+ // Create a new HostDispatcher for the proxy, and hook it up to the new
+ // PluginModule.
+ scoped_ptr<HostDispatcherWrapper> dispatcher(
+ new HostDispatcherWrapper(nacl_plugin_module,
+ nacl_process_id,
+ permissions));
+ if (!dispatcher->Init(
+ channel_handle,
+ webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(),
+ GetPreferences(),
+ permissions,
+ hung_filter.get()))
+ return scoped_refptr<webkit::ppapi::PluginModule>();
+
+ RendererPpapiHostImpl* host_impl =
+ content::RendererPpapiHostImpl::CreateOnModuleForOutOfProcess(
+ nacl_plugin_module, dispatcher->dispatcher(), permissions);
+ render_view_->PpapiPluginCreated(host_impl);
+
+ nacl_plugin_module->InitAsProxiedNaCl(
+ dispatcher.release(),
+ plugin_instance);
+ return nacl_plugin_module;
+}
+
+scoped_refptr<webkit::ppapi::PluginModule>
PepperPluginDelegateImpl::CreateBrowserPluginModule(
const IPC::ChannelHandle& channel_handle,
int guest_process_id) {
« no previous file with comments | « content/renderer/pepper/pepper_plugin_delegate_impl.h ('k') | webkit/plugins/ppapi/plugin_module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698