Changeset 265139 in webkit
- Timestamp:
- Jul 31, 2020 7:03:35 AM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/PAL/ChangeLog
r265115 r265139 1 2020-07-31 Per Arne Vollan <pvollan@apple.com> 2 3 [iOS] Issue a temporary extension to the MobileGestalt daemon when the MobileGestalt cache is invalid 4 https://bugs.webkit.org/show_bug.cgi?id=214965 5 6 Reviewed by Geoffrey Garen. 7 8 Declare MobileGestalt queestion identifier. 9 10 * pal/spi/ios/MobileGestaltSPI.h: 11 1 12 2020-07-30 Jer Noble <jer.noble@apple.com> 2 13 -
trunk/Source/WebCore/PAL/pal/spi/ios/MobileGestaltSPI.h
r261584 r265139 46 46 static const CFStringRef kMGQDeviceClassNumber = CFSTR("DeviceClassNumber"); 47 47 static const CFStringRef kMGQHasExtendedColorDisplay = CFSTR("HasExtendedColorDisplay"); 48 static const CFStringRef kMGQDeviceCornerRadius = CFSTR("DeviceCornerRadius"); 48 49 49 50 typedef enum { -
trunk/Source/WebKit/ChangeLog
r265138 r265139 1 2020-07-31 Per Arne Vollan <pvollan@apple.com> 2 3 [iOS] Issue a temporary extension to the MobileGestalt daemon when the MobileGestalt cache is invalid 4 https://bugs.webkit.org/show_bug.cgi?id=214965 5 6 Reviewed by Geoffrey Garen. 7 8 When the MobileGestalt cache is invalid, some MG queries will fail in the WebContent process, since it has no access to the daemon. 9 This can be fixed by issuing a temporary extension to the daemon, and having the WebContent process query all relevant MG values 10 while holding the extension. This will bring the values into the in-memory cache, which will be valid after the extension to the 11 daemon has been revoked. We will still attempt to rebuild the MG cache if invalid, but since we now have a workaround for when the 12 cache is invalid, we can do this on a secondary thread to avoid blocking the main thread. We also only attempt to rebuild once now, 13 instead of every time a WebContent process is started. Additionally, add IOKit property read access to "platform-name", since that 14 is needed by a MG query. 15 16 No new tests, since testing this depends on having an invalid cache, which is rare, and non-trivial to enforce in the test 17 environment. 18 19 * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: 20 * Shared/WebProcessCreationParameters.cpp: 21 (WebKit::WebProcessCreationParameters::encode const): 22 (WebKit::WebProcessCreationParameters::decode): 23 * Shared/WebProcessCreationParameters.h: 24 * UIProcess/Cocoa/WebProcessPoolCocoa.mm: 25 (WebKit::WebProcessPool::platformInitialize): 26 (WebKit::WebProcessPool::platformInitializeWebProcess): 27 * WebProcess/cocoa/WebProcessCocoa.mm: 28 (WebKit::WebProcess::platformInitializeWebProcess): 29 1 30 2020-07-31 Carlos Garcia Campos <cgarcia@igalia.com> 2 31 -
trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb
r264681 r265139 888 888 (iokit-property "udid-version") ;; <rdar://problem/52903475> 889 889 (iokit-property "ui-pip") ;; <rdar://problem/48867037> 890 (iokit-property "platform-name") 890 891 ) 891 892 … … 947 948 ) 948 949 950 (deny mach-lookup (with telemetry-backtrace) 951 (global-name "com.apple.mobilegestalt.xpc") 952 ) 953 949 954 (allow mach-lookup 950 955 (require-all … … 958 963 "com.apple.lsd.mapdb" 959 964 "com.apple.mobileassetd.v2" 965 "com.apple.mobilegestalt.xpc" 960 966 "com.apple.nehelper" 961 967 "com.apple.nesessionmanager.content-filter" -
trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp
r265081 r265139 161 161 162 162 encoder << containerManagerExtensionHandle; 163 163 encoder << mobileGestaltExtensionHandle; 164 164 165 #if PLATFORM(IOS_FAMILY) 165 166 encoder << diagnosticsExtensionHandles; … … 429 430 parameters.containerManagerExtensionHandle = WTFMove(*containerManagerExtensionHandle); 430 431 432 Optional<Optional<SandboxExtension::Handle>> mobileGestaltExtensionHandle; 433 decoder >> mobileGestaltExtensionHandle; 434 if (!mobileGestaltExtensionHandle) 435 return false; 436 parameters.mobileGestaltExtensionHandle = WTFMove(*mobileGestaltExtensionHandle); 437 431 438 #if PLATFORM(IOS_FAMILY) 432 439 Optional<SandboxExtension::HandleArray> diagnosticsExtensionHandles; -
trunk/Source/WebKit/Shared/WebProcessCreationParameters.h
r265081 r265139 205 205 206 206 Optional<SandboxExtension::Handle> containerManagerExtensionHandle; 207 Optional<SandboxExtension::Handle> mobileGestaltExtensionHandle; 207 208 208 209 #if PLATFORM(IOS_FAMILY) -
trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
r265081 r265139 166 166 167 167 setLegacyCustomProtocolManagerClient(makeUnique<LegacyCustomProtocolManagerClient>()); 168 169 #if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST) 170 if (!_MGCacheValid()) { 171 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 172 [adoptNS([[objc_getClass("MobileGestaltHelperProxy") alloc] init]) proxyRebuildCache]; 173 }); 174 } 175 #endif 168 176 } 169 177 … … 448 456 449 457 #if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST) 450 if (!_MGCacheValid()) 451 [adoptNS([[objc_getClass("MobileGestaltHelperProxy") alloc] init]) proxyRebuildCache]; 458 if (!_MGCacheValid()) { 459 SandboxExtension::Handle handle; 460 SandboxExtension::createHandleForMachLookup("com.apple.mobilegestalt.xpc"_s, WTF::nullopt, handle); 461 parameters.mobileGestaltExtensionHandle = WTFMove(handle); 462 } 452 463 #endif 453 464 -
trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
r265087 r265139 110 110 #import <UIKit/UIAccessibility.h> 111 111 #import <pal/spi/ios/GraphicsServicesSPI.h> 112 #import <pal/spi/ios/MobileGestaltSPI.h> 112 113 #endif 113 114 … … 203 204 void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters& parameters) 204 205 { 206 if (parameters.mobileGestaltExtensionHandle) { 207 if (auto extension = SandboxExtension::create(WTFMove(*parameters.mobileGestaltExtensionHandle))) { 208 bool ok = extension->consume(); 209 ASSERT_UNUSED(ok, ok); 210 #if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST) 211 MGGetFloat32Answer(kMGQMainScreenScale, 0); 212 MGGetSInt32Answer(kMGQMainScreenPitch, 0); 213 MGGetSInt32Answer(kMGQMainScreenClass, MGScreenClassPad2); 214 MGGetBoolAnswer(kMGQAppleInternalInstallCapability); 215 MGGetBoolAnswer(kMGQiPadCapability); 216 auto deviceName = adoptCF(MGCopyAnswer(kMGQDeviceName, nullptr)); 217 MGGetSInt32Answer(kMGQDeviceClassNumber, MGDeviceClassInvalid); 218 MGGetBoolAnswer(kMGQHasExtendedColorDisplay); 219 MGGetFloat32Answer(kMGQDeviceCornerRadius, 0); 220 #endif 221 ok = extension->revoke(); 222 ASSERT_UNUSED(ok, ok); 223 } 224 } 225 205 226 #if HAVE(LSDATABASECONTEXT) 206 227 // FIXME: Remove this entire section when the selector observeDatabaseChange4WebKit is present
Note: See TracChangeset
for help on using the changeset viewer.