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

Unified Diff: Source/core/html/HTMLPlugInElement.h

Issue 603193005: Move the Widget hierarchy to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add ~Scrollbar assert Created 6 years, 3 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
Index: Source/core/html/HTMLPlugInElement.h
diff --git a/Source/core/html/HTMLPlugInElement.h b/Source/core/html/HTMLPlugInElement.h
index 1d2e302f4badcf807dea5f1ac3c5765a816b314c..3d7148bdd8c8378188c7e28c94531c924206d555 100644
--- a/Source/core/html/HTMLPlugInElement.h
+++ b/Source/core/html/HTMLPlugInElement.h
@@ -45,6 +45,9 @@ class HTMLPlugInElement : public HTMLFrameOwnerElement {
public:
virtual ~HTMLPlugInElement();
virtual void trace(Visitor*) OVERRIDE;
+#if ENABLE(OILPAN)
+ virtual void disconnectContentFrame() OVERRIDE;
+#endif
void resetInstance();
SharedPersistent<v8::Object>* pluginWrapper();
@@ -143,7 +146,20 @@ private:
// prevent confusing code which may assume that widget() != null
// means the frame is active, we save off m_widget here while
// the plugin is persisting but not being displayed.
- RefPtr<Widget> m_persistedPluginWidget;
+ // ---
+ // Oilpan: a Persistent<> is used for finalization purposes.
+ // A renderer-less plugin element is not detached prior to
+ // finalization, so the required disposing of plugin container
+ // widgets that happen then won't. Instead, a Persistent is
+ // used to extend the lifetime of this persisted widget
+ // beyond the plugin element's, so that it can be disposed
+ // of by the plugin element's finalizer.
+ //
+ // To prevent a leak from that, the plugin container does not
+ // keep a strong reference back to the plugin element.
+ // Not pretty.
+ GC_PLUGIN_IGNORE("")
+ RefPtrWillBePersistent<Widget> m_persistedPluginWidget;
haraken 2014/09/29 14:16:36 This is a bit too tricky... I think we need to see
};
inline bool isHTMLPlugInElement(const HTMLElement& element)

Powered by Google App Engine
This is Rietveld 408576698