Title: [199081] trunk
Revision
199081
Author
achristen...@apple.com
Date
2016-04-05 16:20:15 -0700 (Tue, 05 Apr 2016)

Log Message

[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.fab...@crf.canon.fr> on 2016-04-05
Reviewed by Alex Christensen.

Source/_javascript_Core:

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:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (199080 => 199081)


--- trunk/Source/_javascript_Core/ChangeLog	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-04-05 23:20:15 UTC (rev 199081)
@@ -1,3 +1,15 @@
+2016-04-05  Youenn Fablet  <youenn.fab...@crf.canon.fr>
+
+        [Fetch API] Add a runtime flag to fetch API and related constructs
+        https://bugs.webkit.org/show_bug.cgi?id=156113
+ 
+        Reviewed by Alex Christensen.
+
+        Add a fetch API runtime flag based on preferences.
+        Disable fetch API by default.
+ 
+        * runtime/CommonIdentifiers.h:
+
 2016-04-05  Filip Pizlo  <fpi...@apple.com>
 
         Unreviewed, fix cloop some more.

Modified: trunk/Source/_javascript_Core/runtime/CommonIdentifiers.h (199080 => 199081)


--- trunk/Source/_javascript_Core/runtime/CommonIdentifiers.h	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/_javascript_Core/runtime/CommonIdentifiers.h	2016-04-05 23:20:15 UTC (rev 199081)
@@ -46,6 +46,7 @@
     macro(GamepadButton) \
     macro(GamepadEvent) \
     macro(GeneratorFunction) \
+    macro(Headers) \
     macro(HTMLAudioElement) \
     macro(HTMLSlotElement) \
     macro(IDBCursor) \
@@ -76,6 +77,8 @@
     macro(ReferenceError) \
     macro(Reflect) \
     macro(RegExp) \
+    macro(Response) \
+    macro(Request) \
     macro(Set)\
     macro(SetIterator)\
     macro(ShadowRoot) \

Modified: trunk/Source/WebCore/ChangeLog (199080 => 199081)


--- trunk/Source/WebCore/ChangeLog	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebCore/ChangeLog	2016-04-05 23:20:15 UTC (rev 199081)
@@ -1,3 +1,27 @@
+2016-04-05  Youenn Fablet  <youenn.fab...@crf.canon.fr>
+
+        [Fetch API] Add a runtime flag to fetch API and related constructs
+        https://bugs.webkit.org/show_bug.cgi?id=156113
+ 
+        Reviewed by Alex Christensen.
+
+        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):
+
 2016-04-05  Brady Eidson  <beid...@apple.com>
 
         Modern IDB: Get blob URLs/files all the way to the IDB backing store.

Modified: trunk/Source/WebCore/Modules/fetch/DOMWindowFetch.idl (199080 => 199081)


--- trunk/Source/WebCore/Modules/fetch/DOMWindowFetch.idl	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebCore/Modules/fetch/DOMWindowFetch.idl	2016-04-05 23:20:15 UTC (rev 199081)
@@ -28,6 +28,7 @@
 
 [
     Conditional=FETCH_API,
+    EnabledAtRuntime=FetchAPI,
 ] partial interface DOMWindow {
     Promise fetch(FetchRequest input, optional Dictionary init);
     Promise fetch(DOMString input, optional Dictionary init);

Modified: trunk/Source/WebCore/Modules/fetch/FetchBody.idl (199080 => 199081)


--- trunk/Source/WebCore/Modules/fetch/FetchBody.idl	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebCore/Modules/fetch/FetchBody.idl	2016-04-05 23:20:15 UTC (rev 199081)
@@ -28,6 +28,7 @@
 
 [
     Conditional=FETCH_API,
+    EnabledAtRuntime=FetchAPI,
     GlobalContext=DOMWindow&WorkerGlobalScope,
     InterfaceName=Body,
     NoInterfaceObject

Modified: trunk/Source/WebCore/Modules/fetch/FetchHeaders.idl (199080 => 199081)


--- trunk/Source/WebCore/Modules/fetch/FetchHeaders.idl	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebCore/Modules/fetch/FetchHeaders.idl	2016-04-05 23:20:15 UTC (rev 199081)
@@ -28,6 +28,7 @@
 
 [
     Conditional=FETCH_API,
+    EnabledAtRuntime=FetchAPI,
     GlobalContext=DOMWindow&WorkerGlobalScope,
     ImplementationLacksVTable,
     InterfaceName=Headers,

Modified: trunk/Source/WebCore/Modules/fetch/FetchRequest.idl (199080 => 199081)


--- trunk/Source/WebCore/Modules/fetch/FetchRequest.idl	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebCore/Modules/fetch/FetchRequest.idl	2016-04-05 23:20:15 UTC (rev 199081)
@@ -37,6 +37,7 @@
 [
     ActiveDOMObject,
     Conditional=FETCH_API,
+    EnabledAtRuntime=FetchAPI,
     ConstructorCallWith=ScriptExecutionContext,
     ConstructorRaisesException,
     Constructor(FetchRequest input, [Default=Undefined] optional Dictionary init),

Modified: trunk/Source/WebCore/Modules/fetch/FetchResponse.idl (199080 => 199081)


--- trunk/Source/WebCore/Modules/fetch/FetchResponse.idl	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebCore/Modules/fetch/FetchResponse.idl	2016-04-05 23:20:15 UTC (rev 199081)
@@ -30,6 +30,7 @@
 [
     ActiveDOMObject,
     Conditional=FETCH_API,
+    EnabledAtRuntime=FetchAPI,
     ConstructorCallWith=ScriptExecutionContext,
     GlobalContext=DOMWindow&WorkerGlobalScope,
     InterfaceName=Response,

Modified: trunk/Source/WebCore/Modules/fetch/WorkerGlobalScopeFetch.idl (199080 => 199081)


--- trunk/Source/WebCore/Modules/fetch/WorkerGlobalScopeFetch.idl	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebCore/Modules/fetch/WorkerGlobalScopeFetch.idl	2016-04-05 23:20:15 UTC (rev 199081)
@@ -28,6 +28,7 @@
 
 [
     Conditional=FETCH_API,
+    EnabledAtRuntime=FetchAPI,
 ] partial interface WorkerGlobalScope {
     Promise fetch(DOMString input, optional Dictionary init);
     Promise fetch(FetchRequest input, optional Dictionary init);

Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h (199080 => 199081)


--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2016-04-05 23:20:15 UTC (rev 199081)
@@ -222,6 +222,11 @@
     bool webGL2Enabled() const { return m_isWebGL2Enabled; }
 #endif
 
+#if ENABLE(FETCH_API)
+    void setFetchAPIEnabled(bool isEnabled) { m_isFetchAPIEnabled = isEnabled; }
+    bool fetchAPIEnabled() const { return m_isFetchAPIEnabled; }
+#endif
+
     WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures();
 
 private:
@@ -319,6 +324,10 @@
     bool m_isWebGL2Enabled;
 #endif
 
+#if ENABLE(FETCH_API)
+    bool m_isFetchAPIEnabled { false };
+#endif
+
     friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>;
 };
 

Modified: trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp (199080 => 199081)


--- trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp	2016-04-05 23:20:15 UTC (rev 199081)
@@ -36,6 +36,7 @@
 #include "JSReadableStream.h"
 #include "JSReadableStreamPrivateConstructors.h"
 #include "JSWorkerGlobalScope.h"
+#include "RuntimeEnabledFeatures.h"
 #include "WebCoreJSClientData.h"
 #include "WorkerGlobalScope.h"
 
@@ -112,6 +113,15 @@
     Base::finishCreation(vm, thisValue);
     ASSERT(inherits(info()));
 
+#if ENABLE(FETCH_API)
+    // FIXME: Modify the bindings generator so this was never added in the first place.
+    if (!RuntimeEnabledFeatures::sharedFeatures().fetchAPIEnabled()) {
+        JSObject* prototype = getPrototypeDirect().getObject();
+        ASSERT(prototype);
+        prototype->putDirect(vm, Identifier::fromString(&vm, "fetch"), jsUndefined());
+    }
+#endif
+    
     addBuiltinGlobals(vm);
 }
 

Modified: trunk/Source/WebKit/mac/ChangeLog (199080 => 199081)


--- trunk/Source/WebKit/mac/ChangeLog	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebKit/mac/ChangeLog	2016-04-05 23:20:15 UTC (rev 199081)
@@ -1,3 +1,25 @@
+2016-04-05  Youenn Fablet  <youenn.fab...@crf.canon.fr>
+
+        [Fetch API] Add a runtime flag to fetch API and related constructs
+        https://bugs.webkit.org/show_bug.cgi?id=156113
+ 
+        Reviewed by Alex Christensen.
+
+        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:]):
+
 2016-04-05  Antoine Quint  <grao...@apple.com>
 
         [WebGL2] Turn the ENABLE_WEBGL2 flag on

Modified: trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (199080 => 199081)


--- trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2016-04-05 23:20:15 UTC (rev 199081)
@@ -162,6 +162,7 @@
 #define WebKitMediaKeysStorageDirectoryKey @"WebKitMediaKeysStorageDirectory"
 #define WebKitShadowDOMEnabledPreferenceKey @"WebKitShadowDOMEnabled"
 #define WebKitCustomElementsEnabledPreferenceKey @"WebKitCustomElementsEnabled"
+#define WebKitFetchAPIEnabledPreferenceKey @"WebKitFetchAPIEnabled"
 
 #if !TARGET_OS_IPHONE
 // These are private both because callers should be using the cover methods and because the

Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (199080 => 199081)


--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2016-04-05 23:20:15 UTC (rev 199081)
@@ -613,6 +613,9 @@
 #if ENABLE(WEBGL2)
         [NSNumber numberWithBool:NO], WebKitWebGL2EnabledPreferenceKey,
 #endif
+#if ENABLE(FETCH_API)
+        [NSNumber numberWithBool:NO], WebKitFetchAPIEnabledPreferenceKey,
+#endif
         nil];
 
 #if !PLATFORM(IOS)
@@ -2713,6 +2716,16 @@
     [self _setBoolValue:flag forKey:WebKitCustomElementsEnabledPreferenceKey];
 }
 
+- (BOOL)fetchAPIEnabled
+{
+    return [self _boolValueForKey:WebKitFetchAPIEnabledPreferenceKey];
+}
+
+- (void)setFetchAPIEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitFetchAPIEnabledPreferenceKey];
+}
+
 @end
 
 @implementation WebPreferences (WebInternal)

Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (199080 => 199081)


--- trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2016-04-05 23:20:15 UTC (rev 199081)
@@ -484,6 +484,9 @@
 - (void)setCustomElementsEnabled:(BOOL)flag;
 - (BOOL)customElementsEnabled;
 
+- (void)setFetchAPIEnabled:(BOOL)flag;
+- (BOOL)fetchAPIEnabled;
+
 @property (nonatomic) BOOL _javascript_MarkupEnabled;
 @property (nonatomic) BOOL mediaDataLoadsAutomatically;
 @property (nonatomic) BOOL attachmentElementEnabled;

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (199080 => 199081)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2016-04-05 23:20:15 UTC (rev 199081)
@@ -2488,6 +2488,10 @@
     RuntimeEnabledFeatures::sharedFeatures().setCustomElementsEnabled([preferences customElementsEnabled]);
 #endif
 
+#if ENABLE(FETCH_API)
+    RuntimeEnabledFeatures::sharedFeatures().setFetchAPIEnabled([preferences fetchAPIEnabled]);
+#endif
+
 #if ENABLE(WEBGL2)
     RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled([preferences webGL2Enabled]);
 #endif
@@ -5504,7 +5508,6 @@
     return [[self preferences] identifier];
 }
 
-
 - (void)setUIDelegate:delegate
 {
     _private->UIDelegate = delegate;

Modified: trunk/Source/WebKit2/ChangeLog (199080 => 199081)


--- trunk/Source/WebKit2/ChangeLog	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebKit2/ChangeLog	2016-04-05 23:20:15 UTC (rev 199081)
@@ -1,3 +1,24 @@
+2016-04-05  Youenn Fablet  <youenn.fab...@crf.canon.fr>
+
+        [Fetch API] Add a runtime flag to fetch API and related constructs
+        https://bugs.webkit.org/show_bug.cgi?id=156113
+ 
+        Reviewed by Alex Christensen.
+
+        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):
+
 2016-04-05  Brady Eidson  <beid...@apple.com>
 
         Modern IDB: Replace use of SerializedScriptValue with IDBValue.

Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (199080 => 199081)


--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2016-04-05 23:20:15 UTC (rev 199081)
@@ -227,6 +227,7 @@
     macro(MockCaptureDevicesEnabled, mockCaptureDevicesEnabled, Bool, bool, false) \
     macro(ShadowDOMEnabled, shadowDOMEnabled, Bool, bool, true) \
     macro(CustomElementsEnabled, customElementsEnabled, Bool, bool, false) \
+    macro(FetchAPIEnabled, fetchAPIEnabled, Bool, bool, false) \
     macro(WebGL2Enabled, webGL2Enabled, Bool, bool, false) \
     FOR_EACH_ADDITIONAL_WEBKIT_BOOL_PREFERENCE(macro) \
     \

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (199080 => 199081)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2016-04-05 23:20:15 UTC (rev 199081)
@@ -1516,3 +1516,13 @@
 {
     return toImpl(preferencesRef)->shadowDOMEnabled();
 }
+
+void WKPreferencesSetFetchAPIEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+    toImpl(preferencesRef)->setFetchAPIEnabled(flag);
+}
+
+bool WKPreferencesGetFetchAPIEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->fetchAPIEnabled();
+}

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (199080 => 199081)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2016-04-05 23:20:15 UTC (rev 199081)
@@ -423,6 +423,10 @@
 WK_EXPORT void WKPreferencesSetCustomElementsEnabled(WKPreferencesRef, bool flag);
 WK_EXPORT bool WKPreferencesGetCustomElementsEnabled(WKPreferencesRef);
 
+// Defaults to false
+WK_EXPORT void WKPreferencesSetFetchAPIEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetFetchAPIEnabled(WKPreferencesRef);
+
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (199080 => 199081)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2016-04-05 23:20:15 UTC (rev 199081)
@@ -208,6 +208,11 @@
         RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled(enabled);
 #endif
 
+#if ENABLE(FETCH_API)
+    if (preference == "WebKitFetchAPIEnabled")
+        RuntimeEnabledFeatures::sharedFeatures().setFetchAPIEnabled(enabled);
+#endif
+
     // Map the names used in LayoutTests with the names used in WebCore::Settings and WebPreferencesStore.
 #define FOR_EACH_OVERRIDE_BOOL_PREFERENCE(macro) \
     macro(WebKitAcceleratedCompositingEnabled, AcceleratedCompositingEnabled, acceleratedCompositingEnabled) \

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (199080 => 199081)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-04-05 23:20:15 UTC (rev 199081)
@@ -3099,6 +3099,10 @@
     RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled(store.getBoolValueForKey(WebPreferencesKey::webGL2EnabledKey()));
 #endif
 
+#if ENABLE(FETCH_API)
+    RuntimeEnabledFeatures::sharedFeatures().setFetchAPIEnabled(store.getBoolValueForKey(WebPreferencesKey::fetchAPIEnabledKey()));
+#endif
+
     bool processSuppressionEnabled = store.getBoolValueForKey(WebPreferencesKey::pageVisibilityBasedProcessSuppressionEnabledKey());
     if (m_processSuppressionEnabled != processSuppressionEnabled) {
         m_processSuppressionEnabled = processSuppressionEnabled;

Modified: trunk/Tools/ChangeLog (199080 => 199081)


--- trunk/Tools/ChangeLog	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Tools/ChangeLog	2016-04-05 23:20:15 UTC (rev 199081)
@@ -1,3 +1,21 @@
+2016-04-05  Youenn Fablet  <youenn.fab...@crf.canon.fr>
+
+        [Fetch API] Add a runtime flag to fetch API and related constructs
+        https://bugs.webkit.org/show_bug.cgi?id=156113
+ 
+        Reviewed by Alex Christensen.
+
+        * 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:
+
 2016-04-05  Keith Miller  <keith_mil...@apple.com>
 
         Make Keith a reviewer!

Modified: trunk/Tools/DumpRenderTree/TestRunner.h (199080 => 199081)


--- trunk/Tools/DumpRenderTree/TestRunner.h	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Tools/DumpRenderTree/TestRunner.h	2016-04-05 23:20:15 UTC (rev 199081)
@@ -89,6 +89,7 @@
     void queueReload();
     void removeAllVisitedLinks();
     void setAcceptsEditing(bool);
+    void setFetchAPIEnabled(bool);
     void setAllowUniversalAccessFromFileURLs(bool);
     void setAllowFileAccessFromFileURLs(bool);
     void setAppCacheMaximumSize(unsigned long long quota);

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (199080 => 199081)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2016-04-05 23:20:15 UTC (rev 199081)
@@ -989,6 +989,8 @@
 
     [preferences setWebGL2Enabled:YES];
 
+    [preferences setFetchAPIEnabled:YES];
+
     [preferences setHiddenPageDOMTimerThrottlingEnabled:NO];
     [preferences setHiddenPageCSSAnimationSuspensionEnabled:NO];
 

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (199080 => 199081)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2016-04-05 23:20:15 UTC (rev 199081)
@@ -315,6 +315,8 @@
 
     m_testRunner->setWebGL2Enabled(true);
 
+    m_testRunner->setFetchAPIEnabled(true);
+
     m_testRunner->setCloseRemainingWindowsWhenComplete(false);
     m_testRunner->setAcceptsEditing(true);
     m_testRunner->setTabKeyCyclesThroughElements(true);

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (199080 => 199081)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2016-04-05 23:20:15 UTC (rev 199081)
@@ -345,6 +345,13 @@
     WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
 }
 
+void TestRunner::setFetchAPIEnabled(bool enabled)
+{
+    WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitFetchAPIEnabled"));
+    auto& injectedBundle = InjectedBundle::singleton();
+    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
+}
+
 void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled)
 {
     auto& injectedBundle = InjectedBundle::singleton();

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (199080 => 199081)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2016-04-05 22:57:26 UTC (rev 199080)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2016-04-05 23:20:15 UTC (rev 199081)
@@ -102,6 +102,7 @@
     void setShadowDOMEnabled(bool);
     void setCustomElementsEnabled(bool);
     void setWebGL2Enabled(bool);
+    void setFetchAPIEnabled(bool);
     void setAllowUniversalAccessFromFileURLs(bool);
     void setAllowFileAccessFromFileURLs(bool);
     void setPluginsEnabled(bool);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to