Chromium Code Reviews| 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()); |