Title: [98478] branches/safari-534.52-branch/Source/WebCore
Revision
98478
Author
lforsch...@apple.com
Date
2011-10-26 07:44:44 -0700 (Wed, 26 Oct 2011)

Log Message

Merge 98178.

Modified Paths


Diff

Modified: branches/safari-534.52-branch/Source/WebCore/ChangeLog (98477 => 98478)


--- branches/safari-534.52-branch/Source/WebCore/ChangeLog	2011-10-26 14:44:20 UTC (rev 98477)
+++ branches/safari-534.52-branch/Source/WebCore/ChangeLog	2011-10-26 14:44:44 UTC (rev 98478)
@@ -1,5 +1,45 @@
 2011-10-26  Lucas Forschler  <lforsch...@apple.com>
 
+    Merge 98178
+
+    2011-10-21  Beth Dakin  <bda...@apple.com>
+
+            https://bugs.webkit.org/show_bug.cgi?id=70647
+            Common but unreproducible crash under [ScrollbarPartAnimation setCurrentProgress:]
+            -and corresponding-
+            <rdar://problem/9542018>
+
+            Reviewed by Sam Weinig.
+
+            This patch implements two speculative fixes for this crash.
+
+            First, block exceptions around all of the code responsible for calling 
+            stopAnimation. If that code throws any exceptions, we want to make sure the other 
+            animations are still stopped.
+            * platform/mac/ScrollAnimatorMac.mm:
+            (-[WebScrollbarPartAnimation scrollAnimatorDestroyed]):
+            (-[WebScrollbarPainterDelegate scrollAnimatorDestroyed]):
+            (WebCore::ScrollAnimatorMac::~ScrollAnimatorMac):
+
+            Only send AppKit these notifications for active pages. I originally made these 
+            assertions, and I found that they were hit a surprising number of times. If we 
+            only send notifications for active pages, then we should greatly reduce and 
+            possibly eliminate our chances of hitting this crash.
+            (WebCore::ScrollAnimatorMac::notifyPositionChanged):
+            (WebCore::ScrollAnimatorMac::contentAreaWillPaint):
+            (WebCore::ScrollAnimatorMac::mouseEnteredContentArea):
+            (WebCore::ScrollAnimatorMac::mouseExitedContentArea):
+            (WebCore::ScrollAnimatorMac::mouseMovedInContentArea):
+            (WebCore::ScrollAnimatorMac::willStartLiveResize):
+            (WebCore::ScrollAnimatorMac::contentsResized):
+            (WebCore::ScrollAnimatorMac::willEndLiveResize):
+            (WebCore::ScrollAnimatorMac::contentAreaDidShow):
+            (WebCore::ScrollAnimatorMac::contentAreaDidHide):
+            (WebCore::ScrollAnimatorMac::didBeginScrollGesture):
+            (WebCore::ScrollAnimatorMac::didEndScrollGesture):
+
+2011-10-26  Lucas Forschler  <lforsch...@apple.com>
+
     Merge 98171
 
     2011-10-21  Matthew Delaney  <mdela...@apple.com>

Modified: branches/safari-534.52-branch/Source/WebCore/platform/mac/ScrollAnimatorMac.mm (98477 => 98478)


--- branches/safari-534.52-branch/Source/WebCore/platform/mac/ScrollAnimatorMac.mm	2011-10-26 14:44:20 UTC (rev 98477)
+++ branches/safari-534.52-branch/Source/WebCore/platform/mac/ScrollAnimatorMac.mm	2011-10-26 14:44:44 UTC (rev 98478)
@@ -29,6 +29,7 @@
 
 #include "ScrollAnimatorMac.h"
 
+#include "BlockExceptions.h" 
 #include "FloatPoint.h"
 #include "PlatformGestureEvent.h"
 #include "PlatformWheelEvent.h"
@@ -296,7 +297,9 @@
 
 - (void)scrollAnimatorDestroyed
 {
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
     [self stopAnimation];
+    END_BLOCK_OBJC_EXCEPTIONS;
     _animator = 0;
 }
 
@@ -330,10 +333,12 @@
 
 - (void)cancelAnimations
 {
+    BEGIN_BLOCK_OBJC_EXCEPTIONS; 
     [_verticalKnobAnimation.get() stopAnimation];
     [_horizontalKnobAnimation.get() stopAnimation];
     [_verticalTrackAnimation.get() stopAnimation];
     [_horizontalTrackAnimation.get() stopAnimation];
+    END_BLOCK_OBJC_EXCEPTIONS;
 }
 
 - (NSRect)convertRectToBacking:(NSRect)aRect
@@ -434,10 +439,12 @@
 - (void)scrollAnimatorDestroyed
 {
     _animator = 0;
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
     [_verticalKnobAnimation.get() scrollAnimatorDestroyed];
     [_horizontalKnobAnimation.get() scrollAnimatorDestroyed];
     [_verticalTrackAnimation.get() scrollAnimatorDestroyed];
     [_horizontalTrackAnimation.get() scrollAnimatorDestroyed];
+    END_BLOCK_OBJC_EXCEPTIONS;
 }
 
 @end
@@ -481,10 +488,12 @@
 ScrollAnimatorMac::~ScrollAnimatorMac()
 {
 #if USE(WK_SCROLLBAR_PAINTER)
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
     [m_scrollbarPainterControllerDelegate.get() scrollAnimatorDestroyed];
     [(id)m_scrollbarPainterController.get() setDelegate:nil];
     [m_scrollbarPainterDelegate.get() scrollAnimatorDestroyed];
     [m_scrollAnimationHelperDelegate.get() scrollAnimatorDestroyed];
+    END_BLOCK_OBJC_EXCEPTIONS;
 #endif
 }
 
@@ -596,6 +605,8 @@
 
 void ScrollAnimatorMac::notityPositionChanged()
 {
+    if (!scrollableArea()->isOnActivePage())
+        return;
 #if USE(WK_SCROLLBAR_PAINTER)
     wkContentAreaScrolled(m_scrollbarPainterController.get());
 #endif
@@ -604,6 +615,8 @@
 
 void ScrollAnimatorMac::contentAreaWillPaint() const
 {
+    if (!scrollableArea()->isOnActivePage()) 
+        return;
 #if USE(WK_SCROLLBAR_PAINTER)
     wkContentAreaWillPaint(m_scrollbarPainterController.get());
 #endif
@@ -611,6 +624,8 @@
 
 void ScrollAnimatorMac::mouseEnteredContentArea() const
 {
+    if (!scrollableArea()->isOnActivePage()) 
+        return;
 #if USE(WK_SCROLLBAR_PAINTER)
     wkMouseEnteredContentArea(m_scrollbarPainterController.get());
 #endif
@@ -618,6 +633,8 @@
 
 void ScrollAnimatorMac::mouseExitedContentArea() const
 {
+    if (!scrollableArea()->isOnActivePage()) 
+        return;
 #if USE(WK_SCROLLBAR_PAINTER)
     wkMouseExitedContentArea(m_scrollbarPainterController.get());
 #endif
@@ -625,6 +642,8 @@
 
 void ScrollAnimatorMac::mouseMovedInContentArea() const
 {
+    if (!scrollableArea()->isOnActivePage()) 
+        return;
 #if USE(WK_SCROLLBAR_PAINTER)
     wkMouseMovedInContentArea(m_scrollbarPainterController.get());
 #endif
@@ -632,6 +651,8 @@
 
 void ScrollAnimatorMac::willStartLiveResize()
 {
+    if (!scrollableArea()->isOnActivePage()) 
+         return;
 #if USE(WK_SCROLLBAR_PAINTER)
     wkWillStartLiveResize(m_scrollbarPainterController.get());
 #endif
@@ -639,6 +660,8 @@
 
 void ScrollAnimatorMac::contentsResized() const
 {
+    if (!scrollableArea()->isOnActivePage()) 
+          return;
 #if USE(WK_SCROLLBAR_PAINTER)
     wkContentAreaResized(m_scrollbarPainterController.get());
 #endif
@@ -646,6 +669,8 @@
 
 void ScrollAnimatorMac::willEndLiveResize()
 {
+    if (!scrollableArea()->isOnActivePage()) 
+         return;
 #if USE(WK_SCROLLBAR_PAINTER)
     wkWillEndLiveResize(m_scrollbarPainterController.get());
 #endif
@@ -653,6 +678,8 @@
 
 void ScrollAnimatorMac::contentAreaDidShow() const
 {
+    if (!scrollableArea()->isOnActivePage()) 
+         return;
 #if USE(WK_SCROLLBAR_PAINTER)
     wkContentAreaDidShow(m_scrollbarPainterController.get());
 #endif
@@ -660,6 +687,8 @@
 
 void ScrollAnimatorMac::contentAreaDidHide() const
 {
+    if (!scrollableArea()->isOnActivePage()) 
+         return;
 #if USE(WK_SCROLLBAR_PAINTER)
     wkContentAreaDidHide(m_scrollbarPainterController.get());
 #endif
@@ -667,6 +696,8 @@
 
 void ScrollAnimatorMac::didBeginScrollGesture() const
 {
+    if (!scrollableArea()->isOnActivePage()) 
+        return;
 #if USE(WK_SCROLLBAR_PAINTER)
     wkDidBeginScrollGesture(m_scrollbarPainterController.get());
 #endif
@@ -674,6 +705,8 @@
 
 void ScrollAnimatorMac::didEndScrollGesture() const
 {
+    if (!scrollableArea()->isOnActivePage()) 
+         return;   
 #if USE(WK_SCROLLBAR_PAINTER)
     wkDidEndScrollGesture(m_scrollbarPainterController.get());
 #endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to