Changeset 229619 in webkit
- Timestamp:
- Mar 14, 2018 10:05:36 PM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r229616 r229619 1 2018-03-14 John Wilander <wilander@apple.com> 2 3 Resource Load Statistics: Add clearing of storage access to WebResourceLoadStatisticsStore::clearInMemory() 4 https://bugs.webkit.org/show_bug.cgi?id=183641 5 <rdar://problem/38469497> 6 7 Reviewed by Brent Fulgham and Chris Dumez. 8 9 No new tests. This change is to stabilize existing layout tests. 10 See Ryan Haddad's comment in https://bugs.webkit.org/show_bug.cgi?id=183620. 11 12 * platform/network/NetworkStorageSession.h: 13 * platform/network/cf/NetworkStorageSessionCFNet.cpp: 14 (WebCore::NetworkStorageSession::removeAllStorageAccess): 15 New function to clear out all storage access entries. 16 1 17 2018-03-14 Youenn Fablet <youenn@apple.com> 2 18 -
trunk/Source/WebCore/platform/network/NetworkStorageSession.h
r229569 r229619 110 110 WEBCORE_EXPORT void removeStorageAccessForFrame(uint64_t frameID, uint64_t pageID); 111 111 WEBCORE_EXPORT void removeStorageAccessForAllFramesOnPage(uint64_t pageID); 112 WEBCORE_EXPORT void removeAllStorageAccess(); 112 113 #endif 113 114 #elif USE(SOUP) -
trunk/Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp
r229569 r229619 361 361 } 362 362 363 void NetworkStorageSession::removeAllStorageAccess() 364 { 365 m_pagesGrantedStorageAccess.clear(); 366 m_framesGrantedStorageAccess.clear(); 367 } 368 363 369 #endif // HAVE(CFNETWORK_STORAGE_PARTITIONING) 364 370 -
trunk/Source/WebKit/ChangeLog
r229617 r229619 1 2018-03-14 John Wilander <wilander@apple.com> 2 3 Resource Load Statistics: Add clearing of storage access to WebResourceLoadStatisticsStore::clearInMemory() 4 https://bugs.webkit.org/show_bug.cgi?id=183641 5 <rdar://problem/38469497> 6 7 Reviewed by Brent Fulgham and Chris Dumez. 8 9 This change is to stabilize existing layout tests by removing 10 all storage access entries on a call to 11 WebResourceLoadStatisticsStore::clearInMemory(). 12 See Ryan Haddad's comment in https://bugs.webkit.org/show_bug.cgi?id=183620. 13 14 Almost all of the code changes are piping to get this 15 call from the WebResourceLoadStatisticsStore to 16 WebCore::NetworkStorageSession where entries reside. 17 18 * NetworkProcess/NetworkProcess.cpp: 19 (WebKit::NetworkProcess::removeAllStorageAccess): 20 * NetworkProcess/NetworkProcess.h: 21 * NetworkProcess/NetworkProcess.messages.in: 22 * UIProcess/Network/NetworkProcessProxy.cpp: 23 (WebKit::NetworkProcessProxy::removeAllStorageAccess): 24 * UIProcess/Network/NetworkProcessProxy.h: 25 * UIProcess/WebResourceLoadStatisticsStore.cpp: 26 (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): 27 (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess): 28 (WebKit::WebResourceLoadStatisticsStore::clearInMemory): 29 Now also clears all storage access entries in the network process. 30 * UIProcess/WebResourceLoadStatisticsStore.h: 31 * UIProcess/WebsiteData/WebsiteDataStore.cpp: 32 (WebKit::WebsiteDataStore::removeAllStorageAccessHandler): 33 (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): 34 * UIProcess/WebsiteData/WebsiteDataStore.h: 35 1 36 2018-03-14 Ryan Haddad <ryanhaddad@apple.com> 2 37 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp
r229569 r229619 395 395 } 396 396 397 void NetworkProcess::removeAllStorageAccess(PAL::SessionID sessionID) 398 { 399 if (auto* networkStorageSession = NetworkStorageSession::storageSession(sessionID)) 400 networkStorageSession->removeAllStorageAccess(); 401 else 402 ASSERT_NOT_REACHED(); 403 } 404 397 405 void NetworkProcess::removePrevalentDomains(PAL::SessionID sessionID, const Vector<String>& domains) 398 406 { -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.h
r229569 r229619 141 141 void getAllStorageAccessEntries(PAL::SessionID, uint64_t contextId); 142 142 void grantStorageAccess(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID, uint64_t contextId); 143 void removeAllStorageAccess(PAL::SessionID); 143 144 void removePrevalentDomains(PAL::SessionID, const Vector<String>& domains); 144 145 #endif -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
r229569 r229619 87 87 GetAllStorageAccessEntries(PAL::SessionID sessionID, uint64_t contextId) 88 88 GrantStorageAccess(PAL::SessionID sessionID, String resourceDomain, String firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID, uint64_t contextId) 89 RemoveAllStorageAccess(PAL::SessionID sessionID) 89 90 RemovePrevalentDomains(PAL::SessionID sessionID, Vector<String> domainsWithInteraction); 90 91 #endif -
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
r229569 r229619 429 429 } 430 430 431 void NetworkProcessProxy::removeAllStorageAccess(PAL::SessionID sessionID) 432 { 433 if (canSendMessage()) 434 send(Messages::NetworkProcess::RemoveAllStorageAccess(sessionID), 0); 435 } 436 431 437 void NetworkProcessProxy::storageAccessRequestResult(bool wasGranted, uint64_t contextId) 432 438 { -
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h
r229569 r229619 83 83 void getAllStorageAccessEntries(PAL::SessionID, CompletionHandler<void(Vector<String>&& domains)>&&); 84 84 void grantStorageAccess(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool)>&& callback); 85 void removeAllStorageAccess(PAL::SessionID); 85 86 #endif 86 87 -
trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp
r229597 r229619 155 155 } 156 156 157 WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore(const String& resourceLoadStatisticsDirectory, Function<void(const String&)>&& testingCallback, bool isEphemeral, UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler&& updatePrevalentDomainsToPartitionOrBlockCookiesHandler, HasStorageAccessForFrameHandler&& hasStorageAccessForFrameHandler, GrantStorageAccessHandler&& grantStorageAccessHandler, Remove PrevalentDomainsHandler&& removeDomainsHandler)157 WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore(const String& resourceLoadStatisticsDirectory, Function<void(const String&)>&& testingCallback, bool isEphemeral, UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler&& updatePrevalentDomainsToPartitionOrBlockCookiesHandler, HasStorageAccessForFrameHandler&& hasStorageAccessForFrameHandler, GrantStorageAccessHandler&& grantStorageAccessHandler, RemoveAllStorageAccessHandler&& removeAllStorageAccessHandler, RemovePrevalentDomainsHandler&& removeDomainsHandler) 158 158 : m_statisticsQueue(WorkQueue::create("WebResourceLoadStatisticsStore Process Data Queue", WorkQueue::Type::Serial, WorkQueue::QOS::Utility)) 159 159 , m_persistentStorage(*this, resourceLoadStatisticsDirectory, isEphemeral ? ResourceLoadStatisticsPersistentStorage::IsReadOnly::Yes : ResourceLoadStatisticsPersistentStorage::IsReadOnly::No) … … 161 161 , m_hasStorageAccessForFrameHandler(WTFMove(hasStorageAccessForFrameHandler)) 162 162 , m_grantStorageAccessHandler(WTFMove(grantStorageAccessHandler)) 163 , m_removeAllStorageAccessHandler(WTFMove(removeAllStorageAccessHandler)) 163 164 , m_removeDomainsHandler(WTFMove(removeDomainsHandler)) 164 165 , m_dailyTasksTimer(RunLoop::main(), this, &WebResourceLoadStatisticsStore::performDailyTasks) … … 409 410 RELEASE_LOG_INFO_IF(m_debugLoggingEnabled, ResourceLoadStatisticsDebug, "Grant storage access for %{public}s under opener %{public}s, %{public}s user interaction.", domainInNeedOfStorageAccess.utf8().data(), openerDomain.utf8().data(), (isTriggeredByUserGesture ? "with" : "without")); 410 411 #endif 412 } 413 414 void WebResourceLoadStatisticsStore::removeAllStorageAccess() 415 { 416 ASSERT(!RunLoop::isMain()); 417 RunLoop::main().dispatch([this, protectedThis = makeRef(*this)] () { 418 m_removeAllStorageAccessHandler(); 419 }); 411 420 } 412 421 … … 955 964 m_operatingDates.clear(); 956 965 966 removeAllStorageAccess(); 957 967 updateCookiePartitioningForDomains({ }, { }, { }, ShouldClearFirst::Yes, []() { }); 958 968 } -
trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h
r229597 r229619 65 65 using HasStorageAccessForFrameHandler = WTF::Function<void(const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, WTF::Function<void(bool hasAccess)>&& callback)>; 66 66 using GrantStorageAccessHandler = WTF::Function<void(const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID, WTF::Function<void(bool wasGranted)>&& callback)>; 67 using RemoveAllStorageAccessHandler = WTF::Function<void()>; 67 68 using RemovePrevalentDomainsHandler = WTF::Function<void (const Vector<String>&)>; 68 static Ref<WebResourceLoadStatisticsStore> create(const String& resourceLoadStatisticsDirectory, Function<void (const String&)>&& testingCallback, bool isEphemeral, UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler&& updatePrevalentDomainsToPartitionOrBlockCookiesHandler = [](const WTF::Vector<String>&, const WTF::Vector<String>&, const WTF::Vector<String>&, ShouldClearFirst) { }, HasStorageAccessForFrameHandler&& hasStorageAccessForFrameHandler = [](const String&, const String&, uint64_t, uint64_t, WTF::Function<void(bool)>&&) { }, GrantStorageAccessHandler&& grantStorageAccessHandler = [](const String&, const String&, std::optional<uint64_t>, uint64_t, WTF::Function<void(bool)>&&) { }, Remove PrevalentDomainsHandler&& removeDomainsHandler = [] (const WTF::Vector<String>&) { })69 static Ref<WebResourceLoadStatisticsStore> create(const String& resourceLoadStatisticsDirectory, Function<void (const String&)>&& testingCallback, bool isEphemeral, UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler&& updatePrevalentDomainsToPartitionOrBlockCookiesHandler = [](const WTF::Vector<String>&, const WTF::Vector<String>&, const WTF::Vector<String>&, ShouldClearFirst) { }, HasStorageAccessForFrameHandler&& hasStorageAccessForFrameHandler = [](const String&, const String&, uint64_t, uint64_t, WTF::Function<void(bool)>&&) { }, GrantStorageAccessHandler&& grantStorageAccessHandler = [](const String&, const String&, std::optional<uint64_t>, uint64_t, WTF::Function<void(bool)>&&) { }, RemoveAllStorageAccessHandler&& removeAllStorageAccessHandler = []() { }, RemovePrevalentDomainsHandler&& removeDomainsHandler = [] (const WTF::Vector<String>&) { }) 69 70 { 70 return adoptRef(*new WebResourceLoadStatisticsStore(resourceLoadStatisticsDirectory, WTFMove(testingCallback), isEphemeral, WTFMove(updatePrevalentDomainsToPartitionOrBlockCookiesHandler), WTFMove(hasStorageAccessForFrameHandler), WTFMove(grantStorageAccessHandler), WTFMove(remove DomainsHandler)));71 return adoptRef(*new WebResourceLoadStatisticsStore(resourceLoadStatisticsDirectory, WTFMove(testingCallback), isEphemeral, WTFMove(updatePrevalentDomainsToPartitionOrBlockCookiesHandler), WTFMove(hasStorageAccessForFrameHandler), WTFMove(grantStorageAccessHandler), WTFMove(removeAllStorageAccessHandler), WTFMove(removeDomainsHandler))); 71 72 } 72 73 … … 152 153 153 154 private: 154 WebResourceLoadStatisticsStore(const String&, Function<void(const String&)>&& testingCallback, bool isEphemeral, UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler&&, HasStorageAccessForFrameHandler&&, GrantStorageAccessHandler&&, Remove PrevalentDomainsHandler&&);155 WebResourceLoadStatisticsStore(const String&, Function<void(const String&)>&& testingCallback, bool isEphemeral, UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler&&, HasStorageAccessForFrameHandler&&, GrantStorageAccessHandler&&, RemoveAllStorageAccessHandler&&, RemovePrevalentDomainsHandler&&); 155 156 156 157 void removeDataRecords(CompletionHandler<void()>&&); … … 179 180 180 181 void resetCookiePartitioningState(); 182 void removeAllStorageAccess(); 181 183 182 184 void setDebugLogggingEnabled(bool enabled) { m_debugLoggingEnabled = enabled; } … … 213 215 HasStorageAccessForFrameHandler m_hasStorageAccessForFrameHandler; 214 216 GrantStorageAccessHandler m_grantStorageAccessHandler; 217 RemoveAllStorageAccessHandler m_removeAllStorageAccessHandler; 215 218 RemovePrevalentDomainsHandler m_removeDomainsHandler; 216 219 -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
r229569 r229619 1215 1215 } 1216 1216 1217 void WebsiteDataStore::removeAllStorageAccessHandler() 1218 { 1219 for (auto& processPool : processPools()) { 1220 if (auto networkProcess = processPool->networkProcess()) 1221 networkProcess->removeAllStorageAccess(m_sessionID); 1222 } 1223 } 1224 1217 1225 void WebsiteDataStore::removePrevalentDomains(const Vector<String>& domains) 1218 1226 { … … 1445 1453 }, [this, protectedThis = makeRef(*this)] (const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID, WTF::CompletionHandler<void(bool wasGranted)>&& callback) { 1446 1454 grantStorageAccessHandler(resourceDomain, firstPartyDomain, frameID, pageID, WTFMove(callback)); 1455 }, [this, protectedThis = makeRef(*this)] () { 1456 removeAllStorageAccessHandler(); 1447 1457 }, [this, protectedThis = makeRef(*this)] (const Vector<String>& domainsToRemove) { 1448 1458 removePrevalentDomains(domainsToRemove); -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
r229569 r229619 128 128 void getAllStorageAccessEntries(CompletionHandler<void(Vector<String>&& domains)>&&); 129 129 void grantStorageAccessHandler(const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID, WTF::CompletionHandler<void(bool wasGranted)>&& callback); 130 void removeAllStorageAccessHandler(); 130 131 void removePrevalentDomains(const Vector<String>& domains); 131 132 void hasStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t pageID, WTF::CompletionHandler<void (bool)>&& callback);
Note: See TracChangeset
for help on using the changeset viewer.