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 e74496a28d6d739012060c40aabbb06479af9502..321cdf19a2723491d65ee8ef9dd5eeb07acb86de 100644 |
--- a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
+++ b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
@@ -685,17 +685,15 @@ WebPluginContainerImpl::WebPluginContainerImpl(HTMLPlugInElement* element, WebPl |
, m_touchEventRequestType(TouchEventRequestTypeNone) |
, m_wantsWheelEvents(false) |
, m_inDispose(false) |
+{ |
#if ENABLE(OILPAN) |
- , m_shouldDisposePlugin(false) |
+ ThreadState::current()->registerPreFinalizer(this); |
#endif |
-{ |
} |
WebPluginContainerImpl::~WebPluginContainerImpl() |
{ |
#if ENABLE(OILPAN) |
- if (m_shouldDisposePlugin) |
- dispose(); |
// The plugin container must have been disposed of by now. |
ASSERT(!m_webPlugin); |
#else |
@@ -724,21 +722,6 @@ void WebPluginContainerImpl::dispose() |
m_element = nullptr; |
} |
-#if ENABLE(OILPAN) |
-void WebPluginContainerImpl::shouldDisposePlugin() |
-{ |
- // If the LocalFrame is still alive, but the plugin element isn't, the |
- // LocalFrame will set m_shouldDisposePlugin via its weak pointer |
- // callback. This is a signal that the plugin container |
- // must dispose of its plugin when finalizing. The LocalFrame and |
- // all objects accessible from it can safely be accessed, but not |
- // the plugin element itself. |
- ASSERT(!m_shouldDisposePlugin); |
- m_shouldDisposePlugin = true; |
- m_element = nullptr; |
-} |
-#endif |
- |
DEFINE_TRACE(WebPluginContainerImpl) |
{ |
visitor->trace(m_element); |