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

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: added WILL_BE_USING_PRE_FINALIZER 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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 return adoptPtrWillBeNoop(new ScrollAnimatorMac(scrollableArea)); 682 return adoptPtrWillBeNoop(new ScrollAnimatorMac(scrollableArea));
683 } 683 }
684 684
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)
693 ThreadState::current()->registerPreFinalizer(this);
694 #endif
695
696 m_scrollAnimationHelperDelegate.adoptNS([[BlinkScrollAnimationHelperDelegate alloc] initWithScrollAnimator:this]); 692 m_scrollAnimationHelperDelegate.adoptNS([[BlinkScrollAnimationHelperDelegate alloc] initWithScrollAnimator:this]);
697 m_scrollAnimationHelper.adoptNS([[NSClassFromString(@"NSScrollAnimationHelpe r") alloc] initWithDelegate:m_scrollAnimationHelperDelegate.get()]); 693 m_scrollAnimationHelper.adoptNS([[NSClassFromString(@"NSScrollAnimationHelpe r") alloc] initWithDelegate:m_scrollAnimationHelperDelegate.get()]);
698 694
699 if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) { 695 if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) {
700 m_scrollbarPainterControllerDelegate.adoptNS([[BlinkScrollbarPainterCont rollerDelegate alloc] initWithScrollableArea:scrollableArea]); 696 m_scrollbarPainterControllerDelegate.adoptNS([[BlinkScrollbarPainterCont rollerDelegate alloc] initWithScrollableArea:scrollableArea]);
701 m_scrollbarPainterController = [[[NSClassFromString(@"NSScrollerImpPair" ) alloc] init] autorelease]; 697 m_scrollbarPainterController = [[[NSClassFromString(@"NSScrollerImpPair" ) alloc] init] autorelease];
702 [m_scrollbarPainterController.get() performSelector:@selector(setDelegat e:) withObject:m_scrollbarPainterControllerDelegate.get()]; 698 [m_scrollbarPainterController.get() performSelector:@selector(setDelegat e:) withObject:m_scrollbarPainterControllerDelegate.get()];
703 [m_scrollbarPainterController.get() setScrollerStyle:ScrollbarThemeMacCo mmon::recommendedScrollerStyle()]; 699 [m_scrollbarPainterController.get() setScrollerStyle:ScrollbarThemeMacCo mmon::recommendedScrollerStyle()];
704 } 700 }
705 } 701 }
(...skipping 11 matching lines...) Expand all
717 BEGIN_BLOCK_OBJC_EXCEPTIONS; 713 BEGIN_BLOCK_OBJC_EXCEPTIONS;
718 [m_scrollbarPainterControllerDelegate.get() invalidate]; 714 [m_scrollbarPainterControllerDelegate.get() invalidate];
719 [m_scrollbarPainterController.get() setDelegate:nil]; 715 [m_scrollbarPainterController.get() setDelegate:nil];
720 [m_horizontalScrollbarPainterDelegate.get() invalidate]; 716 [m_horizontalScrollbarPainterDelegate.get() invalidate];
721 [m_verticalScrollbarPainterDelegate.get() invalidate]; 717 [m_verticalScrollbarPainterDelegate.get() invalidate];
722 [m_scrollAnimationHelperDelegate.get() invalidate]; 718 [m_scrollAnimationHelperDelegate.get() invalidate];
723 END_BLOCK_OBJC_EXCEPTIONS; 719 END_BLOCK_OBJC_EXCEPTIONS;
724 } 720 }
725 m_initialScrollbarPaintTimer.stop(); 721 m_initialScrollbarPaintTimer.stop();
726 m_sendContentAreaScrolledTimer.stop(); 722 m_sendContentAreaScrolledTimer.stop();
723 ScrollAnimatorCompositorCoordinator::dispose();
727 } 724 }
728 725
729 ScrollResultOneDimensional ScrollAnimatorMac::userScroll(ScrollbarOrientation or ientation, ScrollGranularity granularity, float step, float delta) 726 ScrollResultOneDimensional ScrollAnimatorMac::userScroll(ScrollbarOrientation or ientation, ScrollGranularity granularity, float step, float delta)
730 { 727 {
731 m_haveScrolledSincePageLoad = true; 728 m_haveScrolledSincePageLoad = true;
732 729
733 if (!m_scrollableArea->scrollAnimatorEnabled()) 730 if (!m_scrollableArea->scrollAnimatorEnabled())
734 return ScrollAnimatorBase::userScroll(orientation, granularity, step, de lta); 731 return ScrollAnimatorBase::userScroll(orientation, granularity, step, de lta);
735 732
736 if (granularity == ScrollByPixel || granularity == ScrollByPrecisePixel) 733 if (granularity == ScrollByPixel || granularity == ScrollByPrecisePixel)
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
1178 return; 1175 return;
1179 1176
1180 m_visibleScrollerThumbRect = rectInViewCoordinates; 1177 m_visibleScrollerThumbRect = rectInViewCoordinates;
1181 } 1178 }
1182 1179
1183 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() { 1180 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() {
1184 return ScrollbarThemeMacCommon::isOverlayAPIAvailable(); 1181 return ScrollbarThemeMacCommon::isOverlayAPIAvailable();
1185 } 1182 }
1186 1183
1187 } // namespace blink 1184 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698