diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-13 12:04:12 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-13 12:04:12 +0000 |
commit | 5f32610d70c88d43dcb1e9321320f57d2a300849 (patch) | |
tree | 0fb6fbd8896865bf412e25ef91fadae748b8f5b1 /components | |
parent | 1f114854befd4da2326955ebbfb23e42fa3a7af5 (diff) | |
download | chromium_src-5f32610d70c88d43dcb1e9321320f57d2a300849.zip chromium_src-5f32610d70c88d43dcb1e9321320f57d2a300849.tar.gz chromium_src-5f32610d70c88d43dcb1e9321320f57d2a300849.tar.bz2 |
Explicitly cut link between WebViewPlugin and PluginPlaceholder
BUG=332675
R=bauerb@chromium.org,inferno@chromium.org
Review URL: https://codereview.chromium.org/135543002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244487 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components')
-rw-r--r-- | components/plugins/renderer/plugin_placeholder.cc | 6 | ||||
-rw-r--r-- | components/plugins/renderer/plugin_placeholder.h | 1 | ||||
-rw-r--r-- | components/plugins/renderer/webview_plugin.cc | 4 | ||||
-rw-r--r-- | components/plugins/renderer/webview_plugin.h | 3 |
4 files changed, 11 insertions, 3 deletions
diff --git a/components/plugins/renderer/plugin_placeholder.cc b/components/plugins/renderer/plugin_placeholder.cc index f99ee48..14aff70 100644 --- a/components/plugins/renderer/plugin_placeholder.cc +++ b/components/plugins/renderer/plugin_placeholder.cc @@ -88,7 +88,6 @@ void PluginPlaceholder::ReplacePlugin(WebPlugin* new_plugin) { // will be destroyed as soon as V8 garbage collects us. if (!element.pluginContainer()) { plugin_->destroy(); - plugin_ = NULL; return; } @@ -102,7 +101,6 @@ void PluginPlaceholder::ReplacePlugin(WebPlugin* new_plugin) { container->reportGeometry(); plugin_->ReplayReceivedData(new_plugin); plugin_->destroy(); - plugin_ = NULL; } void PluginPlaceholder::HidePlugin() { @@ -174,6 +172,10 @@ void PluginPlaceholder::ShowContextMenu(const WebMouseEvent& event) { return; } +void PluginPlaceholder::PluginDestroyed() { + plugin_ = NULL; +} + void PluginPlaceholder::OnDestruct() { frame_ = NULL; } diff --git a/components/plugins/renderer/plugin_placeholder.h b/components/plugins/renderer/plugin_placeholder.h index c1cbbce..a1cdad5 100644 --- a/components/plugins/renderer/plugin_placeholder.h +++ b/components/plugins/renderer/plugin_placeholder.h @@ -73,6 +73,7 @@ class PluginPlaceholder : public content::RenderFrameObserver, private: // WebViewPlugin::Delegate methods: virtual void ShowContextMenu(const blink::WebMouseEvent&) OVERRIDE; + virtual void PluginDestroyed() OVERRIDE; // RenderFrameObserver methods: virtual void OnDestruct() OVERRIDE; diff --git a/components/plugins/renderer/webview_plugin.cc b/components/plugins/renderer/webview_plugin.cc index d7f5af5..faf56e2 100644 --- a/components/plugins/renderer/webview_plugin.cc +++ b/components/plugins/renderer/webview_plugin.cc @@ -107,8 +107,10 @@ bool WebViewPlugin::initialize(WebPluginContainer* container) { } void WebViewPlugin::destroy() { - if (delegate_) + if (delegate_) { + delegate_->PluginDestroyed(); delegate_ = NULL; + } container_ = NULL; base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } diff --git a/components/plugins/renderer/webview_plugin.h b/components/plugins/renderer/webview_plugin.h index 608879c..6a4f1f3 100644 --- a/components/plugins/renderer/webview_plugin.h +++ b/components/plugins/renderer/webview_plugin.h @@ -42,6 +42,9 @@ class WebViewPlugin : public blink::WebPlugin, // Called upon a context menu event. virtual void ShowContextMenu(const blink::WebMouseEvent&) = 0; + + // Called when the WebViewPlugin is destroyed. + virtual void PluginDestroyed() = 0; }; explicit WebViewPlugin(Delegate* delegate); |