Changeset 259675 in webkit
- Timestamp:
- Apr 7, 2020 3:27:35 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r259674 r259675 1 2020-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 1 14 2020-04-07 Chris Dumez <cdumez@apple.com> 2 15 -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
r259655 r259675 64 64 #else 65 65 #define NETWORK_SESSION_COCOA_ADDITIONS_1 66 #define NETWORK_SESSION_COCOA_ADDITIONS_2 false 66 67 #endif 67 68 … … 1211 1212 #endif 1212 1213 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 } 1215 1218 1216 1219 switch (storedCredentialsPolicy) { -
trunk/Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp
r259655 r259675 39 39 #include <WebKitAdditions/HTTPCookieStoreAdditions.h> 40 40 #else 41 #define IN_APP_BROWSER_PRIVACY_ENABLED false 41 42 #define IMPLEMENT_IN_APP_BROWSER_PRIVACY_ENABLED 42 43 #endif … … 66 67 Vector<WebCore::Cookie> appBoundCookies; 67 68 #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) { 70 71 IMPLEMENT_IN_APP_BROWSER_PRIVACY_ENABLED 71 72 for (auto& cookie : cookies) { -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r259655 r259675 283 283 #else 284 284 #define WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN 285 #define WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN_2 false 285 286 #endif 286 287 … … 3119 3120 }; 3120 3121 3121 void WebPageProxy::setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL& requestURL, Optional<NavigatingToAppBoundDomain>isNavigatingToAppBoundDomain)3122 void WebPageProxy::setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL& requestURL, NavigatingToAppBoundDomain isNavigatingToAppBoundDomain) 3122 3123 { 3123 3124 #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)) { 3130 3126 if (m_ignoresAppBoundDomains) 3131 3127 return; 3132 if (*isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::No) { 3128 WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN 3129 if (isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::No) { 3133 3130 m_configuration->setWebViewCategory(WebViewCategory::InAppBrowser); 3134 3131 m_isNavigatingToAppBoundDomain = NavigatingToAppBoundDomain::No; … … 5109 5106 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 { 5110 5107 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); 5113 5110 5114 5111 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 2283 2283 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)>&&); 2284 2284 2285 void setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL&, Optional<NavigatingToAppBoundDomain>);2285 void setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL&, NavigatingToAppBoundDomain); 2286 2286 NavigatedAwayFromAppBoundDomain hasNavigatedAwayFromAppBoundDomain() const { return m_hasNavigatedAwayFromAppBoundDomain; } 2287 2287 -
trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
r259655 r259675 404 404 static const auto maxAppBoundDomainCount = 10; 405 405 406 appBoundDomainQueue().dispatch([ isInAppBrowserPrivacyEnabled = parameters().networkSessionParameters.isInAppBrowserPrivacyEnabled,forceReinitialization] () mutable {406 appBoundDomainQueue().dispatch([forceReinitialization] () mutable { 407 407 if (hasInitializedAppBoundDomains && forceReinitialization != ForceReinitialization::Yes) 408 408 return; … … 410 410 NSArray<NSString *> *domains = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"WKAppBoundDomains"]; 411 411 412 RunLoop::main().dispatch([ isInAppBrowserPrivacyEnabled, forceReinitialization, domains = retainPtr(domains)] {412 RunLoop::main().dispatch([forceReinitialization , domains = retainPtr(domains)] { 413 413 if (forceReinitialization == ForceReinitialization::Yes) 414 414 appBoundDomains().clear(); … … 427 427 break; 428 428 } 429 if (isInAppBrowserPrivacyEnabled) 430 WEBSITE_DATA_STORE_ADDITIONS 429 WEBSITE_DATA_STORE_ADDITIONS 431 430 hasInitializedAppBoundDomains = true; 432 431 }); -
trunk/Tools/ChangeLog
r259671 r259675 1 2020-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 1 14 2020-04-07 Joanmarie Diggs <jdiggs@igalia.com> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm
r259655 r259675 82 82 static void cleanUpInAppBrowserPrivacyTestSettings() 83 83 { 84 [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];85 84 IN_APP_BROWSER_PRIVACY_ADDITIONS_2 86 85 } … … 88 87 static void initializeInAppBrowserPrivacyTestSettings() 89 88 { 90 [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"];91 89 RunLoop::initializeMainRunLoop(); 92 90 WebCore::clearApplicationBundleIdentifierTestingOverride(); … … 539 537 { 540 538 initializeInAppBrowserPrivacyTestSettings(); 539 [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"]; 541 540 542 541 auto dataStore = [WKWebsiteDataStore defaultDataStore]; … … 583 582 584 583 cleanUpInAppBrowserPrivacyTestSettings(); 584 [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"]; 585 585 gotFlag = false; 586 586 … … 608 608 // Since we can't set non-app-bound cookies with In-App Browser privacy protections on, 609 609 // 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"]; 611 611 612 612 setUpCookieTest(); … … 659 659 660 660 // Now enable protections and ensure we can only retrieve the app-bound cookies. 661 [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"]; 661 662 initializeInAppBrowserPrivacyTestSettings(); 662 663 … … 683 684 [globalCookieStore deleteCookie:appBoundCookie.get() completionHandler:[]() { 684 685 // Reset flag. 686 [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"]; 685 687 cleanUpInAppBrowserPrivacyTestSettings(); 686 688 gotFlag = true; … … 694 696 // Since we can't set non-app-bound cookies with In-App Browser privacy protections on, 695 697 // 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"]; 697 699 setUpCookieTest(); 698 700 … … 719 721 720 722 // Now enable protections and ensure we can only retrieve the app-bound cookies. 723 [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"]; 721 724 initializeInAppBrowserPrivacyTestSettings(); 722 725 … … 728 731 [globalCookieStore deleteCookie:nonAppBoundCookie completionHandler:^{ 729 732 [globalCookieStore deleteCookie:appBoundCookie completionHandler:^{ 733 [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"WebKitDebugIsInAppBrowserPrivacyEnabled"]; 730 734 cleanUpInAppBrowserPrivacyTestSettings(); 731 735 done = true;
Note: See TracChangeset
for help on using the changeset viewer.