Title: [271714] trunk/Source
Revision
271714
Author
commit-qu...@webkit.org
Date
2021-01-21 14:55:23 -0800 (Thu, 21 Jan 2021)

Log Message

Add experimental feature to use network loader
https://bugs.webkit.org/show_bug.cgi?id=220521
<rdar://problem/69394713>

Patch by Alex Christensen <achristen...@webkit.org> on 2021-01-21
Reviewed by Geoff Garen.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

Manually verified that the setting is correctly appearing in Safari and being given to CFNetwork.

* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::experimentalFeatureEnabled):
(WebKit::WebsiteDataStore::http3Enabled):
(WebKit::WebsiteDataStore::useNetworkLoader):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::parameters):
* UIProcess/WebsiteData/WebsiteDataStore.h:

Source/WTF:

* Scripts/Preferences/WebPreferencesExperimental.yaml:
* wtf/PlatformHave.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (271713 => 271714)


--- trunk/Source/WTF/ChangeLog	2021-01-21 22:54:59 UTC (rev 271713)
+++ trunk/Source/WTF/ChangeLog	2021-01-21 22:55:23 UTC (rev 271714)
@@ -1,3 +1,14 @@
+2021-01-21  Alex Christensen  <achristen...@webkit.org>
+
+        Add experimental feature to use network loader
+        https://bugs.webkit.org/show_bug.cgi?id=220521
+        <rdar://problem/69394713>
+
+        Reviewed by Geoff Garen.
+
+        * Scripts/Preferences/WebPreferencesExperimental.yaml:
+        * wtf/PlatformHave.h:
+
 2021-01-21  Aditya Keerthi  <akeer...@apple.com>
 
         Unreviewed, reverting r271691.

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml (271713 => 271714)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml	2021-01-21 22:54:59 UTC (rev 271713)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml	2021-01-21 22:55:23 UTC (rev 271714)
@@ -102,6 +102,17 @@
     WebCore:
       default: true
 
+CFNetworkNetworkLoaderEnabled:
+  type: bool
+  humanReadableName: "Experimental network loader"
+  humanReadableDescription: "Enable experimental network loader"
+  webcoreBinding: none
+  condition: HAVE(NETWORK_LOADER)
+  exposed: [ WebKit ]
+  defaultValue:
+    WebKit:
+      default: false
+
 CSSCustomPropertiesAndValuesEnabled:
   type: bool
   humanReadableName: "CSS Custom Properties and Values API"

Modified: trunk/Source/WTF/wtf/PlatformHave.h (271713 => 271714)


--- trunk/Source/WTF/wtf/PlatformHave.h	2021-01-21 22:54:59 UTC (rev 271713)
+++ trunk/Source/WTF/wtf/PlatformHave.h	2021-01-21 22:55:23 UTC (rev 271714)
@@ -738,6 +738,13 @@
 #define HAVE_RUNNINGBOARD_WEBKIT_PRIORITY_SUPPORT 1
 #endif
 
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000) \
+    || ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000) \
+    || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 80000) \
+    || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 150000)
+#define HAVE_NETWORK_LOADER 1
+#endif
+
 #if PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000
 #define HAVE_CATALYST_USER_INTERFACE_IDIOM_AND_SCALE_FACTOR 1
 #endif

Modified: trunk/Source/WebCore/PAL/ChangeLog (271713 => 271714)


--- trunk/Source/WebCore/PAL/ChangeLog	2021-01-21 22:54:59 UTC (rev 271713)
+++ trunk/Source/WebCore/PAL/ChangeLog	2021-01-21 22:55:23 UTC (rev 271714)
@@ -1,3 +1,13 @@
+2021-01-21  Alex Christensen  <achristen...@webkit.org>
+
+        Add experimental feature to use network loader
+        https://bugs.webkit.org/show_bug.cgi?id=220521
+        <rdar://problem/69394713>
+
+        Reviewed by Geoff Garen.
+
+        * pal/spi/cf/CFNetworkSPI.h:
+
 2021-01-21  Sam Weinig  <wei...@apple.com>
 
         Add experimental support for separated layers

Modified: trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h (271713 => 271714)


--- trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h	2021-01-21 22:54:59 UTC (rev 271713)
+++ trunk/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h	2021-01-21 22:55:23 UTC (rev 271714)
@@ -239,6 +239,9 @@
 #if HAVE(HSTS_STORAGE)
 @property (nullable, retain) _NSHSTSStorage *_hstsStorage;
 #endif
+#if HAVE(NETWORK_LOADER)
+@property BOOL _usesNWLoader;
+#endif
 @end
 
 @interface NSURLSessionTask ()

Modified: trunk/Source/WebKit/ChangeLog (271713 => 271714)


--- trunk/Source/WebKit/ChangeLog	2021-01-21 22:54:59 UTC (rev 271713)
+++ trunk/Source/WebKit/ChangeLog	2021-01-21 22:55:23 UTC (rev 271714)
@@ -1,3 +1,27 @@
+2021-01-21  Alex Christensen  <achristen...@webkit.org>
+
+        Add experimental feature to use network loader
+        https://bugs.webkit.org/show_bug.cgi?id=220521
+        <rdar://problem/69394713>
+
+        Reviewed by Geoff Garen.
+
+        Manually verified that the setting is correctly appearing in Safari and being given to CFNetwork.
+
+        * NetworkProcess/NetworkSessionCreationParameters.cpp:
+        (WebKit::NetworkSessionCreationParameters::encode const):
+        (WebKit::NetworkSessionCreationParameters::decode):
+        * NetworkProcess/NetworkSessionCreationParameters.h:
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
+        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+        (WebKit::experimentalFeatureEnabled):
+        (WebKit::WebsiteDataStore::http3Enabled):
+        (WebKit::WebsiteDataStore::useNetworkLoader):
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::parameters):
+        * UIProcess/WebsiteData/WebsiteDataStore.h:
+
 2021-01-21  Aditya Keerthi  <akeer...@apple.com>
 
         Unreviewed, reverting r271691.

Modified: trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp (271713 => 271714)


--- trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp	2021-01-21 22:54:59 UTC (rev 271713)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.cpp	2021-01-21 22:55:23 UTC (rev 271714)
@@ -84,6 +84,7 @@
     encoder << requiresSecureHTTPSProxyConnection;
     encoder << preventsSystemHTTPProxyAuthentication;
     encoder << appHasRequestedCrossWebsiteTrackingPermission;
+    encoder << useNetworkLoader;
     encoder << resourceLoadStatisticsParameters;
 }
 
@@ -276,6 +277,11 @@
     if (!appHasRequestedCrossWebsiteTrackingPermission)
         return WTF::nullopt;
 
+    Optional<bool> useNetworkLoader;
+    decoder >> useNetworkLoader;
+    if (!useNetworkLoader)
+        return WTF::nullopt;
+
     Optional<ResourceLoadStatisticsParameters> resourceLoadStatisticsParameters;
     decoder >> resourceLoadStatisticsParameters;
     if (!resourceLoadStatisticsParameters)
@@ -326,6 +332,7 @@
         , WTFMove(*requiresSecureHTTPSProxyConnection)
         , WTFMove(*preventsSystemHTTPProxyAuthentication)
         , WTFMove(*appHasRequestedCrossWebsiteTrackingPermission)
+        , WTFMove(*useNetworkLoader)
         , WTFMove(*resourceLoadStatisticsParameters)
     }};
 }

Modified: trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h (271713 => 271714)


--- trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h	2021-01-21 22:54:59 UTC (rev 271713)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSessionCreationParameters.h	2021-01-21 22:55:23 UTC (rev 271714)
@@ -98,6 +98,7 @@
     bool requiresSecureHTTPSProxyConnection { false };
     bool preventsSystemHTTPProxyAuthentication { false };
     bool appHasRequestedCrossWebsiteTrackingPermission { false };
+    bool useNetworkLoader { false };
 
     ResourceLoadStatisticsParameters resourceLoadStatisticsParameters;
 };

Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (271713 => 271714)


--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2021-01-21 22:54:59 UTC (rev 271713)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2021-01-21 22:55:23 UTC (rev 271714)
@@ -1234,6 +1234,10 @@
     }
 #endif
 
+#if HAVE(NETWORK_LOADER)
+    configuration._usesNWLoader = parameters.useNetworkLoader;
+#endif
+
 #if HAVE(APP_SSO) || PLATFORM(MACCATALYST)
     configuration._preventsAppSSO = true;
 #endif

Modified: trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (271713 => 271714)


--- trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2021-01-21 22:54:59 UTC (rev 271713)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2021-01-21 22:55:23 UTC (rev 271714)
@@ -197,20 +197,36 @@
         SandboxExtension::createHandleForReadWriteDirectory(FileSystem::directoryName(cookieFile), parameters.cookieStoragePathExtensionHandle);
 }
 
-bool WebsiteDataStore::http3Enabled()
+#if HAVE(CFNETWORK_ALTERNATIVE_SERVICE) || HAVE(NETWORK_LOADER)
+static bool experimentalFeatureEnabled(const String& key)
 {
-#if HAVE(CFNETWORK_ALTERNATIVE_SERVICE)
 #if PLATFORM(MAC)
     NSString *format = @"Experimental%@";
 #else
     NSString *format = @"WebKitExperimental%@";
 #endif
-    return [[NSUserDefaults standardUserDefaults] boolForKey:[NSString stringWithFormat:format, (NSString *)WebPreferencesKey::http3EnabledKey()]];
+    return [[NSUserDefaults standardUserDefaults] boolForKey:[NSString stringWithFormat:format, static_cast<NSString *>(key)]];
+}
+#endif
+
+bool WebsiteDataStore::http3Enabled()
+{
+#if HAVE(CFNETWORK_ALTERNATIVE_SERVICE)
+    return experimentalFeatureEnabled(WebPreferencesKey::http3EnabledKey());
 #else
     return false;
 #endif
 }
 
+bool WebsiteDataStore::useNetworkLoader()
+{
+#if HAVE(NETWORK_LOADER)
+    return experimentalFeatureEnabled(WebPreferencesKey::cFNetworkNetworkLoaderEnabledKey());
+#else
+    return false;
+#endif
+}
+
 void WebsiteDataStore::platformInitialize()
 {
     ASSERT(!dataStores().contains(this));

Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp (271713 => 271714)


--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp	2021-01-21 22:54:59 UTC (rev 271713)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp	2021-01-21 22:55:23 UTC (rev 271714)
@@ -2218,6 +2218,7 @@
     platformSetNetworkParameters(parameters);
 #if PLATFORM(COCOA)
     parameters.networkSessionParameters.appHasRequestedCrossWebsiteTrackingPermission = hasRequestedCrossWebsiteTrackingPermission();
+    parameters.networkSessionParameters.useNetworkLoader = useNetworkLoader();
 #endif
     
     return parameters;

Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h (271713 => 271714)


--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h	2021-01-21 22:54:59 UTC (rev 271713)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h	2021-01-21 22:55:23 UTC (rev 271714)
@@ -268,6 +268,8 @@
 #if PLATFORM(COCOA)
     void sendNetworkProcessXPCEndpointToWebProcess(WebProcessProxy&);
     void sendNetworkProcessXPCEndpointToAllWebProcesses();
+    
+    static bool useNetworkLoader();
 #endif
 
 #if USE(CURL)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to