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

Unified Diff: Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp

Issue 1215973002: Oilpan: improve ScrollableArea handling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review-induced improvements Created 5 years, 6 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/paint/DeprecatedPaintLayerScrollableArea.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp b/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp
index bb3d55ce33746ecf121ab814f27c981cc85ba63f..efd7abba32930d53bc37bbb1fbd6ad93efa8aa23 100644
--- a/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp
+++ b/Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp
@@ -90,6 +90,9 @@ DeprecatedPaintLayerScrollableArea::DeprecatedPaintLayerScrollableArea(Deprecate
, m_needsCompositedScrolling(false)
, m_scrollCorner(nullptr)
, m_resizer(nullptr)
+#if ENABLE(ASSERT)
+ , m_hasBeenDisposed(false)
+#endif
{
Node* node = box().node();
if (node && node->isElementNode()) {
@@ -106,6 +109,11 @@ DeprecatedPaintLayerScrollableArea::DeprecatedPaintLayerScrollableArea(Deprecate
DeprecatedPaintLayerScrollableArea::~DeprecatedPaintLayerScrollableArea()
{
+ ASSERT(m_hasBeenDisposed);
+}
+
+void DeprecatedPaintLayerScrollableArea::dispose()
+{
if (inResizeMode() && !box().documentBeingDestroyed()) {
if (LocalFrame* frame = box().frame())
frame->eventHandler().resizeScrollableAreaDestroyed();
@@ -142,6 +150,19 @@ DeprecatedPaintLayerScrollableArea::~DeprecatedPaintLayerScrollableArea()
m_scrollCorner->destroy();
if (m_resizer)
m_resizer->destroy();
+
+ clearScrollAnimators();
+
+#if ENABLE(ASSERT)
+ m_hasBeenDisposed = true;
+#endif
+}
+
+DEFINE_TRACE(DeprecatedPaintLayerScrollableArea)
+{
+ visitor->trace(m_hBar);
+ visitor->trace(m_vBar);
+ ScrollableArea::trace(visitor);
}
HostWindow* DeprecatedPaintLayerScrollableArea::hostWindow() const
@@ -935,7 +956,7 @@ PassRefPtrWillBeRawPtr<Scrollbar> DeprecatedPaintLayerScrollableArea::createScro
void DeprecatedPaintLayerScrollableArea::destroyScrollbar(ScrollbarOrientation orientation)
{
- RefPtrWillBePersistent<Scrollbar>& scrollbar = orientation == HorizontalScrollbar ? m_hBar : m_vBar;
+ RefPtrWillBeMember<Scrollbar>& scrollbar = orientation == HorizontalScrollbar ? m_hBar : m_vBar;
if (!scrollbar)
return;
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayerScrollableArea.h ('k') | Source/platform/graphics/GraphicsLayerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698