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

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

Issue 1215973002: Oilpan: improve ScrollableArea handling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: clear out animators on DeprecatedPaintLayerScrollableArea dispose 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();
haraken 2015/06/30 10:30:35 Do we need to call clearScrollAnimators() in dispo
sof 2015/06/30 11:34:09 This is what https://code.google.com/p/chromium/is
haraken 2015/06/30 14:14:24 My question is whether we need to call clearScroll
sof 2015/06/30 14:28:03 It is a problem to delay its clearing until it is
haraken 2015/06/30 14:30:24 Makes sense. Why doesn't it become a problem for S
sof 2015/06/30 14:35:48 It takes care of its owned objects via eager final
haraken 2015/06/30 14:37:21 ah, understood; thanks!
+
+#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;

Powered by Google App Engine
This is Rietveld 408576698