Skip to content

Commit

Permalink
Cleanup *_VERSION_MIN_REQUIRED
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=264817

Reviewed by Brent Fulgham and Elliott Williams.

Remove code for unsupported macOS and iOS versions.

* Source/WTF/wtf/PlatformEnableCocoa.h:
* Source/WTF/wtf/PlatformHave.h:
* Source/WebCore/platform/graphics/avfoundation/FormatDescriptionUtilities.cpp:
* Source/WebKit/GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:
* Source/WebKit/NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.mm:
(WebKit::determineTrackingPreventionStateInternal):
(WebKit::doesParentProcessHaveTrackingPreventionEnabled):
* Source/WebKit/WebProcess/com.apple.WebProcess.sb.in:
* Source/WebKit/webpushd/mac/com.apple.WebKit.webpushd.mac.sb.in:
* Source/WebKit/webpushd/mac/com.apple.WebKit.webpushd.relocatable.mac.sb.in:

Canonical link: https://commits.webkit.org/270867@main
  • Loading branch information
annevk committed Nov 17, 2023
1 parent 803d9c8 commit 7258436
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 208 deletions.
4 changes: 1 addition & 3 deletions Source/WTF/wtf/PlatformEnableCocoa.h
Original file line number Diff line number Diff line change
Expand Up @@ -894,9 +894,7 @@
#define ENABLE_TOUCH_ACTION_REGIONS 1
#endif

#if !defined(ENABLE_TRACKER_DISPOSITION) \
&& (PLATFORM(IOS_FAMILY) \
|| (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000))
#if !defined(ENABLE_TRACKER_DISPOSITION)
#define ENABLE_TRACKER_DISPOSITION 1
#endif

Expand Down
13 changes: 5 additions & 8 deletions Source/WTF/wtf/PlatformHave.h
Original file line number Diff line number Diff line change
Expand Up @@ -846,11 +846,8 @@
#define HAVE_COREVIDEO_COMPRESSED_PIXEL_FORMAT_TYPES 1
#endif

#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000) || PLATFORM(IOS_FAMILY)
#define HAVE_APPLE_LOW_POWER_MODE_SUPPORT 1
#endif

#if PLATFORM(COCOA)
#define HAVE_APPLE_LOW_POWER_MODE_SUPPORT 1
#define HAVE_LIBXSLT_FIX_FOR_RADAR_71864140 1
#endif

Expand Down Expand Up @@ -1022,7 +1019,7 @@
#endif

#if !defined(HAVE_QUICKLOOK_PREVIEW_ITEM_DATA_PROVIDER) \
&& (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000)
&& PLATFORM(MAC)
#define HAVE_QUICKLOOK_PREVIEW_ITEM_DATA_PROVIDER 1
#define HAVE_QUICKLOOK_ITEM_PREVIEW_OPTIONS 1
#define HAVE_QUICKLOOK_PREVIEW_ACTIVITY 1
Expand Down Expand Up @@ -1371,7 +1368,7 @@
#endif
#endif

#if PLATFORM(IOS) || PLATFORM(VISION) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000)
#if PLATFORM(IOS) || PLATFORM(VISION) || PLATFORM(MAC)
#define HAVE_TRANSLATION_UI_SERVICES 1
#endif

Expand Down Expand Up @@ -1615,8 +1612,8 @@
#endif

#if !defined(HAVE_UNIFIED_ASC_AUTH_UI) \
&& ((PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) \
|| (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 160000) \
&& (PLATFORM(MAC) \
|| PLATFORM(IOS) \
|| PLATFORM(VISION))
#define HAVE_UNIFIED_ASC_AUTH_UI 1
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,6 @@
#import <pal/cf/CoreMediaSoftLink.h>
#import <pal/cf/VideoToolboxSoftLink.h>

// Added in macOS 11, iOS 14.
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 110000) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < 140000)
constexpr CMVideoCodecType kCMVideoCodecType_VP9 { 'vp09' };
#endif

// Added in macOS 11.3, iOS 14.5:
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED < 110300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MAX_ALLOWED < 140500)
constexpr CMVideoCodecType kCMVideoCodecType_DolbyVisionHEVC { 'dvh1' };
#endif

namespace WebCore {
FloatSize presentationSizeFromFormatDescription(CMFormatDescriptionRef formatDescription)
{
Expand Down
22 changes: 0 additions & 22 deletions Source/WebKit/GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@
(require-all (file-mode #o0004)
(require-any
(subpath "/Library/Preferences/Logging") ; Logging Rethink
#if __MAC_OS_X_VERSION_MIN_REQUIRED < 110000
(subpath "/private/var/db/dyld")
#endif
(subpath "/private/var/db/timezone")
(subpath "/usr/lib")
(subpath "/usr/share"))))
Expand Down Expand Up @@ -479,9 +476,6 @@
(iokit-property "mt-device-id")
(iokit-property "name")
(iokit-property "nv-stats")
#if __MAC_OS_X_VERSION_MIN_REQUIRED < 110000
(iokit-property "od-server-name") ;; Needed by LaunchServices
#endif
(iokit-property "parser-options")
(iokit-property "parser-type")
(iokit-property "pci-aspm-default")
Expand All @@ -507,9 +501,7 @@
(iokit-property "PanicOnGPUHang")
(iokit-property "TelemetryDisable")
(iokit-property "IOGVAH264EncodeCapabilities") ;; <rdar://problem/49498040>
#if !PLATFORM(MAC) || __MAC_OS_X_VERSION_MIN_REQUIRED > 101500
(iokit-property "IOAVDHEVCDecodeCapabilities") ;; <rdar://problem/71100188>
#endif
)

;; <rdar://problem/60088861>
Expand Down Expand Up @@ -777,9 +769,6 @@
(allow mach-lookup
(global-name "com.apple.audio.audiohald")
(global-name "com.apple.CARenderServer") ; Needed for [CAContext remoteContextWithOptions]
#if __MAC_OS_X_VERSION_MIN_REQUIRED < 120000
(global-name "com.apple.lsd.mapdb")
#endif
(global-name "com.apple.fonts")
(global-name "com.apple.PowerManagement.control")
(global-name "com.apple.trustd.agent")
Expand Down Expand Up @@ -842,17 +831,8 @@

;; Networking
(allow network-outbound
#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 101500
;; Local mDNSResponder for DNS, arbitrary outbound TCP
;; Note: This is needed for some media playback features. <rdar://problem/38191574>
;; Remove this permission when <rdar://problem/38240572> is fixed.
(literal "/private/var/run/mDNSResponder")
#endif
;; ObjC map_images needs to send logging data to syslog. <rdar://problem/39778918>
(literal "/private/var/run/syslog")
#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 101500
(remote tcp)
#endif
)

;; CFNetwork
Expand Down Expand Up @@ -900,9 +880,7 @@
; <rdar://problem/35509194>
(global-name "com.apple.coremedia.endpointremotecontrolsession.xpc")
(global-name "com.apple.coremedia.routediscoverer.xpc")
#if __MAC_OS_X_VERSION_MIN_REQUIRED > 120000
(global-name "com.apple.coremedia.samplebufferconsumer.xpc")
#endif
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 130000
(global-name "com.apple.coremedia.shaphelper.xpc")
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,6 @@

(allow file-read*
(subpath "/Library/Preferences/Logging") ; Logging Rethink
#if __MAC_OS_X_VERSION_MIN_REQUIRED < 110000
(subpath "/private/var/db/dyld")
#endif
(subpath "/private/var/db/timezone")
(subpath "/usr/lib")
(subpath "/usr/share"))
Expand Down Expand Up @@ -402,9 +399,6 @@
(global-name "com.apple.cfnetwork.AuthBrokerAgent")
(global-name "com.apple.cfnetwork.cfnetworkagent")
(global-name "com.apple.ciphermld") ;; <rdar://106216542>
#if __MAC_OS_X_VERSION_MIN_REQUIRED < 120000
(global-name "com.apple.cookied")
#endif
(global-name "com.apple.ist.ds.appleconnect2.service.kdctunnelcontroller")
(global-name "com.apple.logd")
(global-name "com.apple.logd.events")
Expand Down Expand Up @@ -841,9 +835,6 @@
MSC_task_dyld_process_info_notify_get
MSC_task_self_trap
MSC_thread_get_special_reply_port
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 120000
MSC_thread_self_trap
#endif
))

(when (defined? 'MSC_mach_msg2_trap)
Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.mm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static bool determineTrackingPreventionStateInternal(bool appWasLinkedOnOrAfter,
return true;

TCCAccessPreflightResult result = kTCCAccessPreflightDenied;
#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) || PLATFORM(VISION)
#if PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(VISION)
result = TCCAccessPreflight(get_TCC_kTCCServiceWebKitIntelligentTrackingPrevention(), nullptr);
#endif
return result != kTCCAccessPreflightDenied;
Expand Down Expand Up @@ -164,7 +164,7 @@ bool doesParentProcessHaveTrackingPreventionEnabled(AuxiliaryProcess& auxiliaryP
dispatch_once(&once, ^{

TCCAccessPreflightResult result = kTCCAccessPreflightDenied;
#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) || PLATFORM(VISION)
#if PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(VISION)
RefPtr<IPC::Connection> connection = auxiliaryProcess.parentProcessConnection();
if (!connection) {
ASSERT_NOT_REACHED();
Expand Down
Loading

0 comments on commit 7258436

Please sign in to comment.