Commit edfd32d9 authored by Robert Sesek's avatar Robert Sesek Committed by Commit Bot

mac: Disable CoreServices _CSCheckFix.

Under the sandbox, _CSCheckFix() can result in a lot of unnecessary
disk I/O.

Bug: 1110292
Change-Id: I8507156d75fa046b3d5be1d5b0121abce0967af1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2401334
Commit-Queue: Greg Kerr <kerrnel@chromium.org>
Reviewed-by: default avatarGreg Kerr <kerrnel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805864}
parent 79f6cff0
...@@ -29,6 +29,7 @@ void DisableSystemServices() { ...@@ -29,6 +29,7 @@ void DisableSystemServices() {
CHECK_EQ(result, kCGErrorSuccess); CHECK_EQ(result, kCGErrorSuccess);
sandbox::DisableLaunchServices(); sandbox::DisableLaunchServices();
sandbox::DisableCoreServicesCheckFix();
} }
} // namespace } // namespace
......
...@@ -14,6 +14,10 @@ OSStatus SetApplicationIsDaemon(Boolean isDaemon); ...@@ -14,6 +14,10 @@ OSStatus SetApplicationIsDaemon(Boolean isDaemon);
void _LSSetApplicationLaunchServicesServerConnectionStatus( void _LSSetApplicationLaunchServicesServerConnectionStatus(
uint64_t flags, uint64_t flags,
bool (^connection_allowed)(CFDictionaryRef options)); bool (^connection_allowed)(CFDictionaryRef options));
// See
// https://github.com/WebKit/webkit/commit/8da694b0b3febcc262653d01a45e946ce91845ed.
void _CSCheckFixDisable() API_AVAILABLE(macosx(10.15));
} // extern "C" } // extern "C"
namespace sandbox { namespace sandbox {
...@@ -34,4 +38,10 @@ void DisableLaunchServices() { ...@@ -34,4 +38,10 @@ void DisableLaunchServices() {
}); });
} }
void DisableCoreServicesCheckFix() {
if (__builtin_available(macOS 10.15, *)) {
_CSCheckFixDisable();
}
}
} // namespace sandbox } // namespace sandbox
...@@ -18,6 +18,14 @@ namespace sandbox { ...@@ -18,6 +18,14 @@ namespace sandbox {
// it instructs system frameworks to not attempt to connect. // it instructs system frameworks to not attempt to connect.
SEATBELT_EXPORT void DisableLaunchServices(); SEATBELT_EXPORT void DisableLaunchServices();
// Disables the CoresServices CheckFix list. CoreServices maintains a
// compatability database of bugs and workarounds by bundle ID. The system
// depends on check-in in to LaunchServices to obtain a shared memory mapping of
// the database, but if that fails (e.g. under the sandbox), it scans entries
// in /System/Library for individual bug fix lists. This call disables the
// CheckFix list.
SEATBELT_EXPORT void DisableCoreServicesCheckFix();
} // namespace sandbox } // namespace sandbox
#endif // SANDBOX_MAC_SYSTEM_SERVICES_H_ #endif // SANDBOX_MAC_SYSTEM_SERVICES_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment