Title: [261346] branches/safari-610.1.12-branch/Source/WebKit
Revision
261346
Author
alanc...@apple.com
Date
2020-05-07 16:50:25 -0700 (Thu, 07 May 2020)

Log Message

Cherry-pick r261187. rdar://problem/62993016

    Check for app-bound domains should confirm WKAppBoundDomains key exists when checking for default app-bound protocols.
    https://bugs.webkit.org/show_bug.cgi?id=211451
    <rdar://problem/62715316

    Reviewed by Brent Fulgham.

    Checks for WKAppBoundDomains key before treating a protocol as
    app-bound. This is a regression in expected behavior after making
    In-App Browser privacy opt-in based on the presence of the key.

    Also moves the check for special protocols inside of the completion handler for
    ensureAppBoundDomains to make sure the check for the key has finished.

    * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
    (WebKit::WebsiteDataStore::beginAppBoundDomainCheck):
    Added a comment to clarify why we need to check for both an empty
    app-bound domains list and the presence of the key for testing
    purposes.

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

Modified Paths

Diff

Modified: branches/safari-610.1.12-branch/Source/WebKit/ChangeLog (261345 => 261346)


--- branches/safari-610.1.12-branch/Source/WebKit/ChangeLog	2020-05-07 23:50:23 UTC (rev 261345)
+++ branches/safari-610.1.12-branch/Source/WebKit/ChangeLog	2020-05-07 23:50:25 UTC (rev 261346)
@@ -1,5 +1,52 @@
 2020-05-07  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r261187. rdar://problem/62993016
+
+    Check for app-bound domains should confirm WKAppBoundDomains key exists when checking for default app-bound protocols.
+    https://bugs.webkit.org/show_bug.cgi?id=211451
+    <rdar://problem/62715316
+    
+    Reviewed by Brent Fulgham.
+    
+    Checks for WKAppBoundDomains key before treating a protocol as
+    app-bound. This is a regression in expected behavior after making
+    In-App Browser privacy opt-in based on the presence of the key.
+    
+    Also moves the check for special protocols inside of the completion handler for
+    ensureAppBoundDomains to make sure the check for the key has finished.
+    
+    * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+    (WebKit::WebsiteDataStore::beginAppBoundDomainCheck):
+    Added a comment to clarify why we need to check for both an empty
+    app-bound domains list and the presence of the key for testing
+    purposes.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-05-05  Kate Cheney  <katherine_che...@apple.com>
+
+            Check for app-bound domains should confirm WKAppBoundDomains key exists when checking for default app-bound protocols.
+            https://bugs.webkit.org/show_bug.cgi?id=211451
+            <rdar://problem/62715316
+
+            Reviewed by Brent Fulgham.
+
+            Checks for WKAppBoundDomains key before treating a protocol as
+            app-bound. This is a regression in expected behavior after making
+            In-App Browser privacy opt-in based on the presence of the key.
+
+            Also moves the check for special protocols inside of the completion handler for
+            ensureAppBoundDomains to make sure the check for the key has finished.
+
+            * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+            (WebKit::WebsiteDataStore::beginAppBoundDomainCheck):
+            Added a comment to clarify why we need to check for both an empty
+            app-bound domains list and the presence of the key for testing
+            purposes.
+
+2020-05-07  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r261140. rdar://problem/62993055
 
     [iOS] Make sure TestController::statisticsResetToConsistentState() does not hang due to process suspension

Modified: branches/safari-610.1.12-branch/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (261345 => 261346)


--- branches/safari-610.1.12-branch/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2020-05-07 23:50:23 UTC (rev 261345)
+++ branches/safari-610.1.12-branch/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2020-05-07 23:50:25 UTC (rev 261346)
@@ -461,17 +461,19 @@
 {
     ASSERT(RunLoop::isMain());
 
-    if (shouldTreatURLProtocolAsAppBound(requestURL)) {
-        listener.didReceiveAppBoundDomainResult(NavigatingToAppBoundDomain::Yes);
-        return;
-    }
-
-    ensureAppBoundDomains([domain = WebCore::RegistrableDomain(requestURL), listener = makeRef(listener)] (auto& domains) mutable {
-        if (domains.isEmpty() && !keyExists) {
+    ensureAppBoundDomains([&requestURL, listener = makeRef(listener)] (auto& domains) mutable {
+        // Must check for both an empty app bound domains list and an empty key before returning nullopt
+        // because test cases may have app bound domains but no key.
+        bool hasAppBoundDomains = keyExists || !domains.isEmpty();
+        if (!hasAppBoundDomains) {
             listener->didReceiveAppBoundDomainResult(WTF::nullopt);
             return;
         }
-        listener->didReceiveAppBoundDomainResult(domains.contains(domain) ? NavigatingToAppBoundDomain::Yes : NavigatingToAppBoundDomain::No);
+        if (shouldTreatURLProtocolAsAppBound(requestURL)) {
+            listener->didReceiveAppBoundDomainResult(NavigatingToAppBoundDomain::Yes);
+            return;
+        }
+        listener->didReceiveAppBoundDomainResult(domains.contains(WebCore::RegistrableDomain(requestURL)) ? NavigatingToAppBoundDomain::Yes : NavigatingToAppBoundDomain::No);
     });
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to