Add experimental feature to prompt for Storage Access API use
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 May 2018 21:56:53 +0000 (21:56 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 May 2018 21:56:53 +0000 (21:56 +0000)
commitf634f83ea234154c26a562632d64396d0417e8bd
tree9ddba9fae0220eee98c3f9ebfc56197d770a3549
parentbbf3740a41e9629abe81ffefbb58e97bf9062f7e
Add experimental feature to prompt for Storage Access API use
https://bugs.webkit.org/show_bug.cgi?id=185335
<rdar://problem/39994649>

Patch by Brent Fulgham <bfulgham@apple.com> on 2018-05-07
Reviewed by Alex Christensen and Youenn Fablet.

Create a new experimental feature that gates the ability of WebKit clients to prompt the user when
Storage Access API is invoked.

Currently this feature doesn't have any user-visible impact.

Source/WebCore:

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setStorageAccessPromptsEnabled):
(WebCore::RuntimeEnabledFeatures::storageAccessPromptsEnabled const):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setStorageAccessPromptsEnabled):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

Source/WebKit:

* Shared/API/APIObject.h:
* Shared/API/c/WKBase.h:
* Shared/WebPreferences.yaml:
* UIProcess/API/APIUIClient.h:
(API::UIClient::requestStorageAccessConfirm):
* UIProcess/API/C/WKPage.cpp:
(WebKit::RequestStorageAccessConfirmResultListener::create):
(WebKit::RequestStorageAccessConfirmResultListener::~RequestStorageAccessConfirmResultListener):
(WebKit::RequestStorageAccessConfirmResultListener::call):
(WebKit::RequestStorageAccessConfirmResultListener::RequestStorageAccessConfirmResultListener):
(WKPageRequestStorageAccessConfirmResultListenerGetTypeID):
(WKPageRequestStorageAccessConfirmResultListenerCall):
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _storageAccessPromptsEnabled]):
(-[WKPreferences _setStorageAccessPromptsEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestStorageAccessConfirm):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::update):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::requestStorageAccess):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebCore/testing/InternalSettings.idl
Source/WebKit/ChangeLog
Source/WebKit/Shared/API/APIObject.h
Source/WebKit/Shared/API/c/WKBase.h
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/UIProcess/API/APIUIClient.h
Source/WebKit/UIProcess/API/C/WKPage.cpp
Source/WebKit/UIProcess/API/C/WKPageUIClient.h
Source/WebKit/UIProcess/API/C/WKPreferences.cpp
Source/WebKit/UIProcess/API/C/WKPreferencesRef.h
Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h
Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h
Source/WebKit/UIProcess/Cocoa/UIDelegate.h
Source/WebKit/UIProcess/Cocoa/UIDelegate.mm
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/WebPageProxy.messages.in
Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h