⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 259757 in webkit


Ignore:
Timestamp:
Apr 8, 2020, 2:41:32 PM (6 years ago)
Author:
Russell Epstein
Message:

Cherry-pick r259731. 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:

Clean up test settings between tests.

  • TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm: (cleanUpInAppBrowserPrivacyTestSettings):

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

Location:
branches/safari-610.1.9-branch
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-610.1.9-branch/Source/WebKit/ChangeLog

    r259756 r259757  
     12020-04-08  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r259731. rdar://problem/61360282
     4
     5    Return app-bound sessions for instances where WKAppBoundDomains is
     6    empty
     7    https://bugs.webkit.org/show_bug.cgi?id=210124
     8    <rdar://problem/61276630>
     9   
     10    Reviewed by Brent Fulgham.
     11   
     12    Source/WebKit:
     13   
     14    No new tests. Behavior confirmed by existing In-App Browser Privacy
     15    tests.
     16   
     17    * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
     18    (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
     19    Remove the flag checking if In-App Browser Privacy is enabled. We
     20    should return an app-bound session if WKAppBoundDomains is empty so
     21    we no longer need to check the flag here.
     22   
     23    * UIProcess/WebPageProxy.cpp:
     24    (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
     25    (WebKit::WebPageProxy::decidePolicyForNavigationAction):
     26    * UIProcess/WebPageProxy.h:
     27    As described above, we no longer need to check the flag in this
     28    instance as we are determining behavior based on the WKAppBoundDomains
     29    list. Also moved the logic for checking an empty list to setIsNavigatingToAppBoundDomain,
     30    so it should take an Optional (WTF::nullopt indicates an empty list).
     31   
     32    * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
     33    (WebKit::WebsiteDataStore::initializeAppBoundDomains):
     34    Use the flag to enable internal debugging for testing purposes.
     35   
     36    * UIProcess/API/APIHTTPCookieStore.cpp:
     37    (API::HTTPCookieStore::filterAppBoundCookies):
     38    Flag no longer needed. This should be gated by whether the domains
     39    list is empty or not.
     40   
     41    Tools:
     42   
     43    Clean up test settings between tests.
     44   
     45    * TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
     46    (cleanUpInAppBrowserPrivacyTestSettings):
     47   
     48   
     49    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     50
     51    2020-04-08  Kate Cheney  <katherine_cheney@apple.com>
     52
     53            Return app-bound sessions for instances where WKAppBoundDomains is
     54            empty
     55            https://bugs.webkit.org/show_bug.cgi?id=210124
     56            <rdar://problem/61276630>
     57
     58            Reviewed by Brent Fulgham.
     59
     60            No new tests. Behavior confirmed by existing In-App Browser Privacy
     61            tests.
     62
     63            * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
     64            (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
     65            Remove the flag checking if In-App Browser Privacy is enabled. We
     66            should return an app-bound session if WKAppBoundDomains is empty so
     67            we no longer need to check the flag here.
     68
     69            * UIProcess/WebPageProxy.cpp:
     70            (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
     71            (WebKit::WebPageProxy::decidePolicyForNavigationAction):
     72            * UIProcess/WebPageProxy.h:
     73            As described above, we no longer need to check the flag in this
     74            instance as we are determining behavior based on the WKAppBoundDomains
     75            list. Also moved the logic for checking an empty list to setIsNavigatingToAppBoundDomain,
     76            so it should take an Optional (WTF::nullopt indicates an empty list).
     77
     78            * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
     79            (WebKit::WebsiteDataStore::initializeAppBoundDomains):
     80            Use the flag to enable internal debugging for testing purposes.
     81
     82            * UIProcess/API/APIHTTPCookieStore.cpp:
     83            (API::HTTPCookieStore::filterAppBoundCookies):
     84            Flag no longer needed. This should be gated by whether the domains
     85            list is empty or not.
     86
    1872020-04-08  Alan Coon  <alancoon@apple.com>
    288
  • branches/safari-610.1.9-branch/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm

    r259756 r259757  
    6464#else
    6565#define NETWORK_SESSION_COCOA_ADDITIONS_1
    66 #define NETWORK_SESSION_COCOA_ADDITIONS_2 false
    6766#endif
    6867
     
    12121211#endif
    12131212
    1214     if (isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::Yes) {
    1215         if (m_isInAppBrowserPrivacyEnabled || NETWORK_SESSION_COCOA_ADDITIONS_2)
    1216             return appBoundSession(storedCredentialsPolicy);
    1217     }
     1213    if (isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::Yes)
     1214        return appBoundSession(storedCredentialsPolicy);
    12181215
    12191216    switch (storedCredentialsPolicy) {
  • branches/safari-610.1.9-branch/Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp

    r259756 r259757  
    3939#include <WebKitAdditions/HTTPCookieStoreAdditions.h>
    4040#else
    41 #define IN_APP_BROWSER_PRIVACY_ENABLED false
    42 #define IMPLEMENT_IN_APP_BROWSER_PRIVACY_ENABLED
     41#define IMPLEMENT_IN_APP_BROWSER_PRIVACY_ENABLED false
    4342#endif
    4443
     
    6766    Vector<WebCore::Cookie> appBoundCookies;
    6867#if PLATFORM(IOS_FAMILY)
    69     m_owningDataStore->getAppBoundDomains([this, protectedThis = makeRef(*this), cookies, appBoundCookies = WTFMove(appBoundCookies), completionHandler = WTFMove(completionHandler)] (auto& domains) mutable {
    70         if (m_owningDataStore->parameters().networkSessionParameters.isInAppBrowserPrivacyEnabled || IN_APP_BROWSER_PRIVACY_ENABLED) {
    71             IMPLEMENT_IN_APP_BROWSER_PRIVACY_ENABLED
     68    m_owningDataStore->getAppBoundDomains([cookies, appBoundCookies = WTFMove(appBoundCookies), completionHandler = WTFMove(completionHandler)] (auto& domains) mutable {
     69        if (!domains.isEmpty() && IMPLEMENT_IN_APP_BROWSER_PRIVACY_ENABLED) {
    7270            for (auto& cookie : cookies) {
    7371                if (domains.contains(WebCore::RegistrableDomain::uncheckedCreateFromHost(cookie.domain)))
  • branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebPageProxy.cpp

    r259756 r259757  
    282282#include <WebKitAdditions/WebPageProxyAdditions.h>
    283283#else
    284 #define WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN
    285 #define WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN_2 false
     284#define WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN true
    286285#endif
    287286
     
    31203119};
    31213120
    3122 void WebPageProxy::setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL& requestURL, NavigatingToAppBoundDomain isNavigatingToAppBoundDomain)
     3121void WebPageProxy::setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL& requestURL, Optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain)
    31233122{
    31243123#if PLATFORM(IOS_FAMILY)
    3125     if (isMainFrame && (m_preferences->isInAppBrowserPrivacyEnabled() || WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN_2)) {
     3124    if (isMainFrame) {
     3125        if (WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN)
     3126            return;
     3127        if (!isNavigatingToAppBoundDomain) {
     3128            m_isNavigatingToAppBoundDomain = NavigatingToAppBoundDomain::Yes;
     3129            return;
     3130        }
    31263131        if (m_ignoresAppBoundDomains)
    31273132            return;
    3128         WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN
    3129         if (isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::No) {
     3133        if (*isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::No) {
    31303134            m_configuration->setWebViewCategory(WebViewCategory::InAppBrowser);
    31313135            m_isNavigatingToAppBoundDomain = NavigatingToAppBoundDomain::No;
     
    51065110    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 {
    51075111
    5108         if (policyAction != PolicyAction::Ignore && isAppBoundDomain)
    5109             setIsNavigatingToAppBoundDomain(frame->isMainFrame(), navigation->currentRequest().url(), *isAppBoundDomain);
     5112        if (policyAction != PolicyAction::Ignore)
     5113            setIsNavigatingToAppBoundDomain(frame->isMainFrame(), navigation->currentRequest().url(), isAppBoundDomain);
    51105114
    51115115        auto completionHandler = [this, protectedThis = protectedThis.copyRef(), frame = frame.copyRef(), sender = WTFMove(sender), navigation, processSwapRequestedByClient, policies = makeRefPtr(policies)] (PolicyAction policyAction) mutable {
  • branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebPageProxy.h

    r259756 r259757  
    22832283    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)>&&);
    22842284       
    2285     void setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL&, NavigatingToAppBoundDomain);
     2285    void setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL&, Optional<NavigatingToAppBoundDomain>);
    22862286    NavigatedAwayFromAppBoundDomain hasNavigatedAwayFromAppBoundDomain() const { return m_hasNavigatedAwayFromAppBoundDomain; }
    22872287       
  • branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm

    r259756 r259757  
    404404    static const auto maxAppBoundDomainCount = 10;
    405405   
    406     appBoundDomainQueue().dispatch([forceReinitialization] () mutable {
     406    appBoundDomainQueue().dispatch([isInAppBrowserPrivacyEnabled = parameters().networkSessionParameters.isInAppBrowserPrivacyEnabled, forceReinitialization] () mutable {
    407407        if (hasInitializedAppBoundDomains && forceReinitialization != ForceReinitialization::Yes)
    408408            return;
     
    410410        NSArray<NSString *> *domains = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"WKAppBoundDomains"];
    411411       
    412         RunLoop::main().dispatch([forceReinitialization , domains = retainPtr(domains)] {
     412        RunLoop::main().dispatch([isInAppBrowserPrivacyEnabled, forceReinitialization, domains = retainPtr(domains)] {
    413413            if (forceReinitialization == ForceReinitialization::Yes)
    414414                appBoundDomains().clear();
     
    427427                    break;
    428428            }
    429             WEBSITE_DATA_STORE_ADDITIONS
     429            if (isInAppBrowserPrivacyEnabled)
     430                WEBSITE_DATA_STORE_ADDITIONS
    430431            hasInitializedAppBoundDomains = true;
    431432        });
  • branches/safari-610.1.9-branch/Tools/ChangeLog

    r259756 r259757  
     12020-04-08  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r259731. rdar://problem/61360282
     4
     5    Return app-bound sessions for instances where WKAppBoundDomains is
     6    empty
     7    https://bugs.webkit.org/show_bug.cgi?id=210124
     8    <rdar://problem/61276630>
     9   
     10    Reviewed by Brent Fulgham.
     11   
     12    Source/WebKit:
     13   
     14    No new tests. Behavior confirmed by existing In-App Browser Privacy
     15    tests.
     16   
     17    * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
     18    (WebKit::NetworkSessionCocoa::sessionWrapperForTask):
     19    Remove the flag checking if In-App Browser Privacy is enabled. We
     20    should return an app-bound session if WKAppBoundDomains is empty so
     21    we no longer need to check the flag here.
     22   
     23    * UIProcess/WebPageProxy.cpp:
     24    (WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
     25    (WebKit::WebPageProxy::decidePolicyForNavigationAction):
     26    * UIProcess/WebPageProxy.h:
     27    As described above, we no longer need to check the flag in this
     28    instance as we are determining behavior based on the WKAppBoundDomains
     29    list. Also moved the logic for checking an empty list to setIsNavigatingToAppBoundDomain,
     30    so it should take an Optional (WTF::nullopt indicates an empty list).
     31   
     32    * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
     33    (WebKit::WebsiteDataStore::initializeAppBoundDomains):
     34    Use the flag to enable internal debugging for testing purposes.
     35   
     36    * UIProcess/API/APIHTTPCookieStore.cpp:
     37    (API::HTTPCookieStore::filterAppBoundCookies):
     38    Flag no longer needed. This should be gated by whether the domains
     39    list is empty or not.
     40   
     41    Tools:
     42   
     43    Clean up test settings between tests.
     44   
     45    * TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
     46    (cleanUpInAppBrowserPrivacyTestSettings):
     47   
     48   
     49    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     50
     51    2020-04-08  Kate Cheney  <katherine_cheney@apple.com>
     52
     53            Return app-bound sessions for instances where WKAppBoundDomains is
     54            empty
     55            https://bugs.webkit.org/show_bug.cgi?id=210124
     56            <rdar://problem/61276630>
     57
     58            Reviewed by Brent Fulgham.
     59
     60            Clean up test settings between tests.
     61
     62            * TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
     63            (cleanUpInAppBrowserPrivacyTestSettings):
     64
    1652020-04-08  Alan Coon  <alancoon@apple.com>
    266
  • branches/safari-610.1.9-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm

    r259756 r259757  
    8282static void cleanUpInAppBrowserPrivacyTestSettings()
    8383{
     84    WebCore::clearApplicationBundleIdentifierTestingOverride();
    8485    IN_APP_BROWSER_PRIVACY_ADDITIONS_2
    8586}
Note: See TracChangeset for help on using the changeset viewer.