⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 236233 in webkit


Ignore:
Timestamp:
Sep 19, 2018, 5:20:05 PM (8 years ago)
Author:
realdawei@apple.com
Message:

Unreviewed, rolling out r236229.

caused API timouts on mac and ios

Reverted changeset:

"Clear persistent storage between tests for
resourceLoadStatistics"
​https://bugs.webkit.org/show_bug.cgi?id=189684
​https://trac.webkit.org/changeset/236229

Patch by Dawei Fenton <​realdawei@apple.com> on 2018-09-19

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r236232 r236233  
     12018-09-19  Dawei Fenton  <realdawei@apple.com>
     2
     3        Unreviewed, rolling out r236229.
     4
     5        caused API timouts on mac and ios
     6
     7        Reverted changeset:
     8
     9        "Clear persistent storage between tests for
     10        resourceLoadStatistics"
     11        https://bugs.webkit.org/show_bug.cgi?id=189684
     12        https://trac.webkit.org/changeset/236229
     13
    1142018-09-19  Alex Christensen  <achristensen@webkit.org>
    215
  • trunk/Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp

    r236229 r236233  
    485485
    486486    statisticsStore->resetParametersToDefaultValues([callbackAggregator = callbackAggregator.copyRef()] { });
    487     statisticsStore->scheduleClearInMemoryAndPersistent(WebKit::WebResourceLoadStatisticsStore::ShouldGrandfather::No, [callbackAggregator = callbackAggregator.copyRef()] { });
     487    statisticsStore->scheduleClearInMemory([callbackAggregator = callbackAggregator.copyRef()] { });
    488488}
    489489
  • trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp

    r236229 r236233  
    760760#endif
    761761
     762void 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
    762780void WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent(ShouldGrandfather shouldGrandfather, CompletionHandler<void()>&& completionHandler)
    763781{
    764782    ASSERT(RunLoop::isMain());
    765     postTask([this, protectedThis = makeRef(*this), shouldGrandfather, completionHandler = WTFMove(completionHandler)] () mutable {
     783    postTask([this, shouldGrandfather, completionHandler = WTFMove(completionHandler)] () mutable {
     784        if (m_memoryStore)
     785            m_memoryStore->clear([] { });
    766786        if (m_persistentStorage)
    767787            m_persistentStorage->clear();
    768 
    769         CompletionHandlerCallingScope completionHandlerCaller([completionHandler = WTFMove(completionHandler)]() mutable {
     788       
     789        CompletionHandler<void()> callCompletionHandlerOnMainThread = [completionHandler = WTFMove(completionHandler)]() mutable {
    770790            postTaskReply(WTFMove(completionHandler));
    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         }
     791        };
     792
     793        if (shouldGrandfather == ShouldGrandfather::Yes && m_memoryStore)
     794            m_memoryStore->grandfatherExistingWebsiteData(WTFMove(callCompletionHandlerOnMainThread));
     795        else
     796            callCompletionHandlerOnMainThread();
    786797    });
    787798}
Note: See TracChangeset for help on using the changeset viewer.