Changeset 258884 in webkit
- Timestamp:
- Mar 23, 2020 4:00:50 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r258881 r258884 1 2020-03-23 John Wilander <wilander@apple.com> 2 3 Add the capability to change all of a website's cookies to SameSite=Strict 4 https://bugs.webkit.org/show_bug.cgi?id=209369 5 <rdar://problem/60710690> 6 7 Reviewed by Alex Christensen and David Kilzer. 8 9 * http/tests/resourceLoadStatistics/resources/set-all-kinds-of-cookies.php: Added. 10 * http/tests/resourceLoadStatistics/set-all-cookies-to-same-site-strict-expected.txt: Added. 11 * http/tests/resourceLoadStatistics/set-all-cookies-to-same-site-strict.html: Added. 12 * platform/ios/TestExpectations: 13 Marked http/tests/resourceLoadStatistics/set-all-cookies-to-same-site-strict.html 14 as Pass. 15 * platform/mac-wk2/TestExpectations: 16 Marked http/tests/resourceLoadStatistics/set-all-cookies-to-same-site-strict.html 17 as Pass for Catalina+. 18 * platform/wk2/TestExpectations: 19 Skipped http/tests/resourceLoadStatistics/set-all-cookies-to-same-site-strict.html 20 since it's only available on macOS Catalina and up and the functionality is not 21 implemented on non-Cocoa platforms. 22 1 23 2020-03-23 Jason Lawrence <lawrence.j@apple.com> 2 24 -
trunk/LayoutTests/platform/ios/TestExpectations
r258880 r258884 2739 2739 http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-third-party-redirects.html [ Pass ] 2740 2740 http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-third-party-requests.html [ Pass ] 2741 2742 # The SameSite cookie API is only available in macOS Catalina and above, and thus skipped for WK2 in general. 2743 http/tests/resourceLoadStatistics/set-all-cookies-to-same-site-strict.html [ Pass ] 2744 2741 2745 http/tests/storageAccess/deny-storage-access-under-opener.html [ Pass ] 2742 2746 http/tests/storageAccess/deny-storage-access-under-opener-if-auto-dismiss.html [ Pass ] -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r258813 r258884 740 740 [ HighSierra+ ] http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource.html [ Pass ] 741 741 742 # The SameSite cookie API is only available in macOS Catalina and above. 743 [ Catalina+ ] http/tests/resourceLoadStatistics/set-all-cookies-to-same-site-strict.html [ Pass ] 744 742 745 # Skipped in general expectations since they only work on iOS and Mac, WK2. 743 746 media/deactivate-audio-session.html [ Pass ] -
trunk/LayoutTests/platform/wk2/TestExpectations
r258150 r258884 733 733 http/tests/resourceLoadStatistics/prune-statistics.html [ Pass ] 734 734 http/tests/resourceLoadStatistics [ Pass ] 735 736 # The SameSite cookie API is only available in macOS Catalina and above. 737 http/tests/resourceLoadStatistics/set-all-cookies-to-same-site-strict.html [ Skip ] 738 735 739 http/tests/websocket/connection-refusal-in-frame-resource-load-statistics.html [ Pass ] 736 740 # These are only supported behind a compile time flag in macOS High Sierra + iOS 11, and above. -
trunk/Source/WTF/ChangeLog
r258869 r258884 1 2020-03-23 John Wilander <wilander@apple.com> 2 3 Add the capability to change all of a website's cookies to SameSite=Strict 4 https://bugs.webkit.org/show_bug.cgi?id=209369 5 <rdar://problem/60710690> 6 7 Reviewed by Alex Christensen and David Kilzer. 8 9 * wtf/PlatformHave.h: 10 Adds HAVE_CFNETWORK_SAMESITE_COOKIE_API for macOS Catalina and up, 11 iOS 13 and up, Catalyst, watchOS, and Apple TV. 12 1 13 2020-03-23 youenn fablet <youenn@apple.com> 2 14 -
trunk/Source/WTF/wtf/PlatformHave.h
r258772 r258884 445 445 #endif 446 446 447 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || PLATFORM(MACCATALYST) || PLATFORM(WATCHOS) || PLATFORM(APPLETV) 448 #define HAVE_CFNETWORK_SAMESITE_COOKIE_API 1 449 #endif 450 447 451 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101600) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) 448 452 #define HAVE_CFNETWORK_METRICS_APIS_V4 1 -
trunk/Source/WebCore/ChangeLog
r258883 r258884 1 2020-03-23 John Wilander <wilander@apple.com> 2 3 Add the capability to change all of a website's cookies to SameSite=Strict 4 https://bugs.webkit.org/show_bug.cgi?id=209369 5 <rdar://problem/60710690> 6 7 Reviewed by Alex Christensen and David Kilzer. 8 9 Test: http/tests/resourceLoadStatistics/set-all-cookies-to-same-site-strict.html 10 11 * platform/network/NetworkStorageSession.cpp: 12 (WebCore::NetworkStorageSession::setAllCookiesToSameSiteStrict): 13 Stub function for non-Cocoa platforms. 14 * platform/network/NetworkStorageSession.h: 15 * platform/network/cocoa/NetworkStorageSessionCocoa.mm: 16 (WebCore::NetworkStorageSession::setAllCookiesToSameSiteStrict): 17 * testing/Internals.h: 18 Added code to expose SameSite=None and path properties of cookies. 19 However, they don't seem to carry over so I'll have to revisit the 20 internal workings. 21 1 22 2020-03-23 Michael Catanzaro <mcatanzaro@gnome.org> 2 23 -
trunk/Source/WebCore/platform/network/NetworkStorageSession.cpp
r258448 r258884 89 89 } 90 90 91 #if !PLATFORM(COCOA) 92 void NetworkStorageSession::setAllCookiesToSameSiteStrict(const RegistrableDomain&, CompletionHandler<void()>&& completionHandler) 93 { 94 // Not implemented. 95 completionHandler(); 96 } 97 #endif 98 91 99 bool NetworkStorageSession::hasHadUserInteractionAsFirstParty(const RegistrableDomain& registrableDomain) const 92 100 { -
trunk/Source/WebCore/platform/network/NetworkStorageSession.h
r258448 r258884 178 178 WEBCORE_EXPORT bool shouldBlockThirdPartyCookies(const RegistrableDomain&) const; 179 179 WEBCORE_EXPORT bool shouldBlockThirdPartyCookiesButKeepFirstPartyCookiesFor(const RegistrableDomain&) const; 180 WEBCORE_EXPORT void setAllCookiesToSameSiteStrict(const RegistrableDomain&, CompletionHandler<void()>&&); 180 181 WEBCORE_EXPORT bool hasHadUserInteractionAsFirstParty(const RegistrableDomain&) const; 181 182 WEBCORE_EXPORT void setPrevalentDomainsToBlockAndDeleteCookiesFor(const Vector<RegistrableDomain>&); -
trunk/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm
r257888 r258884 115 115 116 116 completionHandler(false); 117 } 118 119 void NetworkStorageSession::setAllCookiesToSameSiteStrict(const RegistrableDomain& domain, CompletionHandler<void()>&& completionHandler) 120 { 121 ASSERT(hasProcessPrivilege(ProcessPrivilege::CanAccessRawCookies)); 122 123 #if HAVE(CFNETWORK_SAMESITE_COOKIE_API) 124 RetainPtr<NSMutableArray<NSHTTPCookie *>> oldCookiesToDelete = adoptNS([[NSMutableArray alloc] init]); 125 RetainPtr<NSMutableArray<NSHTTPCookie *>> newCookiesToAdd = adoptNS([[NSMutableArray alloc] init]); 126 127 for (NSHTTPCookie *nsCookie in nsCookieStorage().cookies) { 128 if (RegistrableDomain::uncheckedCreateFromHost(nsCookie.domain) == domain && nsCookie.sameSitePolicy != NSHTTPCookieSameSiteStrict) { 129 [oldCookiesToDelete addObject:nsCookie]; 130 RetainPtr<NSMutableDictionary<NSHTTPCookiePropertyKey, id>> mutableProperties = adoptNS([[nsCookie properties] mutableCopy]); 131 mutableProperties.get()[NSHTTPCookieSameSitePolicy] = NSHTTPCookieSameSiteStrict; 132 NSHTTPCookie *strictCookie = [NSHTTPCookie cookieWithProperties:mutableProperties.get()]; 133 [newCookiesToAdd addObject:strictCookie]; 134 } 135 } 136 137 BEGIN_BLOCK_OBJC_EXCEPTIONS; 138 for (NSHTTPCookie *oldCookie in oldCookiesToDelete.get()) 139 deleteHTTPCookie(cookieStorage().get(), oldCookie); 140 141 for (NSHTTPCookie *newCookie in newCookiesToAdd.get()) 142 [nsCookieStorage() setCookie:newCookie]; 143 END_BLOCK_OBJC_EXCEPTIONS; 144 #else 145 UNUSED_PARAM(domain); 146 #endif 147 completionHandler(); 117 148 } 118 149 -
trunk/Source/WebCore/testing/Internals.h
r258826 r258884 849 849 String value; 850 850 String domain; 851 String path; 851 852 // Expiration dates are expressed as milliseconds since the UNIX epoch. 852 853 double expires { 0 }; … … 854 855 bool isSecure { false }; 855 856 bool isSession { false }; 857 bool isSameSiteNone { false }; 856 858 bool isSameSiteLax { false }; 857 859 bool isSameSiteStrict { false }; … … 861 863 , value(cookie.value) 862 864 , domain(cookie.domain) 865 , path(cookie.path) 863 866 , expires(cookie.expires.valueOr(0)) 864 867 , isHttpOnly(cookie.httpOnly) 865 868 , isSecure(cookie.secure) 866 869 , isSession(cookie.session) 870 , isSameSiteNone(cookie.sameSite == Cookie::SameSitePolicy::None) 867 871 , isSameSiteLax(cookie.sameSite == Cookie::SameSitePolicy::Lax) 868 872 , isSameSiteStrict(cookie.sameSite == Cookie::SameSitePolicy::Strict) 869 873 { 870 ASSERT(!(isSameSiteLax && isSameSiteStrict) );874 ASSERT(!(isSameSiteLax && isSameSiteStrict) && !(isSameSiteLax && isSameSiteNone) && !(isSameSiteStrict && isSameSiteNone)); 871 875 } 872 876 -
trunk/Source/WebKit/ChangeLog
r258873 r258884 1 2020-03-23 John Wilander <wilander@apple.com> 2 3 Add the capability to change all of a website's cookies to SameSite=Strict 4 https://bugs.webkit.org/show_bug.cgi?id=209369 5 <rdar://problem/60710690> 6 7 Reviewed by Alex Christensen and David Kilzer. 8 9 These changes add test infrastructure to run function 10 WebCore::NetworkStorageSession::setAllCookiesToSameSiteStrict() in the 11 network process. 12 13 * NetworkProcess/NetworkProcess.cpp: 14 (WebKit::NetworkProcess::setToSameSiteStrictCookiesForTesting): 15 * NetworkProcess/NetworkProcess.h: 16 * NetworkProcess/NetworkProcess.messages.in: 17 * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: 18 (WKWebsiteDataStoreSetResourceLoadStatisticsToSameSiteStrictCookiesForTesting): 19 * UIProcess/API/C/WKWebsiteDataStoreRef.h: 20 * UIProcess/Network/NetworkProcessProxy.cpp: 21 (WebKit::NetworkProcessProxy::setToSameSiteStrictCookiesForTesting): 22 * UIProcess/Network/NetworkProcessProxy.h: 23 * UIProcess/WebsiteData/WebsiteDataStore.cpp: 24 (WebKit::WebsiteDataStore::setResourceLoadStatisticsToSameSiteStrictCookiesForTesting): 25 * UIProcess/WebsiteData/WebsiteDataStore.h: 26 1 27 2020-03-23 Daniel Bates <dabates@apple.com> 2 28 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp
r258862 r258884 1307 1307 } 1308 1308 } 1309 1310 void NetworkProcess::setToSameSiteStrictCookiesForTesting(PAL::SessionID sessionID, const WebCore::RegistrableDomain& domain, CompletionHandler<void()>&& completionHandler) 1311 { 1312 if (auto* networkStorageSession = storageSession(sessionID)) 1313 networkStorageSession->setAllCookiesToSameSiteStrict(domain, WTFMove(completionHandler)); 1314 else { 1315 ASSERT_NOT_REACHED(); 1316 completionHandler(); 1317 } 1318 } 1309 1319 #endif // ENABLE(RESOURCE_LOAD_STATISTICS) 1310 1320 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.h
r258862 r258884 266 266 void setShouldBlockThirdPartyCookiesForTesting(PAL::SessionID, WebCore::ThirdPartyCookieBlockingMode, CompletionHandler<void()>&&); 267 267 void setFirstPartyWebsiteDataRemovalModeForTesting(PAL::SessionID, WebCore::FirstPartyWebsiteDataRemovalMode, CompletionHandler<void()>&&); 268 void setToSameSiteStrictCookiesForTesting(PAL::SessionID, const WebCore::RegistrableDomain&, CompletionHandler<void()>&&); 268 269 #endif 269 270 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
r258862 r258884 143 143 SetShouldBlockThirdPartyCookiesForTesting(PAL::SessionID sessionID, enum:uint8_t WebCore::ThirdPartyCookieBlockingMode blockingMode) -> () Async 144 144 SetFirstPartyWebsiteDataRemovalModeForTesting(PAL::SessionID sessionID, enum:uint8_t WebCore::FirstPartyWebsiteDataRemovalMode mode) -> () Async 145 SetToSameSiteStrictCookiesForTesting(PAL::SessionID sessionID, WebCore::RegistrableDomain domain) -> () Async 145 146 #endif 146 147 -
trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp
r258436 r258884 583 583 } 584 584 585 void WKWebsiteDataStoreSetResourceLoadStatisticsToSameSiteStrictCookiesForTesting(WKWebsiteDataStoreRef dataStoreRef, WKStringRef hostName, void* context, WKWebsiteDataStoreSetResourceLoadStatisticsToSameSiteStrictCookiesForTestingFunction completionHandler) 586 { 587 #if ENABLE(RESOURCE_LOAD_STATISTICS) 588 WebKit::toImpl(dataStoreRef)->setResourceLoadStatisticsToSameSiteStrictCookiesForTesting(URL(URL(), WebKit::toImpl(hostName)->string()), [context, completionHandler] { 589 completionHandler(context); 590 }); 591 #else 592 completionHandler(context); 593 #endif 594 } 595 585 596 void WKWebsiteDataStoreStatisticsResetToConsistentState(WKWebsiteDataStoreRef dataStoreRef, void* context, WKWebsiteDataStoreStatisticsResetToConsistentStateFunction completionHandler) 586 597 { -
trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.h
r258436 r258884 128 128 typedef void (*WKWebsiteDataStoreSetResourceLoadStatisticsFirstPartyWebsiteDataRemovalModeForTestingFunction)(void* functionContext); 129 129 WK_EXPORT void WKWebsiteDataStoreSetResourceLoadStatisticsFirstPartyWebsiteDataRemovalModeForTesting(WKWebsiteDataStoreRef dataStoreRef, bool enabled, void* context, WKWebsiteDataStoreSetResourceLoadStatisticsFirstPartyWebsiteDataRemovalModeForTestingFunction completionHandler); 130 typedef void (*WKWebsiteDataStoreSetResourceLoadStatisticsToSameSiteStrictCookiesForTestingFunction)(void* functionContext); 131 WK_EXPORT void WKWebsiteDataStoreSetResourceLoadStatisticsToSameSiteStrictCookiesForTesting(WKWebsiteDataStoreRef dataStoreRef, WKStringRef hostName, void* context, WKWebsiteDataStoreSetResourceLoadStatisticsToSameSiteStrictCookiesForTestingFunction completionHandler); 130 132 typedef void (*WKWebsiteDataStoreStatisticsResetToConsistentStateFunction)(void* functionContext); 131 133 WK_EXPORT void WKWebsiteDataStoreStatisticsResetToConsistentState(WKWebsiteDataStoreRef dataStoreRef, void* context, WKWebsiteDataStoreStatisticsResetToConsistentStateFunction completionHandler); -
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
r258862 r258884 1171 1171 sendWithAsyncReply(Messages::NetworkProcess::SetFirstPartyWebsiteDataRemovalModeForTesting(sessionID, mode), WTFMove(completionHandler)); 1172 1172 } 1173 1174 void NetworkProcessProxy::setToSameSiteStrictCookiesForTesting(PAL::SessionID sessionID, const RegistrableDomain& domain, CompletionHandler<void()>&& completionHandler) 1175 { 1176 if (!canSendMessage()) { 1177 completionHandler(); 1178 return; 1179 } 1180 1181 sendWithAsyncReply(Messages::NetworkProcess::SetToSameSiteStrictCookiesForTesting(sessionID, domain), WTFMove(completionHandler)); 1182 } 1173 1183 #endif // ENABLE(RESOURCE_LOAD_STATISTICS) 1174 1184 -
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h
r258862 r258884 176 176 void setShouldBlockThirdPartyCookiesForTesting(PAL::SessionID, WebCore::ThirdPartyCookieBlockingMode, CompletionHandler<void()>&&); 177 177 void setFirstPartyWebsiteDataRemovalModeForTesting(PAL::SessionID, WebCore::FirstPartyWebsiteDataRemovalMode, CompletionHandler<void()>&&); 178 void setToSameSiteStrictCookiesForTesting(PAL::SessionID, const RegistrableDomain&, CompletionHandler<void()>&&); 178 179 #endif 179 180 -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
r258862 r258884 1858 1858 } 1859 1859 } 1860 1861 void WebsiteDataStore::setResourceLoadStatisticsToSameSiteStrictCookiesForTesting(const URL& url, CompletionHandler<void()>&& completionHandler) 1862 { 1863 auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); 1864 1865 for (auto& processPool : processPools()) { 1866 if (auto* networkProcess = processPool->networkProcess()) 1867 networkProcess->setToSameSiteStrictCookiesForTesting(m_sessionID, WebCore::RegistrableDomain { url }, [callbackAggregator = callbackAggregator.copyRef()] { }); 1868 } 1869 } 1860 1870 #endif // ENABLE(RESOURCE_LOAD_STATISTICS) 1861 1871 -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
r258862 r258884 197 197 void setResourceLoadStatisticsShouldBlockThirdPartyCookiesForTesting(bool enabled, bool onlyOnSitesWithoutUserInteraction, CompletionHandler<void()>&&); 198 198 void setResourceLoadStatisticsFirstPartyWebsiteDataRemovalModeForTesting(bool enabled, CompletionHandler<void()>&&); 199 void setResourceLoadStatisticsToSameSiteStrictCookiesForTesting(const URL&, CompletionHandler<void()>&&); 199 200 WebCore::ThirdPartyCookieBlockingMode thirdPartyCookieBlockingMode() const; 200 201 bool isItpStateExplicitlySet() const { return m_isItpStateExplicitlySet; } -
trunk/Tools/ChangeLog
r258879 r258884 1 2020-03-23 John Wilander <wilander@apple.com> 2 3 Add the capability to change all of a website's cookies to SameSite=Strict 4 https://bugs.webkit.org/show_bug.cgi?id=209369 5 <rdar://problem/60710690> 6 7 Reviewed by Alex Christensen and David Kilzer. 8 9 These changes add TestRunner function statisticsSetToSameSiteStrictCookies(). 10 11 * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: 12 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: 13 (WTR::InjectedBundle::didReceiveMessageToPage): 14 * WebKitTestRunner/InjectedBundle/TestRunner.cpp: 15 (WTR::TestRunner::statisticsSetToSameSiteStrictCookies): 16 (WTR::TestRunner::statisticsCallDidSetToSameSiteStrictCookiesCallback): 17 * WebKitTestRunner/InjectedBundle/TestRunner.h: 18 * WebKitTestRunner/TestController.cpp: 19 (WTR::TestController::setStatisticsToSameSiteStrictCookies): 20 * WebKitTestRunner/TestController.h: 21 * WebKitTestRunner/TestInvocation.cpp: 22 (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): 23 (WTR::TestInvocation::didSetToSameSiteStrictCookies): 24 * WebKitTestRunner/TestInvocation.h: 25 1 26 2020-03-23 Nikos Mouchtaris <nmouchtaris@apple.com> 2 27 -
trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
r258421 r258884 346 346 void setStatisticsShouldBlockThirdPartyCookies(boolean value, object callback, optional boolean onlyOnSitesWithoutUserInteraction); 347 347 void setStatisticsFirstPartyWebsiteDataRemovalMode(boolean value, object callback); 348 void statisticsSetToSameSiteStrictCookies(DOMString hostName, object callback); 348 349 void loadedThirdPartyDomains(object callback); 349 350 -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r258672 r258884 358 358 } 359 359 360 if (WKStringIsEqualToUTF8CString(messageName, "CallDidSetToSameSiteStrictCookies")) { 361 m_testRunner->statisticsCallDidSetToSameSiteStrictCookiesCallback(); 362 return; 363 } 364 360 365 if (WKStringIsEqualToUTF8CString(messageName, "CallDidResetStatisticsToConsistentState")) { 361 366 m_testRunner->statisticsCallDidResetToConsistentStateCallback(); -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
r258672 r258884 755 755 StatisticsDidSetShouldBlockThirdPartyCookiesCallbackID, 756 756 StatisticsDidSetFirstPartyWebsiteDataRemovalModeCallbackID, 757 StatisticsDidSetToSameSiteStrictCookiesCallbackID, 757 758 AllStorageAccessEntriesCallbackID, 758 759 LoadedThirdPartyDomainsCallbackID, … … 2287 2288 } 2288 2289 2290 void TestRunner::statisticsSetToSameSiteStrictCookies(JSStringRef hostName, JSValueRef completionHandler) 2291 { 2292 cacheTestRunnerCallback(StatisticsDidSetToSameSiteStrictCookiesCallbackID, completionHandler); 2293 2294 auto messageName = adoptWK(WKStringCreateWithUTF8CString("StatisticsSetToSameSiteStrictCookies")); 2295 auto messageBody = adoptWK(WKStringCreateWithJSString(hostName)); 2296 WKBundlePostMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get()); 2297 } 2298 2299 void TestRunner::statisticsCallDidSetToSameSiteStrictCookiesCallback() 2300 { 2301 callTestRunnerCallback(StatisticsDidSetToSameSiteStrictCookiesCallbackID); 2302 } 2303 2289 2304 void TestRunner::statisticsResetToConsistentState(JSValueRef completionHandler) 2290 2305 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
r258672 r258884 449 449 void setStatisticsFirstPartyWebsiteDataRemovalMode(bool value, JSValueRef callback); 450 450 void statisticsCallDidSetFirstPartyWebsiteDataRemovalModeCallback(); 451 void statisticsSetToSameSiteStrictCookies(JSStringRef hostName, JSValueRef callback); 452 void statisticsCallDidSetToSameSiteStrictCookiesCallback(); 451 453 void statisticsResetToConsistentState(JSValueRef completionHandler); 452 454 void statisticsCallDidResetToConsistentStateCallback(); -
trunk/Tools/WebKitTestRunner/TestController.cpp
r258672 r258884 3705 3705 } 3706 3706 3707 void TestController::setStatisticsToSameSiteStrictCookies(WKStringRef hostName) 3708 { 3709 ResourceStatisticsCallbackContext context(*this); 3710 WKWebsiteDataStoreSetResourceLoadStatisticsToSameSiteStrictCookiesForTesting(websiteDataStore(), hostName, &context, resourceStatisticsVoidResultCallback); 3711 runUntil(context.done, noTimeout); 3712 m_currentInvocation->didSetToSameSiteStrictCookies(); 3713 } 3714 3707 3715 void TestController::statisticsResetToConsistentState() 3708 3716 { -
trunk/Tools/WebKitTestRunner/TestController.h
r258436 r258884 263 263 void setStatisticsShouldBlockThirdPartyCookies(bool value, bool onlyOnSitesWithoutUserInteraction); 264 264 void setStatisticsFirstPartyWebsiteDataRemovalMode(bool value); 265 void setStatisticsToSameSiteStrictCookies(WKStringRef hostName); 265 266 void statisticsResetToConsistentState(); 266 267 -
trunk/Tools/WebKitTestRunner/TestInvocation.cpp
r258672 r258884 951 951 } 952 952 953 if (WKStringIsEqualToUTF8CString(messageName, "StatisticsSetToSameSiteStrictCookies")) { 954 ASSERT(WKGetTypeID(messageBody) == WKStringGetTypeID()); 955 WKStringRef hostName = static_cast<WKStringRef>(messageBody); 956 TestController::singleton().setStatisticsToSameSiteStrictCookies(hostName); 957 return; 958 } 959 953 960 if (WKStringIsEqualToUTF8CString(messageName, "StatisticsResetToConsistentState")) { 954 961 if (m_shouldDumpResourceLoadStatistics) … … 1917 1924 } 1918 1925 1926 void TestInvocation::didSetToSameSiteStrictCookies() 1927 { 1928 WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("CallDidSetToSameSiteStrictCookies")); 1929 WKPagePostMessageToInjectedBundle(TestController::singleton().mainWebView()->page(), messageName.get(), nullptr); 1930 } 1931 1919 1932 void TestInvocation::didResetStatisticsToConsistentState() 1920 1933 { -
trunk/Tools/WebKitTestRunner/TestInvocation.h
r258672 r258884 78 78 void didSetShouldBlockThirdPartyCookies(); 79 79 void didSetFirstPartyWebsiteDataRemovalMode(); 80 void didSetToSameSiteStrictCookies(); 80 81 void didResetStatisticsToConsistentState(); 81 82 void didSetBlockCookiesForHost();
Note: See TracChangeset
for help on using the changeset viewer.