Storage Access API: Make document.hasStorageAccess() retrieve current status from the network process
https://bugs.webkit.org/show_bug.cgi?id=180681
<rdar://problem/
35982161>
Reviewed by Alex Christensen.
Source/WebCore:
Tests: http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-non-recent-user-interaction.html
http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-recent-user-interaction.html
This change makes an asynchronous request to the network process
to see if storage access has been granted for this frame, on this
page, for this domain.
* dom/Document.cpp:
(WebCore::Document::hasStorageAccess):
* page/ChromeClient.h:
Source/WebKit:
This change makes an asynchronous request to the network process
to see if storage access has been granted for this frame, on this
page, for this domain.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::hasStorageAccessForPrevalentDomains):
(WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::hasStorageAccessForPrevalentDomains):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::hasStorageAccess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::hasStorageAccessForPrevalentDomainsHandler):
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
(WebKit::WebsiteDataStore::hasStorageAccess):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::hasStorageAccess):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::hasStorageAccess):
* WebProcess/WebPage/WebPage.h:
LayoutTests:
This change makes an asynchronous request to the network process
to see if storage access has been granted for this frame, on this
page, for this domain.
* http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-non-recent-user-interaction-expected.txt: Added.
* http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-non-recent-user-interaction.html: Added.
* http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-recent-user-interaction-expected.txt: Added.
* http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-recent-user-interaction.html: Added.
* http/tests/storageAccess/resources/has-storage-access-iframe.html: Added.
* platform/mac-wk2/TestExpectations:
New tests marked as [ Pass ].
All http/tests/storageAccess/ tests marked [ HighSierra+ ] since
document.hasStorageAccess() now requires code that relies on cookie
partitioning.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226016
268f45cc-cd09-0410-ab3c-
d52691b4dbfc