[iOS] ASSERTION FAILED: ASSERT_NOT_REACHED() in selectionChangedWithTouch(WKContentView*, WebCore::IntPoint const&, unsigned int, unsigned int, WebKit::CallbackBase::Error)
https://bugs.webkit.org/show_bug.cgi?id=206427

Reviewed by Wenson Hsieh.

Remove ASSERT_NOT_REACHED() usage in callbacks selectionChangedWithTouch() and selectionChangedWithGesture().
These callbacks can handle being- and should expect to sometimes be- invoked with a non-None error value.
In particular, if the WebProcess crashes then these callbacks will be invoked with error CallbackBase::Error::ProcessExited.

* UIProcess/ios/WKContentViewInteraction.mm:
(selectionChangedWithGesture): Remove ASSERT_NOT_REACHED() when an error occurs. This
function is capable of handling this error.
(selectionChangedWithTouch): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@254769 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog
index be3893b..3347d3d 100644
--- a/Source/WebKit/ChangeLog
+++ b/Source/WebKit/ChangeLog
@@ -1,3 +1,19 @@
+2020-01-17  Daniel Bates  <dabates@apple.com>
+
+        [iOS] ASSERTION FAILED: ASSERT_NOT_REACHED() in selectionChangedWithTouch(WKContentView*, WebCore::IntPoint const&, unsigned int, unsigned int, WebKit::CallbackBase::Error)
+        https://bugs.webkit.org/show_bug.cgi?id=206427
+
+        Reviewed by Wenson Hsieh.
+
+        Remove ASSERT_NOT_REACHED() usage in callbacks selectionChangedWithTouch() and selectionChangedWithGesture().
+        These callbacks can handle being- and should expect to sometimes be- invoked with a non-None error value.
+        In particular, if the WebProcess crashes then these callbacks will be invoked with error CallbackBase::Error::ProcessExited.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (selectionChangedWithGesture): Remove ASSERT_NOT_REACHED() when an error occurs. This
+        function is capable of handling this error.
+        (selectionChangedWithTouch): Ditto.
+
 2020-01-17  Brent Fulgham  <bfulgham@apple.com>
 
         [iOS] Remove the IOHIDEventServiceFastPathUserClient IOKit class
diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
index 13bfcef..eade734 100644
--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
@@ -3858,19 +3858,15 @@
 
 static void selectionChangedWithGesture(WKContentView *view, const WebCore::IntPoint& point, uint32_t gestureType, uint32_t gestureState, uint32_t flags, WebKit::CallbackBase::Error error)
 {
-    if (error != WebKit::CallbackBase::Error::None) {
-        ASSERT_NOT_REACHED();
+    if (error != WebKit::CallbackBase::Error::None)
         return;
-    }
     [(UIWKTextInteractionAssistant *)[view interactionAssistant] selectionChangedWithGestureAt:(CGPoint)point withGesture:toUIWKGestureType((WebKit::GestureType)gestureType) withState:toUIGestureRecognizerState(static_cast<WebKit::GestureRecognizerState>(gestureState)) withFlags:(toUIWKSelectionFlags((WebKit::SelectionFlags)flags))];
 }
 
 static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoint& point, uint32_t touch, uint32_t flags, WebKit::CallbackBase::Error error)
 {
-    if (error != WebKit::CallbackBase::Error::None) {
-        ASSERT_NOT_REACHED();
+    if (error != WebKit::CallbackBase::Error::None)
         return;
-    }
     [(UIWKTextInteractionAssistant *)[view interactionAssistant] selectionChangedWithTouchAt:(CGPoint)point withSelectionTouch:toUIWKSelectionTouch((WebKit::SelectionTouch)touch) withFlags:static_cast<UIWKSelectionFlags>(flags)];
 }