Changeset 244648 in webkit


Ignore:
Timestamp:
Apr 25, 2019 9:58:09 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK] Back/forward gesture snapshot always times out
https://bugs.webkit.org/show_bug.cgi?id=197233

Patch by Alexander Mikhaylenko <exalm7659@gmail.com> on 2019-04-25
Reviewed by Michael Catanzaro.

Delaying web process launch caused a regression where we create ViewGestureController when the
web process doesn't yet exist. The controller immediately tries to connect to it and fails,
and because of that never receives DidHitRenderTreeSizeThreshold() message, so navigation
snapshot always stays until timeout after performing the gesture.

To prevent this, create the controller in webkitWebViewBaseDidRelaunchWebProcess() instead of
webkitWebViewBaseCreateWebPage(). Additionally, since settings are now created earlier than
ViewGestureController, store the value of whether swipe gesture is enabled in WebKitWebViewBase
and immediately apply it when creating the controller.

  • UIProcess/API/glib/WebKitWebView.cpp:

(enableBackForwardNavigationGesturesChanged):
Move the logic into webkitWebViewBaseSetEnableBackForwardNavigationGesture().

  • UIProcess/API/gtk/WebKitWebViewBase.cpp:

(webkitWebViewBaseSetEnableBackForwardNavigationGesture): Added. In addition to what was in
WebKitWebViewBase::enableBackForwardNavigationGesturesChanged(), store the value in a field
for the case ViewGestureController doesn't exist yet.
(webkitWebViewBaseCreateWebPage): Stop creating ViewGestureController.
(webkitWebViewBaseDidRelaunchWebProcess): Move creating ViewGestureController here. Also
immediately call setSwipeGestureEnabled() with the stored value.

  • UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r244645 r244648  
     12019-04-25  Alexander Mikhaylenko  <exalm7659@gmail.com>
     2
     3        [GTK] Back/forward gesture snapshot always times out
     4        https://bugs.webkit.org/show_bug.cgi?id=197233
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Delaying web process launch caused a regression where we create ViewGestureController when the
     9        web process doesn't yet exist. The controller immediately tries to connect to it and fails,
     10        and because of that never receives DidHitRenderTreeSizeThreshold() message, so navigation
     11        snapshot always stays until timeout after performing the gesture.
     12
     13        To prevent this, create the controller in webkitWebViewBaseDidRelaunchWebProcess() instead of
     14        webkitWebViewBaseCreateWebPage(). Additionally, since settings are now created earlier than
     15        ViewGestureController, store the value of whether swipe gesture is enabled in WebKitWebViewBase
     16        and immediately apply it when creating the controller.
     17
     18        * UIProcess/API/glib/WebKitWebView.cpp:
     19        (enableBackForwardNavigationGesturesChanged):
     20        Move the logic into webkitWebViewBaseSetEnableBackForwardNavigationGesture().
     21        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
     22        (webkitWebViewBaseSetEnableBackForwardNavigationGesture): Added. In addition to what was in
     23        WebKitWebViewBase::enableBackForwardNavigationGesturesChanged(), store the value in a field
     24        for the case ViewGestureController doesn't exist yet.
     25        (webkitWebViewBaseCreateWebPage): Stop creating ViewGestureController.
     26        (webkitWebViewBaseDidRelaunchWebProcess): Move creating ViewGestureController here. Also
     27        immediately call setSwipeGestureEnabled() with the stored value.
     28        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
     29
    1302019-04-25  Youenn Fablet  <youenn@apple.com>
    231
  • trunk/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp

    r243434 r244648  
    515515{
    516516    gboolean enable = webkit_settings_get_enable_back_forward_navigation_gestures(settings);
    517 
    518     ViewGestureController& controller = webkitWebViewBaseViewGestureController(WEBKIT_WEB_VIEW_BASE(webView));
    519     controller.setSwipeGestureEnabled(enable);
    520 
    521     getPage(webView).setShouldRecordNavigationSnapshots(enable);
     517    webkitWebViewBaseSetEnableBackForwardNavigationGesture(WEBKIT_WEB_VIEW_BASE(webView), enable);
    522518}
    523519
  • trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp

    r244635 r244648  
    207207#endif
    208208    std::unique_ptr<ViewGestureController> viewGestureController;
     209    bool isBackForwardNavigationGestureEnabled { false };
    209210};
    210211
     
    11901191#endif
    11911192
     1193void webkitWebViewBaseSetEnableBackForwardNavigationGesture(WebKitWebViewBase* webViewBase, bool enabled)
     1194{
     1195    WebKitWebViewBasePrivate* priv = webViewBase->priv;
     1196
     1197    priv->isBackForwardNavigationGestureEnabled = enabled;
     1198
     1199    if (priv->pageProxy->hasRunningProcess())
     1200        webViewBase->priv->viewGestureController->setSwipeGestureEnabled(enabled);
     1201
     1202    priv->pageProxy->setShouldRecordNavigationSnapshots(enabled);
     1203}
     1204
    11921205ViewGestureController& webkitWebViewBaseViewGestureController(WebKitWebViewBase* webViewBase)
    11931206{
     
    14211434    g_signal_connect(webkitWebViewBase, "notify::scale-factor", G_CALLBACK(deviceScaleFactorChanged), nullptr);
    14221435#endif
    1423 
    1424     priv->viewGestureController = std::make_unique<WebKit::ViewGestureController>(*priv->pageProxy);
    14251436}
    14261437
     
    16401651    gtk_widget_queue_resize_no_redraw(GTK_WIDGET(webkitWebViewBase));
    16411652
     1653    WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
     1654
    16421655#if PLATFORM(X11) && USE(TEXTURE_MAPPER_GL) && !USE(REDIRECTED_XCOMPOSITE_WINDOW)
    16431656    if (PlatformDisplay::sharedDisplay().type() != PlatformDisplay::Type::X11)
    16441657        return;
    16451658
    1646     WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
    16471659    auto* drawingArea = static_cast<DrawingAreaProxyCoordinatedGraphics*>(priv->pageProxy->drawingArea());
    16481660    ASSERT(drawingArea);
     
    16561668    UNUSED_PARAM(webkitWebViewBase);
    16571669#endif
     1670
     1671    priv->viewGestureController = std::make_unique<WebKit::ViewGestureController>(*priv->pageProxy);
     1672    priv->viewGestureController->setSwipeGestureEnabled(priv->isBackForwardNavigationGestureEnabled);
    16581673}
    16591674
  • trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBasePrivate.h

    r241224 r244648  
    8585RefPtr<WebKit::ViewSnapshot> webkitWebViewBaseTakeViewSnapshot(WebKitWebViewBase*);
    8686
     87void webkitWebViewBaseSetEnableBackForwardNavigationGesture(WebKitWebViewBase*, bool enabled);
    8788WebKit::ViewGestureController& webkitWebViewBaseViewGestureController(WebKitWebViewBase*);
    8889
Note: See TracChangeset for help on using the changeset viewer.