WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-183641-20180314165521.patch (text/plain), 19.37 KB, created by
John Wilander
on 2018-03-14 16:55:22 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
John Wilander
Created:
2018-03-14 16:55:22 PDT
Size:
19.37 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 229611) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,19 @@ >+2018-03-14 John Wilander <wilander@apple.com> >+ >+ Resource Load Statistics: Add clearing of storage access to WebResourceLoadStatisticsStore::clearInMemory() >+ https://bugs.webkit.org/show_bug.cgi?id=183641 >+ <rdar://problem/38469497> >+ >+ Reviewed by Brent Fulgham. >+ >+ No new tests. This change is to stabilize existing layout tests. >+ See Ryan Haddad's comment in https://bugs.webkit.org/show_bug.cgi?id=183620. >+ >+ * platform/network/NetworkStorageSession.h: >+ * platform/network/cf/NetworkStorageSessionCFNet.cpp: >+ (WebCore::NetworkStorageSession::removeAllStorageAccess): >+ New function to clear out all storage access entries. >+ > 2018-03-14 Mark Lam <mark.lam@apple.com> > > Enhance the MacroAssembler and LinkBuffer to support pointer profiling. >Index: Source/WebCore/platform/network/NetworkStorageSession.h >=================================================================== >--- Source/WebCore/platform/network/NetworkStorageSession.h (revision 229604) >+++ Source/WebCore/platform/network/NetworkStorageSession.h (working copy) >@@ -109,6 +109,7 @@ public: > WEBCORE_EXPORT void grantStorageAccess(const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID); > WEBCORE_EXPORT void removeStorageAccessForFrame(uint64_t frameID, uint64_t pageID); > WEBCORE_EXPORT void removeStorageAccessForAllFramesOnPage(uint64_t pageID); >+ WEBCORE_EXPORT void removeAllStorageAccess(); > #endif > #elif USE(SOUP) > NetworkStorageSession(PAL::SessionID, std::unique_ptr<SoupNetworkSession>&&); >Index: Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp >=================================================================== >--- Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp (revision 229604) >+++ Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp (working copy) >@@ -360,6 +360,12 @@ void NetworkStorageSession::removeStorag > m_framesGrantedStorageAccess.remove(pageID); > } > >+void NetworkStorageSession::removeAllStorageAccess() >+{ >+ m_pagesGrantedStorageAccess.clear(); >+ m_framesGrantedStorageAccess.clear(); >+} >+ > #endif // HAVE(CFNETWORK_STORAGE_PARTITIONING) > > #if !PLATFORM(COCOA) >Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 229611) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,38 @@ >+2018-03-14 John Wilander <wilander@apple.com> >+ >+ Resource Load Statistics: Add clearing of storage access to WebResourceLoadStatisticsStore::clearInMemory() >+ https://bugs.webkit.org/show_bug.cgi?id=183641 >+ <rdar://problem/38469497> >+ >+ Reviewed by Brent Fulgham. >+ >+ This change is to stabilize existing layout tests by removing >+ all storage access entries on a call to >+ WebResourceLoadStatisticsStore::clearInMemory(). >+ See Ryan Haddad's comment in https://bugs.webkit.org/show_bug.cgi?id=183620. >+ >+ Almost all of the code changes are piping to get this >+ call from the WebResourceLoadStatisticsStore to >+ WebCore::NetworkStorageSession where entries reside. >+ >+ * NetworkProcess/NetworkProcess.cpp: >+ (WebKit::NetworkProcess::removeAllStorageAccess): >+ * NetworkProcess/NetworkProcess.h: >+ * NetworkProcess/NetworkProcess.messages.in: >+ * UIProcess/Network/NetworkProcessProxy.cpp: >+ (WebKit::NetworkProcessProxy::removeAllStorageAccess): >+ * UIProcess/Network/NetworkProcessProxy.h: >+ * UIProcess/WebResourceLoadStatisticsStore.cpp: >+ (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): >+ (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess): >+ (WebKit::WebResourceLoadStatisticsStore::clearInMemory): >+ Now also clears all storage access entries in the network process. >+ * UIProcess/WebResourceLoadStatisticsStore.h: >+ * UIProcess/WebsiteData/WebsiteDataStore.cpp: >+ (WebKit::WebsiteDataStore::removeAllStorageAccessHandler): >+ (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): >+ * UIProcess/WebsiteData/WebsiteDataStore.h: >+ > 2018-03-14 Tim Horton <timothy_horton@apple.com> > > Fix the build after r229567 >Index: Source/WebKit/NetworkProcess/NetworkProcess.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkProcess.cpp (revision 229604) >+++ Source/WebKit/NetworkProcess/NetworkProcess.cpp (working copy) >@@ -394,6 +394,14 @@ void NetworkProcess::grantStorageAccess( > parentProcessConnection()->send(Messages::NetworkProcessProxy::StorageAccessRequestResult(isStorageGranted, contextId), 0); > } > >+void NetworkProcess::removeAllStorageAccess(PAL::SessionID sessionID) >+{ >+ if (auto* networkStorageSession = NetworkStorageSession::storageSession(sessionID)) >+ networkStorageSession->removeAllStorageAccess(); >+ else >+ ASSERT_NOT_REACHED(); >+} >+ > void NetworkProcess::removePrevalentDomains(PAL::SessionID sessionID, const Vector<String>& domains) > { > if (auto* networkStorageSession = NetworkStorageSession::storageSession(sessionID)) >Index: Source/WebKit/NetworkProcess/NetworkProcess.h >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkProcess.h (revision 229604) >+++ Source/WebKit/NetworkProcess/NetworkProcess.h (working copy) >@@ -140,6 +140,7 @@ public: > void hasStorageAccessForFrame(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, uint64_t contextId); > void getAllStorageAccessEntries(PAL::SessionID, uint64_t contextId); > void grantStorageAccess(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID, uint64_t contextId); >+ void removeAllStorageAccess(PAL::SessionID); > void removePrevalentDomains(PAL::SessionID, const Vector<String>& domains); > #endif > >Index: Source/WebKit/NetworkProcess/NetworkProcess.messages.in >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkProcess.messages.in (revision 229604) >+++ Source/WebKit/NetworkProcess/NetworkProcess.messages.in (working copy) >@@ -86,6 +86,7 @@ messages -> NetworkProcess LegacyReceive > HasStorageAccessForFrame(PAL::SessionID sessionID, String resourceDomain, String firstPartyDomain, uint64_t frameID, uint64_t pageID, uint64_t contextId) > GetAllStorageAccessEntries(PAL::SessionID sessionID, uint64_t contextId) > GrantStorageAccess(PAL::SessionID sessionID, String resourceDomain, String firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID, uint64_t contextId) >+ RemoveAllStorageAccess(PAL::SessionID sessionID) > RemovePrevalentDomains(PAL::SessionID sessionID, Vector<String> domainsWithInteraction); > #endif > >Index: Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp >=================================================================== >--- Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp (revision 229604) >+++ Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp (working copy) >@@ -154,12 +154,13 @@ static Vector<OperatingDate> mergeOperat > return mergedDates; > } > >-WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore(const String& resourceLoadStatisticsDirectory, Function<void(const String&)>&& testingCallback, bool isEphemeral, UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler&& updatePrevalentDomainsToPartitionOrBlockCookiesHandler, HasStorageAccessForFrameHandler&& hasStorageAccessForFrameHandler, GrantStorageAccessHandler&& grantStorageAccessHandler, RemovePrevalentDomainsHandler&& removeDomainsHandler) >+WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore(const String& resourceLoadStatisticsDirectory, Function<void(const String&)>&& testingCallback, bool isEphemeral, UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler&& updatePrevalentDomainsToPartitionOrBlockCookiesHandler, HasStorageAccessForFrameHandler&& hasStorageAccessForFrameHandler, GrantStorageAccessHandler&& grantStorageAccessHandler, RemoveAllStorageAccessHandler&& removeAllStorageAccessHandler, RemovePrevalentDomainsHandler&& removeDomainsHandler) > : m_statisticsQueue(WorkQueue::create("WebResourceLoadStatisticsStore Process Data Queue", WorkQueue::Type::Serial, WorkQueue::QOS::Utility)) > , m_persistentStorage(*this, resourceLoadStatisticsDirectory, isEphemeral ? ResourceLoadStatisticsPersistentStorage::IsReadOnly::Yes : ResourceLoadStatisticsPersistentStorage::IsReadOnly::No) > , m_updatePrevalentDomainsToPartitionOrBlockCookiesHandler(WTFMove(updatePrevalentDomainsToPartitionOrBlockCookiesHandler)) > , m_hasStorageAccessForFrameHandler(WTFMove(hasStorageAccessForFrameHandler)) > , m_grantStorageAccessHandler(WTFMove(grantStorageAccessHandler)) >+ , m_removeAllStorageAccessHandler(WTFMove(removeAllStorageAccessHandler)) > , m_removeDomainsHandler(WTFMove(removeDomainsHandler)) > , m_dailyTasksTimer(RunLoop::main(), this, &WebResourceLoadStatisticsStore::performDailyTasks) > , m_statisticsTestingCallback(WTFMove(testingCallback)) >@@ -410,6 +411,14 @@ void WebResourceLoadStatisticsStore::req > #endif > } > >+void WebResourceLoadStatisticsStore::removeAllStorageAccess() >+{ >+ ASSERT(!RunLoop::isMain()); >+ RunLoop::main().dispatch([this, protectedThis = makeRef(*this)] () { >+ m_removeAllStorageAccessHandler(); >+ }); >+} >+ > void WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData(CompletionHandler<void()>&& callback) > { > ASSERT(!RunLoop::isMain()); >@@ -954,6 +963,7 @@ void WebResourceLoadStatisticsStore::cle > m_resourceStatisticsMap.clear(); > m_operatingDates.clear(); > >+ removeAllStorageAccess(); > updateCookiePartitioningForDomains({ }, { }, { }, ShouldClearFirst::Yes, []() { }); > } > >Index: Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h >=================================================================== >--- Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h (revision 229604) >+++ Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h (working copy) >@@ -64,10 +64,11 @@ public: > using UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler = WTF::Function<void(const Vector<String>& domainsToPartition, const Vector<String>& domainsToBlock, const Vector<String>& domainsToNeitherPartitionNorBlock, ShouldClearFirst)>; > using HasStorageAccessForFrameHandler = WTF::Function<void(const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, WTF::Function<void(bool hasAccess)>&& callback)>; > 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)>; >+ using RemoveAllStorageAccessHandler = WTF::Function<void()>; > using RemovePrevalentDomainsHandler = WTF::Function<void (const Vector<String>&)>; >- 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)>&&) { }, RemovePrevalentDomainsHandler&& removeDomainsHandler = [] (const WTF::Vector<String>&) { }) >+ 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>&) { }) > { >- return adoptRef(*new WebResourceLoadStatisticsStore(resourceLoadStatisticsDirectory, WTFMove(testingCallback), isEphemeral, WTFMove(updatePrevalentDomainsToPartitionOrBlockCookiesHandler), WTFMove(hasStorageAccessForFrameHandler), WTFMove(grantStorageAccessHandler), WTFMove(removeDomainsHandler))); >+ return adoptRef(*new WebResourceLoadStatisticsStore(resourceLoadStatisticsDirectory, WTFMove(testingCallback), isEphemeral, WTFMove(updatePrevalentDomainsToPartitionOrBlockCookiesHandler), WTFMove(hasStorageAccessForFrameHandler), WTFMove(grantStorageAccessHandler), WTFMove(removeAllStorageAccessHandler), WTFMove(removeDomainsHandler))); > } > > ~WebResourceLoadStatisticsStore(); >@@ -151,7 +152,7 @@ public: > void logTestingEvent(const String&); > > private: >- WebResourceLoadStatisticsStore(const String&, Function<void(const String&)>&& testingCallback, bool isEphemeral, UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler&&, HasStorageAccessForFrameHandler&&, GrantStorageAccessHandler&&, RemovePrevalentDomainsHandler&&); >+ WebResourceLoadStatisticsStore(const String&, Function<void(const String&)>&& testingCallback, bool isEphemeral, UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler&&, HasStorageAccessForFrameHandler&&, GrantStorageAccessHandler&&, RemoveAllStorageAccessHandler&&, RemovePrevalentDomainsHandler&&); > > void removeDataRecords(CompletionHandler<void()>&&); > >@@ -178,6 +179,7 @@ private: > void processStatisticsAndDataRecords(); > > void resetCookiePartitioningState(); >+ void removeAllStorageAccess(); > > void setDebugLogggingEnabled(bool enabled) { m_debugLoggingEnabled = enabled; } > >@@ -212,6 +214,7 @@ private: > UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler m_updatePrevalentDomainsToPartitionOrBlockCookiesHandler; > HasStorageAccessForFrameHandler m_hasStorageAccessForFrameHandler; > GrantStorageAccessHandler m_grantStorageAccessHandler; >+ RemoveAllStorageAccessHandler m_removeAllStorageAccessHandler; > RemovePrevalentDomainsHandler m_removeDomainsHandler; > > WallTime m_endOfGrandfatheringTimestamp; >Index: Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp >=================================================================== >--- Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (revision 229604) >+++ Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (working copy) >@@ -428,6 +428,12 @@ void NetworkProcessProxy::grantStorageAc > send(Messages::NetworkProcess::GrantStorageAccess(sessionID, resourceDomain, firstPartyDomain, frameID, pageID, contextId), 0); > } > >+void NetworkProcessProxy::removeAllStorageAccess(PAL::SessionID sessionID) >+{ >+ if (canSendMessage()) >+ send(Messages::NetworkProcess::RemoveAllStorageAccess(sessionID), 0); >+} >+ > void NetworkProcessProxy::storageAccessRequestResult(bool wasGranted, uint64_t contextId) > { > auto callback = m_storageAccessResponseCallbackMap.take(contextId); >Index: Source/WebKit/UIProcess/Network/NetworkProcessProxy.h >=================================================================== >--- Source/WebKit/UIProcess/Network/NetworkProcessProxy.h (revision 229604) >+++ Source/WebKit/UIProcess/Network/NetworkProcessProxy.h (working copy) >@@ -82,6 +82,7 @@ public: > void hasStorageAccessForFrame(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool)>&& callback); > void getAllStorageAccessEntries(PAL::SessionID, CompletionHandler<void(Vector<String>&& domains)>&&); > void grantStorageAccess(PAL::SessionID, const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID, CompletionHandler<void(bool)>&& callback); >+ void removeAllStorageAccess(PAL::SessionID); > #endif > > void writeBlobToFilePath(const WebCore::URL&, const String& path, CompletionHandler<void(bool)>&& callback); >Index: Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >=================================================================== >--- Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp (revision 229604) >+++ Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp (working copy) >@@ -1214,6 +1214,12 @@ void WebsiteDataStore::grantStorageAcces > processPool->networkProcess()->grantStorageAccess(m_sessionID, resourceDomain, firstPartyDomain, frameID, pageID, WTFMove(callback)); > } > >+void WebsiteDataStore::removeAllStorageAccessHandler() >+{ >+ for (auto& processPool : processPools()) >+ processPool->networkProcess()->removeAllStorageAccess(m_sessionID); >+} >+ > void WebsiteDataStore::removePrevalentDomains(const Vector<String>& domains) > { > for (auto& processPool : processPools()) >@@ -1444,6 +1450,8 @@ void WebsiteDataStore::enableResourceLoa > hasStorageAccessForFrameHandler(resourceDomain, firstPartyDomain, frameID, pageID, WTFMove(callback)); > }, [this, protectedThis = makeRef(*this)] (const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID, WTF::CompletionHandler<void(bool wasGranted)>&& callback) { > grantStorageAccessHandler(resourceDomain, firstPartyDomain, frameID, pageID, WTFMove(callback)); >+ }, [this, protectedThis = makeRef(*this)] () { >+ removeAllStorageAccessHandler(); > }, [this, protectedThis = makeRef(*this)] (const Vector<String>& domainsToRemove) { > removePrevalentDomains(domainsToRemove); > }); >Index: Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >=================================================================== >--- Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h (revision 229604) >+++ Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h (working copy) >@@ -127,6 +127,7 @@ public: > void hasStorageAccessForFrameHandler(const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, WTF::CompletionHandler<void(bool hasAccess)>&& callback); > void getAllStorageAccessEntries(CompletionHandler<void(Vector<String>&& domains)>&&); > void grantStorageAccessHandler(const String& resourceDomain, const String& firstPartyDomain, std::optional<uint64_t> frameID, uint64_t pageID, WTF::CompletionHandler<void(bool wasGranted)>&& callback); >+ void removeAllStorageAccessHandler(); > void removePrevalentDomains(const Vector<String>& domains); > void hasStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t pageID, WTF::CompletionHandler<void (bool)>&& callback); > void requestStorageAccess(String&& subFrameHost, String&& topFrameHost, uint64_t frameID, uint64_t pageID, WTF::CompletionHandler<void (bool)>&& callback);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 183641
:
335789
|
335795
|
335800
|
335809
|
335811
|
335814
|
335817
|
335822
|
335825
|
335828