Commit 81e32e3b authored by bbudge@chromium.org's avatar bbudge@chromium.org

Change PluginInstance so it shuts down the NaCl Plugin when it uses the IPC PPAPI proxy.

BUG=116317
TEST=manual

Review URL: https://chromiumcodereview.appspot.com/10837086

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149885 0039d316-1c4b-4281-b951-d872f2087c98
parent 3f69d6e6
...@@ -403,6 +403,8 @@ void PluginInstance::Delete() { ...@@ -403,6 +403,8 @@ void PluginInstance::Delete() {
// destructor of the instance object tries to use the instance. // destructor of the instance object tries to use the instance.
message_channel_->SetPassthroughObject(NULL); message_channel_->SetPassthroughObject(NULL);
instance_interface_->DidDestroy(pp_instance()); instance_interface_->DidDestroy(pp_instance());
if (nacl_plugin_instance_interface_.get())
nacl_plugin_instance_interface_->DidDestroy(pp_instance());
if (fullscreen_container_) { if (fullscreen_container_) {
fullscreen_container_->Destroy(); fullscreen_container_->Destroy();
...@@ -2133,6 +2135,11 @@ PP_Var PluginInstance::GetPluginInstanceURL( ...@@ -2133,6 +2135,11 @@ PP_Var PluginInstance::GetPluginInstanceURL(
} }
bool PluginInstance::ResetAsProxied() { 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.
nacl_plugin_instance_interface_.reset(instance_interface_.release());
base::Callback<const void*(const char*)> get_plugin_interface_func = base::Callback<const void*(const char*)> get_plugin_interface_func =
base::Bind(&PluginModule::GetPluginInterface, module_.get()); base::Bind(&PluginModule::GetPluginInterface, module_.get());
PPP_Instance_Combined* ppp_instance_combined = PPP_Instance_Combined* ppp_instance_combined =
......
...@@ -506,6 +506,10 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance : ...@@ -506,6 +506,10 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance :
PluginDelegate* delegate_; PluginDelegate* delegate_;
scoped_refptr<PluginModule> module_; scoped_refptr<PluginModule> module_;
scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_; scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_;
// If this is the NaCl plugin, store its instance interface so we can shut
// it down properly when using the IPC-based PPAPI proxy.
// TODO(bbudge) Remove this when the proxy switch is complete.
scoped_ptr< ::ppapi::PPP_Instance_Combined> nacl_plugin_instance_interface_;
PP_Instance pp_instance_; PP_Instance pp_instance_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment