WebKit Bugzilla
Attachment 350151 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-20180919150816.patch (text/plain), 5.26 KB, created by
Woodrow Wang
on 2018-09-19 15:08:17 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Woodrow Wang
Created:
2018-09-19 15:08:17 PDT
Size:
5.26 KB
patch
obsolete
>Subversion Revision: 236212 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 9ae6d78abc68d13001b8630035df0ecd0dceaf5b..3a0cde41e21d55ff9b31f3d98181c9bbf60750c4 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 c7db69b15d1d48d7a4da378f986c445c02e32b37..d2d7ac4b03fbab9f98b469d9f210923d0fc4f8f9 100644 >--- a/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp >+++ b/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp >@@ -759,41 +759,30 @@ 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([] { }); >+ postTask([this, protectedThis = makeRef(*this), shouldGrandfather, completionHandler = WTFMove(completionHandler)] () mutable { > if (m_persistentStorage) > m_persistentStorage->clear(); >- >- CompletionHandler<void()> callCompletionHandlerOnMainThread = [completionHandler = WTFMove(completionHandler)]() mutable { >+ >+ CompletionHandlerCallingScope completionHandlerCaller([completionHandler = WTFMove(completionHandler)]() mutable { > postTaskReply(WTFMove(completionHandler)); >- }; >+ }); > >- if (shouldGrandfather == ShouldGrandfather::Yes && m_memoryStore) >- m_memoryStore->grandfatherExistingWebsiteData(WTFMove(callCompletionHandlerOnMainThread)); >- else >- callCompletionHandlerOnMainThread(); >+ if (m_memoryStore) { >+ m_memoryStore->clear([this, protectedThis = protectedThis.copyRef(), shouldGrandfather, completionHandlerCaller = WTFMove(completionHandlerCaller)] () mutable { >+ if (shouldGrandfather == ShouldGrandfather::Yes) { >+ if (m_memoryStore) >+ m_memoryStore->grandfatherExistingWebsiteData(completionHandlerCaller.release()); >+ else >+ RELEASE_LOG(ResourceLoadStatistics, "WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent After being cleared, m_memoryStore is null when trying to grandfather data."); >+ } >+ }); >+ } else { >+ if (shouldGrandfather == ShouldGrandfather::Yes) >+ RELEASE_LOG(ResourceLoadStatistics, "WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent Before being cleared, m_memoryStore is null when trying to grandfather data."); >+ } > }); > } >
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