Resource Load Statistics: Immediately forward cookie access at user interaction when there's an opener document
https://bugs.webkit.org/show_bug.cgi?id=183577
<rdar://problem/
38266987>
Reviewed by Brent Fulgham.
Source/WebCore:
Tested manually on live websites.
No new automated tests because of a bug in WebKitTestRunner:
https://bugs.webkit.org/show_bug.cgi?id=183578
The event sender triggers gestures in the opener rather than
in the popup.
* dom/Document.cpp:
(WebCore::Document::removedLastRef):
Clears the new m_primaryDomainsGrantedPageSpecificStorageAccess.
(WebCore::Document::hasGrantedPageSpecificStorageAccess):
(WebCore::Document::setHasGrantedPageSpecificStorageAccess):
* dom/Document.h:
Added member m_primaryDomainsGrantedPageSpecificStorageAccess
where we store domains that have been granted access.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setGrantStorageAccessUnderOpenerCallback):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
Now checks if there is a cross-origin opener and if so, immediately
grants cookie access to the popup's domain if it is partitioned or
blocked.
* loader/ResourceLoadObserver.h:
* platform/network/NetworkStorageSession.h:
Added member m_pagesGrantedStorageAccess.
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::cookieStoragePartition const):
(WebCore::NetworkStorageSession::hasStorageAccess const):
Renamed from hasStorageAccessForFrame since the frameID now is optional.
(WebCore::NetworkStorageSession::grantStorageAccess):
Renamed from grantStorageAccessForFrame since the frameID now is optional.
(WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage):
Now removes the pageID entry in m_pagesGrantedStorageAccess.
(WebCore::NetworkStorageSession::hasStorageAccessForFrame const): Deleted.
Renamed since the frameID now is optional.
(WebCore::NetworkStorageSession::grantStorageAccessForFrame): Deleted.
Renamed since the frameID now is optional.
Source/WebKit:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::hasStorageAccessForFrame):
Now also checks for general page access.
(WebKit::NetworkProcess::grantStorageAccess):
Renamed from grantStorageAccessForFrame since the frameID now is optional.
(WebKit::NetworkProcess::grantStorageAccessForFrame): Deleted.
Renamed since the frameID now is optional.
* NetworkProcess/NetworkProcess.h:
Renaming since the frameID now is optional.
* NetworkProcess/NetworkProcess.messages.in:
Renaming since the frameID now is optional.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::logCookieInformation):
Consequence of function renaming.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::grantStorageAccess):
(WebKit::NetworkProcessProxy::grantStorageAccessForFrame): Deleted.
Renaming since the frameID now is optional.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
Renaming since the frameID now is optional.
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
Handler renaming since the frameID now is optional.
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener):
New function for that grants cookie access under a whole page.
* UIProcess/WebResourceLoadStatisticsStore.h:
Member renaming since the frameID now is optional.
* UIProcess/WebResourceLoadStatisticsStore.messages.in:
New message received straight from WebCore::ResourceLoadObserver.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::grantStorageAccessHandler):
Renamed and made frameID optional.
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
Consequence of renaming and making frameID optional.
(WebKit::WebsiteDataStore::grantStorageAccessForFrameHandler): Deleted.
Renamed and made frameID optional.
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/WebProcess.cpp:
(WebProcess::WebProcess):
Now calls setGrantStorageAccessUnderOpenerCallback() on the shared
WebCore::ResourceLoadObserver.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229569
268f45cc-cd09-0410-ab3c-
d52691b4dbfc