Changeset 236229 in webkit
- Timestamp:
- Sep 19, 2018, 3:57:23 PM (8 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/API/C/WKWebsiteDataStoreRef.cpp (modified) (1 diff)
-
UIProcess/WebResourceLoadStatisticsStore.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r236227 r236229 1 2018-09-19 Woodrow Wang <woodrow_wang@apple.com> 2 3 Clear persistent storage between tests for resourceLoadStatistics 4 https://bugs.webkit.org/show_bug.cgi?id=189684 5 <rdar://problem/44540099> 6 7 Reviewed by Chris Dumez. 8 9 * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: 10 (WKWebsiteDataStoreStatisticsResetToConsistentState): 11 * UIProcess/WebResourceLoadStatisticsStore.cpp: 12 (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): 13 14 Remove function only called in testing for resetting statistics to consistent 15 state. 16 17 (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory): Deleted. 18 1 19 2018-09-19 Chris Dumez <cdumez@apple.com> 2 20 -
trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp
r236216 r236229 485 485 486 486 statisticsStore->resetParametersToDefaultValues([callbackAggregator = callbackAggregator.copyRef()] { }); 487 statisticsStore->scheduleClearInMemory ([callbackAggregator = callbackAggregator.copyRef()] { });487 statisticsStore->scheduleClearInMemoryAndPersistent(WebKit::WebResourceLoadStatisticsStore::ShouldGrandfather::No, [callbackAggregator = callbackAggregator.copyRef()] { }); 488 488 } 489 489 -
trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp
r236216 r236229 760 760 #endif 761 761 762 void WebResourceLoadStatisticsStore::scheduleClearInMemory(CompletionHandler<void()>&& completionHandler)763 {764 ASSERT(RunLoop::isMain());765 postTask([this, completionHandler = WTFMove(completionHandler)]() mutable {766 767 CompletionHandler<void()> callCompletionHandlerOnMainThread = [completionHandler = WTFMove(completionHandler)]() mutable {768 postTaskReply(WTFMove(completionHandler));769 };770 771 if (!m_memoryStore) {772 callCompletionHandlerOnMainThread();773 return;774 }775 776 m_memoryStore->clear(WTFMove(callCompletionHandlerOnMainThread));777 });778 }779 780 762 void WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent(ShouldGrandfather shouldGrandfather, CompletionHandler<void()>&& completionHandler) 781 763 { 782 764 ASSERT(RunLoop::isMain()); 783 postTask([this, shouldGrandfather, completionHandler = WTFMove(completionHandler)] () mutable { 784 if (m_memoryStore) 785 m_memoryStore->clear([] { }); 765 postTask([this, protectedThis = makeRef(*this), shouldGrandfather, completionHandler = WTFMove(completionHandler)] () mutable { 786 766 if (m_persistentStorage) 787 767 m_persistentStorage->clear(); 788 789 CompletionHandler <void()> callCompletionHandlerOnMainThread =[completionHandler = WTFMove(completionHandler)]() mutable {768 769 CompletionHandlerCallingScope completionHandlerCaller([completionHandler = WTFMove(completionHandler)]() mutable { 790 770 postTaskReply(WTFMove(completionHandler)); 791 }; 792 793 if (shouldGrandfather == ShouldGrandfather::Yes && m_memoryStore) 794 m_memoryStore->grandfatherExistingWebsiteData(WTFMove(callCompletionHandlerOnMainThread)); 795 else 796 callCompletionHandlerOnMainThread(); 771 }); 772 773 if (m_memoryStore) { 774 m_memoryStore->clear([this, protectedThis = protectedThis.copyRef(), shouldGrandfather, completionHandlerCaller = WTFMove(completionHandlerCaller)] () mutable { 775 if (shouldGrandfather == ShouldGrandfather::Yes) { 776 if (m_memoryStore) 777 m_memoryStore->grandfatherExistingWebsiteData(completionHandlerCaller.release()); 778 else 779 RELEASE_LOG(ResourceLoadStatistics, "WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent After being cleared, m_memoryStore is null when trying to grandfather data."); 780 } 781 }); 782 } else { 783 if (shouldGrandfather == ShouldGrandfather::Yes) 784 RELEASE_LOG(ResourceLoadStatistics, "WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent Before being cleared, m_memoryStore is null when trying to grandfather data."); 785 } 797 786 }); 798 787 }
Note:
See TracChangeset
for help on using the changeset viewer.