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

Unified Diff: Source/web/WebPluginContainerImpl.h

Issue 603193005: Move the Widget hierarchy to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase upto and resolve r182737 conflict. 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/web/WebPluginContainerImpl.h
diff --git a/Source/web/WebPluginContainerImpl.h b/Source/web/WebPluginContainerImpl.h
index 5ff3dcaf5a794f24ed46f98530be968f5bdd365e..c3f7540e311e00a8e00def425c2763813a99e00e 100644
--- a/Source/web/WebPluginContainerImpl.h
+++ b/Source/web/WebPluginContainerImpl.h
@@ -54,6 +54,7 @@ class MouseEvent;
class PlatformGestureEvent;
class ResourceError;
class ResourceResponse;
+class ScriptController;
class ScrollbarGroup;
class TouchEvent;
class WebPlugin;
@@ -63,17 +64,12 @@ class WheelEvent;
class Widget;
struct WebPrintParams;
-class WebPluginContainerImpl FINAL
- : public PluginView
- , public WebPluginContainer
-#if !ENABLE(OILPAN)
- , public FrameDestructionObserver
-#endif
- {
+class WebPluginContainerImpl FINAL : public PluginView, public WebPluginContainer, public FrameDestructionObserver {
+ WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WebPluginContainerImpl);
public:
- static PassRefPtr<WebPluginContainerImpl> create(HTMLPlugInElement* element, WebPlugin* webPlugin)
+ static PassRefPtrWillBeRawPtr<WebPluginContainerImpl> create(HTMLPlugInElement* element, WebPlugin* webPlugin)
{
- return adoptRef(new WebPluginContainerImpl(element, webPlugin));
+ return adoptRefWillBeNoop(new WebPluginContainerImpl(element, webPlugin));
}
// PluginView methods
@@ -173,6 +169,9 @@ public:
virtual void detach() OVERRIDE;
#endif
+ virtual void trace(Visitor*) OVERRIDE;
+ virtual void dispose() OVERRIDE;
+
private:
WebPluginContainerImpl(HTMLPlugInElement*, WebPlugin*);
virtual ~WebPluginContainerImpl();
@@ -198,25 +197,14 @@ private:
const IntRect& frameRect,
Vector<IntRect>& cutOutRects);
-#if ENABLE(OILPAN)
- // FIXME: Oilpan: consider moving Widget to the heap, allowing this
- // container object to be a FrameDestructionObserver. And thereby
- // keep a traced member reference to the frame rather than as a
- // bare pointer. Instead, the owning object (HTMLFrameOwnerElement)
- // explicitly deletes this object when it is disconnected from its
- // frame. Any access to an invalid frame via this bare pointer
- // is therefore not possible.
+ // Oilpan: this is a weak member to support renderer-less
+ // persisted plugins and their finalization. To handle that
+ // correctly, a Persistent reference has to be kept; see
+ // HTMLPlugInElement::m_persistedPluginWidget comment.
//
- // See the HTMLFrameOwnerElement::disconnectContentFrame comment for
- // (even) more.
- LocalFrame* m_frame;
-
- LocalFrame* frame() const { return m_frame; }
-#endif
-
- // FIXME: see above; for the time being, a bare pointer to the owning
- // HTMLPlugInElement and managed as such.
- HTMLPlugInElement* m_element;
+ // To prevent a leak from this on-heap persistent reference
+ // via a direct m_element cycle, it is kept weak.
+ RawPtrWillBeWeakMember<HTMLPlugInElement> m_element;
haraken 2014/09/26 09:19:25 This doesn't need any weak semantics, so I'd prefe
sof 2014/09/28 17:03:52 ok, made it HTMLPlugInElement* again (and adjusted
WebPlugin* m_webPlugin;
Vector<WebPluginLoadObserver*> m_pluginLoadObservers;

Powered by Google App Engine
This is Rietveld 408576698