Storage Access API: Make document.hasStorageAccess() retrieve current status from...
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Dec 2017 03:44:54 +0000 (03:44 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Dec 2017 03:44:54 +0000 (03:44 +0000)
commit6ab8763b07ac5edbfa248deb88c0bfb813a80473
treecb1900eaffe13540b06c7ec12c94d9adae7344dc
parent995bd848b443aa655e99b8d3d129df3f5b941ecc
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
27 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-non-recent-user-interaction-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-non-recent-user-interaction.html [new file with mode: 0644]
LayoutTests/http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-recent-user-interaction-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-recent-user-interaction.html [new file with mode: 0644]
LayoutTests/http/tests/storageAccess/resources/has-storage-access-iframe.html [new file with mode: 0644]
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/page/ChromeClient.h
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkProcess.cpp
Source/WebKit/NetworkProcess/NetworkProcess.h
Source/WebKit/NetworkProcess/NetworkProcess.messages.in
Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
Source/WebKit/UIProcess/Network/NetworkProcessProxy.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/WebPageProxy.messages.in
Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp
Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h