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

Changeset 243671 in webkit


Ignore:
Timestamp:
Mar 29, 2019, 6:09:12 PM (7 years ago)
Author:
wilander@apple.com
Message:

Move WebResourceLoadStatisticsStore IPC calls from the UI process to the network process
https://bugs.webkit.org/show_bug.cgi?id=196407
<rdar://problem/47859936>

Reviewed by Brent Fulgham.

Source/WebCore:

Test: http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture.html

This patch removes old code for the batching into "statistics updated" calls.
Since the move of Resource Load Statistics to the network process, all such
collection is done directly through dedicated calls to the network process.

The remaining functionality was renamed to make it more clear, i.e.
ResourceLoadObserver::notifyObserver() renamed to
ResourceLoadObserver::updateCentralStatisticsStore().

  • loader/ResourceLoadObserver.cpp:

(WebCore::ResourceLoadObserver::setStatisticsUpdatedCallback):
(WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
(WebCore::ResourceLoadObserver::updateCentralStatisticsStore):
(WebCore::ResourceLoadObserver::clearState):
(WebCore::ResourceLoadObserver::setNotificationCallback): Deleted.
(WebCore::ResourceLoadObserver::ResourceLoadObserver): Deleted.
(WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded): Deleted.
(WebCore::ResourceLoadObserver::notifyObserver): Deleted.

  • loader/ResourceLoadObserver.h:
  • testing/Internals.cpp:

(WebCore::Internals::notifyResourceLoadObserver):

Source/WebKit:

The two WebResourceLoadStatisticsStore IPC endpoints were left behind when we
moved Resource Load Statistics from the UI process to the network process. One
of the endpoints is the message RequestStorageAccessUnderOpener which underpins
our compatibility fix for federated logins using popups. This patch redirects
these IPC calls to the network process and cleans up some assumptions around
them.

  • CMakeLists.txt:

Removed the old IPC receiver.

  • DerivedSources.make:

Removed the old IPC receiver.

  • NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:

(WebKit::WebResourceLoadStatisticsStore::requestUpdate): Deleted.

This is no longer needed since there is a dedicated update mechanism
that actually sends the update.

  • NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
  • NetworkProcess/NetworkConnectionToWebProcess.cpp:

(WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
(WebKit::NetworkConnectionToWebProcess::requestStorageAccessUnderOpener):

Two new IPC receivers to pipe the calls to the network process.

(WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate): Deleted.

NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated now serves
this purpose.

  • NetworkProcess/NetworkConnectionToWebProcess.h:
  • NetworkProcess/NetworkConnectionToWebProcess.messages.in:
  • UIProcess/WebResourceLoadStatisticsStore.messages.in: Removed.

Removed the old IPC receiver.

  • UIProcess/WebsiteData/WebsiteDataStore.cpp:
  • WebKit.xcodeproj/project.pbxproj:
  • WebProcess/InjectedBundle/API/c/WKBundle.cpp:

(WKBundleResourceLoadStatisticsNotifyObserver):

Function name update.

  • WebProcess/WebProcess.cpp:

Now calls IPC to the network process instead of the UI process.

LayoutTests:

  • http/tests/storageAccess/deny-storage-access-under-opener-expected.txt:
  • http/tests/storageAccess/deny-storage-access-under-opener-if-auto-dismiss-expected.txt:
  • http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture-expected.txt: Added.
  • http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture.html: Added.
  • http/tests/storageAccess/resources/get-cookies.php:
  • http/tests/storageAccess/resources/produce-user-gesture-set-cookie-and-report-back.html: Added.
Location:
trunk
Files:
3 added
1 deleted
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r243669 r243671  
     12019-03-29  John Wilander  <wilander@apple.com>
     2
     3        Move WebResourceLoadStatisticsStore IPC calls from the UI process to the network process
     4        https://bugs.webkit.org/show_bug.cgi?id=196407
     5        <rdar://problem/47859936>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * http/tests/storageAccess/deny-storage-access-under-opener-expected.txt:
     10        * http/tests/storageAccess/deny-storage-access-under-opener-if-auto-dismiss-expected.txt:
     11        * http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture-expected.txt: Added.
     12        * http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture.html: Added.
     13        * http/tests/storageAccess/resources/get-cookies.php:
     14        * http/tests/storageAccess/resources/produce-user-gesture-set-cookie-and-report-back.html: Added.
     15
    1162019-03-29  Chris Dumez  <cdumez@apple.com>
    217
  • trunk/LayoutTests/http/tests/storageAccess/deny-storage-access-under-opener-expected.txt

    r231450 r243671  
    1515Should not receive first-party cookie.
    1616Did not receive cookie named 'firstPartyCookie'.
    17 Did not receive cookie named ''.
    1817Client-side document.cookie:
  • trunk/LayoutTests/http/tests/storageAccess/deny-storage-access-under-opener-if-auto-dismiss-expected.txt

    r236563 r243671  
    1515Should not receive first-party cookie.
    1616Did not receive cookie named 'firstPartyCookie'.
    17 Did not receive cookie named ''.
    1817Client-side document.cookie:
  • trunk/LayoutTests/http/tests/storageAccess/resources/get-cookies.php

    r235569 r243671  
    66    echo "Received cookie named '" . $_GET["name1"] . "'.<br>";
    77}
    8 if(!isset($_COOKIE[$_GET["name2"]])) {
    9     echo "Did not receive cookie named '" . $_GET["name2"] . "'.<br>";
    10 } else {
    11     echo "Received cookie named '" . $_GET["name2"] . "'.<br>";
     8if(!empty($_GET["name2"])) {
     9    if(!isset($_COOKIE[$_GET["name2"]])) {
     10        echo "Did not receive cookie named '" . $_GET["name2"] . "'.<br>";
     11    } else {
     12        echo "Received cookie named '" . $_GET["name2"] . "'.<br>";
     13    }
    1214}
    1315if(!empty($_GET["name3"])) {
  • trunk/Source/WebCore/ChangeLog

    r243669 r243671  
     12019-03-29  John Wilander  <wilander@apple.com>
     2
     3        Move WebResourceLoadStatisticsStore IPC calls from the UI process to the network process
     4        https://bugs.webkit.org/show_bug.cgi?id=196407
     5        <rdar://problem/47859936>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Test: http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture.html
     10
     11        This patch removes old code for the batching into "statistics updated" calls.
     12        Since the move of Resource Load Statistics to the network process, all such
     13        collection is done directly through dedicated calls to the network process.
     14
     15        The remaining functionality was renamed to make it more clear, i.e.
     16        ResourceLoadObserver::notifyObserver() renamed to
     17        ResourceLoadObserver::updateCentralStatisticsStore().
     18
     19        * loader/ResourceLoadObserver.cpp:
     20        (WebCore::ResourceLoadObserver::setStatisticsUpdatedCallback):
     21        (WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
     22        (WebCore::ResourceLoadObserver::logSubresourceLoading):
     23        (WebCore::ResourceLoadObserver::logWebSocketLoading):
     24        (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
     25        (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
     26        (WebCore::ResourceLoadObserver::updateCentralStatisticsStore):
     27        (WebCore::ResourceLoadObserver::clearState):
     28        (WebCore::ResourceLoadObserver::setNotificationCallback): Deleted.
     29        (WebCore::ResourceLoadObserver::ResourceLoadObserver): Deleted.
     30        (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded): Deleted.
     31        (WebCore::ResourceLoadObserver::notifyObserver): Deleted.
     32        * loader/ResourceLoadObserver.h:
     33        * testing/Internals.cpp:
     34        (WebCore::Internals::notifyResourceLoadObserver):
     35
    1362019-03-29  Chris Dumez  <cdumez@apple.com>
    237
  • trunk/Source/WebCore/loader/ResourceLoadObserver.cpp

    r242155 r243671  
    5454}
    5555
    56 void ResourceLoadObserver::setNotificationCallback(WTF::Function<void (Vector<ResourceLoadStatistics>&&)>&& notificationCallback)
     56void ResourceLoadObserver::setStatisticsUpdatedCallback(WTF::Function<void(Vector<ResourceLoadStatistics>&&)>&& notificationCallback)
    5757{
    5858    ASSERT(!m_notificationCallback);
     
    6060}
    6161
    62 void ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback(WTF::Function<void(const RegistrableDomain& domainInNeedOfStorageAccess, uint64_t openerPageID, const RegistrableDomain& openerDomain)>&& callback)
     62void ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback(WTF::Function<void(PAL::SessionID sessionID, const RegistrableDomain& domainInNeedOfStorageAccess, uint64_t openerPageID, const RegistrableDomain& openerDomain)>&& callback)
    6363{
    6464    ASSERT(!m_requestStorageAccessUnderOpenerCallback);
     
    9090}
    9191   
    92 ResourceLoadObserver::ResourceLoadObserver()
    93     : m_notificationTimer(*this, &ResourceLoadObserver::notifyObserver)
    94 {
    95 }
    96 
    9792static inline bool is3xxRedirect(const ResourceResponse& response)
    9893{
     
    134129        return;
    135130
    136     bool shouldCallNotificationCallback = false;
    137131    {
    138132        auto& targetStatistics = ensureResourceStatisticsForRegistrableDomain(targetDomain);
    139133        auto lastSeen = ResourceLoadStatistics::reduceTimeResolution(WallTime::now());
    140134        targetStatistics.lastSeen = lastSeen;
    141         if (targetStatistics.subresourceUnderTopFrameDomains.add(topFrameDomain).isNewEntry)
    142             shouldCallNotificationCallback = true;
     135        targetStatistics.subresourceUnderTopFrameDomains.add(topFrameDomain);
    143136
    144137        m_logSubresourceLoadingNotificationCallback(page->sessionID(), targetDomain, topFrameDomain, lastSeen);
     
    147140    if (isRedirect) {
    148141        auto& redirectingOriginStatistics = ensureResourceStatisticsForRegistrableDomain(redirectedFromDomain);
    149         bool isNewRedirectToEntry = redirectingOriginStatistics.subresourceUniqueRedirectsTo.add(targetDomain).isNewEntry;
     142        redirectingOriginStatistics.subresourceUniqueRedirectsTo.add(targetDomain);
    150143        auto& targetStatistics = ensureResourceStatisticsForRegistrableDomain(targetDomain);
    151         bool isNewRedirectFromEntry = targetStatistics.subresourceUniqueRedirectsFrom.add(redirectedFromDomain).isNewEntry;
    152 
    153         if (isNewRedirectToEntry || isNewRedirectFromEntry)
    154             shouldCallNotificationCallback = true;
     144        targetStatistics.subresourceUniqueRedirectsFrom.add(redirectedFromDomain);
    155145
    156146        m_logSubresourceRedirectNotificationCallback(page->sessionID(), redirectedFromDomain, targetDomain);
    157147    }
    158 
    159     if (shouldCallNotificationCallback)
    160         scheduleNotificationIfNeeded();
    161148}
    162149
     
    182169    auto& targetStatistics = ensureResourceStatisticsForRegistrableDomain(targetDomain);
    183170    targetStatistics.lastSeen = lastSeen;
    184     if (targetStatistics.subresourceUnderTopFrameDomains.add(topFrameDomain).isNewEntry)
    185         scheduleNotificationIfNeeded();
     171    targetStatistics.subresourceUnderTopFrameDomains.add(topFrameDomain);
    186172
    187173    m_logWebSocketLoadingNotificationCallback(sessionID, targetDomain, topFrameDomain, lastSeen);
     
    216202                if (auto* openerFrame = openerDocument->frame()) {
    217203                    if (auto openerPageID = openerFrame->loader().client().pageID())
    218                         requestStorageAccessUnderOpener(topFrameDomain, openerPageID.value(), *openerDocument);
     204                        requestStorageAccessUnderOpener(document.sessionID(), topFrameDomain, openerPageID.value(), *openerDocument);
    219205                }
    220206            }
     
    224210    m_logUserInteractionNotificationCallback(document.sessionID(), topFrameDomain);
    225211#endif
    226 
    227     m_notificationTimer.stop();
    228     notifyObserver();
    229212
    230213#if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED
     
    251234
    252235#if ENABLE(RESOURCE_LOAD_STATISTICS)
    253 void ResourceLoadObserver::requestStorageAccessUnderOpener(const RegistrableDomain& domainInNeedOfStorageAccess, uint64_t openerPageID, Document& openerDocument)
     236void ResourceLoadObserver::requestStorageAccessUnderOpener(PAL::SessionID sessionID, const RegistrableDomain& domainInNeedOfStorageAccess, uint64_t openerPageID, Document& openerDocument)
    254237{
    255238    auto openerUrl = openerDocument.url();
     
    258241        && !openerDocument.hasRequestedPageSpecificStorageAccessWithUserInteraction(domainInNeedOfStorageAccess)
    259242        && !equalIgnoringASCIICase(openerUrl.string(), WTF::blankURL())) {
    260         m_requestStorageAccessUnderOpenerCallback(domainInNeedOfStorageAccess, openerPageID, openerDomain);
     243        m_requestStorageAccessUnderOpenerCallback(sessionID, domainInNeedOfStorageAccess, openerPageID, openerDomain);
    261244        // Remember user interaction-based requests since they don't need to be repeated.
    262245        openerDocument.setHasRequestedPageSpecificStorageAccessWithUserInteraction(domainInNeedOfStorageAccess);
     
    383366}
    384367
    385 void ResourceLoadObserver::scheduleNotificationIfNeeded()
    386 {
    387     ASSERT(m_notificationCallback);
    388     if (m_resourceStatisticsMap.isEmpty()) {
    389         m_notificationTimer.stop();
    390         return;
    391     }
    392 
    393     if (!m_notificationTimer.isActive())
    394         m_notificationTimer.startOneShot(minimumNotificationInterval);
    395 }
    396 
    397 void ResourceLoadObserver::notifyObserver()
    398 {
    399     ASSERT(m_notificationCallback);
    400     m_notificationTimer.stop();
     368void ResourceLoadObserver::updateCentralStatisticsStore()
     369{
    401370    m_notificationCallback(takeStatistics());
    402371}
     
    425394void ResourceLoadObserver::clearState()
    426395{
    427     m_notificationTimer.stop();
    428396    m_resourceStatisticsMap.clear();
    429397    m_lastReportedUserInteractionMap.clear();
  • trunk/Source/WebCore/loader/ResourceLoadObserver.h

    r242155 r243671  
    7373    WEBCORE_EXPORT String statisticsForURL(const URL&);
    7474
    75     WEBCORE_EXPORT void setNotificationCallback(WTF::Function<void (Vector<ResourceLoadStatistics>&&)>&&);
    76     WEBCORE_EXPORT void setRequestStorageAccessUnderOpenerCallback(Function<void(const RegistrableDomain&, uint64_t, const RegistrableDomain&)>&&);
     75    WEBCORE_EXPORT void setStatisticsUpdatedCallback(WTF::Function<void(Vector<ResourceLoadStatistics>&&)>&&);
     76    WEBCORE_EXPORT void setRequestStorageAccessUnderOpenerCallback(Function<void(PAL::SessionID, const RegistrableDomain&, uint64_t, const RegistrableDomain&)>&&);
    7777    WEBCORE_EXPORT void setLogUserInteractionNotificationCallback(Function<void(PAL::SessionID, const RegistrableDomain&)>&&);
    7878    WEBCORE_EXPORT void setLogWebSocketLoadingNotificationCallback(Function<void(PAL::SessionID, const RegistrableDomain&, const RegistrableDomain&, WallTime)>&&);
     
    8080    WEBCORE_EXPORT void setLogSubresourceRedirectNotificationCallback(Function<void(PAL::SessionID, const RegistrableDomain&, const RegistrableDomain&)>&&);
    8181
    82     WEBCORE_EXPORT void notifyObserver();
     82    WEBCORE_EXPORT void updateCentralStatisticsStore();
    8383    WEBCORE_EXPORT void clearState();
    8484
     
    8989
    9090private:
    91     ResourceLoadObserver();
    92 
    9391    bool shouldLog(bool usesEphemeralSession) const;
    9492    ResourceLoadStatistics& ensureResourceStatisticsForRegistrableDomain(const RegistrableDomain&);
    9593
    96     void scheduleNotificationIfNeeded();
    9794    Vector<ResourceLoadStatistics> takeStatistics();
    9895
    9996#if ENABLE(RESOURCE_LOAD_STATISTICS)
    100     void requestStorageAccessUnderOpener(const RegistrableDomain& domainInNeedOfStorageAccess, uint64_t openerPageID, Document& openerDocument);
     97    void requestStorageAccessUnderOpener(PAL::SessionID, const RegistrableDomain& domainInNeedOfStorageAccess, uint64_t openerPageID, Document& openerDocument);
    10198#endif
    10299
     
    104101    HashMap<RegistrableDomain, WTF::WallTime> m_lastReportedUserInteractionMap;
    105102    Function<void(Vector<ResourceLoadStatistics>&&)> m_notificationCallback;
    106     Function<void(const RegistrableDomain&, uint64_t, const RegistrableDomain&)> m_requestStorageAccessUnderOpenerCallback;
     103    Function<void(PAL::SessionID, const RegistrableDomain&, uint64_t, const RegistrableDomain&)> m_requestStorageAccessUnderOpenerCallback;
    107104    Function<void(PAL::SessionID, const RegistrableDomain&)> m_logUserInteractionNotificationCallback;
    108105    Function<void(PAL::SessionID, const RegistrableDomain&, const RegistrableDomain&, WallTime)> m_logWebSocketLoadingNotificationCallback;
    109106    Function<void(PAL::SessionID, const RegistrableDomain&, const RegistrableDomain&, WallTime)> m_logSubresourceLoadingNotificationCallback;
    110107    Function<void(PAL::SessionID, const RegistrableDomain&, const RegistrableDomain&)> m_logSubresourceRedirectNotificationCallback;
    111 
    112     Timer m_notificationTimer;
    113108#if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED
    114109    uint64_t m_loggingCounter { 0 };
  • trunk/Source/WebCore/testing/Internals.cpp

    r243482 r243671  
    49174917void Internals::notifyResourceLoadObserver()
    49184918{
    4919     ResourceLoadObserver::shared().notifyObserver();
     4919    ResourceLoadObserver::shared().updateCentralStatisticsStore();
    49204920}
    49214921
  • trunk/Source/WebKit/CMakeLists.txt

    r242503 r243671  
    145145    UIProcess/WebProcessPool.messages.in
    146146    UIProcess/WebProcessProxy.messages.in
    147     UIProcess/WebResourceLoadStatisticsStore.messages.in
    148147
    149148    UIProcess/Automation/WebAutomationSession.messages.in
  • trunk/Source/WebKit/ChangeLog

    r243666 r243671  
     12019-03-29  John Wilander  <wilander@apple.com>
     2
     3        Move WebResourceLoadStatisticsStore IPC calls from the UI process to the network process
     4        https://bugs.webkit.org/show_bug.cgi?id=196407
     5        <rdar://problem/47859936>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        The two WebResourceLoadStatisticsStore IPC endpoints were left behind when we
     10        moved Resource Load Statistics from the UI process to the network process. One
     11        of the endpoints is the message RequestStorageAccessUnderOpener which underpins
     12        our compatibility fix for federated logins using popups. This patch redirects
     13        these IPC calls to the network process and cleans up some assumptions around
     14        them.
     15
     16        * CMakeLists.txt:
     17            Removed the old IPC receiver.
     18        * DerivedSources.make:
     19            Removed the old IPC receiver.
     20        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
     21        (WebKit::WebResourceLoadStatisticsStore::requestUpdate): Deleted.
     22            This is no longer needed since there is a dedicated update mechanism
     23            that actually sends the update.
     24        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
     25        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
     26        (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
     27        (WebKit::NetworkConnectionToWebProcess::requestStorageAccessUnderOpener):
     28            Two new IPC receivers to pipe the calls to the network process.
     29        (WebKit::NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate): Deleted.
     30            NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated now serves
     31            this purpose.
     32        * NetworkProcess/NetworkConnectionToWebProcess.h:
     33        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
     34        * UIProcess/WebResourceLoadStatisticsStore.messages.in: Removed.
     35            Removed the old IPC receiver.
     36        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
     37        * WebKit.xcodeproj/project.pbxproj:
     38        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
     39        (WKBundleResourceLoadStatisticsNotifyObserver):
     40            Function name update.
     41        * WebProcess/WebProcess.cpp:
     42            Now calls IPC to the network process instead of the UI process.
     43
    1442019-03-29  Myles C. Maxfield  <mmaxfield@apple.com>
    245
  • trunk/Source/WebKit/DerivedSources.make

    r243195 r243671  
    179179    WebRTCResolver \
    180180    WebRTCSocket \
    181     WebResourceLoadStatisticsStore \
    182181    WebResourceLoader \
    183182    WebSWClientConnection \
  • trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp

    r243181 r243671  
    4343#include "WebProcessPool.h"
    4444#include "WebProcessProxy.h"
    45 #include "WebResourceLoadStatisticsStoreMessages.h"
    4645#include "WebResourceLoadStatisticsTelemetry.h"
    4746#include "WebsiteDataFetchOption.h"
     
    252251}
    253252
    254 void WebResourceLoadStatisticsStore::requestUpdate()
    255 {
    256     resourceLoadStatisticsUpdated({ });
    257 }
    258 
    259253void WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated(Vector<WebCore::ResourceLoadStatistics>&& origins)
    260254{
  • trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h

    r243181 r243671  
    6767};
    6868
    69 class WebResourceLoadStatisticsStore final : public ThreadSafeRefCounted<WebResourceLoadStatisticsStore, WTF::DestructionThread::Main>, public IPC::MessageReceiver {
     69class WebResourceLoadStatisticsStore final : public ThreadSafeRefCounted<WebResourceLoadStatisticsStore, WTF::DestructionThread::Main> {
    7070public:
    7171    using ResourceLoadStatistics = WebCore::ResourceLoadStatistics;
     
    121121    void requestStorageAccess(const SubFrameDomain&, const TopFrameDomain&, Optional<FrameID>, PageID, CompletionHandler<void(StorageAccessStatus)>&&);
    122122    void requestStorageAccessGranted(const SubFrameDomain&, const TopFrameDomain&, FrameID, PageID, CompletionHandler<void(bool)>&&);
    123     void requestUpdate();
    124123    void setLastSeen(const RegistrableDomain&, Seconds, CompletionHandler<void()>&&);
    125124    void setPrevalentResource(const RegistrableDomain&, CompletionHandler<void()>&&);
     
    179178    void notifyPageStatisticsTelemetryFinished(unsigned totalPrevalentResources, unsigned totalPrevalentResourcesWithUserInteraction, unsigned top3SubframeUnderTopFrameOrigins) const;
    180179
     180    void resourceLoadStatisticsUpdated(Vector<ResourceLoadStatistics>&&);
     181    void requestStorageAccessUnderOpener(DomainInNeedOfStorageAccess&&, uint64_t openerPageID, OpenerDomain&&);
     182
    181183private:
    182184    explicit WebResourceLoadStatisticsStore(NetworkSession&, const String&, ShouldIncludeLocalhost);
     
    184186    void postTask(WTF::Function<void()>&&);
    185187    static void postTaskReply(WTF::Function<void()>&&);
    186 
    187     // IPC::MessageReceiver.
    188     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
    189 
    190     // IPC message handlers.
    191     void resourceLoadStatisticsUpdated(Vector<ResourceLoadStatistics>&& origins);
    192     void requestStorageAccessUnderOpener(DomainInNeedOfStorageAccess&&, uint64_t openerPageID, OpenerDomain&&);
    193188
    194189    void performDailyTasks();
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp

    r243258 r243671  
    654654}
    655655
    656 void NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate()
     656void NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated(Vector<WebCore::ResourceLoadStatistics>&& statistics)
    657657{
    658658    for (auto& networkSession : networkProcess().networkSessions().values()) {
     
    661661
    662662        if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics())
    663             resourceLoadStatistics->requestUpdate();
     663            resourceLoadStatistics->resourceLoadStatisticsUpdated(WTFMove(statistics));
    664664    }
    665665}
     
    673673{
    674674    networkProcess().requestStorageAccessGranted(sessionID, subFrameDomain, topFrameDomain, frameID, pageID, WTFMove(completionHandler));
     675}
     676
     677void NetworkConnectionToWebProcess::requestStorageAccessUnderOpener(PAL::SessionID sessionID, WebCore::RegistrableDomain&& domainInNeedOfStorageAccess, uint64_t openerPageID, WebCore::RegistrableDomain&& openerDomain)
     678{
     679    if (auto networkSession = networkProcess().networkSession(sessionID)) {
     680        if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics())
     681            resourceLoadStatistics->requestStorageAccessUnderOpener(WTFMove(domainInNeedOfStorageAccess), openerPageID, WTFMove(openerDomain));
     682    }
    675683}
    676684#endif
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h

    r243258 r243671  
    219219    void logSubresourceLoading(PAL::SessionID, const RegistrableDomain& targetDomain, const RegistrableDomain& topFrameDomain, WallTime lastSeen);
    220220    void logSubresourceRedirect(PAL::SessionID, const RegistrableDomain& sourceDomain, const RegistrableDomain& targetDomain);
    221     void requestResourceLoadStatisticsUpdate();
     221    void resourceLoadStatisticsUpdated(Vector<WebCore::ResourceLoadStatistics>&&);
    222222    void hasStorageAccess(PAL::SessionID, const RegistrableDomain& subFrameDomain, const RegistrableDomain& topFrameDomain, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool)>&&);
    223223    void requestStorageAccess(PAL::SessionID, const RegistrableDomain& subFrameDomain, const RegistrableDomain& topFrameDomain, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool)>&&);
     224    void requestStorageAccessUnderOpener(PAL::SessionID, WebCore::RegistrableDomain&& domainInNeedOfStorageAccess, uint64_t openerPageID, WebCore::RegistrableDomain&& openerDomain);
    224225#endif
    225226
  • trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in

    r243345 r243671  
    6363    LogSubresourceLoading(PAL::SessionID sessionID, WebCore::RegistrableDomain targetDomain, WebCore::RegistrableDomain topFrameDomain, WallTime lastSeen)
    6464    LogSubresourceRedirect(PAL::SessionID sessionID, WebCore::RegistrableDomain sourceDomain, WebCore::RegistrableDomain targetDomain)
    65     RequestResourceLoadStatisticsUpdate();
     65    ResourceLoadStatisticsUpdated(Vector<WebCore::ResourceLoadStatistics> statistics)
    6666    HasStorageAccess(PAL::SessionID sessionID, WebCore::RegistrableDomain subFrameDomain, WebCore::RegistrableDomain topFrameDomain, uint64_t frameID, uint64_t pageID) -> (bool hasStorageAccess) Async
    6767    RequestStorageAccess(PAL::SessionID sessionID, WebCore::RegistrableDomain subFrameDomain, WebCore::RegistrableDomain topFrameDomain, uint64_t frameID, uint64_t pageID) -> (bool accessGranted) Async
     68    RequestStorageAccessUnderOpener(PAL::SessionID sessionID, WebCore::RegistrableDomain domainInNeedOfStorageAccess, uint64_t openerPageID, WebCore::RegistrableDomain openerDomain)
    6869#endif
    6970
  • trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp

    r243632 r243671  
    4141#include "WebProcessPool.h"
    4242#include "WebResourceLoadStatisticsStore.h"
    43 #include "WebResourceLoadStatisticsStoreMessages.h"
    4443#include "WebsiteData.h"
    4544#include "WebsiteDataStoreClient.h"
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r243567 r243671  
    11231123                7A78FF32224191960096483E /* WKStorageAccessAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A78FF2E224191750096483E /* WKStorageAccessAlert.h */; };
    11241124                7A78FF332241919B0096483E /* WKStorageAccessAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7A78FF2F224191760096483E /* WKStorageAccessAlert.mm */; };
    1125                 7A791EFA1C7CFCF100C4C52B /* WebResourceLoadStatisticsStoreMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A791EF91C7CFB3700C4C52B /* WebResourceLoadStatisticsStoreMessageReceiver.cpp */; };
    1126                 7A791EFB1C7CFD0100C4C52B /* WebResourceLoadStatisticsStoreMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A791EF81C7CFB1000C4C52B /* WebResourceLoadStatisticsStoreMessages.h */; };
    11271125                7A821F4C1E2F673900604577 /* LegacyCustomProtocolManagerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A821F4B1E2F664800604577 /* LegacyCustomProtocolManagerClient.h */; };
    11281126                7A821F501E2F7A7500604577 /* APICustomProtocolManagerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A821F4F1E2F7A5C00604577 /* APICustomProtocolManagerClient.h */; };
     
    35813579                7A78FF2E224191750096483E /* WKStorageAccessAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKStorageAccessAlert.h; sourceTree = "<group>"; };
    35823580                7A78FF2F224191760096483E /* WKStorageAccessAlert.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKStorageAccessAlert.mm; sourceTree = "<group>"; };
    3583                 7A791EF81C7CFB1000C4C52B /* WebResourceLoadStatisticsStoreMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebResourceLoadStatisticsStoreMessages.h; path = DerivedSources/WebKit2/WebResourceLoadStatisticsStoreMessages.h; sourceTree = BUILT_PRODUCTS_DIR; };
    3584                 7A791EF91C7CFB3700C4C52B /* WebResourceLoadStatisticsStoreMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebResourceLoadStatisticsStoreMessageReceiver.cpp; path = DerivedSources/WebKit2/WebResourceLoadStatisticsStoreMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
    35853581                7A821F491E2F65DD00604577 /* LegacyCustomProtocolManagerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LegacyCustomProtocolManagerProxy.cpp; path = CustomProtocols/LegacyCustomProtocolManagerProxy.cpp; sourceTree = "<group>"; };
    35863582                7A821F4B1E2F664800604577 /* LegacyCustomProtocolManagerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyCustomProtocolManagerClient.h; sourceTree = "<group>"; };
     
    35913587                7A8A9D591EF13020009801AE /* APIInjectedBundleBundleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIInjectedBundleBundleClient.h; sourceTree = "<group>"; };
    35923588                7A8A9D5B1EF1458E009801AE /* APIInjectedBundlePageResourceLoadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIInjectedBundlePageResourceLoadClient.h; sourceTree = "<group>"; };
    3593                 7A9CD8C21C779AD600D9F6C7 /* WebResourceLoadStatisticsStore.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebResourceLoadStatisticsStore.messages.in; sourceTree = "<group>"; };
    35943589                7AB6EA441EEAAE2300037B2B /* APIIconDatabaseClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIIconDatabaseClient.h; sourceTree = "<group>"; };
    35953590                7AB6EA461EEAB6B000037B2B /* APIGeolocationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIGeolocationProvider.h; sourceTree = "<group>"; };
     
    76017596                                BC032DCF10F4389F0058C15A /* WebProcessProxy.h */,
    76027597                                BCEE7AB312817095009827DA /* WebProcessProxy.messages.in */,
    7603                                 7A9CD8C21C779AD600D9F6C7 /* WebResourceLoadStatisticsStore.messages.in */,
    76047598                                51D124241E6D3CC3002B2820 /* WebURLSchemeHandler.cpp */,
    76057599                                51D124251E6D3CC3002B2820 /* WebURLSchemeHandler.h */,
     
    86548648                                51F060DD1654317500F3281B /* WebResourceLoaderMessageReceiver.cpp */,
    86558649                                51F060DE1654317500F3281B /* WebResourceLoaderMessages.h */,
    8656                                 7A791EF91C7CFB3700C4C52B /* WebResourceLoadStatisticsStoreMessageReceiver.cpp */,
    8657                                 7A791EF81C7CFB1000C4C52B /* WebResourceLoadStatisticsStoreMessages.h */,
    86588650                                51F060DD1654317500F3281F /* WebRTCMonitorMessageReceiver.cpp */,
    86598651                                51F060DD1654317500F3282C /* WebRTCResolverMessageReceiver.cpp */,
     
    96729664                                51F060E01654317F00F3281B /* WebResourceLoaderMessages.h in Headers */,
    96739665                                7AFBD36321E50F39005DBACB /* WebResourceLoadStatisticsStore.h in Headers */,
    9674                                 7A791EFB1C7CFD0100C4C52B /* WebResourceLoadStatisticsStoreMessages.h in Headers */,
    96759666                                413075B01DE85F580039EC69 /* WebRTCMonitor.h in Headers */,
    96769667                                41FAF5F51E3C0649001AE678 /* WebRTCResolver.h in Headers */,
     
    1118311174                                BCEE7AD012817988009827DA /* WebProcessProxyMessageReceiver.cpp in Sources */,
    1118411175                                51F060E11654318500F3281B /* WebResourceLoaderMessageReceiver.cpp in Sources */,
    11185                                 7A791EFA1C7CFCF100C4C52B /* WebResourceLoadStatisticsStoreMessageReceiver.cpp in Sources */,
    1118611176                                51F060E11654318500F3281F /* WebRTCMonitorMessageReceiver.cpp in Sources */,
    1118711177                                51F060E11654318500F3282C /* WebRTCResolverMessageReceiver.cpp in Sources */,
  • trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp

    r242339 r243671  
    324324void WKBundleResourceLoadStatisticsNotifyObserver(WKBundleRef)
    325325{
    326     WebCore::ResourceLoadObserver::shared().notifyObserver();
     326    WebCore::ResourceLoadObserver::shared().updateCentralStatisticsStore();
    327327}
    328328
  • trunk/Source/WebKit/WebProcess/WebProcess.cpp

    r243388 r243671  
    6666#include "WebProcessPoolMessages.h"
    6767#include "WebProcessProxyMessages.h"
    68 #include "WebResourceLoadStatisticsStoreMessages.h"
    6968#include "WebSWContextManagerConnection.h"
    7069#include "WebSWContextManagerConnectionMessages.h"
     
    212211
    213212#if ENABLE(RESOURCE_LOAD_STATISTICS)
    214     ResourceLoadObserver::shared().setNotificationCallback([this] (Vector<ResourceLoadStatistics>&& statistics) {
    215         parentProcessConnection()->send(Messages::WebResourceLoadStatisticsStore::ResourceLoadStatisticsUpdated(WTFMove(statistics)), 0);
    216 
    217         ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RequestResourceLoadStatisticsUpdate(), 0);
     213    ResourceLoadObserver::shared().setStatisticsUpdatedCallback([this] (Vector<ResourceLoadStatistics>&& statistics) {
     214        ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::ResourceLoadStatisticsUpdated(WTFMove(statistics)), 0);
    218215    });
    219216
    220     ResourceLoadObserver::shared().setRequestStorageAccessUnderOpenerCallback([this] (const RegistrableDomain& domainInNeedOfStorageAccess, uint64_t openerPageID, const RegistrableDomain& openerDomain) {
    221         parentProcessConnection()->send(Messages::WebResourceLoadStatisticsStore::RequestStorageAccessUnderOpener(domainInNeedOfStorageAccess, openerPageID, openerDomain), 0);
     217    ResourceLoadObserver::shared().setRequestStorageAccessUnderOpenerCallback([this] (PAL::SessionID sessionID, const RegistrableDomain& domainInNeedOfStorageAccess, uint64_t openerPageID, const RegistrableDomain& openerDomain) {
     218        ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RequestStorageAccessUnderOpener(sessionID, domainInNeedOfStorageAccess, openerPageID, openerDomain), 0);
    222219    });
    223220#endif
Note: See TracChangeset for help on using the changeset viewer.