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

Unified Diff: Source/platform/scroll/Scrollbar.cpp

Issue 603193005: Move the Widget hierarchy to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase upto and resolve r182737 conflict. 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/Scrollbar.cpp
diff --git a/Source/platform/scroll/Scrollbar.cpp b/Source/platform/scroll/Scrollbar.cpp
index 96b5f79c464d7bc95264e673f493a4a203a6ad2d..c5345546665bee971fe687852191fa39179c5aa0 100644
--- a/Source/platform/scroll/Scrollbar.cpp
+++ b/Source/platform/scroll/Scrollbar.cpp
@@ -43,9 +43,9 @@
namespace blink {
-PassRefPtr<Scrollbar> Scrollbar::create(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize size)
+PassRefPtrWillBeRawPtr<Scrollbar> Scrollbar::create(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize size)
{
- return adoptRef(new Scrollbar(scrollableArea, orientation, size));
+ return adoptRefWillBeNoop(new Scrollbar(scrollableArea, orientation, size));
}
Scrollbar::Scrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize, ScrollbarTheme* theme)
@@ -81,6 +81,11 @@ Scrollbar::Scrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orient
Widget::setFrameRect(IntRect(0, 0, thickness, thickness));
m_currentPos = scrollableAreaCurrentPos();
+
+#if ENABLE(OILPAN)
+ if (m_scrollableArea)
+ m_animator = m_scrollableArea->scrollAnimator();
+#endif
}
Scrollbar::~Scrollbar()
@@ -88,6 +93,16 @@ Scrollbar::~Scrollbar()
stopTimerIfNeeded();
m_theme->unregisterScrollbar(this);
+
+#if ENABLE(OILPAN)
+ if (!m_animator)
+ return;
+
haraken 2014/09/26 09:19:25 Shall we add ASSERT(m_scrollableArea) ?
sof 2014/09/28 21:11:25 Sure, why not.
+ if (m_orientation == VerticalScrollbar)
+ m_animator->willRemoveVerticalScrollbar(this);
+ else
+ m_animator->willRemoveHorizontalScrollbar(this);
+#endif
}
void Scrollbar::removeFromParent()
@@ -144,6 +159,14 @@ void Scrollbar::offsetDidChange()
setPressedPos(m_pressedPos + theme()->thumbPosition(this) - oldThumbPosition);
}
+void Scrollbar::disconnectFromScrollableArea()
+{
+ m_scrollableArea = nullptr;
+#if ENABLE(OILPAN)
+ m_animator = nullptr;
+#endif
+}
+
void Scrollbar::setProportion(int visibleSize, int totalSize)
{
if (visibleSize == m_visibleSize && totalSize == m_totalSize)

Powered by Google App Engine
This is Rietveld 408576698