Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc |
=================================================================== |
--- webkit/plugins/ppapi/ppapi_plugin_instance.cc (revision 151201) |
+++ webkit/plugins/ppapi/ppapi_plugin_instance.cc (working copy) |
@@ -402,9 +402,13 @@ |
// destroy it. We want to do this prior to calling DidDestroy in case the |
// destructor of the instance object tries to use the instance. |
message_channel_->SetPassthroughObject(NULL); |
- instance_interface_->DidDestroy(pp_instance()); |
+ // 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()); |
+ else |
+ instance_interface_->DidDestroy(pp_instance()); |
if (fullscreen_container_) { |
fullscreen_container_->Destroy(); |
@@ -2142,9 +2146,8 @@ |
} |
bool PluginInstance::ResetAsProxied() { |
- // Remember the existing instance interface, so we can call DidDestroy in |
- // our Delete() method. This will delete the NaCl plugin instance, which |
- // will shut down the NaCl process. |
+ // 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()); |
base::Callback<const void*(const char*)> get_plugin_interface_func = |