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

Unified Diff: Source/platform/scroll/ScrollView.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/platform/scroll/ScrollView.h
diff --git a/Source/platform/scroll/ScrollView.h b/Source/platform/scroll/ScrollView.h
index cccd70ea840e5d95f98eaf2d558d533b54ad77c6..d1519c640772355a13d28b5adfae02d1f6388629 100644
--- a/Source/platform/scroll/ScrollView.h
+++ b/Source/platform/scroll/ScrollView.h
@@ -30,6 +30,7 @@
#include "platform/PlatformExport.h"
#include "platform/Widget.h"
#include "platform/geometry/IntRect.h"
+#include "platform/heap/Handle.h"
#include "platform/scroll/ScrollTypes.h"
#include "platform/scroll/ScrollableArea.h"
#include "platform/scroll/Scrollbar.h"
@@ -45,6 +46,8 @@ class PLATFORM_EXPORT ScrollView : public Widget, public ScrollableArea {
public:
virtual ~ScrollView();
+ virtual void trace(Visitor*) OVERRIDE;
+
// ScrollableArea functions.
virtual int scrollSize(ScrollbarOrientation) const OVERRIDE;
virtual void setScrollOffset(const IntPoint&) OVERRIDE;
@@ -62,9 +65,11 @@ public:
// Returns a clip rect in host window coordinates. Used to clip the blit on a scroll.
virtual IntRect windowClipRect(IncludeScrollbarsInRect = ExcludeScrollbars) const = 0;
+ typedef WillBeHeapHashSet<RefPtrWillBeMember<Widget> > ChildrenWidgetSet;
+
// Functions for child manipulation and inspection.
- const HashSet<RefPtr<Widget> >* children() const { return &m_children; }
- virtual void addChild(PassRefPtr<Widget>);
+ const ChildrenWidgetSet* children() const { return &m_children; }
+ virtual void addChild(PassRefPtrWillBeRawPtr<Widget>);
virtual void removeChild(Widget*);
// If the scroll view does not use a native widget, then it will have cross-platform Scrollbars. These functions
@@ -103,7 +108,7 @@ public:
void setClipsRepaints(bool);
// Overridden by FrameView to create custom CSS scrollbars if applicable.
- virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation);
+ virtual PassRefPtrWillBeRawPtr<Scrollbar> createScrollbar(ScrollbarOrientation);
// The visible content rect has a location that is the scrolled offset of the document. The width and height are the viewport width
// and height. By default the scrollbars themselves are excluded from this rectangle, but an optional boolean argument allows them to be
@@ -308,15 +313,15 @@ private:
// some cleanup.
void setScrollOffsetFromUpdateScrollbars(const IntSize&);
- RefPtr<Scrollbar> m_horizontalScrollbar;
- RefPtr<Scrollbar> m_verticalScrollbar;
+ RefPtrWillBeMember<Scrollbar> m_horizontalScrollbar;
+ RefPtrWillBeMember<Scrollbar> m_verticalScrollbar;
ScrollbarMode m_horizontalScrollbarMode;
ScrollbarMode m_verticalScrollbarMode;
bool m_horizontalScrollbarLock;
bool m_verticalScrollbarLock;
- HashSet<RefPtr<Widget> > m_children;
+ ChildrenWidgetSet m_children;
IntSize m_pendingScrollDelta;
IntSize m_scrollOffset; // FIXME: Would rather store this as a position, but we will wait to make this change until more code is shared.

Powered by Google App Engine
This is Rietveld 408576698