Changeset 240247 in webkit


Ignore:
Timestamp:
Jan 21, 2019 5:55:47 PM (5 years ago)
Author:
Brent Fulgham
Message:

Unreviewed test fix after r240243
Nhttps://bugs.webkit.org/show_bug.cgi?id=193660
<rdar://problem/47433602>

The new ResourceLoadStatistics section of 'removeData' was incrementing the
pending callback count before deciding whether to send a message to delete
data. This left the count out-of-balance leading to the operation never
completing.

This patch also prevents sending a second message to the NetworkProcess
requesting data be deleted if the message was already sent in an earlier
section of the method (e.g., as typically happens when all website data
is being deleted).

  • UIProcess/WebsiteData/WebsiteDataStore.cpp:

(WebKit::WebsiteDataStore::removeData):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r240243 r240247  
     12019-01-21  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Unreviewed test fix after r240243
     4        Nhttps://bugs.webkit.org/show_bug.cgi?id=193660
     5        <rdar://problem/47433602>
     6
     7        The new ResourceLoadStatistics section of 'removeData' was incrementing the
     8        pending callback count before deciding whether to send a message to delete
     9        data. This left the count out-of-balance leading to the operation never
     10        completing.
     11
     12        This patch also prevents sending a second message to the NetworkProcess
     13        requesting data be deleted if the message was already sent in an earlier
     14        section of the method (e.g., as typically happens when all website data
     15        is being deleted).
     16
     17        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
     18        (WebKit::WebsiteDataStore::removeData):
     19
    1202019-01-21  Brent Fulgham  <bfulgham@apple.com>
    221
  • trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp

    r240243 r240247  
    758758#endif
    759759
     760    bool didNotifyNetworkProcessToDeleteWebsiteData = false;
    760761    auto networkProcessAccessType = computeNetworkProcessAccessTypeForDataRemoval(dataTypes, !isPersistent());
    761762    if (networkProcessAccessType != ProcessAccessType::None) {
     
    779780                callbackAggregator->removePendingCallback();
    780781            });
     782            didNotifyNetworkProcessToDeleteWebsiteData = true;
    781783        }
    782784    }
     
    939941        auto shouldGrandfather = ((monitoredTypesRaw & deletedTypesRaw) == monitoredTypesRaw) ? ShouldGrandfather::No : ShouldGrandfather::Yes;
    940942       
    941         callbackAggregator->addPendingCallback();
    942 
    943943        if (m_resourceLoadStatistics) {
     944            callbackAggregator->addPendingCallback();
    944945            m_resourceLoadStatistics->scheduleClearInMemoryAndPersistent(modifiedSince, shouldGrandfather, [callbackAggregator] {
    945946                callbackAggregator->removePendingCallback();
    946947            });
    947         } else {
     948        } else if (!didNotifyNetworkProcessToDeleteWebsiteData) {
    948949            for (auto& processPool : processPools()) {
    949950                if (auto* process = processPool->networkProcess()) {
     951                    callbackAggregator->addPendingCallback();
    950952                    process->deleteWebsiteData(m_sessionID, dataTypes, modifiedSince, [callbackAggregator] {
    951953                        callbackAggregator->removePendingCallback();
Note: See TracChangeset for help on using the changeset viewer.