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

Unified Diff: chrome/renderer/pepper/ppb_nacl_private_impl.cc

Issue 10912060: Allow the NaCl IPC proxy to support multiple instances. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | « no previous file | webkit/plugins/ppapi/plugin_module.h » ('j') | webkit/plugins/ppapi/ppapi_plugin_instance.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/pepper/ppb_nacl_private_impl.cc
===================================================================
--- chrome/renderer/pepper/ppb_nacl_private_impl.cc (revision 154244)
+++ chrome/renderer/pepper/ppb_nacl_private_impl.cc (working copy)
@@ -42,6 +42,7 @@
using webkit::ppapi::HostGlobals;
using webkit::ppapi::PluginInstance;
using webkit::ppapi::PluginDelegate;
+using webkit::ppapi::PluginModule;
using WebKit::WebView;
namespace {
@@ -207,7 +208,7 @@
IPC::ChannelHandle channel_handle = it->second;
map.erase(it);
- webkit::ppapi::PluginInstance* plugin_instance =
+ PluginInstance* plugin_instance =
content::GetHostGlobals()->GetInstance(instance);
if (!plugin_instance)
return PP_FALSE;
@@ -216,18 +217,24 @@
plugin_instance->container()->element().document().frame()->view();
RenderView* render_view = content::RenderView::FromWebView(web_view);
- webkit::ppapi::PluginModule* plugin_module = plugin_instance->module();
+ PluginModule* plugin_module = plugin_instance->module();
scoped_refptr<SyncMessageStatusReceiver>
status_receiver(new SyncMessageStatusReceiver());
scoped_ptr<OutOfProcessProxy> out_of_process_proxy(new OutOfProcessProxy);
+ // Create a new module for each instance of the NaCl plugin that is using
+ // the IPC based out-of-process proxy. This allows the built-in NaCl plugin
+ // to create additional instances.
dmichael (off chromium) 2012/09/04 21:21:33 Could you elaborate more as to why new instances c
bbudge 2012/09/05 19:15:48 Done.
+ scoped_refptr<PluginModule> nacl_plugin_module(
+ plugin_module->CreateModuleForNaClInstance());
+
if (out_of_process_proxy->Init(
channel_handle,
- plugin_module->pp_module(),
- webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(),
+ nacl_plugin_module->pp_module(),
+ PluginModule::GetLocalGetInterfaceFunc(),
ppapi::Preferences(render_view->GetWebkitPreferences()),
status_receiver.get())) {
- plugin_module->InitAsProxiedNaCl(
+ nacl_plugin_module->InitAsProxiedNaCl(
out_of_process_proxy.PassAs<PluginDelegate::OutOfProcessProxy>(),
instance);
return PP_TRUE;
« no previous file with comments | « no previous file | webkit/plugins/ppapi/plugin_module.h » ('j') | webkit/plugins/ppapi/ppapi_plugin_instance.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698