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

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.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 | « webkit/plugins/ppapi/ppapi_plugin_instance.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc
===================================================================
--- webkit/plugins/ppapi/ppapi_plugin_instance.cc (revision 154817)
+++ webkit/plugins/ppapi/ppapi_plugin_instance.cc (working copy)
@@ -484,6 +484,9 @@
delegate_->InstanceDeleted(this);
module_->InstanceDeleted(this);
+ // If we switched from the NaCl plugin module, notify it too.
+ if (original_module_.get())
+ original_module_->InstanceDeleted(this);
HostGlobals::Get()->InstanceDeleted(pp_instance_);
}
@@ -505,8 +508,8 @@
// If this is a NaCl plugin instance, shut down the NaCl plugin by calling
// its DidDestroy. Don't call DidDestroy on the untrusted plugin instance,
// since there is little that it can do at this point.
- if (nacl_plugin_instance_interface_.get())
- nacl_plugin_instance_interface_->DidDestroy(pp_instance());
+ if (original_instance_interface_.get())
+ original_instance_interface_->DidDestroy(pp_instance());
else
instance_interface_->DidDestroy(pp_instance());
@@ -2526,10 +2529,15 @@
components);
}
-bool PluginInstance::ResetAsProxied() {
+bool PluginInstance::ResetAsProxied(scoped_refptr<PluginModule> module) {
+ // Save the original module and switch over to the new one now that this
+ // plugin is using the IPC-based proxy.
+ original_module_ = module_;
+ module_ = module;
+
// For NaCl instances, remember the NaCl plugin instance interface, so we
// can shut it down by calling its DidDestroy in our Delete() method.
- nacl_plugin_instance_interface_.reset(instance_interface_.release());
+ original_instance_interface_.reset(instance_interface_.release());
base::Callback<const void*(const char*)> get_plugin_interface_func =
base::Bind(&PluginModule::GetPluginInterface, module_.get());
« no previous file with comments | « webkit/plugins/ppapi/ppapi_plugin_instance.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698