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

Side by Side Diff: third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm

Issue 1714663002: Attempt to fix the crash in blink Scroll Animator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review feedback Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 ScrollAnimatorMac::ScrollAnimatorMac(ScrollableArea* scrollableArea) 685 ScrollAnimatorMac::ScrollAnimatorMac(ScrollableArea* scrollableArea)
686 : ScrollAnimatorBase(scrollableArea) 686 : ScrollAnimatorBase(scrollableArea)
687 , m_initialScrollbarPaintTimer(this, &ScrollAnimatorMac::initialScrollbarPai ntTimerFired) 687 , m_initialScrollbarPaintTimer(this, &ScrollAnimatorMac::initialScrollbarPai ntTimerFired)
688 , m_sendContentAreaScrolledTimer(this, &ScrollAnimatorMac::sendContentAreaSc rolledTimerFired) 688 , m_sendContentAreaScrolledTimer(this, &ScrollAnimatorMac::sendContentAreaSc rolledTimerFired)
689 , m_haveScrolledSincePageLoad(false) 689 , m_haveScrolledSincePageLoad(false)
690 , m_needsScrollerStyleUpdate(false) 690 , m_needsScrollerStyleUpdate(false)
691 { 691 {
692 #if ENABLE(OILPAN) 692 #if ENABLE(OILPAN)
693 ThreadState::current()->registerPreFinalizer(this); 693 ThreadState::current()->registerPreFinalizer(this);
694 #endif 694 #endif
695
696 m_scrollAnimationHelperDelegate.adoptNS([[BlinkScrollAnimationHelperDelegate alloc] initWithScrollAnimator:this]); 695 m_scrollAnimationHelperDelegate.adoptNS([[BlinkScrollAnimationHelperDelegate alloc] initWithScrollAnimator:this]);
697 m_scrollAnimationHelper.adoptNS([[NSClassFromString(@"NSScrollAnimationHelpe r") alloc] initWithDelegate:m_scrollAnimationHelperDelegate.get()]); 696 m_scrollAnimationHelper.adoptNS([[NSClassFromString(@"NSScrollAnimationHelpe r") alloc] initWithDelegate:m_scrollAnimationHelperDelegate.get()]);
698 697
699 if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) { 698 if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) {
700 m_scrollbarPainterControllerDelegate.adoptNS([[BlinkScrollbarPainterCont rollerDelegate alloc] initWithScrollableArea:scrollableArea]); 699 m_scrollbarPainterControllerDelegate.adoptNS([[BlinkScrollbarPainterCont rollerDelegate alloc] initWithScrollableArea:scrollableArea]);
701 m_scrollbarPainterController = [[[NSClassFromString(@"NSScrollerImpPair" ) alloc] init] autorelease]; 700 m_scrollbarPainterController = [[[NSClassFromString(@"NSScrollerImpPair" ) alloc] init] autorelease];
702 [m_scrollbarPainterController.get() performSelector:@selector(setDelegat e:) withObject:m_scrollbarPainterControllerDelegate.get()]; 701 [m_scrollbarPainterController.get() performSelector:@selector(setDelegat e:) withObject:m_scrollbarPainterControllerDelegate.get()];
703 [m_scrollbarPainterController.get() setScrollerStyle:ScrollbarThemeMacCo mmon::recommendedScrollerStyle()]; 702 [m_scrollbarPainterController.get() setScrollerStyle:ScrollbarThemeMacCo mmon::recommendedScrollerStyle()];
704 } 703 }
705 } 704 }
(...skipping 13 matching lines...) Expand all
719 [m_scrollbarPainterController.get() setDelegate:nil]; 718 [m_scrollbarPainterController.get() setDelegate:nil];
720 [m_horizontalScrollbarPainterDelegate.get() invalidate]; 719 [m_horizontalScrollbarPainterDelegate.get() invalidate];
721 [m_verticalScrollbarPainterDelegate.get() invalidate]; 720 [m_verticalScrollbarPainterDelegate.get() invalidate];
722 [m_scrollAnimationHelperDelegate.get() invalidate]; 721 [m_scrollAnimationHelperDelegate.get() invalidate];
723 END_BLOCK_OBJC_EXCEPTIONS; 722 END_BLOCK_OBJC_EXCEPTIONS;
724 } 723 }
725 m_initialScrollbarPaintTimer.stop(); 724 m_initialScrollbarPaintTimer.stop();
726 m_sendContentAreaScrolledTimer.stop(); 725 m_sendContentAreaScrolledTimer.stop();
727 } 726 }
728 727
728 void ScrollAnimatorMac::clearScrollAnimator()
729 {
730 dispose();
731 ScrollAnimatorBase::dispose();
732 }
733
729 ScrollResultOneDimensional ScrollAnimatorMac::userScroll(ScrollbarOrientation or ientation, ScrollGranularity granularity, float step, float delta) 734 ScrollResultOneDimensional ScrollAnimatorMac::userScroll(ScrollbarOrientation or ientation, ScrollGranularity granularity, float step, float delta)
730 { 735 {
731 m_haveScrolledSincePageLoad = true; 736 m_haveScrolledSincePageLoad = true;
732 737
733 if (!m_scrollableArea->scrollAnimatorEnabled()) 738 if (!m_scrollableArea->scrollAnimatorEnabled())
734 return ScrollAnimatorBase::userScroll(orientation, granularity, step, de lta); 739 return ScrollAnimatorBase::userScroll(orientation, granularity, step, de lta);
735 740
736 if (granularity == ScrollByPixel || granularity == ScrollByPrecisePixel) 741 if (granularity == ScrollByPixel || granularity == ScrollByPrecisePixel)
737 return ScrollAnimatorBase::userScroll(orientation, granularity, step, de lta); 742 return ScrollAnimatorBase::userScroll(orientation, granularity, step, de lta);
738 743
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1178 return; 1183 return;
1179 1184
1180 m_visibleScrollerThumbRect = rectInViewCoordinates; 1185 m_visibleScrollerThumbRect = rectInViewCoordinates;
1181 } 1186 }
1182 1187
1183 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() { 1188 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() {
1184 return ScrollbarThemeMacCommon::isOverlayAPIAvailable(); 1189 return ScrollbarThemeMacCommon::isOverlayAPIAvailable();
1185 } 1190 }
1186 1191
1187 } // namespace blink 1192 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698