Bug 207341

Summary: [WK2][iOS] Add WKWebviewConfiguration SPI to run client navigations at foreground priority, even if the view is background
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: aakash_jain, achristensen, beidson, commit-queue, ggaren, koivisto, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=209759
Attachments:
Description Flags
Patch
none
Patch none

Description Chris Dumez 2020-02-06 10:23:11 PST
Add WKWebviewConfiguration SPI to run client navigations at foreground priority, even if the view is background.
Comment 1 Chris Dumez 2020-02-06 10:23:23 PST
<rdar://problem/59227077>
Comment 2 Chris Dumez 2020-02-06 12:35:58 PST
Created attachment 389981 [details]
Patch
Comment 3 Geoffrey Garen 2020-02-06 14:36:02 PST
Comment on attachment 389981 [details]
Patch

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

r=me

> Source/WebKit/UIProcess/ios/PageClientImplIOS.mm:153
> +    bool isViewService = WTF::processHasEntitlement("com.apple.UIKit.vends-view-services") && [[m_webView window] _isHostedInAnotherProcess];
> +    if (_UIApplicationIsExtension() || isViewService) {

Might be nicer to use applicationType() here.
Comment 4 Chris Dumez 2020-02-06 14:42:23 PST
(In reply to Geoffrey Garen from comment #3)
> Comment on attachment 389981 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=389981&action=review
> 
> r=me
> 
> > Source/WebKit/UIProcess/ios/PageClientImplIOS.mm:153
> > +    bool isViewService = WTF::processHasEntitlement("com.apple.UIKit.vends-view-services") && [[m_webView window] _isHostedInAnotherProcess];
> > +    if (_UIApplicationIsExtension() || isViewService) {
> 
> Might be nicer to use applicationType() here.

applicationType() is in ApplicationStateTracker.mm, would you like me to move it somewhere else so I can reuse it here?
Comment 5 Chris Dumez 2020-02-06 15:01:11 PST
Created attachment 390009 [details]
Patch
Comment 6 Chris Dumez 2020-02-06 16:44:39 PST
Comment on attachment 390009 [details]
Patch

Clearing flags on attachment: 390009

Committed r255992: <https://trac.webkit.org/changeset/255992>
Comment 7 Chris Dumez 2020-02-06 16:44:41 PST
All reviewed patches have been landed.  Closing bug.