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

Unified Diff: webkit/plugins/ppapi/plugin_module.cc

Issue 10543029: PPAPI/NaCl: Reinitialize some stuff when the ipc proxy starts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: should fix mac Created 8 years, 6 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 | « webkit/plugins/ppapi/plugin_module.h ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/plugin_module.cc
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc
index 3d7f0723daa35241ea48ffb7c9fca180da7dc657..a16f79aa0b470f3794100946649b62c4c6900c51 100644
--- a/webkit/plugins/ppapi/plugin_module.cc
+++ b/webkit/plugins/ppapi/plugin_module.cc
@@ -495,6 +495,25 @@ void PluginModule::InitAsProxied(
out_of_process_proxy_.reset(out_of_process_proxy);
}
+void PluginModule::InitAsProxiedNaCl(
+ PluginDelegate::OutOfProcessProxy* out_of_process_proxy,
+ PP_Instance instance) {
+ InitAsProxied(out_of_process_proxy);
+ // InitAsProxied (for the trusted/out-of-process case) initializes only the
+ // module, and one or more instances are added later. In this case, the
+ // PluginInstance was already created as in-process, so we missed the proxy
+ // AddInstance step and must do it now.
+ out_of_process_proxy_->AddInstance(instance);
+
+ // In NaCl, we need to tell the instance to reset itself as proxied. This will
+ // clear cached interface pointers and send DidCreate (etc) to the plugin
+ // side of the proxy.
+ PluginInstance* plugin_instance = host_globals->GetInstance(instance);
+ if (!plugin_instance)
+ return;
+ plugin_instance->ResetAsProxied();
+}
+
// static
const PPB_Core* PluginModule::GetCore() {
return &core_interface;
@@ -506,14 +525,7 @@ PluginModule::GetInterfaceFunc PluginModule::GetLocalGetInterfaceFunc() {
}
PluginInstance* PluginModule::CreateInstance(PluginDelegate* delegate) {
- PluginInstance* instance(NULL);
- const void* ppp_instance = GetPluginInterface(PPP_INSTANCE_INTERFACE_1_1);
- if (ppp_instance) {
- instance = PluginInstance::Create1_1(delegate, this, ppp_instance);
- } else if ((ppp_instance = GetPluginInterface(PPP_INSTANCE_INTERFACE_1_0))) {
- instance = PluginInstance::Create1_0(delegate, this, ppp_instance);
- }
-
+ PluginInstance* instance = PluginInstance::Create(delegate, this);
if (!instance) {
LOG(WARNING) << "Plugin doesn't support instance interface, failing.";
return NULL;
« no previous file with comments | « webkit/plugins/ppapi/plugin_module.h ('k') | webkit/plugins/ppapi/ppapi_plugin_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698