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

Unified Diff: third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm

Issue 1477113003: [Oilpan] Move ScrollAnimators onto oilpan heap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do not touch on-heap objects in destructors Created 5 years 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: third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm
diff --git a/third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm b/third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm
index 02e5cd16ca8d0bc0450683472f6791cd634a0701..996ce8b8aea21385b80858e46145327f77fdbdc3 100644
--- a/third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm
+++ b/third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm
@@ -40,7 +40,6 @@
#include "platform/scroll/ScrollbarThemeMacCommon.h"
#include "platform/scroll/ScrollbarThemeMacOverlayAPI.h"
#include "wtf/MainThread.h"
-#include "wtf/PassOwnPtr.h"
using namespace blink;
@@ -679,9 +678,9 @@ private:
namespace blink {
-PassOwnPtr<ScrollAnimatorBase> ScrollAnimatorBase::create(ScrollableArea* scrollableArea)
+ScrollAnimatorBase* ScrollAnimatorBase::create(ScrollableArea* scrollableArea)
{
- return adoptPtr(new ScrollAnimatorMac(scrollableArea));
+ return new ScrollAnimatorMac(scrollableArea);
}
ScrollAnimatorMac::ScrollAnimatorMac(ScrollableArea* scrollableArea)
@@ -691,6 +690,8 @@ ScrollAnimatorMac::ScrollAnimatorMac(ScrollableArea* scrollableArea)
, m_haveScrolledSincePageLoad(false)
, m_needsScrollerStyleUpdate(false)
{
+ ThreadState::current()->registerPreFinalizer(this);
+
m_scrollAnimationHelperDelegate.adoptNS([[WebScrollAnimationHelperDelegate alloc] initWithScrollAnimator:this]);
m_scrollAnimationHelper.adoptNS([[NSClassFromString(@"NSScrollAnimationHelper") alloc] initWithDelegate:m_scrollAnimationHelperDelegate.get()]);
@@ -704,6 +705,11 @@ ScrollAnimatorMac::ScrollAnimatorMac(ScrollableArea* scrollableArea)
ScrollAnimatorMac::~ScrollAnimatorMac()
{
+ cleanup();
haraken 2015/12/03 03:47:11 Remove this. cleanup() is already called in the pr
peria 2015/12/03 05:02:14 Done.
+}
+
+void ScrollAnimatorMac::cleanup()
+{
if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) {
BEGIN_BLOCK_OBJC_EXCEPTIONS;
[m_scrollbarPainterControllerDelegate.get() invalidate];
@@ -713,6 +719,8 @@ ScrollAnimatorMac::~ScrollAnimatorMac()
[m_scrollAnimationHelperDelegate.get() invalidate];
END_BLOCK_OBJC_EXCEPTIONS;
}
+ m_initialScrollbarPaintTimer.stop();
+ m_sendContentAreaScrolledTimer.stop();
}
ScrollResultOneDimensional ScrollAnimatorMac::userScroll(ScrollbarOrientation orientation, ScrollGranularity granularity, float step, float delta)

Powered by Google App Engine
This is Rietveld 408576698