Unresponsive Web processes sometimes throw ObjC exceptions under didPerformActionMenu...
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Jan 2015 08:20:02 +0000 (08:20 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Jan 2015 08:20:02 +0000 (08:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=140859
<rdar://problem/19571057>

Reviewed by Darin Adler.

* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController didPerformActionMenuHitTest:userData:]):
If we've already given up on this gesture (either because it was canceled or the
willBeginAnimation timeout expired), we shouldn't build a new animationController for it.
This is true both because it wouldn't look good to swap animationControllers out
from under the gesture, but also because AppKit throws an exception when you do this
and that breaks a lot of things.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@179087 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm

index f2162ee2f499a8f7edb08af0ffd0f8c5a431a127..b8b2e82c4981086d16a24151b4c392ff0df39817 100644 (file)
@@ -1,3 +1,19 @@
+2015-01-25  Timothy Horton  <timothy_horton@apple.com>
+
+        Unresponsive Web processes sometimes throw ObjC exceptions under didPerformActionMenuHitTest:
+        https://bugs.webkit.org/show_bug.cgi?id=140859
+        <rdar://problem/19571057>
+
+        Reviewed by Darin Adler.
+
+        * UIProcess/mac/WKImmediateActionController.mm:
+        (-[WKImmediateActionController didPerformActionMenuHitTest:userData:]):
+        If we've already given up on this gesture (either because it was canceled or the
+        willBeginAnimation timeout expired), we shouldn't build a new animationController for it.
+        This is true both because it wouldn't look good to swap animationControllers out
+        from under the gesture, but also because AppKit throws an exception when you do this
+        and that breaks a lot of things.
+
 2015-01-24  Chris Dumez  <cdumez@apple.com>
 
         [WK2][Cocoa] Drop WKDiagnosticLoggingResultType defines
index 4195ee71b8da621dcba104c44e692fbb041af66a..ee3ff0e6cc55f318436a720c2288b79c3a084605 100644 (file)
@@ -131,6 +131,11 @@ using namespace WebKit;
 
 - (void)didPerformActionMenuHitTest:(const ActionMenuHitTestResult&)hitTestResult userData:(API::Object*)userData
 {
+    // If we've already given up on this gesture (either because it was canceled or the
+    // willBeginAnimation timeout expired), we shouldn't build a new animationController for it.
+    if (_state != ImmediateActionState::Pending)
+        return;
+
     // FIXME: This needs to use the WebKit2 callback mechanism to avoid out-of-order replies.
     _state = ImmediateActionState::Ready;
     _hitTestResult = hitTestResult;