[GTK] Crash in webkitWebViewBaseSetEnableBackForwardNavigationGesture
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 May 2019 14:33:47 +0000 (14:33 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 May 2019 14:33:47 +0000 (14:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197653

Reviewed by Žan Doberšek.

We still need to null-check the ViewGestureController there, since it can be called with a running process but
not yet attached when using a related view.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseSetEnableBackForwardNavigationGesture):

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp

index 33eff14..04e2116 100644 (file)
@@ -1,3 +1,16 @@
+2019-05-07  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Crash in webkitWebViewBaseSetEnableBackForwardNavigationGesture
+        https://bugs.webkit.org/show_bug.cgi?id=197653
+
+        Reviewed by Žan Doberšek.
+
+        We still need to null-check the ViewGestureController there, since it can be called with a running process but
+        not yet attached when using a related view.
+
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (webkitWebViewBaseSetEnableBackForwardNavigationGesture):
+
 2019-05-07  Antti Koivisto  <antti@apple.com>
 
         <body> with overflow:hidden CSS is scrollable on iOS
index 10ea4b2..1cf6e29 100644 (file)
@@ -1196,8 +1196,8 @@ void webkitWebViewBaseSetEnableBackForwardNavigationGesture(WebKitWebViewBase* w
 
     priv->isBackForwardNavigationGestureEnabled = enabled;
 
-    if (priv->pageProxy->hasRunningProcess())
-        webViewBase->priv->viewGestureController->setSwipeGestureEnabled(enabled);
+    if (auto* controller = webkitWebViewBaseViewGestureController(webViewBase))
+        controller->setSwipeGestureEnabled(enabled);
 
     priv->pageProxy->setShouldRecordNavigationSnapshots(enabled);
 }