Introduce SPI _WKWebsitePolicies.websiteDataStore
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Dec 2017 23:14:33 +0000 (23:14 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Dec 2017 23:14:33 +0000 (23:14 +0000)
commitdfaeaa56d3834c5f9b627a2a0fdcc9c1e6319e22
treefcece41228e0c5ad05f4bb8444b77b8cba7b4c5a
parentf9a62765cf95d4f0d0d034fb04d0962d01759cf3
Introduce SPI _WKWebsitePolicies.websiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=180880
<rdar://problem/35535328>

Reviewed by Andy Estes.

Source/WebKit:

The SPI doesn't do anything yet, but it already has some restrictions and tests!
WKWebView._updateWebsitePolicies can't be used to update a WKWebsiteDataStore.  Only during navigation.
Even during navigation, we are only supporting the default and ephemeral data stores right now.
This functionality won't be supported in the C API.  This is enforced with RELEASE_ASSERTs.
If we change our minds, we can change them and add restrictions similar to the ObjC restrictions.

* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::WebsitePolicies):
(API::WebsitePolicies::setWebsiteDataStore):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/C/WKFramePolicyListener.cpp:
(WKFramePolicyListenerUseWithPolicies):
* UIProcess/API/C/WKPage.cpp:
(WKPageUpdateWebsitePolicies):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateWebsitePolicies:]):
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies websiteDataStore]):
(-[_WKWebsitePolicies setWebsiteDataStore:]):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(-[WebsitePoliciesWebsiteDataStoreDelegate _webView:decidePolicyForNavigationAction:decisionHandler:]):
(-[WebsitePoliciesWebsiteDataStoreDelegate webView:startURLSchemeTask:]):
(-[WebsitePoliciesWebsiteDataStoreDelegate webView:stopURLSchemeTask:]):
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225989 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebsitePoliciesData.cpp
Source/WebKit/Shared/WebsitePoliciesData.h
Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp
Source/WebKit/UIProcess/API/APIWebsitePolicies.h
Source/WebKit/UIProcess/API/C/WKFramePolicyListener.cpp
Source/WebKit/UIProcess/API/C/WKPage.cpp
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.h
Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.mm
Source/WebKit/UIProcess/Cocoa/NavigationState.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm