Title: [263543] branches/safari-610.1.18-branch/Source/WebKit
Revision
263543
Author
alanc...@apple.com
Date
2020-06-25 16:27:27 -0700 (Thu, 25 Jun 2020)

Log Message

Cherry-pick r263525. rdar://problem/64778764

    Allow service workers for web browsers
    https://bugs.webkit.org/show_bug.cgi?id=213573
    <rdar://problem/64712630>

    Reviewed by Brent Fulgham.

    Allows applications with the full web-browser entitlement to use
    service workers.

    * NetworkProcess/ios/NetworkProcessIOS.mm:
    (WebKit::NetworkProcess::parentProcessHasServiceWorkerEntitlement const):
    * UIProcess/API/Cocoa/WKWebView.mm:
    (-[WKWebView _setupPageConfiguration:]):
    * WebProcess/WebPage/ios/WebPageIOS.mm:
    (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263525 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-610.1.18-branch/Source/WebKit/ChangeLog (263542 => 263543)


--- branches/safari-610.1.18-branch/Source/WebKit/ChangeLog	2020-06-25 23:27:25 UTC (rev 263542)
+++ branches/safari-610.1.18-branch/Source/WebKit/ChangeLog	2020-06-25 23:27:27 UTC (rev 263543)
@@ -1,3 +1,44 @@
+2020-06-25  Alan Coon  <alanc...@apple.com>
+
+        Cherry-pick r263525. rdar://problem/64778764
+
+    Allow service workers for web browsers
+    https://bugs.webkit.org/show_bug.cgi?id=213573
+    <rdar://problem/64712630>
+    
+    Reviewed by Brent Fulgham.
+    
+    Allows applications with the full web-browser entitlement to use
+    service workers.
+    
+    * NetworkProcess/ios/NetworkProcessIOS.mm:
+    (WebKit::NetworkProcess::parentProcessHasServiceWorkerEntitlement const):
+    * UIProcess/API/Cocoa/WKWebView.mm:
+    (-[WKWebView _setupPageConfiguration:]):
+    * WebProcess/WebPage/ios/WebPageIOS.mm:
+    (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263525 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-06-25  Kate Cheney  <katherine_che...@apple.com>
+
+            Allow service workers for web browsers
+            https://bugs.webkit.org/show_bug.cgi?id=213573
+            <rdar://problem/64712630>
+
+            Reviewed by Brent Fulgham.
+
+            Allows applications with the full web-browser entitlement to use
+            service workers.
+
+            * NetworkProcess/ios/NetworkProcessIOS.mm:
+            (WebKit::NetworkProcess::parentProcessHasServiceWorkerEntitlement const):
+            * UIProcess/API/Cocoa/WKWebView.mm:
+            (-[WKWebView _setupPageConfiguration:]):
+            * WebProcess/WebPage/ios/WebPageIOS.mm:
+            (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const):
+
 2020-06-24  Kocsen Chung  <kocsen_ch...@apple.com>
 
         Cherry-pick r263462. rdar://problem/64711607

Modified: branches/safari-610.1.18-branch/Source/WebKit/NetworkProcess/ios/NetworkProcessIOS.mm (263542 => 263543)


--- branches/safari-610.1.18-branch/Source/WebKit/NetworkProcess/ios/NetworkProcessIOS.mm	2020-06-25 23:27:25 UTC (rev 263542)
+++ branches/safari-610.1.18-branch/Source/WebKit/NetworkProcess/ios/NetworkProcessIOS.mm	2020-06-25 23:27:27 UTC (rev 263543)
@@ -81,7 +81,7 @@
     if (disableServiceWorkerEntitlementTestingOverride)
         return false;
 
-    static bool hasEntitlement = WTF::hasEntitlement(parentProcessConnection()->xpcConnection(), "com.apple.developer.WebKit.ServiceWorkers");
+    static bool hasEntitlement = WTF::hasEntitlement(parentProcessConnection()->xpcConnection(), "com.apple.developer.WebKit.ServiceWorkers") || WTF::hasEntitlement(parentProcessConnection()->xpcConnection(), "com.apple.developer.web-browser");
     return hasEntitlement;
 }
 

Modified: branches/safari-610.1.18-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (263542 => 263543)


--- branches/safari-610.1.18-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2020-06-25 23:27:25 UTC (rev 263542)
+++ branches/safari-610.1.18-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2020-06-25 23:27:27 UTC (rev 263543)
@@ -521,7 +521,8 @@
 #endif
 
 #if PLATFORM(IOS_FAMILY) && ENABLE(SERVICE_WORKER)
-    if ((!WTF::processHasEntitlement("com.apple.developer.WebKit.ServiceWorkers") || !![_configuration preferences]._serviceWorkerEntitlementDisabledForTesting) && ![_configuration limitsNavigationsToAppBoundDomains])
+    bool hasServiceWorkerEntitlement = (WTF::processHasEntitlement("com.apple.developer.WebKit.ServiceWorkers") || WTF::processHasEntitlement("com.apple.developer.web-browser")) && ![_configuration preferences]._serviceWorkerEntitlementDisabledForTesting;
+    if (!hasServiceWorkerEntitlement && ![_configuration limitsNavigationsToAppBoundDomains])
         pageConfiguration->preferences()->setServiceWorkersEnabled(false);
     pageConfiguration->preferences()->setServiceWorkerEntitlementDisabledForTesting(!![_configuration preferences]._serviceWorkerEntitlementDisabledForTesting);
 #endif

Modified: branches/safari-610.1.18-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (263542 => 263543)


--- branches/safari-610.1.18-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2020-06-25 23:27:25 UTC (rev 263542)
+++ branches/safari-610.1.18-branch/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2020-06-25 23:27:27 UTC (rev 263543)
@@ -510,7 +510,7 @@
     if (disableServiceWorkerEntitlementTestingOverride)
         return false;
     
-    static bool hasEntitlement = WTF::hasEntitlement(WebProcess::singleton().parentProcessConnection()->xpcConnection(), "com.apple.developer.WebKit.ServiceWorkers");
+    static bool hasEntitlement = WTF::hasEntitlement(WebProcess::singleton().parentProcessConnection()->xpcConnection(), "com.apple.developer.WebKit.ServiceWorkers") || WTF::hasEntitlement(WebProcess::singleton().parentProcessConnection()->xpcConnection(), "com.apple.developer.web-browser");
     return hasEntitlement;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to