Changeset 219236 in webkit


Ignore:
Timestamp:
Jul 6, 2017 9:15:09 PM (7 years ago)
Author:
Chris Dumez
Message:

Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver
https://bugs.webkit.org/show_bug.cgi?id=174234

Reviewed by Brent Fulgham.

Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver. It is
always 0 since this member is only initialized later on, in the UIProcess.

  • loader/ResourceLoadObserver.cpp:

(WebCore::ResourceLoadObserver::logFrameNavigation):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r219234 r219236  
     12017-07-06  Chris Dumez  <cdumez@apple.com>
     2
     3        Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver
     4        https://bugs.webkit.org/show_bug.cgi?id=174234
     5
     6        Reviewed by Brent Fulgham.
     7
     8        Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver. It is
     9        always 0 since this member is only initialized later on, in the UIProcess.
     10
     11        * loader/ResourceLoadObserver.cpp:
     12        (WebCore::ResourceLoadObserver::logFrameNavigation):
     13        (WebCore::ResourceLoadObserver::logSubresourceLoading):
     14        (WebCore::ResourceLoadObserver::logWebSocketLoading):
     15
    1162017-07-06  Yoav Weiss  <yoav@yoav.ws>
    217
  • trunk/Source/WebCore/loader/ResourceLoadObserver.cpp

    r219231 r219236  
    8585    ASSERT(topFrame.document());
    8686    ASSERT(topFrame.page());
     87
     88    if (frame.isMainFrame())
     89        return;
    8790   
    8891    if (!shouldLog(topFrame.page()))
     
    110113
    111114    auto& targetStatistics = ensureResourceStatisticsForPrimaryDomain(targetPrimaryDomain);
    112 
    113     // Always fire if we have previously removed data records for this domain
    114     // FIXME: targetStatistics.dataRecordsRemoved is always 0 in WebCore as it gets populated in the UIProcess.
    115     bool shouldCallNotificationCallback = targetStatistics.dataRecordsRemoved > 0;
    116 
    117     if (!frame.isMainFrame()) {
    118         auto subframeUnderTopFrameOriginsResult = targetStatistics.subframeUnderTopFrameOrigins.add(mainFramePrimaryDomain);
    119         if (subframeUnderTopFrameOriginsResult.isNewEntry)
    120             shouldCallNotificationCallback = true;
    121     }
    122 
    123     if (shouldCallNotificationCallback)
     115    auto subframeUnderTopFrameOriginsResult = targetStatistics.subframeUnderTopFrameOrigins.add(mainFramePrimaryDomain);
     116    if (subframeUnderTopFrameOriginsResult.isNewEntry)
    124117        scheduleNotificationIfNeeded();
    125118}
     
    151144
    152145    bool shouldCallNotificationCallback = false;
    153 
    154146    {
    155147        auto& targetStatistics = ensureResourceStatisticsForPrimaryDomain(targetPrimaryDomain);
    156 
    157         // Always fire if we have previously removed data records for this domain
    158         // FIXME: targetStatistics.dataRecordsRemoved is always 0 in WebCore as it gets populated in the UIProcess.
    159         shouldCallNotificationCallback = targetStatistics.dataRecordsRemoved > 0;
    160 
    161         auto subresourceUnderTopFrameOriginsResult = targetStatistics.subresourceUnderTopFrameOrigins.add(mainFramePrimaryDomain);
    162         if (subresourceUnderTopFrameOriginsResult.isNewEntry)
     148        if (targetStatistics.subresourceUnderTopFrameOrigins.add(mainFramePrimaryDomain).isNewEntry)
    163149            shouldCallNotificationCallback = true;
    164150    }
     
    166152    if (isRedirect) {
    167153        auto& redirectingOriginStatistics = ensureResourceStatisticsForPrimaryDomain(sourcePrimaryDomain);
    168         auto subresourceUniqueRedirectsToResult = redirectingOriginStatistics.subresourceUniqueRedirectsTo.add(targetPrimaryDomain);
    169         if (subresourceUniqueRedirectsToResult.isNewEntry)
     154        if (redirectingOriginStatistics.subresourceUniqueRedirectsTo.add(targetPrimaryDomain).isNewEntry)
    170155            shouldCallNotificationCallback = true;
    171156    }
     
    200185
    201186    auto& targetStatistics = ensureResourceStatisticsForPrimaryDomain(targetPrimaryDomain);
    202 
    203     // Always fire if we have previously removed data records for this domain
    204     // FIXME: targetStatistics.dataRecordsRemoved is always 0 in WebCore as it gets populated in the UIProcess.
    205     bool shouldCallNotificationCallback = targetStatistics.dataRecordsRemoved > 0;
    206 
    207     auto subresourceUnderTopFrameOriginsResult = targetStatistics.subresourceUnderTopFrameOrigins.add(mainFramePrimaryDomain);
    208     if (subresourceUnderTopFrameOriginsResult.isNewEntry)
    209         shouldCallNotificationCallback = true;
    210 
    211     if (shouldCallNotificationCallback)
     187    if (targetStatistics.subresourceUnderTopFrameOrigins.add(mainFramePrimaryDomain).isNewEntry)
    212188        scheduleNotificationIfNeeded();
    213189}
Note: See TracChangeset for help on using the changeset viewer.