WebKit Bugzilla
Attachment 349977 Details for
Bug 189684
: Clear persistent storage between tests for resourceLoadStatistics
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189684-20180917172030.patch (text/plain), 4.73 KB, created by
Woodrow Wang
on 2018-09-17 17:20:32 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Woodrow Wang
Created:
2018-09-17 17:20:32 PDT
Size:
4.73 KB
patch
obsolete
>Subversion Revision: 236094 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index c45212f3dcf6c4dfccee218ab05f8fc3c34889fb..b72975440008354a57620f9cea4a12b6b6a09e1d 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,21 @@ >+2018-09-17 Woodrow Wang <woodrow_wang@apple.com> >+ >+ Clear persistent storage between tests for resourceLoadStatistics >+ https://bugs.webkit.org/show_bug.cgi?id=189684 >+ <rdar://problem/44540099> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: >+ (WKWebsiteDataStoreStatisticsResetToConsistentState): >+ * UIProcess/WebResourceLoadStatisticsStore.cpp: >+ (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): >+ >+ Remove function only called in testing for resetting statistics to consistent >+ state. >+ >+ (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory): Deleted. >+ > 2018-09-14 Woodrow Wang <woodrow_wang@apple.com> > > Clear pending resource load statistics' writes after tests >diff --git a/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp b/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp >index 7f23e90ff7c6e2ce4d54792c64a0b9623f2efe83..6ef3bf6560358dcd77a2f542f436b463659bb441 100644 >--- a/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp >+++ b/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp >@@ -476,7 +476,7 @@ void WKWebsiteDataStoreStatisticsResetToConsistentState(WKWebsiteDataStoreRef da > return; > > statisticsStore->resetParametersToDefaultValues([callbackAggregator = callbackAggregator.copyRef()] { }); >- statisticsStore->scheduleClearInMemory([callbackAggregator = callbackAggregator.copyRef()] { }); >+ statisticsStore->scheduleClearInMemoryAndPersistent(WebKit::WebResourceLoadStatisticsStore::ShouldGrandfather::No, [callbackAggregator = callbackAggregator.copyRef()] { }); > } > > void WKWebsiteDataStoreRemoveAllFetchCaches(WKWebsiteDataStoreRef dataStoreRef, void* context, WKWebsiteDataStoreRemoveFetchCacheRemovalFunction callback) >diff --git a/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp b/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp >index 6c5089afeb5de3f4859ce14d0631ebca07240a4d..138d840f6b54f109a97c1c46ce5161fed0f6d97a 100644 >--- a/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp >+++ b/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp >@@ -38,6 +38,7 @@ > #include "WebsiteDataFetchOption.h" > #include "WebsiteDataStore.h" > #include <WebCore/ResourceLoadStatistics.h> >+#include <wtf/CallbackAggregator.h> > #include <wtf/CrossThreadCopier.h> > #include <wtf/NeverDestroyed.h> > #include <wtf/threads/BinarySemaphore.h> >@@ -759,41 +760,23 @@ void WebResourceLoadStatisticsStore::scheduleCookieBlockingStateReset() > } > #endif > >-void WebResourceLoadStatisticsStore::scheduleClearInMemory(CompletionHandler<void()>&& completionHandler) >-{ >- ASSERT(RunLoop::isMain()); >- postTask([this, completionHandler = WTFMove(completionHandler)]() mutable { >- >- CompletionHandler<void()> callCompletionHandlerOnMainThread = [completionHandler = WTFMove(completionHandler)]() mutable { >- postTaskReply(WTFMove(completionHandler)); >- }; >- >- if (!m_memoryStore) { >- callCompletionHandlerOnMainThread(); >- return; >- } >- >- m_memoryStore->clear(WTFMove(callCompletionHandlerOnMainThread)); >- }); >-} >- > void WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent(ShouldGrandfather shouldGrandfather, CompletionHandler<void()>&& completionHandler) > { > ASSERT(RunLoop::isMain()); > postTask([this, shouldGrandfather, completionHandler = WTFMove(completionHandler)] () mutable { >- if (m_memoryStore) >- m_memoryStore->clear([] { }); > if (m_persistentStorage) > m_persistentStorage->clear(); >- > CompletionHandler<void()> callCompletionHandlerOnMainThread = [completionHandler = WTFMove(completionHandler)]() mutable { > postTaskReply(WTFMove(completionHandler)); > }; > >- if (shouldGrandfather == ShouldGrandfather::Yes && m_memoryStore) >- m_memoryStore->grandfatherExistingWebsiteData(WTFMove(callCompletionHandlerOnMainThread)); >- else >- callCompletionHandlerOnMainThread(); >+ auto callbackAggregator = CallbackAggregator::create(WTFMove(callCompletionHandlerOnMainThread)); >+ >+ if (m_memoryStore) { >+ if (shouldGrandfather == ShouldGrandfather::Yes) >+ m_memoryStore->grandfatherExistingWebsiteData([callbackAggregator = callbackAggregator.copyRef()] { }); >+ m_memoryStore->clear([callbackAggregator = callbackAggregator.copyRef()] { }); >+ } > }); > } >
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 189684
:
349977
|
349986
|
350032
|
350059
|
350082
|
350130
|
350147
|
350151
|
350279