[Fetch API] Add a runtime flag to fetch API and related constructs
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Apr 2016 23:20:15 +0000 (23:20 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Apr 2016 23:20:15 +0000 (23:20 +0000)
commitccc8263d39dae528385846fd863bccad5ff3dc4a
treeba7ec8a9c1312e9402ff22674064d8ce3b84f2bc
parente1dfbc318f0432e86bdf35bd410ac0efd7f35863
[Fetch API] Add a runtime flag to fetch API and related constructs
https://bugs.webkit.org/show_bug.cgi?id=156113

Patch by Youenn Fablet <youenn.fablet@crf.canon.fr> on 2016-04-05
Reviewed by Alex Christensen.

Source/JavaScriptCore:

Add a fetch API runtime flag based on preferences.
Disable fetch API by default.

* runtime/CommonIdentifiers.h:

Source/WebCore:

Marking all Fetch interfaces EnabledAtRuntime=FetchAPI.
Adding FetchAPI runtime flag setter and getter.
In case, fetch API is disabled, ensure Window.prototype.fetch returns undefined.

* Modules/fetch/DOMWindowFetch.idl:
* Modules/fetch/FetchBody.idl:
* Modules/fetch/FetchHeaders.idl:
* Modules/fetch/FetchRequest.idl:
* Modules/fetch/FetchResponse.idl:
* Modules/fetch/WorkerGlobalScopeFetch.idl:
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webGL2Enabled):
(WebCore::RuntimeEnabledFeatures::setFetchAPIEnabled):
(WebCore::RuntimeEnabledFeatures::fetchAPIEnabled):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::finishCreation):

Source/WebKit/mac:

Add a fetch API runtime flag based on preferences.
Disable fetch API by default.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences setCustomElementsEnabled:]):
(-[WebPreferences fetchAPIEnabled]):
(-[WebPreferences setFetchAPIEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):
(-[WebView preferencesIdentifier]):
(-[WebView setUIDelegate:]):

Source/WebKit2:

Add a fetch API runtime flag based on preferences.
Disable fetch API by default.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesGetCustomElementsEnabled):
(WKPreferencesSetFetchAPIEnabled):
(WKPreferencesGetFetchAPIEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

* DumpRenderTree/TestRunner.h:
* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setWebGL2Enabled):
(WTR::TestRunner::setFetchAPIEnabled):
(WTR::TestRunner::setAllowUniversalAccessFromFileURLs):
* WebKitTestRunner/InjectedBundle/TestRunner.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199081 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/CommonIdentifiers.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/fetch/DOMWindowFetch.idl
Source/WebCore/Modules/fetch/FetchBody.idl
Source/WebCore/Modules/fetch/FetchHeaders.idl
Source/WebCore/Modules/fetch/FetchRequest.idl
Source/WebCore/Modules/fetch/FetchResponse.idl
Source/WebCore/Modules/fetch/WorkerGlobalScopeFetch.idl
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h
Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebPreferencesPrivate.h
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesDefinitions.h
Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Tools/ChangeLog
Tools/DumpRenderTree/TestRunner.h
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.h