Bug 207121 - Regression(r253224) WKUIDelegate.webViewDidClose may get called twice after calling _tryClose on the WKWebView
Summary: Regression(r253224) WKUIDelegate.webViewDidClose may get called twice after c...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks: 204950
  Show dependency treegraph
 
Reported: 2020-02-03 08:58 PST by Chris Dumez
Modified: 2020-02-04 01:49 PST (History)
12 users (show)

See Also:


Attachments
Patch (8.99 KB, patch)
2020-02-03 09:00 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2020-02-03 08:58:42 PST
WKUIDelegate.webViewDidClose may get called twice after calling _tryClose on the WKWebView, in case we time out while waiting for an answer from the WebProcess but the WebProcess eventually responds.
Comment 1 Chris Dumez 2020-02-03 08:58:56 PST
<rdar://problem/58880177>
Comment 2 Chris Dumez 2020-02-03 09:00:48 PST
Created attachment 389521 [details]
Patch
Comment 3 WebKit Commit Bot 2020-02-03 14:21:58 PST
Comment on attachment 389521 [details]
Patch

Clearing flags on attachment: 389521

Committed r255595: <https://trac.webkit.org/changeset/255595>
Comment 4 WebKit Commit Bot 2020-02-03 14:22:00 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Aakash Jain 2020-02-03 17:59:02 PST
> Committed r255595: <https://trac.webkit.org/changeset/255595>
This seems to have broken api-gtk test: /WebKit2Gtk/TestUIClient:/webkit/WebKitWebView/javascript-dialogs

Can you please check?
Comment 6 Carlos Garcia Campos 2020-02-04 01:23:26 PST
Comment on attachment 389521 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=389521&action=review

> Source/WebKit/UIProcess/WebPageProxy.cpp:1134
> +        // If we timed out, don't ask the client to close again.
> +        if (!m_tryCloseTimeoutTimer.isActive())
> +            return;

This is assuming that the timer being not active means we timed out, but WebPageProxy::runBeforeUnloadConfirmPanel() stops the timer.