Move WebResourceLoadStatisticsStore IPC calls from the UI process to the network...
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Mar 2019 01:09:12 +0000 (01:09 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Mar 2019 01:09:12 +0000 (01:09 +0000)
commit36bb4338cd19b0ffe5bcafca3a471ea2f94e48c6
tree5bff385fc5cccf2eabe325e4c2f1eebffcb75eab
parentf637615750950ff26937391c27e0df613136e0f3
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243671 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/storageAccess/deny-storage-access-under-opener-expected.txt
LayoutTests/http/tests/storageAccess/deny-storage-access-under-opener-if-auto-dismiss-expected.txt
LayoutTests/http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture.html [new file with mode: 0644]
LayoutTests/http/tests/storageAccess/resources/get-cookies.php
LayoutTests/http/tests/storageAccess/resources/produce-user-gesture-set-cookie-and-report-back.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/loader/ResourceLoadObserver.cpp
Source/WebCore/loader/ResourceLoadObserver.h
Source/WebCore/testing/Internals.cpp
Source/WebKit/CMakeLists.txt
Source/WebKit/ChangeLog
Source/WebKit/DerivedSources.make
Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp
Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in
Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.messages.in [deleted file]
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp
Source/WebKit/WebProcess/WebProcess.cpp