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

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
Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc
===================================================================
--- webkit/plugins/ppapi/ppapi_plugin_instance.cc (revision 154244)
+++ 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 (nacl_module_.get())
+ nacl_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 (nacl_instance_interface_.get())
+ nacl_instance_interface_->DidDestroy(pp_instance());
else
instance_interface_->DidDestroy(pp_instance());
@@ -2524,10 +2527,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.
+ nacl_module_.swap(module_);
dmichael (off chromium) 2012/09/04 21:21:33 What's the benefit of using swap()? Are you just t
bbudge 2012/09/05 19:15:48 Done.
+ module_.swap(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());
+ nacl_instance_interface_.reset(instance_interface_.release());
base::Callback<const void*(const char*)> get_plugin_interface_func =
base::Bind(&PluginModule::GetPluginInterface, module_.get());
« webkit/plugins/ppapi/ppapi_plugin_instance.h ('K') | « 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