Bug 151319 - A window with a hung tab waits 5s before closing
Summary: A window with a hung tab waits 5s before closing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Geoffrey Garen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-16 12:18 PST by Geoffrey Garen
Modified: 2015-11-17 13:32 PST (History)
3 users (show)

See Also:


Attachments
Patch (2.15 KB, patch)
2015-11-16 13:23 PST, Geoffrey Garen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Geoffrey Garen 2015-11-16 12:18:15 PST
A window with a hung tab waits 5s before closing
Comment 1 Geoffrey Garen 2015-11-16 13:23:43 PST
Created attachment 265607 [details]
Patch
Comment 2 Anders Carlsson 2015-11-16 15:45:41 PST
Comment on attachment 265607 [details]
Patch

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

> Source/WebKit2/UIProcess/WebPageProxy.cpp:867
> +    // Close without delay if the process allows it. Our goal is to terminate
> +    // the process, so we check a per-process status bit.
> +    if (m_process->isSuddenTerminationEnabled())
> +        return true;

Don't you also want to check that the process has one page?
Comment 3 Geoffrey Garen 2015-11-16 19:32:08 PST
> > Source/WebKit2/UIProcess/WebPageProxy.cpp:867
> > +    // Close without delay if the process allows it. Our goal is to terminate
> > +    // the process, so we check a per-process status bit.
> > +    if (m_process->isSuddenTerminationEnabled())
> > +        return true;
> 
> Don't you also want to check that the process has one page?

I don't think we need to. Returning true here just means that we skip the tryClose message and go straight to close. That should be safe even if there's another page in the process. (WKWebView always does this.)

Skipping the tryClose message in a process with more than one page is a tiny optimization -- but I mostly did it because it is simpler this way.
Comment 4 Geoffrey Garen 2015-11-17 13:25:01 PST
Comment on attachment 265607 [details]
Patch

cq+
Comment 5 WebKit Commit Bot 2015-11-17 13:32:01 PST
Comment on attachment 265607 [details]
Patch

Clearing flags on attachment: 265607

Committed r192528: <http://trac.webkit.org/changeset/192528>
Comment 6 WebKit Commit Bot 2015-11-17 13:32:04 PST
All reviewed patches have been landed.  Closing bug.