Storage Access API: Make document.hasStorageAccess a function and always allow access...
authorsaid@apple.com <said@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Dec 2017 19:56:13 +0000 (19:56 +0000)
committersaid@apple.com <said@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Dec 2017 19:56:13 +0000 (19:56 +0000)
commitbbe718e4a6b3d1bfa98a76bfab14917ae5ef8cad
tree2b41555c82bed565f2d49b4b17643894140ade28
parentb1b6db997c1ade415ec85ac4e9701218485a744c
Storage Access API: Make document.hasStorageAccess a function and always allow access for same-origin iframes
https://bugs.webkit.org/show_bug.cgi?id=176944
<rdar://problem/34440658>

Patch by John Wilander <wilander@apple.com> on 2017-12-06
Reviewed by Brent Fulgham.

Test: http/tests/storageAccess/request-storage-access-cross-origin-sandboxed-iframe-without-user-gesture.html

This change introduces document.hasStorageAccess() as a function which
returns a promise instead of being a property. Since cookie access can
be due to both a granted request and recent user interaction as first
party, the WebKit::WebResourceLoadStatisticsStore needs to be consulted.

* dom/Document.cpp:
(WebCore::Document::hasStorageAccess):
(WebCore::Document::requestStorageAccess):
    Removed check of the previous m_hasStorageAccess member.
    Same-origin check done earlier. This was a request/suggestion
    from Mozilla.
* dom/Document.h:
(WebCore::Document::hasStorageAccess const): Deleted.
    Now uses a promise.
* dom/Document.idl:
* page/ChromeClient.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog