Changeset 77970 in webkit
- Timestamp:
- Feb 8, 2011 2:11:34 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r77963 r77970 1 2011-02-08 Beth Dakin <bdakin@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Fix for <rdar://problem/8953365> CrashTracer: 14 6 crashes in WebProcess at com.apple.WebCore: 7 -[ScrollKnobAnimation setCurrentProgress:] + 258 8 9 This crash seems to happen when the animation is running 10 and a window is closed. If the ScrollAnimator is destroyed, 11 delegate calls for the animation can still run, so we have 12 to make sure we inform the delegates when the ScrollAnimator 13 is gone, and then we have to null-check it before we do 14 anything with it. 15 16 Remove scrollbarPainterDelegate() since it's not used anymore. 17 * platform/mac/ScrollAnimatorMac.h: 18 * platform/mac/ScrollAnimatorMac.mm: 19 20 Add null-checks for _animator 21 (-[ScrollbarPartAnimation setCurrentProgress:]): 22 (-[ScrollbarPartAnimation scrollAnimatorDestroyed]): 23 (-[ScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]): 24 (-[ScrollbarPainterDelegate scrollerImp:animateTrackAlphaTo:duration:]): 25 (-[ScrollbarPainterDelegate scrollerImp:overlayScrollerStateChangedTo:]): 26 27 New function to inform the delegates that the ScrollAnimator 28 is being destroyed. 29 (-[ScrollbarPainterDelegate scrollAnimatorDestroyed]): 30 (WebCore::ScrollAnimatorMac::~ScrollAnimatorMac): 31 1 32 2011-02-08 Adam Barth <abarth@webkit.org> 2 33 -
trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h
r77876 r77970 71 71 void immediateScrollByDeltaX(float deltaX); 72 72 void immediateScrollByDeltaY(float deltaY); 73 74 id scrollbarPainterDelegate();75 73 76 74 private: -
trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
r77910 r77970 279 279 [super setCurrentProgress:progress]; 280 280 281 if (!_animator) 282 return; 283 281 284 CGFloat currentAlpha; 282 285 if (_initialAlpha > _newAlpha) … … 297 300 } 298 301 302 - (void)scrollAnimatorDestroyed 303 { 304 _animator = 0; 305 } 306 299 307 @end 300 308 … … 319 327 - (void)scrollerImp:(id)scrollerImp animateTrackAlphaTo:(CGFloat)newTrackAlpha duration:(NSTimeInterval)duration; 320 328 - (void)scrollerImp:(id)scrollerImp overlayScrollerStateChangedTo:(NSUInteger)newOverlayScrollerState; 329 330 - (void)scrollAnimatorDestroyed; 321 331 322 332 @end … … 368 378 - (void)scrollerImp:(id)scrollerImp animateKnobAlphaTo:(CGFloat)newKnobAlpha duration:(NSTimeInterval)duration 369 379 { 380 if (!_animator) 381 return; 382 370 383 WKScrollbarPainterRef scrollerPainter = (WKScrollbarPainterRef)scrollerImp; 371 384 if (newKnobAlpha == wkScrollbarPainterKnobAlpha(scrollerPainter)) … … 380 393 - (void)scrollerImp:(id)scrollerImp animateTrackAlphaTo:(CGFloat)newTrackAlpha duration:(NSTimeInterval)duration 381 394 { 395 if (!_animator) 396 return; 397 382 398 WKScrollbarPainterRef scrollerPainter = (WKScrollbarPainterRef)scrollerImp; 383 399 if (newTrackAlpha == wkScrollbarPainterTrackAlpha(scrollerPainter)) … … 392 408 - (void)scrollerImp:(id)scrollerImp overlayScrollerStateChangedTo:(NSUInteger)newOverlayScrollerState 393 409 { 410 if (!_animator) 411 return; 412 394 413 WKScrollbarPainterRef scrollbarPainter = (WKScrollbarPainterRef)scrollerImp; 395 414 wkScrollbarPainterSetOverlayState(scrollbarPainter, newOverlayScrollerState); … … 403 422 404 423 } 424 } 425 426 - (void)scrollAnimatorDestroyed 427 { 428 _animator = 0; 429 [_verticalKnobAnimation.get() scrollAnimatorDestroyed]; 430 [_horizontalKnobAnimation.get() scrollAnimatorDestroyed]; 431 [_verticalTrackAnimation.get() scrollAnimatorDestroyed]; 432 [_horizontalTrackAnimation.get() scrollAnimatorDestroyed]; 405 433 } 406 434 … … 440 468 #if defined(USE_WK_SCROLLBAR_PAINTER_AND_CONTROLLER) 441 469 [(id)m_scrollbarPainterController.get() setDelegate:nil]; 442 #endif 443 } 444 445 id ScrollAnimatorMac::scrollbarPainterDelegate() 446 { 447 #if defined(USE_WK_SCROLLBAR_PAINTER_AND_CONTROLLER) 448 return m_scrollbarPainterDelegate.get(); 449 #else 450 return nil; 470 [(id)m_scrollbarPainterDelegate.get() scrollAnimatorDestroyed]; 451 471 #endif 452 472 }
Note: See TracChangeset
for help on using the changeset viewer.