Changeset 259675 in webkit


Ignore:
Timestamp:
Apr 7, 2020 3:27:35 PM (4 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, reverting r259655.

Caused assertion failures and timeouts on iOS bots

Reverted changeset:

"Return app-bound sessions for instances where
WKAppBoundDomains is"
https://bugs.webkit.org/show_bug.cgi?id=210124
https://trac.webkit.org/changeset/259655

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r259674 r259675  
     12020-04-07  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, reverting r259655.
     4
     5        Caused assertion failures and timeouts on iOS bots
     6
     7        Reverted changeset:
     8
     9        "Return app-bound sessions for instances where
     10        WKAppBoundDomains is"
     11        https://bugs.webkit.org/show_bug.cgi?id=210124
     12        https://trac.webkit.org/changeset/259655
     13
    1142020-04-07  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm

    r259655 r259675  
    6464#else
    6565#define NETWORK_SESSION_COCOA_ADDITIONS_1
     66#define NETWORK_SESSION_COCOA_ADDITIONS_2 false
    6667#endif
    6768
     
    12111212#endif
    12121213
    1213     if (isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::Yes)
    1214         return appBoundSession(storedCredentialsPolicy);
     1214    if (isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::Yes) {
     1215        if (m_isInAppBrowserPrivacyEnabled || NETWORK_SESSION_COCOA_ADDITIONS_2)
     1216            return appBoundSession(storedCredentialsPolicy);
     1217    }
    12151218
    12161219    switch (storedCredentialsPolicy) {
  • trunk/Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp

    r259655 r259675  
    3939#include <WebKitAdditions/HTTPCookieStoreAdditions.h>
    4040#else
     41#define IN_APP_BROWSER_PRIVACY_ENABLED false
    4142#define IMPLEMENT_IN_APP_BROWSER_PRIVACY_ENABLED
    4243#endif
     
    6667    Vector<WebCore::Cookie> appBoundCookies;
    6768#if PLATFORM(IOS_FAMILY)
    68     m_owningDataStore->getAppBoundDomains([cookies, appBoundCookies = WTFMove(appBoundCookies), completionHandler = WTFMove(completionHandler)] (auto& domains) mutable {
    69         if (!domains.isEmpty()) {
     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) {
    7071            IMPLEMENT_IN_APP_BROWSER_PRIVACY_ENABLED
    7172            for (auto& cookie : cookies) {
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r259655 r259675  
    283283#else
    284284#define WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN
     285#define WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN_2 false
    285286#endif
    286287
     
    31193120};
    31203121
    3121 void WebPageProxy::setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL& requestURL, Optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain)
     3122void WebPageProxy::setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL& requestURL, NavigatingToAppBoundDomain isNavigatingToAppBoundDomain)
    31223123{
    31233124#if PLATFORM(IOS_FAMILY)
    3124     if (isMainFrame) {
    3125         WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN
    3126         if (!isNavigatingToAppBoundDomain) {
    3127             m_isNavigatingToAppBoundDomain = NavigatingToAppBoundDomain::Yes;
    3128             return;
    3129         }
     3125    if (isMainFrame && (m_preferences->isInAppBrowserPrivacyEnabled() || WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN_2)) {
    31303126        if (m_ignoresAppBoundDomains)
    31313127            return;
    3132         if (*isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::No) {
     3128        WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN
     3129        if (isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::No) {
    31333130            m_configuration->setWebViewCategory(WebViewCategory::InAppBrowser);
    31343131            m_isNavigatingToAppBoundDomain = NavigatingToAppBoundDomain::No;
     
    51095106    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 {
    51105107
    5111         if (policyAction != PolicyAction::Ignore)
    5112             setIsNavigatingToAppBoundDomain(frame->isMainFrame(), navigation->currentRequest().url(), isAppBoundDomain);
     5108        if (policyAction != PolicyAction::Ignore && isAppBoundDomain)
     5109            setIsNavigatingToAppBoundDomain(frame->isMainFrame(), navigation->currentRequest().url(), *isAppBoundDomain);
    51135110
    51145111        auto completionHandler = [this, protectedThis = protectedThis.copyRef(), frame = frame.copyRef(), sender = WTFMove(sender), navigation, processSwapRequestedByClient, policies = makeRefPtr(policies)] (PolicyAction policyAction) mutable {
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r259655 r259675  
    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&, Optional<NavigatingToAppBoundDomain>);
     2285    void setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL&, NavigatingToAppBoundDomain);
    22862286    NavigatedAwayFromAppBoundDomain hasNavigatedAwayFromAppBoundDomain() const { return m_hasNavigatedAwayFromAppBoundDomain; }
    22872287       
  • trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm

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

    r259671 r259675  
     12020-04-07  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, reverting r259655.
     4
     5        Caused assertion failures and timeouts on iOS bots
     6
     7        Reverted changeset:
     8
     9        "Return app-bound sessions for instances where
     10        WKAppBoundDomains is"
     11        https://bugs.webkit.org/show_bug.cgi?id=210124
     12        https://trac.webkit.org/changeset/259655
     13
    1142020-04-07  Joanmarie Diggs  <jdiggs@igalia.com>
    215
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm

    r259655 r259675  
    8282static void cleanUpInAppBrowserPrivacyTestSettings()
    8383{
    84     [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
    8584    IN_APP_BROWSER_PRIVACY_ADDITIONS_2
    8685}
     
    8887static void initializeInAppBrowserPrivacyTestSettings()
    8988{
    90     [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
    9189    RunLoop::initializeMainRunLoop();
    9290    WebCore::clearApplicationBundleIdentifierTestingOverride();
     
    539537{
    540538    initializeInAppBrowserPrivacyTestSettings();
     539    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
    541540
    542541    auto dataStore = [WKWebsiteDataStore defaultDataStore];
     
    583582
    584583    cleanUpInAppBrowserPrivacyTestSettings();
     584    [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
    585585    gotFlag = false;
    586586
     
    608608    // Since we can't set non-app-bound cookies with In-App Browser privacy protections on,
    609609    // we can turn the protections off to set a cookie we will then try to get with protections enabled.
    610     cleanUpInAppBrowserPrivacyTestSettings();
     610    [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
    611611
    612612    setUpCookieTest();
     
    659659
    660660    // Now enable protections and ensure we can only retrieve the app-bound cookies.
     661    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
    661662    initializeInAppBrowserPrivacyTestSettings();
    662663
     
    683684    [globalCookieStore deleteCookie:appBoundCookie.get() completionHandler:[]() {
    684685        // Reset flag.
     686        [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
    685687        cleanUpInAppBrowserPrivacyTestSettings();
    686688        gotFlag = true;
     
    694696    // Since we can't set non-app-bound cookies with In-App Browser privacy protections on,
    695697    // we can turn the protections off to set a cookie we will then try to get with protections enabled.
    696     cleanUpInAppBrowserPrivacyTestSettings();
     698    [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
    697699    setUpCookieTest();
    698700
     
    719721
    720722            // Now enable protections and ensure we can only retrieve the app-bound cookies.
     723            [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
    721724            initializeInAppBrowserPrivacyTestSettings();
    722725
     
    728731                    [globalCookieStore deleteCookie:nonAppBoundCookie completionHandler:^{
    729732                        [globalCookieStore deleteCookie:appBoundCookie completionHandler:^{
     733                            [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];
    730734                            cleanUpInAppBrowserPrivacyTestSettings();
    731735                            done = true;
Note: See TracChangeset for help on using the changeset viewer.