Changeset 98178 in webkit
- Timestamp:
- Oct 21, 2011 6:15:20 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r98177 r98178 1 2011-10-21 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=70647 4 Common but unreproducible crash under [ScrollbarPartAnimation setCurrentProgress:] 5 -and corresponding- 6 <rdar://problem/9542018> 7 8 Reviewed by Sam Weinig. 9 10 This patch implements two speculative fixes for this crash. 11 12 First, block exceptions around all of the code responsible for calling 13 stopAnimation. If that code throws any exceptions, we want to make sure the other 14 animations are still stopped. 15 * platform/mac/ScrollAnimatorMac.mm: 16 (-[WebScrollbarPartAnimation scrollAnimatorDestroyed]): 17 (-[WebScrollbarPainterDelegate scrollAnimatorDestroyed]): 18 (WebCore::ScrollAnimatorMac::~ScrollAnimatorMac): 19 20 Only send AppKit these notifications for active pages. I originally made these 21 assertions, and I found that they were hit a surprising number of times. If we 22 only send notifications for active pages, then we should greatly reduce and 23 possibly eliminate our chances of hitting this crash. 24 (WebCore::ScrollAnimatorMac::notifyPositionChanged): 25 (WebCore::ScrollAnimatorMac::contentAreaWillPaint): 26 (WebCore::ScrollAnimatorMac::mouseEnteredContentArea): 27 (WebCore::ScrollAnimatorMac::mouseExitedContentArea): 28 (WebCore::ScrollAnimatorMac::mouseMovedInContentArea): 29 (WebCore::ScrollAnimatorMac::willStartLiveResize): 30 (WebCore::ScrollAnimatorMac::contentsResized): 31 (WebCore::ScrollAnimatorMac::willEndLiveResize): 32 (WebCore::ScrollAnimatorMac::contentAreaDidShow): 33 (WebCore::ScrollAnimatorMac::contentAreaDidHide): 34 (WebCore::ScrollAnimatorMac::didBeginScrollGesture): 35 (WebCore::ScrollAnimatorMac::didEndScrollGesture): 36 1 37 2011-10-21 Mark Hahnenberg <mhahnenberg@apple.com> 2 38 -
trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
r97229 r98178 30 30 #include "ScrollAnimatorMac.h" 31 31 32 #include "BlockExceptions.h" 32 33 #include "FloatPoint.h" 33 34 #include "NSScrollerImpDetails.h" … … 298 299 - (void)scrollAnimatorDestroyed 299 300 { 301 BEGIN_BLOCK_OBJC_EXCEPTIONS; 300 302 [self stopAnimation]; 303 END_BLOCK_OBJC_EXCEPTIONS; 301 304 _animator = 0; 302 305 } … … 332 335 - (void)cancelAnimations 333 336 { 337 BEGIN_BLOCK_OBJC_EXCEPTIONS; 334 338 [_verticalKnobAnimation.get() stopAnimation]; 335 339 [_horizontalKnobAnimation.get() stopAnimation]; 336 340 [_verticalTrackAnimation.get() stopAnimation]; 337 341 [_horizontalTrackAnimation.get() stopAnimation]; 342 END_BLOCK_OBJC_EXCEPTIONS; 338 343 } 339 344 … … 436 441 { 437 442 _animator = 0; 443 BEGIN_BLOCK_OBJC_EXCEPTIONS; 438 444 [_verticalKnobAnimation.get() scrollAnimatorDestroyed]; 439 445 [_horizontalKnobAnimation.get() scrollAnimatorDestroyed]; 440 446 [_verticalTrackAnimation.get() scrollAnimatorDestroyed]; 441 447 [_horizontalTrackAnimation.get() scrollAnimatorDestroyed]; 448 END_BLOCK_OBJC_EXCEPTIONS; 442 449 } 443 450 … … 490 497 { 491 498 #if USE(SCROLLBAR_PAINTER) 499 BEGIN_BLOCK_OBJC_EXCEPTIONS; 492 500 [m_scrollbarPainterControllerDelegate.get() scrollAnimatorDestroyed]; 493 501 [m_scrollbarPainterController.get() setDelegate:nil]; 494 502 [m_scrollbarPainterDelegate.get() scrollAnimatorDestroyed]; 495 503 [m_scrollAnimationHelperDelegate.get() scrollAnimatorDestroyed]; 504 END_BLOCK_OBJC_EXCEPTIONS; 496 505 #endif 497 506 } … … 605 614 void ScrollAnimatorMac::notifyPositionChanged() 606 615 { 616 if (!scrollableArea()->isOnActivePage()) 617 return; 607 618 #if USE(SCROLLBAR_PAINTER) 608 619 [m_scrollbarPainterController.get() contentAreaScrolled]; … … 613 624 void ScrollAnimatorMac::contentAreaWillPaint() const 614 625 { 626 if (!scrollableArea()->isOnActivePage()) 627 return; 615 628 #if USE(SCROLLBAR_PAINTER) 616 629 [m_scrollbarPainterController.get() contentAreaWillDraw]; … … 620 633 void ScrollAnimatorMac::mouseEnteredContentArea() const 621 634 { 635 if (!scrollableArea()->isOnActivePage()) 636 return; 622 637 #if USE(SCROLLBAR_PAINTER) 623 638 [m_scrollbarPainterController.get() mouseEnteredContentArea]; … … 627 642 void ScrollAnimatorMac::mouseExitedContentArea() const 628 643 { 644 if (!scrollableArea()->isOnActivePage()) 645 return; 629 646 #if USE(SCROLLBAR_PAINTER) 630 647 [m_scrollbarPainterController.get() mouseExitedContentArea]; … … 634 651 void ScrollAnimatorMac::mouseMovedInContentArea() const 635 652 { 653 if (!scrollableArea()->isOnActivePage()) 654 return; 636 655 #if USE(SCROLLBAR_PAINTER) 637 656 [m_scrollbarPainterController.get() mouseMovedInContentArea]; … … 641 660 void ScrollAnimatorMac::willStartLiveResize() 642 661 { 662 if (!scrollableArea()->isOnActivePage()) 663 return; 643 664 #if USE(SCROLLBAR_PAINTER) 644 665 [m_scrollbarPainterController.get() startLiveResize]; … … 648 669 void ScrollAnimatorMac::contentsResized() const 649 670 { 671 if (!scrollableArea()->isOnActivePage()) 672 return; 650 673 #if USE(SCROLLBAR_PAINTER) 651 674 [m_scrollbarPainterController.get() contentAreaDidResize]; … … 655 678 void ScrollAnimatorMac::willEndLiveResize() 656 679 { 680 if (!scrollableArea()->isOnActivePage()) 681 return; 657 682 #if USE(SCROLLBAR_PAINTER) 658 683 [m_scrollbarPainterController.get() endLiveResize]; … … 662 687 void ScrollAnimatorMac::contentAreaDidShow() const 663 688 { 689 if (!scrollableArea()->isOnActivePage()) 690 return; 664 691 #if USE(SCROLLBAR_PAINTER) 665 692 [m_scrollbarPainterController.get() windowOrderedIn]; … … 669 696 void ScrollAnimatorMac::contentAreaDidHide() const 670 697 { 698 if (!scrollableArea()->isOnActivePage()) 699 return; 671 700 #if USE(SCROLLBAR_PAINTER) 672 701 [m_scrollbarPainterController.get() windowOrderedOut]; … … 676 705 void ScrollAnimatorMac::didBeginScrollGesture() const 677 706 { 707 if (!scrollableArea()->isOnActivePage()) 708 return; 678 709 #if USE(SCROLLBAR_PAINTER) 679 710 [m_scrollbarPainterController.get() beginScrollGesture]; … … 683 714 void ScrollAnimatorMac::didEndScrollGesture() const 684 715 { 716 if (!scrollableArea()->isOnActivePage()) 717 return; 685 718 #if USE(SCROLLBAR_PAINTER) 686 719 [m_scrollbarPainterController.get() endScrollGesture];
Note: See TracChangeset
for help on using the changeset viewer.