Chromium Code Reviews| Index: content/renderer/browser_plugin/browser_plugin.cc |
| diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc |
| index 3364c60142ebfe6bd019f6457b46883996a85b04..479d5a06185d5b9b6e486a4501c06121b4e3adfe 100644 |
| --- a/content/renderer/browser_plugin/browser_plugin.cc |
| +++ b/content/renderer/browser_plugin/browser_plugin.cc |
| @@ -269,9 +269,18 @@ void BrowserPlugin::Attach(int guest_instance_id, |
| scoped_ptr<base::DictionaryValue> extra_params) { |
| CHECK(guest_instance_id != browser_plugin::kInstanceIDNone); |
| - // If this BrowserPlugin is already attached to a guest, then do nothing. |
| - if (HasGuestInstanceID()) |
| - return; |
| + // If this BrowserPlugin is already attached to a guest, then kill the guest. |
| + if (HasGuestInstanceID()) { |
| + guest_crashed_ = false; |
| + EnableCompositing(false); |
| + if (compositing_helper_) { |
| + compositing_helper_->OnContainerDestroy(); |
| + compositing_helper_ = NULL; |
| + } |
| + browser_plugin_manager()->RemoveBrowserPlugin(guest_instance_id_); |
| + browser_plugin_manager()->Send(new BrowserPluginHostMsg_PluginDestroyed( |
| + render_view_routing_id_, guest_instance_id_)); |
|
lazyboy
2014/07/08 18:24:34
DCHECK_NE(guest_instance_id_, guest_instance_id)?
Fady Samuel
2014/07/08 20:23:46
I just added an early exit in this case. There's n
|
| + } |
| // This API may be called directly without setting the src attribute. |
| // In that case, we need to make sure we don't allocate another instance ID. |