Make IsNSURLSessionWebSocketEnabled an experimental flag
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Sep 2019 09:04:35 +0000 (09:04 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Sep 2019 09:04:35 +0000 (09:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=202135
<rdar://problem/55694721>

Reviewed by Geoff Garen.

Source/WebKit:

Add C API to switch off this feature in WTR.

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetIsNSURLSessionWebSocketEnabled):
(WKPreferencesGetIsNSURLSessionWebSocketEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
Set preference to false by default.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250417 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/UIProcess/API/C/WKPreferences.cpp
Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h
Tools/ChangeLog
Tools/WebKitTestRunner/TestController.cpp

index 18eb630..87d33b8 100644 (file)
@@ -1,3 +1,19 @@
+2019-09-27  Youenn Fablet  <youenn@apple.com>
+
+        Make IsNSURLSessionWebSocketEnabled an experimental flag
+        https://bugs.webkit.org/show_bug.cgi?id=202135
+        <rdar://problem/55694721>
+
+        Reviewed by Geoff Garen.
+
+        Add C API to switch off this feature in WTR.
+
+        * Shared/WebPreferences.yaml:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetIsNSURLSessionWebSocketEnabled):
+        (WKPreferencesGetIsNSURLSessionWebSocketEnabled):
+        * UIProcess/API/C/WKPreferencesRefPrivate.h:
+
 2019-09-27  Jiewen Tan  <jiewen_tan@apple.com>
 
         SubFrameSOAuthorizationSession should ensure messages are posted in the right order to the parent frame
index de45a62..366a0ed 100644 (file)
@@ -1722,7 +1722,7 @@ IsNSURLSessionWebSocketEnabled:
   defaultValue: false
   humanReadableName: "NSURLSession WebSocket"
   humanReadableDescription: "Use NSURLSession WebSocket API"
-  category: internal
+  category: experimental
   webcoreBinding: RuntimeEnabledFeatures
   condition: HAVE(NSURLSESSION_WEBSOCKET)
 
index 5e7f523..b34f4bc 100644 (file)
@@ -1809,6 +1809,16 @@ bool WKPreferencesGetResourceTimingEnabled(WKPreferencesRef preferencesRef)
     return toImpl(preferencesRef)->resourceTimingEnabled();
 }
 
+void WKPreferencesSetIsNSURLSessionWebSocketEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+    toImpl(preferencesRef)->setIsNSURLSessionWebSocketEnabled(flag);
+}
+
+bool WKPreferencesGetIsNSURLSessionWebSocketEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->isNSURLSessionWebSocketEnabled();
+}
+
 void WKPreferencesSetFetchAPIKeepAliveEnabled(WKPreferencesRef preferencesRef, bool flag)
 {
     toImpl(preferencesRef)->setFetchAPIKeepAliveEnabled(flag);
index 9b07de8..05a89b8 100644 (file)
@@ -503,6 +503,10 @@ WK_EXPORT bool WKPreferencesGetResourceTimingEnabled(WKPreferencesRef);
 WK_EXPORT void WKPreferencesSetFetchAPIKeepAliveEnabled(WKPreferencesRef, bool flag);
 WK_EXPORT bool WKPreferencesGetFetchAPIKeepAliveEnabled(WKPreferencesRef);
 
+// Defaults to false
+WK_EXPORT void WKPreferencesSetIsNSURLSessionWebSocketEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetIsNSURLSessionWebSocketEnabled(WKPreferencesRef);
+
 // Defaults to true.
 WK_EXPORT void WKPreferencesSetLargeImageAsyncDecodingEnabled(WKPreferencesRef preferencesRef, bool flag);
 WK_EXPORT bool WKPreferencesGetLargeImageAsyncDecodingEnabled(WKPreferencesRef preferencesRef);
index 1aed91a..cf790a5 100644 (file)
@@ -1,3 +1,15 @@
+2019-09-27  Youenn Fablet  <youenn@apple.com>
+
+        Make IsNSURLSessionWebSocketEnabled an experimental flag
+        https://bugs.webkit.org/show_bug.cgi?id=202135
+        <rdar://problem/55694721>
+
+        Reviewed by Geoff Garen.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::resetPreferencesToConsistentValues):
+        Set preference to false by default.
+
 2019-09-27  Jiewen Tan  <jiewen_tan@apple.com>
 
         SubFrameSOAuthorizationSession should ensure messages are posted in the right order to the parent frame
index fc6712e..2633def 100644 (file)
@@ -874,6 +874,8 @@ void TestController::resetPreferencesToConsistentValues(const TestOptions& optio
     // FIXME: We should be testing the default.
     WKPreferencesSetStorageBlockingPolicy(preferences, kWKAllowAllStorage);
 
+    WKPreferencesSetIsNSURLSessionWebSocketEnabled(preferences, false);
+
     WKPreferencesSetFetchAPIKeepAliveEnabled(preferences, true);
     WKPreferencesSetResourceTimingEnabled(preferences, true);
     WKPreferencesSetUserTimingEnabled(preferences, true);