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

Unified Diff: Source/core/rendering/RenderScrollbar.h

Issue 603193005: Move the Widget hierarchy to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix popup unit tests Created 6 years, 2 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/rendering/RenderScrollbar.h
diff --git a/Source/core/rendering/RenderScrollbar.h b/Source/core/rendering/RenderScrollbar.h
index fccf926b78394f5b33ad660687756cd46d3d2811..8e15a20a3cef3cd0f208e6a6514899ef179aaede 100644
--- a/Source/core/rendering/RenderScrollbar.h
+++ b/Source/core/rendering/RenderScrollbar.h
@@ -44,7 +44,7 @@ protected:
public:
friend class Scrollbar;
- static PassRefPtr<Scrollbar> createCustomScrollbar(ScrollableArea*, ScrollbarOrientation, Node*, LocalFrame* owningFrame = 0);
+ static PassRefPtrWillBeRawPtr<Scrollbar> createCustomScrollbar(ScrollableArea*, ScrollbarOrientation, Node*, LocalFrame* owningFrame = 0);
virtual ~RenderScrollbar();
RenderBox* owningRenderer() const;
@@ -59,6 +59,8 @@ public:
RenderScrollbarPart* getPart(ScrollbarPart partType) { return m_parts.get(partType); }
+ virtual void trace(Visitor*) OVERRIDE;
+
private:
virtual void setParent(Widget*) OVERRIDE;
virtual void setEnabled(bool) OVERRIDE;
@@ -79,9 +81,18 @@ private:
// so we keep a reference to the Node which caused this custom scrollbar creation.
// This will not create a reference cycle as the Widget tree is owned by our containing
// FrameView which this Node pointer can in no way keep alive. See webkit bug 80610.
- RefPtrWillBePersistent<Node> m_owner;
-
- LocalFrame* m_owningFrame;
+ RefPtrWillBeMember<Node> m_owner;
+
+ RawPtrWillBeMember<LocalFrame> m_owningFrame;
+
+ // FIXME: Oilpan: post-detach creation of RenderScrollbarPart
+ // objects (see ~RenderScrollbar comment) makes it difficult to
+ // ensure that all RenderScrollbarParts have been explicitly
+ // destroyed prior to finalization. To reliably address, a
+ // Persistent reference to the hash map is kept here, so that the
+ // RenderScrollbar finalizer can safely notify the 'parts' of
+ // destruction..before they're swept out the next time around.
+ GC_PLUGIN_IGNORE("")
WillBePersistentHeapHashMap<unsigned, RawPtrWillBeMember<RenderScrollbarPart> > m_parts;
};

Powered by Google App Engine
This is Rietveld 408576698