Diff
Modified: trunk/Source/WebKit/ChangeLog (283182 => 283183)
--- trunk/Source/WebKit/ChangeLog 2021-09-28 18:06:16 UTC (rev 283182)
+++ trunk/Source/WebKit/ChangeLog 2021-09-28 18:06:40 UTC (rev 283183)
@@ -1,3 +1,33 @@
+2021-09-28 Per Arne Vollan <[email protected]>
+
+ Enable CFPrefs direct mode in all WebKit processes
+ https://bugs.webkit.org/show_bug.cgi?id=230771
+ <rdar://problem/83510055>
+
+ Reviewed by Brent Fulgham.
+
+ We currently enable CFPrefs direct mode in the WebContent and GPU Process, and we should enable it in all WebKit processes.
+
+ * NetworkProcess/NetworkProcess.h:
+ * NetworkProcess/NetworkProcess.messages.in:
+ * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
+ (WebKit::NetworkProcess::notifyPreferencesChanged):
+ * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
+ * Resources/SandboxProfiles/ios/com.apple.WebKit.WebAuthn.sb:
+ * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
+ (WebKit::XPCServiceMain):
+ (WebKit::shouldEnableCFPrefsDirectMode): Deleted.
+ * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+ (WebKit::WebProcessPool::notifyPreferencesChanged):
+ * UIProcess/WebAuthentication/WebAuthnProcessProxy.cpp:
+ (WebKit::WebAuthnProcessProxy::singletonIfCreated):
+ * UIProcess/WebAuthentication/WebAuthnProcessProxy.h:
+ * WebAuthnProcess/WebAuthnProcess.cpp:
+ (WebKit::WebAuthnProcess::notifyPreferencesChanged):
+ * WebAuthnProcess/WebAuthnProcess.h:
+ * WebAuthnProcess/WebAuthnProcess.messages.in:
+ * WebAuthnProcess/mac/com.apple.WebKit.WebAuthnProcess.sb.in:
+
2021-09-28 Per Arne <[email protected]>
[GPUP] Add sandbox telemetry
Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.h (283182 => 283183)
--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.h 2021-09-28 18:06:16 UTC (rev 283182)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.h 2021-09-28 18:06:40 UTC (rev 283183)
@@ -390,6 +390,10 @@
RTCDataChannelRemoteManagerProxy& rtcDataChannelProxy();
#endif
+#if ENABLE(CFPREFS_DIRECT_MODE)
+ void notifyPreferencesChanged(const String& domain, const String& key, const std::optional<String>& encodedValue);
+#endif
+
bool ftpEnabled() const { return m_ftpEnabled; }
private:
Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in (283182 => 283183)
--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in 2021-09-28 18:06:16 UTC (rev 283182)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in 2021-09-28 18:06:40 UTC (rev 283183)
@@ -199,4 +199,8 @@
AddWebPageNetworkParameters(PAL::SessionID sessionID, WebKit::WebPageProxyIdentifier pageID, WebKit::WebPageNetworkParameters parameters)
RemoveWebPageNetworkParameters(PAL::SessionID sessionID, WebKit::WebPageProxyIdentifier pageID)
CountNonDefaultSessionSets(PAL::SessionID sessionID) -> (size_t count) Async
+
+#if ENABLE(CFPREFS_DIRECT_MODE)
+ NotifyPreferencesChanged(String domain, String key, std::optional<String> encodedValue)
+#endif
}
Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm (283182 => 283183)
--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm 2021-09-28 18:06:16 UTC (rev 283182)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm 2021-09-28 18:06:40 UTC (rev 283183)
@@ -249,4 +249,11 @@
completionHandler();
}
+#if ENABLE(CFPREFS_DIRECT_MODE)
+void NetworkProcess::notifyPreferencesChanged(const String& domain, const String& key, const std::optional<String>& encodedValue)
+{
+ preferenceDidUpdate(domain, key, encodedValue);
+}
+#endif
+
} // namespace WebKit
Modified: trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb (283182 => 283183)
--- trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb 2021-09-28 18:06:16 UTC (rev 283182)
+++ trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb 2021-09-28 18:06:40 UTC (rev 283183)
@@ -401,19 +401,7 @@
(global-name "com.apple.logd")
(global-name "com.apple.logd.events"))
-(allow mach-lookup (with report) (with telemetry)
- (global-name "com.apple.cfprefsd.agent")
- (local-name "com.apple.cfprefsd.agent")
-)
-
(allow mach-lookup
- (global-name "com.apple.cfprefsd.daemon") ;; Needed by _CFPreferencesGetAppBooleanValueWithContainer and others.
-)
-
-(allow ipc-posix-shm-read*
- (ipc-posix-name-prefix "apple.cfprefs."))
-
-(allow mach-lookup
(global-name "com.apple.runningboard")) ;; Needed by process assertion code (ProcessTaskStateObserver).
(allow-multi-instance-xpc-services)
Modified: trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebAuthn.sb (283182 => 283183)
--- trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebAuthn.sb 2021-09-28 18:06:16 UTC (rev 283182)
+++ trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebAuthn.sb 2021-09-28 18:06:40 UTC (rev 283183)
@@ -230,7 +230,6 @@
(allow mach-lookup
(global-name
- "com.apple.cfprefsd.daemon"
"com.apple.logd"
"com.apple.logd.events"
"com.apple.system.notification_center"
Modified: trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm (283182 => 283183)
--- trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm 2021-09-28 18:06:16 UTC (rev 283182)
+++ trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm 2021-09-28 18:06:40 UTC (rev 283183)
@@ -169,35 +169,15 @@
#endif // PLATFORM(MAC)
-#if ENABLE(CFPREFS_DIRECT_MODE)
-static bool shouldEnableCFPrefsDirectMode(int argc, const char** argv)
+int XPCServiceMain(int, const char**)
{
- if (argc <= 0 || !argv[0])
- return false;
- if (strstr(argv[0], "com.apple.WebKit.WebContent"))
- return true;
- if (strstr(argv[0], "com.apple.WebKit.GPU"))
- return true;
- return false;
-}
-#endif
-
-int XPCServiceMain(int argc, const char** argv)
-{
- ASSERT(argc >= 1);
- ASSERT(argv[0]);
#if ENABLE(CFPREFS_DIRECT_MODE)
- if (shouldEnableCFPrefsDirectMode(argc, argv)) {
- // Enable CFPrefs direct mode to avoid unsuccessfully attempting to connect to the daemon and getting blocked by the sandbox.
- _CFPrefsSetDirectModeEnabled(YES);
+ // Enable CFPrefs direct mode to avoid unsuccessfully attempting to connect to the daemon and getting blocked by the sandbox.
+ _CFPrefsSetDirectModeEnabled(YES);
#if HAVE(CF_PREFS_SET_READ_ONLY)
- _CFPrefsSetReadOnly(YES);
+ _CFPrefsSetReadOnly(YES);
#endif
- }
-#else
- UNUSED_PARAM(argc);
- UNUSED_PARAM(argv);
-#endif
+#endif // ENABLE(CFPREFS_DIRECT_MODE)
WTF::initializeMainThread();
Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (283182 => 283183)
--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm 2021-09-28 18:06:16 UTC (rev 283182)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm 2021-09-28 18:06:40 UTC (rev 283183)
@@ -43,6 +43,8 @@
#import "WKBrowsingContextControllerInternal.h"
#import "WKMouseDeviceObserver.h"
#import "WKStylusDeviceObserver.h"
+#import "WebAuthnProcessMessages.h"
+#import "WebAuthnProcessProxy.h"
#import "WebBackForwardCache.h"
#import "WebMemoryPressureHandler.h"
#import "WebPageGroup.h"
@@ -1059,8 +1061,18 @@
if (auto* gpuProcess = GPUProcessProxy::singletonIfCreated())
gpuProcess->send(Messages::GPUProcess::NotifyPreferencesChanged(domain, key, encodedValue), 0);
#endif
+
+ WebsiteDataStore::forEachWebsiteDataStore([domain, key, encodedValue] (WebsiteDataStore& dataStore) {
+ if (auto* networkProcess = dataStore.networkProcessIfExists())
+ networkProcess->send(Messages::NetworkProcess::NotifyPreferencesChanged(domain, key, encodedValue), 0);
+ });
+
+#if ENABLE(WEB_AUTHN)
+ if (auto webAuthnProcess = WebAuthnProcessProxy::singletonIfCreated())
+ webAuthnProcess->send(Messages::WebAuthnProcess::NotifyPreferencesChanged(domain, key, encodedValue), 0);
+#endif
}
-#endif
+#endif // ENABLE(CFPREFS_DIRECT_MODE)
#if PLATFORM(MAC)
static void webProcessPoolHighDynamicRangeDidChangeCallback(CMNotificationCenterRef, const void*, CFStringRef notificationName, const void*, CFTypeRef)
Modified: trunk/Source/WebKit/UIProcess/WebAuthentication/WebAuthnProcessProxy.cpp (283182 => 283183)
--- trunk/Source/WebKit/UIProcess/WebAuthentication/WebAuthnProcessProxy.cpp 2021-09-28 18:06:16 UTC (rev 283182)
+++ trunk/Source/WebKit/UIProcess/WebAuthentication/WebAuthnProcessProxy.cpp 2021-09-28 18:06:40 UTC (rev 283183)
@@ -77,6 +77,11 @@
return *sharedProcess();
}
+WebAuthnProcessProxy* WebAuthnProcessProxy::singletonIfCreated()
+{
+ return sharedProcess().get();
+}
+
WebAuthnProcessProxy::WebAuthnProcessProxy()
: AuxiliaryProcessProxy()
, m_throttler(*this, false)
Modified: trunk/Source/WebKit/UIProcess/WebAuthentication/WebAuthnProcessProxy.h (283182 => 283183)
--- trunk/Source/WebKit/UIProcess/WebAuthentication/WebAuthnProcessProxy.h 2021-09-28 18:06:16 UTC (rev 283182)
+++ trunk/Source/WebKit/UIProcess/WebAuthentication/WebAuthnProcessProxy.h 2021-09-28 18:06:40 UTC (rev 283183)
@@ -47,6 +47,7 @@
friend LazyNeverDestroyed<WebAuthnProcessProxy>;
public:
static WebAuthnProcessProxy& singleton();
+ static WebAuthnProcessProxy* singletonIfCreated();
void getWebAuthnProcessConnection(WebProcessProxy&, Messages::WebProcessProxy::GetWebAuthnProcessConnectionDelayedReply&&);
Modified: trunk/Source/WebKit/WebAuthnProcess/WebAuthnProcess.cpp (283182 => 283183)
--- trunk/Source/WebKit/WebAuthnProcess/WebAuthnProcess.cpp 2021-09-28 18:06:16 UTC (rev 283182)
+++ trunk/Source/WebKit/WebAuthnProcess/WebAuthnProcess.cpp 2021-09-28 18:06:40 UTC (rev 283183)
@@ -134,6 +134,13 @@
}
#endif
+#if ENABLE(CFPREFS_DIRECT_MODE)
+void WebAuthnProcess::notifyPreferencesChanged(const String& domain, const String& key, const std::optional<String>& encodedValue)
+{
+ preferenceDidUpdate(domain, key, encodedValue);
+}
+#endif
+
} // namespace WebKit
#endif // ENABLE(WEB_AUTHN)
Modified: trunk/Source/WebKit/WebAuthnProcess/WebAuthnProcess.h (283182 => 283183)
--- trunk/Source/WebKit/WebAuthnProcess/WebAuthnProcess.h 2021-09-28 18:06:16 UTC (rev 283182)
+++ trunk/Source/WebKit/WebAuthnProcess/WebAuthnProcess.h 2021-09-28 18:06:40 UTC (rev 283183)
@@ -64,6 +64,10 @@
AuthenticatorManager& authenticatorManager() { return m_authenticatorManager.get(); }
void setMockWebAuthenticationConfiguration(WebCore::MockWebAuthenticationConfiguration&&);
+#if ENABLE(CFPREFS_DIRECT_MODE)
+ void notifyPreferencesChanged(const String& domain, const String& key, const std::optional<String>& encodedValue);
+#endif
+
private:
void platformInitializeWebAuthnProcess(const WebAuthnProcessCreationParameters&);
void lowMemoryHandler(Critical);
Modified: trunk/Source/WebKit/WebAuthnProcess/WebAuthnProcess.messages.in (283182 => 283183)
--- trunk/Source/WebKit/WebAuthnProcess/WebAuthnProcess.messages.in 2021-09-28 18:06:16 UTC (rev 283182)
+++ trunk/Source/WebKit/WebAuthnProcess/WebAuthnProcess.messages.in 2021-09-28 18:06:40 UTC (rev 283183)
@@ -28,6 +28,10 @@
# Creates a connection for communication with a WebProcess
CreateWebAuthnConnectionToWebProcess(WebCore::ProcessIdentifier processIdentifier) -> (std::optional<IPC::Attachment> connectionIdentifier) Async
+
+#if ENABLE(CFPREFS_DIRECT_MODE)
+ NotifyPreferencesChanged(String domain, String key, std::optional<String> encodedValue)
+#endif
}
#endif // ENABLE(WEB_AUTHN)
Modified: trunk/Source/WebKit/WebAuthnProcess/mac/com.apple.WebKit.WebAuthnProcess.sb.in (283182 => 283183)
--- trunk/Source/WebKit/WebAuthnProcess/mac/com.apple.WebKit.WebAuthnProcess.sb.in 2021-09-28 18:06:16 UTC (rev 283182)
+++ trunk/Source/WebKit/WebAuthnProcess/mac/com.apple.WebKit.WebAuthnProcess.sb.in 2021-09-28 18:06:40 UTC (rev 283183)
@@ -320,7 +320,9 @@
#endif
(global-name "com.apple.audio.AudioComponentRegistrar")
(global-name "com.apple.awdd")
+#if !ENABLE(CFPREFS_DIRECT_MODE)
(global-name "com.apple.cfprefsd.agent")
+#endif
(global-name "com.apple.cookied")
(global-name "com.apple.diagnosticd")
(global-name "com.apple.iconservices")
@@ -339,7 +341,9 @@
(global-name "com.apple.assertiond.processassertionconnection")
(global-name "com.apple.audio.SystemSoundServer-OSX")
(global-name "com.apple.audio.audiohald")
+#if !ENABLE(CFPREFS_DIRECT_MODE)
(global-name "com.apple.cfprefsd.daemon")
+#endif
(global-name "com.apple.coreservices.launchservicesd")
(global-name "com.apple.fonts")
(global-name "com.apple.mediaremoted.xpc")