| Index: content/browser/browser_plugin/browser_plugin_guest.cc
|
| diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
|
| index 83f2b3c950b9d80bff1e586fb773bb9731527117..fb053c91c73051ddfc62ac9977ac7bae719db2d8 100644
|
| --- a/content/browser/browser_plugin/browser_plugin_guest.cc
|
| +++ b/content/browser/browser_plugin/browser_plugin_guest.cc
|
| @@ -319,8 +319,7 @@ class BrowserPluginGuest::EmbedderRenderViewHostObserver
|
| // RenderViewHostObserver:
|
| virtual void RenderViewHostDestroyed(
|
| RenderViewHost* render_view_host) OVERRIDE {
|
| - browser_plugin_guest_->embedder_web_contents_ = NULL;
|
| - browser_plugin_guest_->Destroy();
|
| + browser_plugin_guest_->EmbedderDestroyed();
|
| }
|
|
|
| private:
|
| @@ -424,6 +423,13 @@ int BrowserPluginGuest::RequestPermission(
|
| return request_id;
|
| }
|
|
|
| +void BrowserPluginGuest::EmbedderDestroyed() {
|
| + embedder_web_contents_ = NULL;
|
| + if (delegate_)
|
| + delegate_->EmbedderDestroyed();
|
| + Destroy();
|
| +}
|
| +
|
| void BrowserPluginGuest::Destroy() {
|
| is_in_destruction_ = true;
|
| if (!attached() && opener())
|
|
|