Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp

Issue 1652093002: Support reviving a disposed plugin container. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tidy event listener removal Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698