Title: [276862] trunk
Revision
276862
Author
bfulg...@apple.com
Date
2021-04-30 16:33:07 -0700 (Fri, 30 Apr 2021)

Log Message

[Cocoa] Always extend access to local process HTTP/3 cache directory
https://bugs.webkit.org/show_bug.cgi?id=225171
<rdar://problem/76287224>

Reviewed by Alex Christensen.

Source/WebKit:

Always pass the cache directory for HTTP/3 use, regardless of the current setting of
the flag. We still pass the flag so that users can turn the feature on and off, so there
is no change in expected behavior. However, certain OS settings can override the user
setting in the browser, so it's helpful to have the path permission for cases where a user
toggles state outside of the browser.

* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::platformSetNetworkParameters):

Tools:

Since we always create the directory (even if HTTP/3 is turned off) we should expect that it is
created after loading a page.

* TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
(TEST):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (276861 => 276862)


--- trunk/Source/WebKit/ChangeLog	2021-04-30 23:04:06 UTC (rev 276861)
+++ trunk/Source/WebKit/ChangeLog	2021-04-30 23:33:07 UTC (rev 276862)
@@ -1,3 +1,20 @@
+2021-04-30  Brent Fulgham  <bfulg...@apple.com>
+
+        [Cocoa] Always extend access to local process HTTP/3 cache directory
+        https://bugs.webkit.org/show_bug.cgi?id=225171
+        <rdar://problem/76287224>
+
+        Reviewed by Alex Christensen.
+
+        Always pass the cache directory for HTTP/3 use, regardless of the current setting of
+        the flag. We still pass the flag so that users can turn the feature on and off, so there
+        is no change in expected behavior. However, certain OS settings can override the user
+        setting in the browser, so it's helpful to have the path permission for cases where a user
+        toggles state outside of the browser.
+
+        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+        (WebKit::WebsiteDataStore::platformSetNetworkParameters):
+
 2021-04-30  Peng Liu  <peng.l...@apple.com>
 
         ASSERTION FAILED: Unhandled message RemoteRemoteCommandListenerProxy_UpdateSupportedCommands

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


--- trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2021-04-30 23:04:06 UTC (rev 276861)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm	2021-04-30 23:33:07 UTC (rev 276862)
@@ -153,13 +153,10 @@
 
 #if HAVE(CFNETWORK_ALTERNATIVE_SERVICE)
     bool http3Enabled = WebsiteDataStore::http3Enabled();
-    String alternativeServiceStorageDirectory;
     SandboxExtension::Handle alternativeServiceStorageDirectoryExtensionHandle;
-    if (http3Enabled) {
-        alternativeServiceStorageDirectory = resolvedAlternativeServicesStorageDirectory();
-        if (!alternativeServiceStorageDirectory.isEmpty())
-            SandboxExtension::createHandleForReadWriteDirectory(alternativeServiceStorageDirectory, alternativeServiceStorageDirectoryExtensionHandle);
-    }
+    String alternativeServiceStorageDirectory = resolvedAlternativeServicesStorageDirectory();
+    if (!alternativeServiceStorageDirectory.isEmpty())
+        SandboxExtension::createHandleForReadWriteDirectory(alternativeServiceStorageDirectory, alternativeServiceStorageDirectoryExtensionHandle);
 #endif
 
     bool shouldIncludeLocalhostInResourceLoadStatistics = isSafari;

Modified: trunk/Tools/ChangeLog (276861 => 276862)


--- trunk/Tools/ChangeLog	2021-04-30 23:04:06 UTC (rev 276861)
+++ trunk/Tools/ChangeLog	2021-04-30 23:33:07 UTC (rev 276862)
@@ -1,3 +1,17 @@
+2021-04-30  Brent Fulgham  <bfulg...@apple.com>
+
+        [Cocoa] Always extend access to local process HTTP/3 cache directory
+        https://bugs.webkit.org/show_bug.cgi?id=225171
+        <rdar://problem/76287224>
+
+        Reviewed by Alex Christensen.
+
+        Since we always create the directory (even if HTTP/3 is turned off) we should expect that it is
+        created after loading a page.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
+        (TEST):
+
 2021-04-30  Kyle Piddington  <kpidding...@apple.com>
 
         Add kpiddington to commiters list

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm (276861 => 276862)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm	2021-04-30 23:04:06 UTC (rev 276861)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm	2021-04-30 23:33:07 UTC (rev 276862)
@@ -395,13 +395,14 @@
 {
     NSURL *defaultDirectory = [NSURL fileURLWithPath:[@"~/Library/Caches/com.apple.WebKit.TestWebKitAPI/WebKit/AlternativeServices" stringByExpandingTildeInPath] isDirectory:YES];
     [[NSFileManager defaultManager] removeItemAtURL:defaultDirectory error:nil];
-    
+    EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath:defaultDirectory.path]);
+
     auto webView1 = adoptNS([[TestWKWebView alloc] init]);
     [webView1 synchronouslyLoadHTMLString:@"start auxiliary processes" baseURL:nil];
 
-    EXPECT_FALSE([[NSFileManager defaultManager] fileExistsAtPath:defaultDirectory.path]);
-    
 #if HAVE(CFNETWORK_ALTERNATIVE_SERVICE)
+    // We always create the path, even if HTTP/3 is turned off.
+    EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:defaultDirectory.path]);
 
 #if PLATFORM(MAC)
     NSString *key = @"ExperimentalHTTP3Enabled";
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to