Storage Access API: Refactor to make naming accurate and explicit, simplify access...
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 6 Jan 2018 02:16:51 +0000 (02:16 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 6 Jan 2018 02:16:51 +0000 (02:16 +0000)
commita42ccf8afde1eb0caa0f3a6134a40caca66f4cd8
tree597b6c2051733975c6e30cf1f84983ce7def632c
parent09cb9a85d65af5c18b3eee308fbc11698667cabc
Storage Access API: Refactor to make naming accurate and explicit, simplify access table, and prepare for access removal for page
https://bugs.webkit.org/show_bug.cgi?id=181357
<rdar://problem/36331031>

Reviewed by Alex Christensen.

Source/WebCore:

No new tests. The only changed functionality that isn't covered
by existing tests is cross-origin iframes in the same partition
should be handled as already having access. This cannot be
tested in layout tests since they don't support subdomains.

This change does the following:
- Changes function and message names to reflect how this feature
  was eventually implemented, i.e. access per frame.
- Makes it explicit that the UI process is only involved in
  granting storage access and not removing storage access.
  The latter is done directly by the web process.
- Simplifies the network process' entry map since only needs to
  be able to give access to one domain in one frame at a time.
  Access goes away on frame navigation so there can only be one
  domain at a time per frame. Also, the map now uses pageIDs as
  main keys to prepare for efficient access removal for all
  frames under a page.
- Fixes a bug in so that a cross-origin iframe with the same
  partition as the top frame correctly is handled as already
  having access.

* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::cookieStoragePartition const):
    The only change here is the changed named of the call to
    NetworkStorageSession::hasStorageAccessForFrame().
(WebCore::NetworkStorageSession::hasStorageAccessForFrame const):
(WebCore::NetworkStorageSession::grantStorageAccessForFrame):
(WebCore::NetworkStorageSession::removeStorageAccessForFrame):
(WebCore::NetworkStorageSession::isStorageAccessGranted const): Deleted.
(WebCore::NetworkStorageSession::setStorageAccessGranted): Deleted.
(WebCore::NetworkStorageSession::removeStorageAccess): Deleted.

Source/WebKit:

This change does the following:
- Changes function and message names to reflect how this feature
  was eventually implemented, i.e. access per frame.
- Makes it explicit that the UI process is only involved in
  granting storage access and not removing storage access.
  The latter is done directly by the web process.
- Simplifies the network process' entry map since only needs to
  be able to give access to one domain in one frame at a time.
  Access goes away on frame navigation so there can only be one
  domain at a time per frame. Also, the map now uses pageIDs as
  main keys to prepare for efficient access removal for all
  frames under a page.
- Fixes a bug in so that a cross-origin iframe with the same
  partition as the top frame correctly is handled as already
  having access.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
(WebKit::NetworkConnectionToWebProcess::removeStorageAccess): Deleted.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::hasStorageAccessForFrame):
(WebKit::NetworkProcess::grantStorageAccessForFrame):
(WebKit::NetworkProcess::hasStorageAccessForPrevalentDomains): Deleted.
(WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
(WebKit::NetworkProcessProxy::grantStorageAccessForFrame):
(WebKit::NetworkProcessProxy::hasStorageAccessForPrevalentDomains): Deleted.
(WebKit::NetworkProcessProxy::updateStorageAccessForPrevalentDomains): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
(WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler):
(WebKit::WebsiteDataStore::grantStorageAccessForFrameHandler):
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
(WebKit::WebsiteDataStore::hasStorageAccessForPrevalentDomainsHandler): Deleted.
(WebKit::WebsiteDataStore::updateStorageAccessForPrevalentDomainsHandler): Deleted.
* UIProcess/WebsiteData/WebsiteDataStore.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::detachedFromParent2):
(WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226482 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/network/NetworkStorageSession.h
Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in
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/WebResourceLoadStatisticsStore.cpp
Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp