Index: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
diff --git a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
index 1a9ca1339518c78fb8dc3857623631ac64e0a435..f653b39b81794db1942fc6f611b7be78d2441804 100644 |
--- a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
+++ b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
@@ -267,11 +267,12 @@ void WebPluginContainerImpl::setParent(Widget* widget) |
void WebPluginContainerImpl::setPlugin(WebPlugin* plugin) |
{ |
- RELEASE_ASSERT(!m_inDispose); |
- if (plugin != m_webPlugin) { |
- m_element->resetInstance(); |
- m_webPlugin = plugin; |
- } |
+ if (plugin == m_webPlugin) |
+ return; |
+ |
+ m_element->resetInstance(); |
+ m_webPlugin = plugin; |
+ m_inDispose = false; |
} |
float WebPluginContainerImpl::deviceScaleFactor() |
@@ -530,7 +531,7 @@ bool WebPluginContainerImpl::isRectTopmost(const WebRect& rect) |
void WebPluginContainerImpl::requestTouchEventType(TouchEventRequestType requestType) |
{ |
- if (m_touchEventRequestType == requestType) |
+ if (m_touchEventRequestType == requestType || !m_element) |
return; |
if (m_element->document().frameHost()) { |
@@ -704,8 +705,7 @@ void WebPluginContainerImpl::dispose() |
{ |
m_inDispose = true; |
haraken
2016/02/02 01:33:51
I'd rename m_inDispose to m_isDisposed.
sof
2016/02/02 06:34:01
Done.
|
- if (m_element && m_touchEventRequestType != TouchEventRequestTypeNone && m_element->document().frameHost()) |
- m_element->document().frameHost()->eventHandlerRegistry().didRemoveEventHandler(*m_element, EventHandlerRegistry::TouchEvent); |
+ requestTouchEventType(TouchEventRequestTypeNone); |
if (m_webPlugin) { |
RELEASE_ASSERT(!m_webPlugin->container() || m_webPlugin->container() == this); |
@@ -717,8 +717,6 @@ void WebPluginContainerImpl::dispose() |
GraphicsLayer::unregisterContentsLayer(m_webLayer); |
m_webLayer = nullptr; |
} |
- |
- m_element = nullptr; |
} |
DEFINE_TRACE(WebPluginContainerImpl) |