Index: third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp |
diff --git a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp |
index 68bb358424d0d09ef2c4d574c809b0cdd2a4eb5c..15d82af2929e9db8bedd87afde10ef58787f2464 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp |
@@ -114,6 +114,8 @@ void HTMLPlugInElement::setPersistedPluginWidget(Widget* widget) |
#if ENABLE(OILPAN) |
unregisterAsRenderlessIfNeeded(); |
registerAsRenderless(widget); |
+ if (m_persistedPluginWidget) |
+ m_persistedPluginWidget->dispose(); |
#endif |
m_persistedPluginWidget = widget; |
} |
@@ -124,10 +126,6 @@ bool HTMLPlugInElement::unregisterAsRenderlessIfNeeded() |
if (!m_persistedPluginWidget || !m_persistedPluginWidget->isPluginView()) |
return false; |
- // If we are in a renderer-less state, keep the registration. |
- if (!layoutEmbeddedObject()) |
- return false; |
- |
LocalFrame* frame = toPluginView(m_persistedPluginWidget.get())->pluginFrame(); |
ASSERT(frame); |
frame->unregisterPluginElement(this); |
@@ -148,7 +146,9 @@ void HTMLPlugInElement::registerAsRenderless(Widget* widget) |
PassRefPtrWillBeRawPtr<Widget> HTMLPlugInElement::releasePersistedPluginWidget() |
{ |
#if ENABLE(OILPAN) |
- unregisterAsRenderlessIfNeeded(); |
+ // If we are in a renderer-less state, keep the registration. |
+ if (layoutEmbeddedObject()) |
+ unregisterAsRenderlessIfNeeded(); |
#endif |
return m_persistedPluginWidget.release(); |
} |