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

Unified Diff: Source/core/frame/FrameView.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/frame/FrameView.h
diff --git a/Source/core/frame/FrameView.h b/Source/core/frame/FrameView.h
index 509b9dc0e099a29c5786010dcf2c1df239ece37d..d6e83a569541829d316821d89eed340a5d6f518c 100644
--- a/Source/core/frame/FrameView.h
+++ b/Source/core/frame/FrameView.h
@@ -63,8 +63,8 @@ public:
friend class RenderView;
friend class Internals;
- static PassRefPtr<FrameView> create(LocalFrame*);
- static PassRefPtr<FrameView> create(LocalFrame*, const IntSize& initialSize);
+ static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*);
+ static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*, const IntSize& initialSize);
virtual ~FrameView();
@@ -85,7 +85,7 @@ public:
virtual void setCanHaveScrollbars(bool) OVERRIDE;
- virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation) OVERRIDE;
+ virtual PassRefPtrWillBeRawPtr<Scrollbar> createScrollbar(ScrollbarOrientation) OVERRIDE;
virtual void setContentsSize(const IntSize&) OVERRIDE;
IntPoint clampOffsetAtScale(const IntPoint& offset, float scale) const;
@@ -225,7 +225,7 @@ public:
void incrementVisuallyNonEmptyPixelCount(const IntSize&);
void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; }
void enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSize);
- void disableAutoSizeMode() { m_autoSizeInfo.clear(); }
+ void disableAutoSizeMode() { disposeAutoSizeInfo(); }
void forceLayout(bool allowSubtree = false);
void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkFactor);
@@ -332,6 +332,9 @@ public:
virtual GraphicsLayer* layerForVerticalScrollbar() const OVERRIDE;
virtual GraphicsLayer* layerForScrollCorner() const OVERRIDE;
+ virtual void trace(Visitor*) OVERRIDE;
+ void dispose();
+
protected:
virtual bool scrollContentsFastPath(const IntSize& scrollDelta) OVERRIDE;
virtual void scrollContentsSlowPath(const IntRect& updateRect) OVERRIDE;
@@ -368,6 +371,8 @@ private:
void invalidateTreeIfNeeded();
+ void setLayoutSizeFixedToFrameSizeAndInvalidate(bool);
+
void gatherDebugLayoutRects(RenderObject* layoutRoot);
DocumentLifecycle& lifecycle() const;
@@ -417,6 +422,8 @@ private:
void setLayoutSizeInternal(const IntSize&);
+ void disposeAutoSizeInfo();
+
bool paintInvalidationIsAllowed() const
{
return !isInPerformLayout() || canInvalidatePaintDuringPerformLayout();
@@ -428,18 +435,16 @@ private:
LayoutSize m_size;
typedef WillBeHeapHashSet<RefPtrWillBeMember<RenderEmbeddedObject> > EmbeddedObjectSet;
- WillBePersistentHeapHashSet<RefPtrWillBeMember<RenderEmbeddedObject> > m_widgetUpdateSet;
+ WillBeHeapHashSet<RefPtrWillBeMember<RenderEmbeddedObject> > m_widgetUpdateSet;
// FIXME: These are just "children" of the FrameView and should be RefPtr<Widget> instead.
- WillBePersistentHeapHashSet<RefPtrWillBeMember<RenderWidget> > m_widgets;
+ WillBeHeapHashSet<RefPtrWillBeMember<RenderWidget> > m_widgets;
- // Oilpan: the use of a persistent back reference 'emulates' the
- // RefPtr-cycle that is kept between the two objects non-Oilpan.
- //
- // That cycle is broken when a LocalFrame is detached by
- // FrameLoader::detachFromParent(), it then clears its
- // FrameView's m_frame reference by calling setView(nullptr).
- RefPtrWillBePersistent<LocalFrame> m_frame;
+ // The RefPtr cycle between LocalFrame and FrameView is broken
+ // when a LocalFrame is detached by FrameLoader::detachFromParent(),
+ // it then clears its FrameView's m_frame reference by calling
+ // setView(nullptr).
+ RefPtrWillBeMember<LocalFrame> m_frame;
bool m_doFullPaintInvalidation;
@@ -482,7 +487,7 @@ private:
bool m_isTrackingPaintInvalidations; // Used for testing.
Vector<IntRect> m_trackedPaintInvalidationRects;
- RefPtrWillBePersistent<Node> m_nodeToDraw;
+ RefPtrWillBeMember<Node> m_nodeToDraw;
PaintBehavior m_paintBehavior;
bool m_isPainting;
@@ -491,15 +496,15 @@ private:
bool m_isVisuallyNonEmpty;
bool m_firstVisuallyNonEmptyLayoutCallbackPending;
- RefPtrWillBePersistent<Node> m_maintainScrollPositionAnchor;
+ RefPtrWillBeMember<Node> m_maintainScrollPositionAnchor;
// Renderer to hold our custom scroll corner.
- RawPtrWillBePersistent<RenderScrollbarPart> m_scrollCorner;
+ RawPtrWillBeMember<RenderScrollbarPart> m_scrollCorner;
OwnPtr<ScrollableAreaSet> m_scrollableAreas;
OwnPtr<ResizerAreaSet> m_resizerAreas;
OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects;
- OwnPtr<FrameViewAutoSizeInfo> m_autoSizeInfo;
+ OwnPtrWillBeMember<FrameViewAutoSizeInfo> m_autoSizeInfo;
float m_visibleContentScaleFactor;
IntSize m_inputEventsOffsetForEmulation;
@@ -542,6 +547,7 @@ inline void FrameView::incrementVisuallyNonEmptyPixelCount(const IntSize& size)
DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFrameView());
class AllowPaintInvalidationScope {
+ STACK_ALLOCATED();
public:
explicit AllowPaintInvalidationScope(FrameView* view)
: m_view(view)
@@ -560,8 +566,9 @@ public:
m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue);
}
+
private:
- FrameView* m_view;
+ RawPtrWillBeMember<FrameView> m_view;
bool m_originalValue;
};

Powered by Google App Engine
This is Rietveld 408576698