Changeset 259757 in webkit
- Timestamp:
- Apr 8, 2020, 2:41:32 PM (6 years ago)
- Location:
- branches/safari-610.1.9-branch
- Files:
-
- 8 edited
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (modified) (2 diffs)
-
Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp (modified) (2 diffs)
-
Source/WebKit/UIProcess/WebPageProxy.cpp (modified) (3 diffs)
-
Source/WebKit/UIProcess/WebPageProxy.h (modified) (1 diff)
-
Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (modified) (3 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-610.1.9-branch/Source/WebKit/ChangeLog
r259756 r259757 1 2020-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 1 87 2020-04-08 Alan Coon <alancoon@apple.com> 2 88 -
branches/safari-610.1.9-branch/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
r259756 r259757 64 64 #else 65 65 #define NETWORK_SESSION_COCOA_ADDITIONS_1 66 #define NETWORK_SESSION_COCOA_ADDITIONS_2 false67 66 #endif 68 67 … … 1212 1211 #endif 1213 1212 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); 1218 1215 1219 1216 switch (storedCredentialsPolicy) { -
branches/safari-610.1.9-branch/Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp
r259756 r259757 39 39 #include <WebKitAdditions/HTTPCookieStoreAdditions.h> 40 40 #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 43 42 #endif 44 43 … … 67 66 Vector<WebCore::Cookie> appBoundCookies; 68 67 #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) { 72 70 for (auto& cookie : cookies) { 73 71 if (domains.contains(WebCore::RegistrableDomain::uncheckedCreateFromHost(cookie.domain))) -
branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebPageProxy.cpp
r259756 r259757 282 282 #include <WebKitAdditions/WebPageProxyAdditions.h> 283 283 #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 286 285 #endif 287 286 … … 3120 3119 }; 3121 3120 3122 void WebPageProxy::setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL& requestURL, NavigatingToAppBoundDomainisNavigatingToAppBoundDomain)3121 void WebPageProxy::setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL& requestURL, Optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain) 3123 3122 { 3124 3123 #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 } 3126 3131 if (m_ignoresAppBoundDomains) 3127 3132 return; 3128 WEB_PAGE_PROXY_ADDITIONS_SETISNAVIGATINGTOAPPBOUNDDOMAIN 3129 if (isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::No) { 3133 if (*isNavigatingToAppBoundDomain == NavigatingToAppBoundDomain::No) { 3130 3134 m_configuration->setWebViewCategory(WebViewCategory::InAppBrowser); 3131 3135 m_isNavigatingToAppBoundDomain = NavigatingToAppBoundDomain::No; … … 5106 5110 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 { 5107 5111 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); 5110 5114 5111 5115 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 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&, NavigatingToAppBoundDomain);2285 void setIsNavigatingToAppBoundDomain(bool isMainFrame, const URL&, Optional<NavigatingToAppBoundDomain>); 2286 2286 NavigatedAwayFromAppBoundDomain hasNavigatedAwayFromAppBoundDomain() const { return m_hasNavigatedAwayFromAppBoundDomain; } 2287 2287 -
branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
r259756 r259757 404 404 static const auto maxAppBoundDomainCount = 10; 405 405 406 appBoundDomainQueue().dispatch([ forceReinitialization] () mutable {406 appBoundDomainQueue().dispatch([isInAppBrowserPrivacyEnabled = parameters().networkSessionParameters.isInAppBrowserPrivacyEnabled, 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([ forceReinitialization, domains = retainPtr(domains)] {412 RunLoop::main().dispatch([isInAppBrowserPrivacyEnabled, forceReinitialization, domains = retainPtr(domains)] { 413 413 if (forceReinitialization == ForceReinitialization::Yes) 414 414 appBoundDomains().clear(); … … 427 427 break; 428 428 } 429 WEBSITE_DATA_STORE_ADDITIONS 429 if (isInAppBrowserPrivacyEnabled) 430 WEBSITE_DATA_STORE_ADDITIONS 430 431 hasInitializedAppBoundDomains = true; 431 432 }); -
branches/safari-610.1.9-branch/Tools/ChangeLog
r259756 r259757 1 2020-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 1 65 2020-04-08 Alan Coon <alancoon@apple.com> 2 66 -
branches/safari-610.1.9-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm
r259756 r259757 82 82 static void cleanUpInAppBrowserPrivacyTestSettings() 83 83 { 84 WebCore::clearApplicationBundleIdentifierTestingOverride(); 84 85 IN_APP_BROWSER_PRIVACY_ADDITIONS_2 85 86 }
Note:
See TracChangeset
for help on using the changeset viewer.