Changeset 242288 in webkit
- Timestamp:
- Mar 1, 2019, 2:11:33 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 10 added
- 20 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site-expected.txt (added)
-
LayoutTests/http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site.html (added)
-
LayoutTests/http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource-expected.txt (added)
-
LayoutTests/http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource.html (added)
-
LayoutTests/http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource-expected.txt (added)
-
LayoutTests/http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource.html (added)
-
LayoutTests/http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource-expected.txt (added)
-
LayoutTests/http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource.html (added)
-
LayoutTests/http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource-expected.txt (added)
-
LayoutTests/http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource.html (added)
-
LayoutTests/http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js.html (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/network/NetworkStorageSession.cpp (modified) (3 diffs)
-
Source/WebCore/platform/network/NetworkStorageSession.h (modified) (3 diffs)
-
Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (modified) (1 diff)
-
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h (modified) (1 diff)
-
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in (modified) (1 diff)
-
Source/WebKit/NetworkProcess/NetworkProcess.cpp (modified) (1 diff)
-
Source/WebKit/NetworkProcess/NetworkProcess.h (modified) (1 diff)
-
Source/WebKit/NetworkProcess/NetworkProcess.messages.in (modified) (1 diff)
-
Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp (modified) (1 diff)
-
Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (modified) (1 diff)
-
Source/WebKit/UIProcess/Network/NetworkProcessProxy.h (modified) (1 diff)
-
Source/WebKit/UIProcess/WebPageProxy.cpp (modified) (2 diffs)
-
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp (modified) (1 diff)
-
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/WebPage.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r242284 r242288 1 2019-03-01 John Wilander <wilander@apple.com> 2 3 Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration 4 https://bugs.webkit.org/show_bug.cgi?id=195196 5 <rdar://problem/48006419> 6 7 Reviewed by Brent Fulgham. 8 9 * http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site-expected.txt: Added. 10 * http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site.html: Added. 11 * http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource-expected.txt: Added. 12 * http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource.html: Added. 13 * http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource-expected.txt: Added. 14 * http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource.html: Added. 15 * http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource-expected.txt: Added. 16 * http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource.html: Added. 17 * http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource-expected.txt: Added. 18 * http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource.html: Added. 19 * http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js.html: 20 Now clears cookies after the test. 21 1 22 2019-03-01 Rob Buis <rbuis@igalia.com> 2 23 -
trunk/LayoutTests/http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js.html
r237304 r242288 63 63 } 64 64 } 65 66 resetCookiesForCurrentOrigin(); 67 65 68 if (passedTests === 4) { 66 69 testPassed("The two short-lived cookies don't expire after more than " + overTwoDaysInSeconds + " seconds."); -
trunk/Source/WebCore/ChangeLog
r242284 r242288 1 2019-03-01 John Wilander <wilander@apple.com> 2 3 Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration 4 https://bugs.webkit.org/show_bug.cgi?id=195196 5 <rdar://problem/48006419> 6 7 Reviewed by Brent Fulgham. 8 9 Tests: http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site.html 10 http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource.html 11 http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource.html 12 http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource.html 13 http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource.html 14 15 Trackers abuse link query parameters to transport user identifiers cross-site. 16 This patch detects such navigations and applies further restrictions to 17 client-site cookies on the destination page. 18 19 * platform/network/NetworkStorageSession.cpp: 20 (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies): 21 Now sets the regular 7-day cap and a reduced 1-day cap. 22 (WebCore::NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics): 23 Renamed NetworkStorageSession::removeStorageAccessForAllFramesOnPage() to 24 NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics since 25 it now clears out two types of page-specific data. 26 (WebCore::NetworkStorageSession::committedCrossSiteLoadWithLinkDecoration): 27 This function receives a cross-site navigation and checks if the originating 28 site is a prevalent resource. If so, it marks the page or stricter cookie 29 rules. 30 (WebCore::NetworkStorageSession::resetCrossSiteLoadsWithLinkDecorationForTesting): 31 Test infrastructure. This sets a state that overrides the regular per-page 32 clear of data. The reason is that the double clear was racy and caused test 33 failures. 34 (WebCore::NetworkStorageSession::clientSideCookieCap const): 35 New function that returns the current cookie lifetime cap. 36 (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted. 37 Renamed to NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics(). 38 * platform/network/NetworkStorageSession.h: 39 * platform/network/cocoa/NetworkStorageSessionCocoa.mm: 40 (WebCore::NetworkStorageSession::setCookiesFromDOM const): 41 Now calls NetworkStorageSession::clientSideCookieCap() to set the cap. 42 1 43 2019-03-01 Rob Buis <rbuis@igalia.com> 2 44 -
trunk/Source/WebCore/platform/network/NetworkStorageSession.cpp
r242056 r242288 101 101 { 102 102 m_ageCapForClientSideCookies = seconds; 103 m_ageCapForClientSideCookiesShort = seconds ? Seconds { seconds->seconds() / 7. } : seconds; 103 104 } 104 105 … … 191 192 } 192 193 193 void NetworkStorageSession:: removeStorageAccessForAllFramesOnPage(uint64_t pageID)194 void NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics(uint64_t pageID) 194 195 { 195 196 m_pagesGrantedStorageAccess.remove(pageID); 196 197 m_framesGrantedStorageAccess.remove(pageID); 198 if (!m_navigationWithLinkDecorationTestMode) 199 m_navigatedToWithLinkDecorationByPrevalentResource.remove(pageID); 197 200 } 198 201 … … 212 215 m_cacheMaxAgeCapForPrevalentResources = WTF::nullopt; 213 216 } 217 218 void NetworkStorageSession::committedCrossSiteLoadWithLinkDecoration(const RegistrableDomain& fromDomain, const RegistrableDomain& toDomain, uint64_t pageID) 219 { 220 if (shouldBlockThirdPartyCookies(fromDomain)) 221 m_navigatedToWithLinkDecorationByPrevalentResource.add(pageID, toDomain); 222 } 223 224 void NetworkStorageSession::resetCrossSiteLoadsWithLinkDecorationForTesting() 225 { 226 m_navigatedToWithLinkDecorationByPrevalentResource.clear(); 227 m_navigationWithLinkDecorationTestMode = true; 228 } 229 230 Optional<Seconds> NetworkStorageSession::clientSideCookieCap(const RegistrableDomain& firstParty, Optional<uint64_t> pageID) const 231 { 232 if (!m_ageCapForClientSideCookies || !pageID || m_navigatedToWithLinkDecorationByPrevalentResource.isEmpty()) 233 return m_ageCapForClientSideCookies; 234 235 auto domainIterator = m_navigatedToWithLinkDecorationByPrevalentResource.find(*pageID); 236 if (domainIterator == m_navigatedToWithLinkDecorationByPrevalentResource.end()) 237 return m_ageCapForClientSideCookies; 238 239 if (domainIterator->value == firstParty) 240 return m_ageCapForClientSideCookiesShort; 241 242 return m_ageCapForClientSideCookies; 243 } 214 244 #endif // ENABLE(RESOURCE_LOAD_STATISTICS) 215 245 -
trunk/Source/WebCore/platform/network/NetworkStorageSession.h
r242056 r242288 150 150 WEBCORE_EXPORT void grantStorageAccess(const RegistrableDomain& resourceDomain, const RegistrableDomain& firstPartyDomain, Optional<uint64_t> frameID, uint64_t pageID); 151 151 WEBCORE_EXPORT void removeStorageAccessForFrame(uint64_t frameID, uint64_t pageID); 152 WEBCORE_EXPORT void removeStorageAccessForAllFramesOnPage(uint64_t pageID);152 WEBCORE_EXPORT void clearPageSpecificDataForResourceLoadStatistics(uint64_t pageID); 153 153 WEBCORE_EXPORT void removeAllStorageAccess(); 154 154 WEBCORE_EXPORT void setCacheMaxAgeCapForPrevalentResources(Seconds); 155 155 WEBCORE_EXPORT void resetCacheMaxAgeCapForPrevalentResources(); 156 156 WEBCORE_EXPORT Optional<Seconds> maxAgeCacheCap(const ResourceRequest&); 157 WEBCORE_EXPORT void committedCrossSiteLoadWithLinkDecoration(const RegistrableDomain& fromDomain, const RegistrableDomain& toDomain, uint64_t pageID); 158 WEBCORE_EXPORT void resetCrossSiteLoadsWithLinkDecorationForTesting(); 157 159 #endif 158 160 … … 179 181 #if ENABLE(RESOURCE_LOAD_STATISTICS) 180 182 bool shouldBlockThirdPartyCookies(const RegistrableDomain&) const; 183 Optional<Seconds> clientSideCookieCap(const RegistrableDomain& firstParty, Optional<uint64_t> pageID) const; 181 184 HashSet<RegistrableDomain> m_registrableDomainsToBlockCookieFor; 182 185 HashMap<uint64_t, HashMap<uint64_t, RegistrableDomain, DefaultHash<uint64_t>::Hash, WTF::UnsignedWithZeroKeyHashTraits<uint64_t>>, DefaultHash<uint64_t>::Hash, WTF::UnsignedWithZeroKeyHashTraits<uint64_t>> m_framesGrantedStorageAccess; … … 184 187 Optional<Seconds> m_cacheMaxAgeCapForPrevalentResources { }; 185 188 Optional<Seconds> m_ageCapForClientSideCookies { }; 189 Optional<Seconds> m_ageCapForClientSideCookiesShort { }; 190 HashMap<uint64_t, RegistrableDomain, DefaultHash<uint64_t>::Hash, WTF::UnsignedWithZeroKeyHashTraits<uint64_t>> m_navigatedToWithLinkDecorationByPrevalentResource; 191 bool m_navigationWithLinkDecorationTestMode = false; 186 192 #endif 187 193 -
trunk/Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm
r240243 r242288 404 404 405 405 #if ENABLE(RESOURCE_LOAD_STATISTICS) 406 RetainPtr<NSArray> filteredCookies = filterCookies(unfilteredCookies, m_ageCapForClientSideCookies);406 RetainPtr<NSArray> filteredCookies = filterCookies(unfilteredCookies, clientSideCookieCap(RegistrableDomain { firstParty }, pageID)); 407 407 #else 408 408 RetainPtr<NSArray> filteredCookies = filterCookies(unfilteredCookies, WTF::nullopt); -
trunk/Source/WebKit/ChangeLog
r242287 r242288 1 2019-03-01 John Wilander <wilander@apple.com> 2 3 Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration 4 https://bugs.webkit.org/show_bug.cgi?id=195196 5 <rdar://problem/48006419> 6 7 Reviewed by Brent Fulgham. 8 9 Trackers abuse link query parameters to transport user identifiers cross-site. 10 This patch detects such navigations and applies further restrictions to 11 client-site cookies on the destination page. 12 13 * NetworkProcess/NetworkConnectionToWebProcess.cpp: 14 (WebKit::NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics): 15 (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage): Deleted. 16 Renamed NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics(). 17 * NetworkProcess/NetworkConnectionToWebProcess.h: 18 * NetworkProcess/NetworkConnectionToWebProcess.messages.in: 19 * NetworkProcess/NetworkProcess.cpp: 20 (WebKit::NetworkProcess::committedCrossSiteLoadWithLinkDecoration): 21 Reporting IPC message when a link decorated cross-site navigation happens. 22 (WebKit::NetworkProcess::resetCrossSiteLoadsWithLinkDecorationForTesting): 23 * NetworkProcess/NetworkProcess.h: 24 * NetworkProcess/NetworkProcess.messages.in: 25 * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: 26 (WKWebsiteDataStoreStatisticsResetToConsistentState): 27 Added clearing of the new state between test runs. 28 * UIProcess/Network/NetworkProcessProxy.cpp: 29 (WebKit::NetworkProcessProxy::resetCrossSiteLoadsWithLinkDecorationForTesting): 30 Test infrastructure. 31 * UIProcess/Network/NetworkProcessProxy.h: 32 * UIProcess/WebPageProxy.cpp: 33 (WebKit::isNonUniqueNavigationWithLinkDecoration): 34 Convenience function. 35 (WebKit::WebPageProxy::didCommitLoadForFrame): 36 This function now reports to the network process when a link decorated 37 cross-site navigation happens. 38 * UIProcess/WebsiteData/WebsiteDataStore.cpp: 39 (WebKit::WebsiteDataStore::resetCrossSiteLoadsWithLinkDecorationForTesting): 40 Test infrastructure. 41 * UIProcess/WebsiteData/WebsiteDataStore.h: 42 * WebProcess/WebPage/WebPage.cpp: 43 (WebKit::WebPage::close): 44 Name change of function called. 45 1 46 2019-03-01 Tim Horton <timothy_horton@apple.com> 2 47 -
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
r242155 r242288 580 580 } 581 581 582 void NetworkConnectionToWebProcess:: removeStorageAccessForAllFramesOnPage(PAL::SessionID sessionID, uint64_t pageID)582 void NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics(PAL::SessionID sessionID, uint64_t pageID) 583 583 { 584 584 if (auto* storageSession = networkProcess().storageSession(sessionID)) 585 storageSession-> removeStorageAccessForAllFramesOnPage(pageID);585 storageSession->clearPageSpecificDataForResourceLoadStatistics(pageID); 586 586 } 587 587 -
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
r242056 r242288 201 201 #if ENABLE(RESOURCE_LOAD_STATISTICS) 202 202 void removeStorageAccessForFrame(PAL::SessionID, uint64_t frameID, uint64_t pageID); 203 void removeStorageAccessForAllFramesOnPage(PAL::SessionID, uint64_t pageID);203 void clearPageSpecificDataForResourceLoadStatistics(PAL::SessionID, uint64_t pageID); 204 204 205 205 void logUserInteraction(PAL::SessionID, const RegistrableDomain&); -
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in
r242056 r242288 58 58 #if ENABLE(RESOURCE_LOAD_STATISTICS) 59 59 RemoveStorageAccessForFrame(PAL::SessionID sessionID, uint64_t frameID, uint64_t pageID); 60 RemoveStorageAccessForAllFramesOnPage(PAL::SessionID sessionID, uint64_t pageID);60 ClearPageSpecificDataForResourceLoadStatistics(PAL::SessionID sessionID, uint64_t pageID); 61 61 LogUserInteraction(PAL::SessionID sessionID, WebCore::RegistrableDomain domain) 62 62 LogWebSocketLoading(PAL::SessionID sessionID, WebCore::RegistrableDomain targetDomain, WebCore::RegistrableDomain topFrameDomain, WallTime lastSeen) -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp
r242230 r242288 1180 1180 completionHandler(); 1181 1181 } 1182 1183 void NetworkProcess::committedCrossSiteLoadWithLinkDecoration(PAL::SessionID sessionID, const RegistrableDomain& fromDomain, const RegistrableDomain& toDomain, uint64_t pageID) 1184 { 1185 if (auto* networkStorageSession = storageSession(sessionID)) 1186 networkStorageSession->committedCrossSiteLoadWithLinkDecoration(fromDomain, toDomain, pageID); 1187 else 1188 ASSERT_NOT_REACHED(); 1189 } 1190 1191 void NetworkProcess::resetCrossSiteLoadsWithLinkDecorationForTesting(PAL::SessionID sessionID, CompletionHandler<void()>&& completionHandler) 1192 { 1193 if (auto* networkStorageSession = storageSession(sessionID)) 1194 networkStorageSession->resetCrossSiteLoadsWithLinkDecorationForTesting(); 1195 else 1196 ASSERT_NOT_REACHED(); 1197 completionHandler(); 1198 } 1182 1199 #endif // ENABLE(RESOURCE_LOAD_STATISTICS) 1183 1200 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.h
r242230 r242288 253 253 void setTopFrameUniqueRedirectFrom(PAL::SessionID, const TopFrameDomain&, const RedirectedFromDomain&, CompletionHandler<void()>&&); 254 254 void registrableDomainsWithWebsiteData(PAL::SessionID, OptionSet<WebsiteDataType>, bool shouldNotifyPage, CompletionHandler<void(HashSet<RegistrableDomain>&&)>&&); 255 void committedCrossSiteLoadWithLinkDecoration(PAL::SessionID, const RegistrableDomain& fromDomain, const RegistrableDomain& toDomain, uint64_t pageID); 256 void resetCrossSiteLoadsWithLinkDecorationForTesting(PAL::SessionID, CompletionHandler<void()>&&); 255 257 #endif 256 258 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
r242155 r242288 133 133 SetTopFrameUniqueRedirectFrom(PAL::SessionID sessionID, WebCore::RegistrableDomain topFrameDomain, WebCore::RegistrableDomain redirectedFromDomain) -> () Async 134 134 ResetCacheMaxAgeCapForPrevalentResources(PAL::SessionID sessionID) -> () Async 135 CommittedCrossSiteLoadWithLinkDecoration(PAL::SessionID sessionID, WebCore::RegistrableDomain fromDomain, WebCore::RegistrableDomain toDomain, uint64_t pageID) 136 ResetCrossSiteLoadsWithLinkDecorationForTesting(PAL::SessionID sessionID) -> () Async 135 137 #endif 136 138 -
trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp
r242155 r242288 430 430 store.clearResourceLoadStatisticsInWebProcesses([callbackAggregator = callbackAggregator.copyRef()] { }); 431 431 store.resetCacheMaxAgeCapForPrevalentResources([callbackAggregator = callbackAggregator.copyRef()] { }); 432 store.resetCrossSiteLoadsWithLinkDecorationForTesting([callbackAggregator = callbackAggregator.copyRef()] { }); 432 433 store.resetParametersToDefaultValues([callbackAggregator = callbackAggregator.copyRef()] { }); 433 434 store.scheduleClearInMemoryAndPersistent(ShouldGrandfatherStatistics::No, [callbackAggregator = callbackAggregator.copyRef()] { }); -
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
r242155 r242288 932 932 WebProcessProxy::notifyPageStatisticsTelemetryFinished(API::Dictionary::create(messageBody).ptr()); 933 933 } 934 935 void NetworkProcessProxy::resetCrossSiteLoadsWithLinkDecorationForTesting(PAL::SessionID sessionID, CompletionHandler<void()>&& completionHandler) 936 { 937 if (!canSendMessage()) { 938 completionHandler(); 939 return; 940 } 941 942 sendWithAsyncReply(Messages::NetworkProcess::ResetCrossSiteLoadsWithLinkDecorationForTesting(sessionID), WTFMove(completionHandler)); 943 } 934 944 #endif // ENABLE(RESOURCE_LOAD_STATISTICS) 935 945 -
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h
r242155 r242288 145 145 void setShouldClassifyResourcesBeforeDataRecordsRemoval(PAL::SessionID, bool, CompletionHandler<void()>&&); 146 146 void resetCacheMaxAgeCapForPrevalentResources(PAL::SessionID, CompletionHandler<void()>&&); 147 void resetCrossSiteLoadsWithLinkDecorationForTesting(PAL::SessionID, CompletionHandler<void()>&&); 147 148 #endif 148 149 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r242277 r242288 4049 4049 } 4050 4050 4051 #if ENABLE(RESOURCE_LOAD_STATISTICS) 4052 static bool isNonUniqueNavigationWithLinkDecoration(const SecurityOriginData requesterOrigin, const URL& currentURL) 4053 { 4054 return !requesterOrigin.securityOrigin()->isUnique() && (!currentURL.query().isEmpty() || !currentURL.fragmentIdentifier().isEmpty()); 4055 } 4056 #endif 4057 4051 4058 void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t opaqueFrameLoadType, const WebCore::CertificateInfo& certificateInfo, bool containsPluginDocument, Optional<HasInsecureContent> hasInsecureContent, const UserData& userData) 4052 4059 { … … 4062 4069 // FIXME: We should message check that navigationID is not zero here, but it's currently zero for some navigations through the page cache. 4063 4070 RefPtr<API::Navigation> navigation; 4064 if (frame->isMainFrame() && navigationID) 4071 if (frame->isMainFrame() && navigationID) { 4065 4072 navigation = navigationState().navigation(navigationID); 4073 #if ENABLE(RESOURCE_LOAD_STATISTICS) 4074 auto requesterOrigin = navigation->lastNavigationAction().requesterOrigin; 4075 auto currentURL = navigation->currentRequest().url(); 4076 if (isNonUniqueNavigationWithLinkDecoration(requesterOrigin, currentURL)) { 4077 RegistrableDomain currentDomain { currentURL }; 4078 URL requesterURL { URL(), requesterOrigin.toString() }; 4079 if (!currentDomain.matches(requesterURL)) 4080 m_process->processPool().sendToNetworkingProcess(Messages::NetworkProcess::CommittedCrossSiteLoadWithLinkDecoration(m_websiteDataStore->sessionID(), RegistrableDomain { requesterURL }, currentDomain, m_pageID)); 4081 } 4082 #endif 4083 } 4066 4084 4067 4085 m_hasCommittedAnyProvisionalLoads = true; -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
r242182 r242288 1754 1754 } 1755 1755 } 1756 1757 void WebsiteDataStore::resetCrossSiteLoadsWithLinkDecorationForTesting(CompletionHandler<void()>&& completionHandler) 1758 { 1759 auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); 1760 1761 for (auto& processPool : processPools()) { 1762 if (auto* networkProcess = processPool->networkProcess()) 1763 networkProcess->resetCrossSiteLoadsWithLinkDecorationForTesting(m_sessionID, [callbackAggregator = callbackAggregator.copyRef()] { }); 1764 } 1765 } 1756 1766 #endif // ENABLE(RESOURCE_LOAD_STATISTICS) 1757 1767 -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
r242155 r242288 168 168 void grantStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t pageID, bool userWasPrompted, CompletionHandler<void(bool)>&&); 169 169 void setSubframeUnderTopFrameDomain(const URL& subframe, const URL& topFrame); 170 void resetCrossSiteLoadsWithLinkDecorationForTesting(CompletionHandler<void()>&&); 170 171 #endif 171 172 void setCacheMaxAgeCapForPrevalentResources(Seconds, CompletionHandler<void()>&&); -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r242205 r242288 1237 1237 1238 1238 #if ENABLE(RESOURCE_LOAD_STATISTICS) 1239 WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess:: RemoveStorageAccessForAllFramesOnPage(sessionID(), m_pageID), 0);1239 WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::ClearPageSpecificDataForResourceLoadStatistics(sessionID(), m_pageID), 0); 1240 1240 #endif 1241 1241
Note:
See TracChangeset
for help on using the changeset viewer.