Bug 198488 - [iOS] Do not prevent app suspension for more than 20 seconds after getting backgrounded
Summary: [iOS] Do not prevent app suspension for more than 20 seconds after getting ba...
Status: REOPENED
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:
 
Reported: 2019-06-03 10:35 PDT by Chris Dumez
Modified: 2019-08-22 16:58 PDT (History)
6 users (show)

See Also:


Attachments
Patch (8.47 KB, patch)
2019-06-03 10:39 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews105 for mac-highsierra-wk2 (2.80 MB, application/zip)
2019-06-03 11:53 PDT, EWS Watchlist
no flags Details
Patch (10.03 KB, patch)
2019-06-03 16:20 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (11.43 KB, patch)
2019-06-03 16:46 PDT, 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 2019-06-03 10:35:33 PDT
Do not prevent app suspension for more than 20 seconds after getting backgrounded on iOS. We do this by implementing our own expiration handler which notifies our child processes of their imminent suspension before ending the background task that was preventing suspension.
Comment 1 Chris Dumez 2019-06-03 10:36:12 PDT
<rdar://problem/50837208>
Comment 2 Chris Dumez 2019-06-03 10:39:30 PDT
Created attachment 371194 [details]
Patch
Comment 3 EWS Watchlist 2019-06-03 11:53:08 PDT
Comment on attachment 371194 [details]
Patch

Attachment 371194 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/12364580

New failing tests:
http/wpt/service-workers/service-worker-networkprocess-crash.html
Comment 4 EWS Watchlist 2019-06-03 11:53:09 PDT
Created attachment 371201 [details]
Archive of layout-test-results from ews105 for mac-highsierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-highsierra-wk2  Platform: Mac OS X 10.13.6
Comment 5 Geoffrey Garen 2019-06-03 16:11:15 PDT
Comment on attachment 371194 [details]
Patch

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

r=me

> Source/WebKit/UIProcess/ios/ProcessAssertionIOS.mm:236
> +    [self _cancelPendingReleaseTask];
> +    [self _cancelTimeoutTask];

Naming inconsistency is a little annoying here. 

I think the right naming is probabaly

    _cancelPendingReleaseTask => _cancelReleaseTask
    _pendingReleaseTask => _releaseTask
    _pendingTimeoutTask => _timeoutTask
Comment 6 Chris Dumez 2019-06-03 16:20:53 PDT
Created attachment 371227 [details]
Patch
Comment 7 Chris Dumez 2019-06-03 16:46:20 PDT
Created attachment 371230 [details]
Patch
Comment 8 Chris Dumez 2019-06-03 18:28:46 PDT
Comment on attachment 371230 [details]
Patch

Clearing flags on attachment: 371230

Committed r246053: <https://trac.webkit.org/changeset/246053>
Comment 9 Chris Dumez 2019-06-03 18:28:55 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Jer Noble 2019-07-03 15:00:09 PDT
Rolled out r246053 for reason:

This changeset caused media playback when the hosting application is backgrounded to break.

Committed r247109: <https://trac.webkit.org/changeset/247109/webkit>
Comment 11 Ryosuke Niwa 2019-08-22 16:58:48 PDT
Was this ever fixed some other way?