Title: [259697] branches/safari-610.1.9-branch
Revision
259697
Author
[email protected]
Date
2020-04-07 17:43:18 -0700 (Tue, 07 Apr 2020)

Log Message

Cherry-pick r259655. rdar://problem/61360282

    Return app-bound sessions for instances where WKAppBoundDomains is
    empty
    https://bugs.webkit.org/show_bug.cgi?id=210124
    <rdar://problem/61276630>

    Reviewed by Brent Fulgham.

    Source/WebKit:

    No new tests. Behavior confirmed by existing In-App Browser Privacy
    tests.

    * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
    (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
    Remove the flag checking if In-App Browser Privacy is enabled. We
    should return an app-bound session if WKAppBoundDomains is empty so
    we no longer need to check the flag here.

    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
    (WebKit::WebPageProxy::decidePolicyForNavigationAction):
    * UIProcess/WebPageProxy.h:
    As described above, we no longer need to check the flag in this
    instance as we are determining behavior based on the WKAppBoundDomains
    list. Also moved the logic for checking an empty list to setIsNavigatingToAppBoundDomain,
    so it should take an Optional (WTF::nullopt indicates an empty list).

    * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
    (WebKit::WebsiteDataStore::initializeAppBoundDomains):
    Use the flag to enable internal debugging for testing purposes.

    * UIProcess/API/APIHTTPCookieStore.cpp:
    (API::HTTPCookieStore::filterAppBoundCookies):
    Flag no longer needed. This should be gated by whether the domains
    list is empty or not.

    Tools:

    Cleaned up tests to turn the flag on at the start of each In-App
    Browser Privacy test.

    * TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
    (cleanUpInAppBrowserPrivacyTestSettings):
    (initializeInAppBrowserPrivacyTestSettings):
    (TEST):

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

Modified Paths

Diff

Modified: branches/safari-610.1.9-branch/Source/WebKit/ChangeLog (259696 => 259697)


--- branches/safari-610.1.9-branch/Source/WebKit/ChangeLog	2020-04-08 00:43:15 UTC (rev 259696)
+++ branches/safari-610.1.9-branch/Source/WebKit/ChangeLog	2020-04-08 00:43:18 UTC (rev 259697)
@@ -1,5 +1,94 @@
 2020-04-07  Alan Coon  <[email protected]>
 
+        Cherry-pick r259655. rdar://problem/61360282
+
+    Return app-bound sessions for instances where WKAppBoundDomains is
+    empty
+    https://bugs.webkit.org/show_bug.cgi?id=210124
+    <rdar://problem/61276630>
+    
+    Reviewed by Brent Fulgham.
+    
+    Source/WebKit:
+    
+    No new tests. Behavior confirmed by existing In-App Browser Privacy
+    tests.
+    
+    * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+    (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
+    Remove the flag checking if In-App Browser Privacy is enabled. We
+    should return an app-bound session if WKAppBoundDomains is empty so
+    we no longer need to check the flag here.
+    
+    * UIProcess/WebPageProxy.cpp:
+    (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
+    (WebKit::WebPageProxy::decidePolicyForNavigationAction):
+    * UIProcess/WebPageProxy.h:
+    As described above, we no longer need to check the flag in this
+    instance as we are determining behavior based on the WKAppBoundDomains
+    list. Also moved the logic for checking an empty list to setIsNavigatingToAppBoundDomain,
+    so it should take an Optional (WTF::nullopt indicates an empty list).
+    
+    * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+    (WebKit::WebsiteDataStore::initializeAppBoundDomains):
+    Use the flag to enable internal debugging for testing purposes.
+    
+    * UIProcess/API/APIHTTPCookieStore.cpp:
+    (API::HTTPCookieStore::filterAppBoundCookies):
+    Flag no longer needed. This should be gated by whether the domains
+    list is empty or not.
+    
+    Tools:
+    
+    Cleaned up tests to turn the flag on at the start of each In-App
+    Browser Privacy test.
+    
+    * TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
+    (cleanUpInAppBrowserPrivacyTestSettings):
+    (initializeInAppBrowserPrivacyTestSettings):
+    (TEST):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259655 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-04-07  Kate Cheney  <[email protected]>
+
+            Return app-bound sessions for instances where WKAppBoundDomains is
+            empty
+            https://bugs.webkit.org/show_bug.cgi?id=210124
+            <rdar://problem/61276630>
+
+            Reviewed by Brent Fulgham.
+
+            No new tests. Behavior confirmed by existing In-App Browser Privacy
+            tests.
+
+            * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+            (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
+            Remove the flag checking if In-App Browser Privacy is enabled. We
+            should return an app-bound session if WKAppBoundDomains is empty so
+            we no longer need to check the flag here.
+
+            * UIProcess/WebPageProxy.cpp:
+            (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
+            (WebKit::WebPageProxy::decidePolicyForNavigationAction):
+            * UIProcess/WebPageProxy.h:
+            As described above, we no longer need to check the flag in this
+            instance as we are determining behavior based on the WKAppBoundDomains
+            list. Also moved the logic for checking an empty list to setIsNavigatingToAppBoundDomain,
+            so it should take an Optional (WTF::nullopt indicates an empty list).
+
+            * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+            (WebKit::WebsiteDataStore::initializeAppBoundDomains):
+            Use the flag to enable internal debugging for testing purposes.
+
+            * UIProcess/API/APIHTTPCookieStore.cpp:
+            (API::HTTPCookieStore::filterAppBoundCookies):
+            Flag no longer needed. This should be gated by whether the domains
+            list is empty or not.
+
+2020-04-07  Alan Coon  <[email protected]>
+
         Cherry-pick r259615. rdar://problem/61360282
 
     Create a way to signal if the WKAppBoundDomains list is empty

Modified: branches/safari-610.1.9-branch/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (259696 => 259697)


--- branches/safari-610.1.9-branch/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2020-04-08 00:43:15 UTC (rev 259696)
+++ branches/safari-610.1.9-branch/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2020-04-08 00:43:18 UTC (rev 259697)
@@ -63,7 +63,6 @@
 #include <WebKitAdditions/NetworkSessionCocoaAdditions.h>
 #else
 #define NETWORK_SESSION_COCOA_ADDITIONS_1
-#define NETWORK_SESSION_COCOA_ADDITIONS_2 false
 #endif
 
 #import "DeviceManagementSoftLink.h"
@@ -1211,10 +1210,8 @@
         ASSERT_NOT_REACHED();
 #endif
 
-    if (isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::Yes) {
-        if (m_isInAppBrowserPrivacyEnabled || NETWORK_SESSION_COCOA_ADDITIONS_2)
-            return appBoundSession(storedCredentialsPolicy);
-    }
+    if (isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::Yes)
+        return appBoundSession(storedCredentialsPolicy);
 
     switch (storedCredentialsPolicy) {
     case WebCore::StoredCredentialsPolicy::Use:

Modified: branches/safari-610.1.9-branch/Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp (259696 => 259697)


--- branches/safari-610.1.9-branch/Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp	2020-04-08 00:43:15 UTC (rev 259696)
+++ branches/safari-610.1.9-branch/Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp	2020-04-08 00:43:18 UTC (rev 259697)
@@ -38,7 +38,6 @@
 #if USE(APPLE_INTERNAL_SDK)
 #include <WebKitAdditions/HTTPCookieStoreAdditions.h>
 #else
-#define IN_APP_BROWSER_PRIVACY_ENABLED false
 #define IMPLEMENT_IN_APP_BROWSER_PRIVACY_ENABLED
 #endif
 
@@ -66,8 +65,8 @@
 {
     Vector<WebCore::Cookie> appBoundCookies;
 #if PLATFORM(IOS_FAMILY)
-    m_owningDataStore->getAppBoundDomains([this, protectedThis = makeRef(*this), cookies, appBoundCookies = WTFMove(appBoundCookies), completionHandler = WTFMove(completionHandler)] (auto& domains) mutable {
-        if (m_owningDataStore->parameters().networkSessionParameters.isInAppBrowserPrivacyEnabled || IN_APP_BROWSER_PRIVACY_ENABLED) {
+    m_owningDataStore->getAppBoundDomains([cookies, appBoundCookies = WTFMove(appBoundCookies), completionHandler = WTFMove(completionHandler)] (auto& domains) mutable {
+        if (!domains.isEmpty()) {
             IMPLEMENT_IN_APP_BROWSER_PRIVACY_ENABLED
             for (auto& cookie : cookies) {
                 if (domains.contains(WebCore::RegistrableDomain::uncheckedCreateFromHost(cookie.domain)))

Modified: branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebPageProxy.cpp (259696 => 259697)


--- branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebPageProxy.cpp	2020-04-08 00:43:15 UTC (rev 259696)
+++ branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebPageProxy.cpp	2020-04-08 00:43:18 UTC (rev 259697)
@@ -282,7 +282,6 @@
 #include <WebKitAdditions/WebPageProxyAdditions.h>
 #else
 #define WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN
-#define WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN_2 false
 #endif
 
 // This controls what strategy we use for mouse wheel coalescing.
@@ -3119,14 +3118,18 @@
     PolicyCheckIdentifier m_identifier;
 };
 
-void WebPageProxy::setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL& requestURL, NavigatingToAppBoundDomain isNavigatingToAppBoundDomain)
+void WebPageProxy::setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL& requestURL, Optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain)
 {
 #if PLATFORM(IOS_FAMILY)
-    if (isMainFrame && (m_preferences->isInAppBrowserPrivacyEnabled() || WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN_2)) {
+    if (isMainFrame) {
+        WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN
+        if (!isNavigatingToAppBoundDomain) {
+            m_isNavigatingToAppBoundDomain = NavigatingToAppBoundDomain::Yes;
+            return;
+        }
         if (m_ignoresAppBoundDomains)
             return;
-        WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN
-        if (isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::No) {
+        if (*isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::No) {
             m_configuration->setWebViewCategory(WebViewCategory::InAppBrowser);
             m_isNavigatingToAppBoundDomain = NavigatingToAppBoundDomain::No;
             m_hasNavigatedAwayFromAppBoundDomain = NavigatedAwayFromAppBoundDomain::Yes;
@@ -5105,8 +5108,8 @@
     
     auto listener = makeRef(frame.setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), frame = makeRef(frame), sender = WTFMove(sender), navigation] (PolicyAction policyAction, API::WebsitePolicies* policies, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning, Optional<NavigatingToAppBoundDomain> isAppBoundDomain) mutable {
 
-        if (policyAction != PolicyAction::Ignore && isAppBoundDomain)
-            setIsNavigatingToAppBoundDomain(frame->isMainFrame(), navigation->currentRequest().url(), *isAppBoundDomain);
+        if (policyAction != PolicyAction::Ignore)
+            setIsNavigatingToAppBoundDomain(frame->isMainFrame(), navigation->currentRequest().url(), isAppBoundDomain);
 
         auto completionHandler = [this, protectedThis = protectedThis.copyRef(), frame = frame.copyRef(), sender = WTFMove(sender), navigation, processSwapRequestedByClient, policies = makeRefPtr(policies)] (PolicyAction policyAction) mutable {
             if (frame->isMainFrame()) {

Modified: branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebPageProxy.h (259696 => 259697)


--- branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebPageProxy.h	2020-04-08 00:43:15 UTC (rev 259696)
+++ branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebPageProxy.h	2020-04-08 00:43:18 UTC (rev 259697)
@@ -2282,7 +2282,7 @@
     void tryCloseTimedOut();
     void makeStorageSpaceRequest(WebCore::FrameIdentifier, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, CompletionHandler<void(uint64_t)>&&);
         
-    void setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL&, NavigatingToAppBoundDomain);
+    void setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL&, Optional<NavigatingToAppBoundDomain>);
     NavigatedAwayFromAppBoundDomain hasNavigatedAwayFromAppBoundDomain() const { return m_hasNavigatedAwayFromAppBoundDomain; }
         
     const Identifier m_identifier;

Modified: branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (259696 => 259697)


--- branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2020-04-08 00:43:15 UTC (rev 259696)
+++ branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2020-04-08 00:43:18 UTC (rev 259697)
@@ -403,13 +403,13 @@
     
     static const auto maxAppBoundDomainCount = 10;
     
-    appBoundDomainQueue().dispatch([forceReinitialization] () mutable {
+    appBoundDomainQueue().dispatch([isInAppBrowserPrivacyEnabled = parameters().networkSessionParameters.isInAppBrowserPrivacyEnabled, forceReinitialization] () mutable {
         if (hasInitializedAppBoundDomains && forceReinitialization != ForceReinitialization::Yes)
             return;
         
         NSArray<NSString *> *domains = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"WKAppBoundDomains"];
         
-        RunLoop::main().dispatch([forceReinitialization , domains = retainPtr(domains)] {
+        RunLoop::main().dispatch([isInAppBrowserPrivacyEnabled, forceReinitialization, domains = retainPtr(domains)] {
             if (forceReinitialization == ForceReinitialization::Yes)
                 appBoundDomains().clear();
 
@@ -426,7 +426,8 @@
                 if (appBoundDomains().size() >= maxAppBoundDomainCount)
                     break;
             }
-            WEBSITE_DATA_STORE_ADDITIONS
+            if (isInAppBrowserPrivacyEnabled)
+                WEBSITE_DATA_STORE_ADDITIONS
             hasInitializedAppBoundDomains = true;
         });
     });

Modified: branches/safari-610.1.9-branch/Tools/ChangeLog (259696 => 259697)


--- branches/safari-610.1.9-branch/Tools/ChangeLog	2020-04-08 00:43:15 UTC (rev 259696)
+++ branches/safari-610.1.9-branch/Tools/ChangeLog	2020-04-08 00:43:18 UTC (rev 259697)
@@ -1,5 +1,75 @@
 2020-04-07  Alan Coon  <[email protected]>
 
+        Cherry-pick r259655. rdar://problem/61360282
+
+    Return app-bound sessions for instances where WKAppBoundDomains is
+    empty
+    https://bugs.webkit.org/show_bug.cgi?id=210124
+    <rdar://problem/61276630>
+    
+    Reviewed by Brent Fulgham.
+    
+    Source/WebKit:
+    
+    No new tests. Behavior confirmed by existing In-App Browser Privacy
+    tests.
+    
+    * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+    (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
+    Remove the flag checking if In-App Browser Privacy is enabled. We
+    should return an app-bound session if WKAppBoundDomains is empty so
+    we no longer need to check the flag here.
+    
+    * UIProcess/WebPageProxy.cpp:
+    (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
+    (WebKit::WebPageProxy::decidePolicyForNavigationAction):
+    * UIProcess/WebPageProxy.h:
+    As described above, we no longer need to check the flag in this
+    instance as we are determining behavior based on the WKAppBoundDomains
+    list. Also moved the logic for checking an empty list to setIsNavigatingToAppBoundDomain,
+    so it should take an Optional (WTF::nullopt indicates an empty list).
+    
+    * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+    (WebKit::WebsiteDataStore::initializeAppBoundDomains):
+    Use the flag to enable internal debugging for testing purposes.
+    
+    * UIProcess/API/APIHTTPCookieStore.cpp:
+    (API::HTTPCookieStore::filterAppBoundCookies):
+    Flag no longer needed. This should be gated by whether the domains
+    list is empty or not.
+    
+    Tools:
+    
+    Cleaned up tests to turn the flag on at the start of each In-App
+    Browser Privacy test.
+    
+    * TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
+    (cleanUpInAppBrowserPrivacyTestSettings):
+    (initializeInAppBrowserPrivacyTestSettings):
+    (TEST):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259655 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-04-07  Kate Cheney  <[email protected]>
+
+            Return app-bound sessions for instances where WKAppBoundDomains is
+            empty
+            https://bugs.webkit.org/show_bug.cgi?id=210124
+            <rdar://problem/61276630>
+
+            Reviewed by Brent Fulgham.
+
+            Cleaned up tests to turn the flag on at the start of each In-App
+            Browser Privacy test.
+
+            * TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
+            (cleanUpInAppBrowserPrivacyTestSettings):
+            (initializeInAppBrowserPrivacyTestSettings):
+            (TEST):
+
+2020-04-07  Alan Coon  <[email protected]>
+
         Cherry-pick r259650. rdar://problem/61419505
 
     WKUserScripts deferred from injection are not injected if -[WKWebView _notifyUserScripts] is called early.

Modified: branches/safari-610.1.9-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm (259696 => 259697)


--- branches/safari-610.1.9-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm	2020-04-08 00:43:15 UTC (rev 259696)
+++ branches/safari-610.1.9-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm	2020-04-08 00:43:18 UTC (rev 259697)
@@ -81,11 +81,13 @@
 
 static void cleanUpInAppBrowserPrivacyTestSettings()
 {
+    [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
     IN_APP_BROWSER_PRIVACY_ADDITIONS_2
 }
 
 static void initializeInAppBrowserPrivacyTestSettings()
 {
+    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
     RunLoop::initializeMainRunLoop();
     WebCore::clearApplicationBundleIdentifierTestingOverride();
     IN_APP_BROWSER_PRIVACY_ADDITIONS
@@ -536,7 +538,6 @@
 TEST(InAppBrowserPrivacy, SetCookieForNonAppBoundDomainFails)
 {
     initializeInAppBrowserPrivacyTestSettings();
-    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
 
     auto dataStore = [WKWebsiteDataStore defaultDataStore];
     auto webView = adoptNS([TestWKWebView new]);
@@ -581,7 +582,6 @@
     TestWebKitAPI::Util::run(&gotFlag);
 
     cleanUpInAppBrowserPrivacyTestSettings();
-    [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
     gotFlag = false;
 
     // Check the cookie store to make sure only one cookie was set.
@@ -607,7 +607,7 @@
 {
     // Since we can't set non-app-bound cookies with In-App Browser privacy protections on,
     // we can turn the protections off to set a cookie we will then try to get with protections enabled.
-    [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
+    cleanUpInAppBrowserPrivacyTestSettings();
 
     setUpCookieTest();
     globalCookieStore = [[WKWebsiteDataStore defaultDataStore] httpCookieStore];
@@ -658,7 +658,6 @@
     ASSERT_EQ(cookies.count, 2u);
 
     // Now enable protections and ensure we can only retrieve the app-bound cookies.
-    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
     initializeInAppBrowserPrivacyTestSettings();
 
     gotFlag = false;
@@ -683,7 +682,6 @@
     gotFlag = false;
     [globalCookieStore deleteCookie:appBoundCookie.get() completionHandler:[]() {
         // Reset flag.
-        [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
         cleanUpInAppBrowserPrivacyTestSettings();
         gotFlag = true;
     }];
@@ -695,7 +693,7 @@
 {
     // Since we can't set non-app-bound cookies with In-App Browser privacy protections on,
     // we can turn the protections off to set a cookie we will then try to get with protections enabled.
-    [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
+    cleanUpInAppBrowserPrivacyTestSettings();
     setUpCookieTest();
 
     globalCookieStore = [[WKWebsiteDataStore defaultDataStore] httpCookieStore];
@@ -720,7 +718,6 @@
         [globalCookieStore setCookie:appBoundCookie completionHandler:^{
 
             // Now enable protections and ensure we can only retrieve the app-bound cookies.
-            [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
             initializeInAppBrowserPrivacyTestSettings();
 
             [globalCookieStore _getCookiesForURL:[NSURL URLWithString:@"https://webkit.org/"] completionHandler:^(NSArray<NSHTTPCookie *> *cookies) {
@@ -730,7 +727,6 @@
                     EXPECT_EQ(cookies.count, 0u);
                     [globalCookieStore deleteCookie:nonAppBoundCookie completionHandler:^{
                         [globalCookieStore deleteCookie:appBoundCookie completionHandler:^{
-                            [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
                             cleanUpInAppBrowserPrivacyTestSettings();
                             done = true;
                         }];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to