Title: [243671] trunk
Revision
243671
Author
wilan...@apple.com
Date
2019-03-29 18:09:12 -0700 (Fri, 29 Mar 2019)

Log 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.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (243670 => 243671)


--- trunk/LayoutTests/ChangeLog	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/LayoutTests/ChangeLog	2019-03-30 01:09:12 UTC (rev 243671)
@@ -1,3 +1,18 @@
+2019-03-29  John Wilander  <wilan...@apple.com>
+
+        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.
+
+        * 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.
+
 2019-03-29  Chris Dumez  <cdu...@apple.com>
 
         Make someWindow.frames, .self, .window always return someWindow

Modified: trunk/LayoutTests/http/tests/storageAccess/deny-storage-access-under-opener-expected.txt (243670 => 243671)


--- trunk/LayoutTests/http/tests/storageAccess/deny-storage-access-under-opener-expected.txt	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/LayoutTests/http/tests/storageAccess/deny-storage-access-under-opener-expected.txt	2019-03-30 01:09:12 UTC (rev 243671)
@@ -14,5 +14,4 @@
 --------
 Should not receive first-party cookie.
 Did not receive cookie named 'firstPartyCookie'.
-Did not receive cookie named ''.
 Client-side document.cookie:

Modified: trunk/LayoutTests/http/tests/storageAccess/deny-storage-access-under-opener-if-auto-dismiss-expected.txt (243670 => 243671)


--- trunk/LayoutTests/http/tests/storageAccess/deny-storage-access-under-opener-if-auto-dismiss-expected.txt	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/LayoutTests/http/tests/storageAccess/deny-storage-access-under-opener-if-auto-dismiss-expected.txt	2019-03-30 01:09:12 UTC (rev 243671)
@@ -14,5 +14,4 @@
 --------
 Should not receive first-party cookie.
 Did not receive cookie named 'firstPartyCookie'.
-Did not receive cookie named ''.
 Client-side document.cookie:

Added: trunk/LayoutTests/http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture-expected.txt (0 => 243671)


--- trunk/LayoutTests/http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture-expected.txt	2019-03-30 01:09:12 UTC (rev 243671)
@@ -0,0 +1,17 @@
+Tests that a cross-origin window from a prevalent domain with previous user interaction gets storage access under its opener if it gets user interaction.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Cookie created.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
+
+--------
+Frame: '<!--frame1-->'
+--------
+Should receive first-party cookie.
+Received cookie named 'firstPartyCookie'.
+Client-side document.cookie: firstPartyCookie=value

Added: trunk/LayoutTests/http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture.html (0 => 243671)


--- trunk/LayoutTests/http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture.html	2019-03-30 01:09:12 UTC (rev 243671)
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script src=""
+    <script src=""
+</head>
+<body _onload_="run()">
+<script>
+    description("Tests that a cross-origin window from a prevalent domain with previous user interaction gets storage access under its opener if it gets user interaction.");
+    jsTestIsAsync = true;
+
+    function finishTest() {
+        setEnableFeature(false, finishJSTest);
+    }
+
+    function openIframe(url, onLoadHandler) {
+        const element = document.createElement("iframe");
+        element.src = ""
+        if (onLoadHandler) {
+            element._onload_ = onLoadHandler;
+        }
+        document.body.appendChild(element);
+    }
+
+    function receiveMessage(event) {
+        if (event.origin === "http://localhost:8000") {
+            if (event.data.indexOf("PASS") !== -1)
+                testPassed(event.data.replace("PASS ", ""));
+            else
+                testFailed(event.data);
+        } else
+            testFailed("Received a message from an unexpected origin: " + event.origin);
+
+        newWin.close();
+        openIframe(thirdPartyBaseUrl + subPathToGetCookies + "&message=Should receive first-party cookie.", finishTest);
+    }
+
+    const thirdPartyOrigin = "http://localhost:8000";
+    const resourcePath = "/storageAccess/resources";
+    const thirdPartyBaseUrl = thirdPartyOrigin + resourcePath;
+    const firstPartyCookieName = "firstPartyCookie";
+    const subPathToGetCookies = "/get-cookies.php?name1=" + firstPartyCookieName;
+    var newWin;
+
+    function run() {
+        setEnableFeature(true, function() {
+            window.addEventListener("message", receiveMessage, false);
+
+            testRunner.setCanOpenWindows();
+
+            testRunner.setStatisticsPrevalentResource(thirdPartyOrigin, true, function() {
+                if (!testRunner.isStatisticsPrevalentResource(thirdPartyOrigin))
+                    testFailed("Host did not get set as prevalent resource.");
+                testRunner.setStatisticsHasHadUserInteraction(thirdPartyOrigin, true, function() {
+                    if (!testRunner.isStatisticsHasHadUserInteraction(thirdPartyOrigin))
+                        testFailed("Host did not get logged for user interaction.");
+                    testRunner.dumpChildFramesAsText();
+                    testRunner.setCloseRemainingWindowsWhenComplete(true);
+
+                    testRunner.statisticsUpdateCookieBlocking(function () {
+                        newWin = window.open(thirdPartyOrigin + "/storageAccess/resources/produce-user-gesture-set-cookie-and-report-back.html", "testWindow");
+                    });
+                });
+            });
+        });
+    }
+</script>
+</body>
+</html>
\ No newline at end of file

Modified: trunk/LayoutTests/http/tests/storageAccess/resources/get-cookies.php (243670 => 243671)


--- trunk/LayoutTests/http/tests/storageAccess/resources/get-cookies.php	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/LayoutTests/http/tests/storageAccess/resources/get-cookies.php	2019-03-30 01:09:12 UTC (rev 243671)
@@ -5,10 +5,12 @@
 } else {
     echo "Received cookie named '" . $_GET["name1"] . "'.<br>";
 }
-if(!isset($_COOKIE[$_GET["name2"]])) {
-    echo "Did not receive cookie named '" . $_GET["name2"] . "'.<br>";
-} else {
-    echo "Received cookie named '" . $_GET["name2"] . "'.<br>";
+if(!empty($_GET["name2"])) {
+    if(!isset($_COOKIE[$_GET["name2"]])) {
+        echo "Did not receive cookie named '" . $_GET["name2"] . "'.<br>";
+    } else {
+        echo "Received cookie named '" . $_GET["name2"] . "'.<br>";
+    }
 }
 if(!empty($_GET["name3"])) {
     if(!isset($_COOKIE[$_GET["name3"]])) {

Added: trunk/LayoutTests/http/tests/storageAccess/resources/produce-user-gesture-set-cookie-and-report-back.html (0 => 243671)


--- trunk/LayoutTests/http/tests/storageAccess/resources/produce-user-gesture-set-cookie-and-report-back.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/storageAccess/resources/produce-user-gesture-set-cookie-and-report-back.html	2019-03-30 01:09:12 UTC (rev 243671)
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <script src=""
+    <script>
+        let intervalID;
+        function setCookieAndPostMessage() {
+            internals.withUserGesture(function() {
+                intervalID = setInterval(function() {
+                    var promise = document.hasStorageAccess();
+                    promise.then(
+                        function (hasAccess) {
+                            if (hasAccess) {
+                                clearInterval(intervalID);
+                                document.cookie = "firstPartyCookie=value";
+                                window.opener.postMessage("PASS Cookie created.", "http://127.0.0.1:8000");
+                            }
+                        },
+                        function (reason) {
+                            window.opener.postMessage("FAIL Promise was rejected, reason: " + reason, "http://127.0.0.1:8000");
+                        }
+                    );
+                }, 100);
+
+            });
+        }
+    </script>
+</head>
+<body _onload_="setCookieAndPostMessage()">
+</body>
+</html>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (243670 => 243671)


--- trunk/Source/WebCore/ChangeLog	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/Source/WebCore/ChangeLog	2019-03-30 01:09:12 UTC (rev 243671)
@@ -1,3 +1,38 @@
+2019-03-29  John Wilander  <wilan...@apple.com>
+
+        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.
+
+        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):
+
 2019-03-29  Chris Dumez  <cdu...@apple.com>
 
         Make someWindow.frames, .self, .window always return someWindow

Modified: trunk/Source/WebCore/loader/ResourceLoadObserver.cpp (243670 => 243671)


--- trunk/Source/WebCore/loader/ResourceLoadObserver.cpp	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/Source/WebCore/loader/ResourceLoadObserver.cpp	2019-03-30 01:09:12 UTC (rev 243671)
@@ -53,13 +53,13 @@
     return resourceLoadObserver;
 }
 
-void ResourceLoadObserver::setNotificationCallback(WTF::Function<void (Vector<ResourceLoadStatistics>&&)>&& notificationCallback)
+void ResourceLoadObserver::setStatisticsUpdatedCallback(WTF::Function<void(Vector<ResourceLoadStatistics>&&)>&& notificationCallback)
 {
     ASSERT(!m_notificationCallback);
     m_notificationCallback = WTFMove(notificationCallback);
 }
 
-void ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback(WTF::Function<void(const RegistrableDomain& domainInNeedOfStorageAccess, uint64_t openerPageID, const RegistrableDomain& openerDomain)>&& callback)
+void ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback(WTF::Function<void(PAL::SessionID sessionID, const RegistrableDomain& domainInNeedOfStorageAccess, uint64_t openerPageID, const RegistrableDomain& openerDomain)>&& callback)
 {
     ASSERT(!m_requestStorageAccessUnderOpenerCallback);
     m_requestStorageAccessUnderOpenerCallback = WTFMove(callback);
@@ -89,11 +89,6 @@
     m_logSubresourceRedirectNotificationCallback = WTFMove(callback);
 }
     
-ResourceLoadObserver::ResourceLoadObserver()
-    : m_notificationTimer(*this, &ResourceLoadObserver::notifyObserver)
-{
-}
-
 static inline bool is3xxRedirect(const ResourceResponse& response)
 {
     return response.httpStatusCode() >= 300 && response.httpStatusCode() <= 399;
@@ -133,13 +128,11 @@
     if (targetDomain == topFrameDomain || (isRedirect && targetDomain == redirectedFromDomain))
         return;
 
-    bool shouldCallNotificationCallback = false;
     {
         auto& targetStatistics = ensureResourceStatisticsForRegistrableDomain(targetDomain);
         auto lastSeen = ResourceLoadStatistics::reduceTimeResolution(WallTime::now());
         targetStatistics.lastSeen = lastSeen;
-        if (targetStatistics.subresourceUnderTopFrameDomains.add(topFrameDomain).isNewEntry)
-            shouldCallNotificationCallback = true;
+        targetStatistics.subresourceUnderTopFrameDomains.add(topFrameDomain);
 
         m_logSubresourceLoadingNotificationCallback(page->sessionID(), targetDomain, topFrameDomain, lastSeen);
     }
@@ -146,18 +139,12 @@
 
     if (isRedirect) {
         auto& redirectingOriginStatistics = ensureResourceStatisticsForRegistrableDomain(redirectedFromDomain);
-        bool isNewRedirectToEntry = redirectingOriginStatistics.subresourceUniqueRedirectsTo.add(targetDomain).isNewEntry;
+        redirectingOriginStatistics.subresourceUniqueRedirectsTo.add(targetDomain);
         auto& targetStatistics = ensureResourceStatisticsForRegistrableDomain(targetDomain);
-        bool isNewRedirectFromEntry = targetStatistics.subresourceUniqueRedirectsFrom.add(redirectedFromDomain).isNewEntry;
+        targetStatistics.subresourceUniqueRedirectsFrom.add(redirectedFromDomain);
 
-        if (isNewRedirectToEntry || isNewRedirectFromEntry)
-            shouldCallNotificationCallback = true;
-
         m_logSubresourceRedirectNotificationCallback(page->sessionID(), redirectedFromDomain, targetDomain);
     }
-
-    if (shouldCallNotificationCallback)
-        scheduleNotificationIfNeeded();
 }
 
 void ResourceLoadObserver::logWebSocketLoading(const URL& targetURL, const URL& mainFrameURL, PAL::SessionID sessionID)
@@ -181,8 +168,7 @@
 
     auto& targetStatistics = ensureResourceStatisticsForRegistrableDomain(targetDomain);
     targetStatistics.lastSeen = lastSeen;
-    if (targetStatistics.subresourceUnderTopFrameDomains.add(topFrameDomain).isNewEntry)
-        scheduleNotificationIfNeeded();
+    targetStatistics.subresourceUnderTopFrameDomains.add(topFrameDomain);
 
     m_logWebSocketLoadingNotificationCallback(sessionID, targetDomain, topFrameDomain, lastSeen);
 }
@@ -215,7 +201,7 @@
             if (auto* openerDocument = opener->document()) {
                 if (auto* openerFrame = openerDocument->frame()) {
                     if (auto openerPageID = openerFrame->loader().client().pageID())
-                        requestStorageAccessUnderOpener(topFrameDomain, openerPageID.value(), *openerDocument);
+                        requestStorageAccessUnderOpener(document.sessionID(), topFrameDomain, openerPageID.value(), *openerDocument);
                 }
             }
         }
@@ -224,9 +210,6 @@
     m_logUserInteractionNotificationCallback(document.sessionID(), topFrameDomain);
 #endif
 
-    m_notificationTimer.stop();
-    notifyObserver();
-
 #if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED
     if (shouldLogUserInteraction()) {
         auto counter = ++m_loggingCounter;
@@ -250,7 +233,7 @@
 }
 
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
-void ResourceLoadObserver::requestStorageAccessUnderOpener(const RegistrableDomain& domainInNeedOfStorageAccess, uint64_t openerPageID, Document& openerDocument)
+void ResourceLoadObserver::requestStorageAccessUnderOpener(PAL::SessionID sessionID, const RegistrableDomain& domainInNeedOfStorageAccess, uint64_t openerPageID, Document& openerDocument)
 {
     auto openerUrl = openerDocument.url();
     RegistrableDomain openerDomain { openerUrl };
@@ -257,7 +240,7 @@
     if (domainInNeedOfStorageAccess != openerDomain
         && !openerDocument.hasRequestedPageSpecificStorageAccessWithUserInteraction(domainInNeedOfStorageAccess)
         && !equalIgnoringASCIICase(openerUrl.string(), WTF::blankURL())) {
-        m_requestStorageAccessUnderOpenerCallback(domainInNeedOfStorageAccess, openerPageID, openerDomain);
+        m_requestStorageAccessUnderOpenerCallback(sessionID, domainInNeedOfStorageAccess, openerPageID, openerDomain);
         // Remember user interaction-based requests since they don't need to be repeated.
         openerDocument.setHasRequestedPageSpecificStorageAccessWithUserInteraction(domainInNeedOfStorageAccess);
     }
@@ -382,22 +365,8 @@
     return addResult.iterator->value;
 }
 
-void ResourceLoadObserver::scheduleNotificationIfNeeded()
+void ResourceLoadObserver::updateCentralStatisticsStore()
 {
-    ASSERT(m_notificationCallback);
-    if (m_resourceStatisticsMap.isEmpty()) {
-        m_notificationTimer.stop();
-        return;
-    }
-
-    if (!m_notificationTimer.isActive())
-        m_notificationTimer.startOneShot(minimumNotificationInterval);
-}
-
-void ResourceLoadObserver::notifyObserver()
-{
-    ASSERT(m_notificationCallback);
-    m_notificationTimer.stop();
     m_notificationCallback(takeStatistics());
 }
 
@@ -424,7 +393,6 @@
 
 void ResourceLoadObserver::clearState()
 {
-    m_notificationTimer.stop();
     m_resourceStatisticsMap.clear();
     m_lastReportedUserInteractionMap.clear();
 }

Modified: trunk/Source/WebCore/loader/ResourceLoadObserver.h (243670 => 243671)


--- trunk/Source/WebCore/loader/ResourceLoadObserver.h	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/Source/WebCore/loader/ResourceLoadObserver.h	2019-03-30 01:09:12 UTC (rev 243671)
@@ -72,14 +72,14 @@
 
     WEBCORE_EXPORT String statisticsForURL(const URL&);
 
-    WEBCORE_EXPORT void setNotificationCallback(WTF::Function<void (Vector<ResourceLoadStatistics>&&)>&&);
-    WEBCORE_EXPORT void setRequestStorageAccessUnderOpenerCallback(Function<void(const RegistrableDomain&, uint64_t, const RegistrableDomain&)>&&);
+    WEBCORE_EXPORT void setStatisticsUpdatedCallback(WTF::Function<void(Vector<ResourceLoadStatistics>&&)>&&);
+    WEBCORE_EXPORT void setRequestStorageAccessUnderOpenerCallback(Function<void(PAL::SessionID, const RegistrableDomain&, uint64_t, const RegistrableDomain&)>&&);
     WEBCORE_EXPORT void setLogUserInteractionNotificationCallback(Function<void(PAL::SessionID, const RegistrableDomain&)>&&);
     WEBCORE_EXPORT void setLogWebSocketLoadingNotificationCallback(Function<void(PAL::SessionID, const RegistrableDomain&, const RegistrableDomain&, WallTime)>&&);
     WEBCORE_EXPORT void setLogSubresourceLoadingNotificationCallback(Function<void(PAL::SessionID, const RegistrableDomain&, const RegistrableDomain&, WallTime)>&&);
     WEBCORE_EXPORT void setLogSubresourceRedirectNotificationCallback(Function<void(PAL::SessionID, const RegistrableDomain&, const RegistrableDomain&)>&&);
 
-    WEBCORE_EXPORT void notifyObserver();
+    WEBCORE_EXPORT void updateCentralStatisticsStore();
     WEBCORE_EXPORT void clearState();
 
 #if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED
@@ -88,28 +88,23 @@
 #endif
 
 private:
-    ResourceLoadObserver();
-
     bool shouldLog(bool usesEphemeralSession) const;
     ResourceLoadStatistics& ensureResourceStatisticsForRegistrableDomain(const RegistrableDomain&);
 
-    void scheduleNotificationIfNeeded();
     Vector<ResourceLoadStatistics> takeStatistics();
 
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
-    void requestStorageAccessUnderOpener(const RegistrableDomain& domainInNeedOfStorageAccess, uint64_t openerPageID, Document& openerDocument);
+    void requestStorageAccessUnderOpener(PAL::SessionID, const RegistrableDomain& domainInNeedOfStorageAccess, uint64_t openerPageID, Document& openerDocument);
 #endif
 
     HashMap<RegistrableDomain, ResourceLoadStatistics> m_resourceStatisticsMap;
     HashMap<RegistrableDomain, WTF::WallTime> m_lastReportedUserInteractionMap;
     Function<void(Vector<ResourceLoadStatistics>&&)> m_notificationCallback;
-    Function<void(const RegistrableDomain&, uint64_t, const RegistrableDomain&)> m_requestStorageAccessUnderOpenerCallback;
+    Function<void(PAL::SessionID, const RegistrableDomain&, uint64_t, const RegistrableDomain&)> m_requestStorageAccessUnderOpenerCallback;
     Function<void(PAL::SessionID, const RegistrableDomain&)> m_logUserInteractionNotificationCallback;
     Function<void(PAL::SessionID, const RegistrableDomain&, const RegistrableDomain&, WallTime)> m_logWebSocketLoadingNotificationCallback;
     Function<void(PAL::SessionID, const RegistrableDomain&, const RegistrableDomain&, WallTime)> m_logSubresourceLoadingNotificationCallback;
     Function<void(PAL::SessionID, const RegistrableDomain&, const RegistrableDomain&)> m_logSubresourceRedirectNotificationCallback;
-
-    Timer m_notificationTimer;
 #if ENABLE(RESOURCE_LOAD_STATISTICS) && !RELEASE_LOG_DISABLED
     uint64_t m_loggingCounter { 0 };
     bool m_shouldLogUserInteraction { false };

Modified: trunk/Source/WebCore/testing/Internals.cpp (243670 => 243671)


--- trunk/Source/WebCore/testing/Internals.cpp	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/Source/WebCore/testing/Internals.cpp	2019-03-30 01:09:12 UTC (rev 243671)
@@ -4916,7 +4916,7 @@
 
 void Internals::notifyResourceLoadObserver()
 {
-    ResourceLoadObserver::shared().notifyObserver();
+    ResourceLoadObserver::shared().updateCentralStatisticsStore();
 }
 
 unsigned Internals::primaryScreenDisplayID()

Modified: trunk/Source/WebKit/CMakeLists.txt (243670 => 243671)


--- trunk/Source/WebKit/CMakeLists.txt	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/Source/WebKit/CMakeLists.txt	2019-03-30 01:09:12 UTC (rev 243671)
@@ -144,7 +144,6 @@
     UIProcess/WebPasteboardProxy.messages.in
     UIProcess/WebProcessPool.messages.in
     UIProcess/WebProcessProxy.messages.in
-    UIProcess/WebResourceLoadStatisticsStore.messages.in
 
     UIProcess/Automation/WebAutomationSession.messages.in
 

Modified: trunk/Source/WebKit/ChangeLog (243670 => 243671)


--- trunk/Source/WebKit/ChangeLog	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/Source/WebKit/ChangeLog	2019-03-30 01:09:12 UTC (rev 243671)
@@ -1,3 +1,46 @@
+2019-03-29  John Wilander  <wilan...@apple.com>
+
+        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.
+
+        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.
+
 2019-03-29  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         Delete WebMetal implementation in favor of WebGPU

Modified: trunk/Source/WebKit/DerivedSources.make (243670 => 243671)


--- trunk/Source/WebKit/DerivedSources.make	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/Source/WebKit/DerivedSources.make	2019-03-30 01:09:12 UTC (rev 243671)
@@ -178,7 +178,6 @@
     WebRTCMonitor \
     WebRTCResolver \
     WebRTCSocket \
-    WebResourceLoadStatisticsStore \
     WebResourceLoader \
     WebSWClientConnection \
     WebSWContextManagerConnection \

Modified: trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp (243670 => 243671)


--- trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp	2019-03-30 01:09:12 UTC (rev 243671)
@@ -42,7 +42,6 @@
 #include "WebProcessMessages.h"
 #include "WebProcessPool.h"
 #include "WebProcessProxy.h"
-#include "WebResourceLoadStatisticsStoreMessages.h"
 #include "WebResourceLoadStatisticsTelemetry.h"
 #include "WebsiteDataFetchOption.h"
 #include <WebCore/CookieJar.h>
@@ -251,11 +250,6 @@
     });
 }
 
-void WebResourceLoadStatisticsStore::requestUpdate()
-{
-    resourceLoadStatisticsUpdated({ });
-}
-
 void WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated(Vector<WebCore::ResourceLoadStatistics>&& origins)
 {
     ASSERT(RunLoop::isMain());

Modified: trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h (243670 => 243671)


--- trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h	2019-03-30 01:09:12 UTC (rev 243671)
@@ -66,7 +66,7 @@
     AllButCookies
 };
 
-class WebResourceLoadStatisticsStore final : public ThreadSafeRefCounted<WebResourceLoadStatisticsStore, WTF::DestructionThread::Main>, public IPC::MessageReceiver {
+class WebResourceLoadStatisticsStore final : public ThreadSafeRefCounted<WebResourceLoadStatisticsStore, WTF::DestructionThread::Main> {
 public:
     using ResourceLoadStatistics = WebCore::ResourceLoadStatistics;
     using RegistrableDomain = WebCore::RegistrableDomain;
@@ -120,7 +120,6 @@
     bool hasStorageAccessForFrame(const SubFrameDomain&, const TopFrameDomain&, FrameID, PageID);
     void requestStorageAccess(const SubFrameDomain&, const TopFrameDomain&, Optional<FrameID>, PageID, CompletionHandler<void(StorageAccessStatus)>&&);
     void requestStorageAccessGranted(const SubFrameDomain&, const TopFrameDomain&, FrameID, PageID, CompletionHandler<void(bool)>&&);
-    void requestUpdate();
     void setLastSeen(const RegistrableDomain&, Seconds, CompletionHandler<void()>&&);
     void setPrevalentResource(const RegistrableDomain&, CompletionHandler<void()>&&);
     void setVeryPrevalentResource(const RegistrableDomain&, CompletionHandler<void()>&&);
@@ -178,6 +177,9 @@
     void sendDiagnosticMessageWithValue(const String& message, const String& description, unsigned value, unsigned sigDigits, WebCore::ShouldSample) const;
     void notifyPageStatisticsTelemetryFinished(unsigned totalPrevalentResources, unsigned totalPrevalentResourcesWithUserInteraction, unsigned top3SubframeUnderTopFrameOrigins) const;
 
+    void resourceLoadStatisticsUpdated(Vector<ResourceLoadStatistics>&&);
+    void requestStorageAccessUnderOpener(DomainInNeedOfStorageAccess&&, uint64_t openerPageID, OpenerDomain&&);
+
 private:
     explicit WebResourceLoadStatisticsStore(NetworkSession&, const String&, ShouldIncludeLocalhost);
 
@@ -184,13 +186,6 @@
     void postTask(WTF::Function<void()>&&);
     static void postTaskReply(WTF::Function<void()>&&);
 
-    // IPC::MessageReceiver.
-    void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
-
-    // IPC message handlers.
-    void resourceLoadStatisticsUpdated(Vector<ResourceLoadStatistics>&& origins);
-    void requestStorageAccessUnderOpener(DomainInNeedOfStorageAccess&&, uint64_t openerPageID, OpenerDomain&&);
-
     void performDailyTasks();
 
     StorageAccessStatus storageAccessStatus(const String& subFramePrimaryDomain, const String& topFramePrimaryDomain);

Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (243670 => 243671)


--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2019-03-30 01:09:12 UTC (rev 243671)
@@ -653,7 +653,7 @@
     }
 }
 
-void NetworkConnectionToWebProcess::requestResourceLoadStatisticsUpdate()
+void NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated(Vector<WebCore::ResourceLoadStatistics>&& statistics)
 {
     for (auto& networkSession : networkProcess().networkSessions().values()) {
         if (networkSession->sessionID().isEphemeral())
@@ -660,7 +660,7 @@
             continue;
 
         if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics())
-            resourceLoadStatistics->requestUpdate();
+            resourceLoadStatistics->resourceLoadStatisticsUpdated(WTFMove(statistics));
     }
 }
 
@@ -673,6 +673,14 @@
 {
     networkProcess().requestStorageAccessGranted(sessionID, subFrameDomain, topFrameDomain, frameID, pageID, WTFMove(completionHandler));
 }
+
+void NetworkConnectionToWebProcess::requestStorageAccessUnderOpener(PAL::SessionID sessionID, WebCore::RegistrableDomain&& domainInNeedOfStorageAccess, uint64_t openerPageID, WebCore::RegistrableDomain&& openerDomain)
+{
+    if (auto networkSession = networkProcess().networkSession(sessionID)) {
+        if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics())
+            resourceLoadStatistics->requestStorageAccessUnderOpener(WTFMove(domainInNeedOfStorageAccess), openerPageID, WTFMove(openerDomain));
+    }
+}
 #endif
 
 void NetworkConnectionToWebProcess::addOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, bool allowDestinationSubdomains)

Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h (243670 => 243671)


--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h	2019-03-30 01:09:12 UTC (rev 243671)
@@ -218,9 +218,10 @@
     void logWebSocketLoading(PAL::SessionID, const RegistrableDomain& targetDomain, const RegistrableDomain& topFrameDomain, WallTime lastSeen);
     void logSubresourceLoading(PAL::SessionID, const RegistrableDomain& targetDomain, const RegistrableDomain& topFrameDomain, WallTime lastSeen);
     void logSubresourceRedirect(PAL::SessionID, const RegistrableDomain& sourceDomain, const RegistrableDomain& targetDomain);
-    void requestResourceLoadStatisticsUpdate();
+    void resourceLoadStatisticsUpdated(Vector<WebCore::ResourceLoadStatistics>&&);
     void hasStorageAccess(PAL::SessionID, const RegistrableDomain& subFrameDomain, const RegistrableDomain& topFrameDomain, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool)>&&);
     void requestStorageAccess(PAL::SessionID, const RegistrableDomain& subFrameDomain, const RegistrableDomain& topFrameDomain, uint64_t frameID, uint64_t pageID, CompletionHandler<void(bool)>&&);
+    void requestStorageAccessUnderOpener(PAL::SessionID, WebCore::RegistrableDomain&& domainInNeedOfStorageAccess, uint64_t openerPageID, WebCore::RegistrableDomain&& openerDomain);
 #endif
 
     void addOriginAccessWhitelistEntry(const String& sourceOrigin, const String& destinationProtocol, const String& destinationHost, bool allowDestinationSubdomains);

Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in (243670 => 243671)


--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in	2019-03-30 01:09:12 UTC (rev 243671)
@@ -62,9 +62,10 @@
     LogWebSocketLoading(PAL::SessionID sessionID, WebCore::RegistrableDomain targetDomain, WebCore::RegistrableDomain topFrameDomain, WallTime lastSeen)
     LogSubresourceLoading(PAL::SessionID sessionID, WebCore::RegistrableDomain targetDomain, WebCore::RegistrableDomain topFrameDomain, WallTime lastSeen)
     LogSubresourceRedirect(PAL::SessionID sessionID, WebCore::RegistrableDomain sourceDomain, WebCore::RegistrableDomain targetDomain)
-    RequestResourceLoadStatisticsUpdate();
+    ResourceLoadStatisticsUpdated(Vector<WebCore::ResourceLoadStatistics> statistics)
     HasStorageAccess(PAL::SessionID sessionID, WebCore::RegistrableDomain subFrameDomain, WebCore::RegistrableDomain topFrameDomain, uint64_t frameID, uint64_t pageID) -> (bool hasStorageAccess) Async
     RequestStorageAccess(PAL::SessionID sessionID, WebCore::RegistrableDomain subFrameDomain, WebCore::RegistrableDomain topFrameDomain, uint64_t frameID, uint64_t pageID) -> (bool accessGranted) Async
+    RequestStorageAccessUnderOpener(PAL::SessionID sessionID, WebCore::RegistrableDomain domainInNeedOfStorageAccess, uint64_t openerPageID, WebCore::RegistrableDomain openerDomain)
 #endif
 
     AddOriginAccessWhitelistEntry(String sourceOrigin, String destinationProtocol, String destinationHost, bool allowDestinationSubdomains);

Deleted: trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.messages.in (243670 => 243671)


--- trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.messages.in	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.messages.in	2019-03-30 01:09:12 UTC (rev 243671)
@@ -1,30 +0,0 @@
-# Copyright (C) 2016 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer.
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
-# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#if ENABLE(RESOURCE_LOAD_STATISTICS)
-
-messages -> WebResourceLoadStatisticsStore {
-    RequestStorageAccessUnderOpener(WebCore::RegistrableDomain domainReceivingUserInteraction, uint64_t openerPageID, WebCore::RegistrableDomain openerDomain)
-    ResourceLoadStatisticsUpdated(Vector<WebCore::ResourceLoadStatistics> origins)
-}
-
-#endif

Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp (243670 => 243671)


--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp	2019-03-30 01:09:12 UTC (rev 243671)
@@ -40,7 +40,6 @@
 #include "WebProcessMessages.h"
 #include "WebProcessPool.h"
 #include "WebResourceLoadStatisticsStore.h"
-#include "WebResourceLoadStatisticsStoreMessages.h"
 #include "WebsiteData.h"
 #include "WebsiteDataStoreClient.h"
 #include "WebsiteDataStoreParameters.h"

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (243670 => 243671)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2019-03-30 01:09:12 UTC (rev 243671)
@@ -1122,8 +1122,6 @@
 		7A772C8D1DDD4A25000F34F1 /* com.apple.WebKit.plugin-common.sb in Copy Plug-in Sandbox Profiles */ = {isa = PBXBuildFile; fileRef = 7A1506721DD56298001F4B58 /* com.apple.WebKit.plugin-common.sb */; };
 		7A78FF32224191960096483E /* WKStorageAccessAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A78FF2E224191750096483E /* WKStorageAccessAlert.h */; };
 		7A78FF332241919B0096483E /* WKStorageAccessAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7A78FF2F224191760096483E /* WKStorageAccessAlert.mm */; };
-		7A791EFA1C7CFCF100C4C52B /* WebResourceLoadStatisticsStoreMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A791EF91C7CFB3700C4C52B /* WebResourceLoadStatisticsStoreMessageReceiver.cpp */; };
-		7A791EFB1C7CFD0100C4C52B /* WebResourceLoadStatisticsStoreMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A791EF81C7CFB1000C4C52B /* WebResourceLoadStatisticsStoreMessages.h */; };
 		7A821F4C1E2F673900604577 /* LegacyCustomProtocolManagerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A821F4B1E2F664800604577 /* LegacyCustomProtocolManagerClient.h */; };
 		7A821F501E2F7A7500604577 /* APICustomProtocolManagerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A821F4F1E2F7A5C00604577 /* APICustomProtocolManagerClient.h */; };
 		7A8A9D581EF119B0009801AE /* APIInjectedBundleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A8A9D571EF119AA009801AE /* APIInjectedBundleClient.h */; };
@@ -3580,8 +3578,6 @@
 		7A5E39491D5BD8A700B4B7CE /* com.macromedia.Flash Player ESR.plugin.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "com.macromedia.Flash Player ESR.plugin.sb"; sourceTree = "<group>"; };
 		7A78FF2E224191750096483E /* WKStorageAccessAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKStorageAccessAlert.h; sourceTree = "<group>"; };
 		7A78FF2F224191760096483E /* WKStorageAccessAlert.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKStorageAccessAlert.mm; sourceTree = "<group>"; };
-		7A791EF81C7CFB1000C4C52B /* WebResourceLoadStatisticsStoreMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebResourceLoadStatisticsStoreMessages.h; path = DerivedSources/WebKit2/WebResourceLoadStatisticsStoreMessages.h; sourceTree = BUILT_PRODUCTS_DIR; };
-		7A791EF91C7CFB3700C4C52B /* WebResourceLoadStatisticsStoreMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebResourceLoadStatisticsStoreMessageReceiver.cpp; path = DerivedSources/WebKit2/WebResourceLoadStatisticsStoreMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
 		7A821F491E2F65DD00604577 /* LegacyCustomProtocolManagerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LegacyCustomProtocolManagerProxy.cpp; path = CustomProtocols/LegacyCustomProtocolManagerProxy.cpp; sourceTree = "<group>"; };
 		7A821F4B1E2F664800604577 /* LegacyCustomProtocolManagerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyCustomProtocolManagerClient.h; sourceTree = "<group>"; };
 		7A821F4D1E2F679E00604577 /* LegacyCustomProtocolManagerClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LegacyCustomProtocolManagerClient.mm; sourceTree = "<group>"; };
@@ -3590,7 +3586,6 @@
 		7A8A9D571EF119AA009801AE /* APIInjectedBundleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIInjectedBundleClient.h; sourceTree = "<group>"; };
 		7A8A9D591EF13020009801AE /* APIInjectedBundleBundleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIInjectedBundleBundleClient.h; sourceTree = "<group>"; };
 		7A8A9D5B1EF1458E009801AE /* APIInjectedBundlePageResourceLoadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIInjectedBundlePageResourceLoadClient.h; sourceTree = "<group>"; };
-		7A9CD8C21C779AD600D9F6C7 /* WebResourceLoadStatisticsStore.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebResourceLoadStatisticsStore.messages.in; sourceTree = "<group>"; };
 		7AB6EA441EEAAE2300037B2B /* APIIconDatabaseClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIIconDatabaseClient.h; sourceTree = "<group>"; };
 		7AB6EA461EEAB6B000037B2B /* APIGeolocationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIGeolocationProvider.h; sourceTree = "<group>"; };
 		7ACE82E7221CAE06000DA94C /* ResourceLoadStatisticsStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ResourceLoadStatisticsStore.h; path = Classifier/ResourceLoadStatisticsStore.h; sourceTree = "<group>"; };
@@ -7600,7 +7595,6 @@
 				BC111B0D112F5E4F00337BAB /* WebProcessProxy.cpp */,
 				BC032DCF10F4389F0058C15A /* WebProcessProxy.h */,
 				BCEE7AB312817095009827DA /* WebProcessProxy.messages.in */,
-				7A9CD8C21C779AD600D9F6C7 /* WebResourceLoadStatisticsStore.messages.in */,
 				51D124241E6D3CC3002B2820 /* WebURLSchemeHandler.cpp */,
 				51D124251E6D3CC3002B2820 /* WebURLSchemeHandler.h */,
 				51E8B68D1E712873001B7132 /* WebURLSchemeTask.cpp */,
@@ -8653,8 +8647,6 @@
 				BCEE7ACD12817988009827DA /* WebProcessProxyMessages.h */,
 				51F060DD1654317500F3281B /* WebResourceLoaderMessageReceiver.cpp */,
 				51F060DE1654317500F3281B /* WebResourceLoaderMessages.h */,
-				7A791EF91C7CFB3700C4C52B /* WebResourceLoadStatisticsStoreMessageReceiver.cpp */,
-				7A791EF81C7CFB1000C4C52B /* WebResourceLoadStatisticsStoreMessages.h */,
 				51F060DD1654317500F3281F /* WebRTCMonitorMessageReceiver.cpp */,
 				51F060DD1654317500F3282C /* WebRTCResolverMessageReceiver.cpp */,
 				51F060DD1654317500F3281C /* WebRTCSocketMessageReceiver.cpp */,
@@ -9671,7 +9663,6 @@
 				510AFFBA16542048001BA05E /* WebResourceLoader.h in Headers */,
 				51F060E01654317F00F3281B /* WebResourceLoaderMessages.h in Headers */,
 				7AFBD36321E50F39005DBACB /* WebResourceLoadStatisticsStore.h in Headers */,
-				7A791EFB1C7CFD0100C4C52B /* WebResourceLoadStatisticsStoreMessages.h in Headers */,
 				413075B01DE85F580039EC69 /* WebRTCMonitor.h in Headers */,
 				41FAF5F51E3C0649001AE678 /* WebRTCResolver.h in Headers */,
 				41DC459F1E3DBDA500B11F51 /* WebRTCSocket.h in Headers */,
@@ -11182,7 +11173,6 @@
 				7CE4D2271A4916C200C7F152 /* WebProcessPoolMessageReceiver.cpp in Sources */,
 				BCEE7AD012817988009827DA /* WebProcessProxyMessageReceiver.cpp in Sources */,
 				51F060E11654318500F3281B /* WebResourceLoaderMessageReceiver.cpp in Sources */,
-				7A791EFA1C7CFCF100C4C52B /* WebResourceLoadStatisticsStoreMessageReceiver.cpp in Sources */,
 				51F060E11654318500F3281F /* WebRTCMonitorMessageReceiver.cpp in Sources */,
 				51F060E11654318500F3282C /* WebRTCResolverMessageReceiver.cpp in Sources */,
 				51F060E11654318500F3281C /* WebRTCSocketMessageReceiver.cpp in Sources */,

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp (243670 => 243671)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp	2019-03-30 01:09:12 UTC (rev 243671)
@@ -323,7 +323,7 @@
 
 void WKBundleResourceLoadStatisticsNotifyObserver(WKBundleRef)
 {
-    WebCore::ResourceLoadObserver::shared().notifyObserver();
+    WebCore::ResourceLoadObserver::shared().updateCentralStatisticsStore();
 }
 
 

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (243670 => 243671)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2019-03-30 00:21:38 UTC (rev 243670)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2019-03-30 01:09:12 UTC (rev 243671)
@@ -65,7 +65,6 @@
 #include "WebProcessMessages.h"
 #include "WebProcessPoolMessages.h"
 #include "WebProcessProxyMessages.h"
-#include "WebResourceLoadStatisticsStoreMessages.h"
 #include "WebSWContextManagerConnection.h"
 #include "WebSWContextManagerConnectionMessages.h"
 #include "WebServiceWorkerProvider.h"
@@ -211,14 +210,12 @@
     m_plugInAutoStartOriginHashes.add(PAL::SessionID::defaultSessionID(), HashMap<unsigned, WallTime>());
 
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
-    ResourceLoadObserver::shared().setNotificationCallback([this] (Vector<ResourceLoadStatistics>&& statistics) {
-        parentProcessConnection()->send(Messages::WebResourceLoadStatisticsStore::ResourceLoadStatisticsUpdated(WTFMove(statistics)), 0);
-
-        ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RequestResourceLoadStatisticsUpdate(), 0);
+    ResourceLoadObserver::shared().setStatisticsUpdatedCallback([this] (Vector<ResourceLoadStatistics>&& statistics) {
+        ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::ResourceLoadStatisticsUpdated(WTFMove(statistics)), 0);
     });
 
-    ResourceLoadObserver::shared().setRequestStorageAccessUnderOpenerCallback([this] (const RegistrableDomain& domainInNeedOfStorageAccess, uint64_t openerPageID, const RegistrableDomain& openerDomain) {
-        parentProcessConnection()->send(Messages::WebResourceLoadStatisticsStore::RequestStorageAccessUnderOpener(domainInNeedOfStorageAccess, openerPageID, openerDomain), 0);
+    ResourceLoadObserver::shared().setRequestStorageAccessUnderOpenerCallback([this] (PAL::SessionID sessionID, const RegistrableDomain& domainInNeedOfStorageAccess, uint64_t openerPageID, const RegistrableDomain& openerDomain) {
+        ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RequestStorageAccessUnderOpener(sessionID, domainInNeedOfStorageAccess, openerPageID, openerDomain), 0);
     });
 #endif
     
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to