Changeset 288451 in webkit
- Timestamp:
- Jan 24, 2022, 9:44:12 AM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r288450 r288451 1 2022-01-24 David Quesada <david_quesada@apple.com> 2 3 Simplify accesses to SystemVersion.plist 4 https://bugs.webkit.org/show_bug.cgi?id=234306 5 6 Reviewed by Alexey Proskuryakov. 7 8 No new tests since no behavior change is expected. 9 10 * platform/cocoa/SystemVersion.mm: 11 (WebCore::createSystemMarketingVersion): 12 Read the SystemVersion.plist file using _CFCopySystemVersionDictionary() 13 rather than by manually constructing the path and initializing the dictionary. 14 1 15 2022-01-24 Rob Buis <rbuis@igalia.com> 2 16 -
trunk/Source/WebCore/PAL/ChangeLog
r288389 r288451 1 2022-01-24 David Quesada <david_quesada@apple.com> 2 3 Simplify accesses to SystemVersion.plist 4 https://bugs.webkit.org/show_bug.cgi?id=234306 5 6 Reviewed by Alexey Proskuryakov. 7 8 * pal/spi/cf/CFUtilitiesSPI.h: 9 Forward declare _kCFSystemVersionProductUserVisibleVersionKey, used 10 by WebCore's SystemVersion.mm 11 1 12 2022-01-21 Sihui Liu <sihui_liu@apple.com> 2 13 -
trunk/Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h
r263773 r288451 50 50 extern const CFStringRef kCFWebServicesTypeWebSearch; 51 51 extern const CFStringRef _kCFSystemVersionBuildVersionKey; 52 extern const CFStringRef _kCFSystemVersionProductUserVisibleVersionKey; 52 53 extern const CFStringRef _kCFSystemVersionProductVersionKey; 53 54 -
trunk/Source/WebCore/platform/cocoa/SystemVersion.mm
r273848 r288451 25 25 #import "config.h" 26 26 #import "SystemVersion.h" 27 #import <pal/spi/cf/CFUtilitiesSPI.h> 27 28 28 29 namespace WebCore { … … 31 32 { 32 33 // Can't use -[NSProcessInfo operatingSystemVersionString] because it has too much stuff we don't want. 33 NSString *systemLibraryPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSSystemDomainMask, YES) objectAtIndex:0]; 34 #if PLATFORM(IOS_FAMILY_SIMULATOR) 35 if (char *simulatorRoot = getenv("SIMULATOR_ROOT")) 36 systemLibraryPath = [NSString stringWithFormat:@"%s/%@", simulatorRoot, systemLibraryPath]; 37 #endif 38 NSString *systemVersionPlistPath = [systemLibraryPath stringByAppendingPathComponent:@"CoreServices/SystemVersion.plist"]; 39 NSDictionary *systemVersionInfo = [NSDictionary dictionaryWithContentsOfFile:systemVersionPlistPath]; 40 return adoptNS([[systemVersionInfo objectForKey:@"ProductVersion"] copy]); 34 auto systemVersionDictionary = adoptCF(_CFCopySystemVersionDictionary()); 35 CFStringRef productVersion = static_cast<CFStringRef>(CFDictionaryGetValue(systemVersionDictionary.get(), _kCFSystemVersionProductVersionKey)); 36 return adoptNS([(__bridge NSString *)productVersion copy]); 41 37 } 42 38 -
trunk/Source/WebKit/ChangeLog
r288432 r288451 1 2022-01-24 David Quesada <david_quesada@apple.com> 2 3 Simplify accesses to SystemVersion.plist 4 https://bugs.webkit.org/show_bug.cgi?id=234306 5 6 Reviewed by Alexey Proskuryakov. 7 8 No new tests since no behavior change is expected. 9 10 * UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm: 11 (WebKit::WebInspectorUIProxy::infoForLocalDebuggable): 12 Use _CFCopySystemVersionDictionary() to locate and load the 13 SystemVersion.plist file rather than doing that all manually. 14 (WebKit::systemVersionPlist): Deleted. 15 1 16 2022-01-24 Said Abou-Hallawa <said@apple.com> 2 17 -
trunk/Source/WebKit/UIProcess/Inspector/mac/WebInspectorUIProxyMac.mm
r284968 r288451 49 49 #import <WebCore/InspectorFrontendClientLocal.h> 50 50 #import <WebCore/LocalizedStrings.h> 51 #import <pal/spi/cf/CFUtilitiesSPI.h> 51 52 #import <wtf/text/Base64.h> 52 53 … … 788 789 } 789 790 790 static NSDictionary *systemVersionPlist()791 {792 NSString *systemLibraryPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSSystemDomainMask, YES) objectAtIndex:0];793 NSString *systemVersionPlistPath = [systemLibraryPath stringByAppendingPathComponent:@"CoreServices/SystemVersion.plist"];794 NSDictionary *systemVersionInfo = [NSDictionary dictionaryWithContentsOfFile:systemVersionPlistPath];795 return systemVersionInfo;796 }797 798 791 DebuggableInfoData WebInspectorUIProxy::infoForLocalDebuggable() 799 792 { 800 NSDictionary *plist = systemVersionPlist();793 NSDictionary *plist = adoptCF(_CFCopySystemVersionDictionary()).bridgingAutorelease(); 801 794 802 795 DebuggableInfoData result; 803 796 result.debuggableType = Inspector::DebuggableType::WebPage; 804 797 result.targetPlatformName = "macOS"_s; 805 result.targetBuildVersion = plist[ @"ProductBuildVersion"];806 result.targetProductVersion = plist[ @"ProductUserVisibleVersion"];798 result.targetBuildVersion = plist[static_cast<NSString *>(_kCFSystemVersionBuildVersionKey)]; 799 result.targetProductVersion = plist[static_cast<NSString *>(_kCFSystemVersionProductUserVisibleVersionKey)]; 807 800 result.targetIsSimulator = false; 808 801
Note:
See TracChangeset
for help on using the changeset viewer.