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 8f6b0c971926021cadefbd87bfb8ef19a226dbf8..882aed58d675ad61db1d5f7e5f740c59e287ae34 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp |
@@ -94,7 +94,10 @@ DEFINE_TRACE(HTMLPlugInElement) |
void HTMLPlugInElement::disconnectContentFrame() |
{ |
if (m_persistedPluginWidget) { |
- m_persistedPluginWidget->dispose(); |
+ if (m_persistedPluginWidget->isPluginView()) |
+ m_persistedPluginWidget->dispose(); |
+ else |
+ ASSERT(m_persistedPluginWidget->isFrameView()); |
m_persistedPluginWidget = nullptr; |
} |
HTMLFrameOwnerElement::disconnectContentFrame(); |
@@ -115,8 +118,12 @@ void HTMLPlugInElement::setPersistedPluginWidget(Widget* widget) |
unregisterAsRenderlessIfNeeded(); |
registerAsRenderless(widget); |
if (m_persistedPluginWidget) { |
- m_persistedPluginWidget->hide(); |
- m_persistedPluginWidget->dispose(); |
+ if (m_persistedPluginWidget->isPluginView()) { |
+ m_persistedPluginWidget->hide(); |
+ m_persistedPluginWidget->dispose(); |
+ } else { |
+ ASSERT(m_persistedPluginWidget->isFrameView()); |
+ } |
} |
#endif |
m_persistedPluginWidget = widget; |