Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cocoa] Delete dead code after cleaning up HAVE() and USE() macros #15225

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1775,7 +1775,6 @@
DDE99312278D089000F60D26 /* libWebKitAdditions.a in Product Dependencies */ = {isa = PBXBuildFile; fileRef = DDE9930E278D086600F60D26 /* libWebKitAdditions.a */; };
DE26E9031CB5DD0500D2BE82 /* BuiltinExecutableCreator.h in Headers */ = {isa = PBXBuildFile; fileRef = DE26E9021CB5DD0500D2BE82 /* BuiltinExecutableCreator.h */; };
DEA7E2451BBC677F00D78440 /* JSTypedArrayViewPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 53917E7C1B791106000EBD33 /* JSTypedArrayViewPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; };
DFBC2CA625E6D5B90081BDD1 /* SymbolStubsForSafariCompatibility.mm in Sources */ = {isa = PBXBuildFile; fileRef = DFBC2CA525E6D5790081BDD1 /* SymbolStubsForSafariCompatibility.mm */; };
E124A8F70E555775003091F1 /* OpaqueJSString.h in Headers */ = {isa = PBXBuildFile; fileRef = E124A8F50E555775003091F1 /* OpaqueJSString.h */; settings = {ATTRIBUTES = (Private, ); }; };
E307178324C7827100DF0644 /* IntlRelativeTimeFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = A3BF885024480BE1001B9F35 /* IntlRelativeTimeFormat.h */; };
E307178424C7827700DF0644 /* IntlRelativeTimeFormatConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = A3BF884E24480BE0001B9F35 /* IntlRelativeTimeFormatConstructor.h */; };
Expand Down Expand Up @@ -5183,7 +5182,6 @@
DDE9930E278D086600F60D26 /* libWebKitAdditions.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libWebKitAdditions.a; sourceTree = BUILT_PRODUCTS_DIR; };
DE26E9021CB5DD0500D2BE82 /* BuiltinExecutableCreator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BuiltinExecutableCreator.h; sourceTree = "<group>"; };
DE26E9061CB5DD9600D2BE82 /* BuiltinExecutableCreator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BuiltinExecutableCreator.cpp; sourceTree = "<group>"; };
DFBC2CA525E6D5790081BDD1 /* SymbolStubsForSafariCompatibility.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SymbolStubsForSafariCompatibility.mm; sourceTree = "<group>"; };
E124A8F50E555775003091F1 /* OpaqueJSString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpaqueJSString.h; sourceTree = "<group>"; };
E124A8F60E555775003091F1 /* OpaqueJSString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OpaqueJSString.cpp; sourceTree = "<group>"; };
E178633F0D9BEC0000D74E75 /* InitializeThreading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InitializeThreading.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -8295,7 +8293,6 @@
705B41A81A6E501E00716757 /* SymbolObject.h */,
705B41A91A6E501E00716757 /* SymbolPrototype.cpp */,
705B41AA1A6E501E00716757 /* SymbolPrototype.h */,
DFBC2CA525E6D5790081BDD1 /* SymbolStubsForSafariCompatibility.mm */,
0F919D2715856770004A4E7D /* SymbolTable.cpp */,
14A396A60CD2933100B5B4FF /* SymbolTable.h */,
E39BF39822A2288B00BD183E /* SymbolTableInlines.h */,
Expand Down Expand Up @@ -12374,7 +12371,6 @@
4B46940328984FA800512FDF /* MacroAssemblerARM64.cpp in Sources */,
4B46940428984FEE00512FDF /* MacroAssemblerX86Common.cpp in Sources */,
FE770390298CD40F009634C7 /* Parser.cpp in Sources */,
DFBC2CA625E6D5B90081BDD1 /* SymbolStubsForSafariCompatibility.mm in Sources */,
E32F713F281B3C6600AFD21D /* UnifiedSource1-c.c in Sources */,
536B319A1F735E780037FC33 /* UnifiedSource1-mm.mm in Sources */,
536B315F1F71C5990037FC33 /* UnifiedSource1.cpp in Sources */,
Expand Down

This file was deleted.

68 changes: 1 addition & 67 deletions Source/WTF/wtf/PlatformHave.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@
#endif
#endif

#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 120000
#define HAVE_MISSING_STD_FILESYSTEM_PATH_CONSTRUCTOR 1
// FIXME: This should be deleted, along with any code that's using it.
#define HAVE_CPP20_INCOMPATIBLE_INTERNAL_HEADERS 1
#elif PLATFORM(PLAYSTATION)
#if PLATFORM(PLAYSTATION)
#define HAVE_MISSING_STD_FILESYSTEM_PATH_CONSTRUCTOR 1
#endif

Expand Down Expand Up @@ -361,12 +357,6 @@
#define HAVE_NS_ACTIVITY 1
#endif

// FIXME: The only place this is used is in Cocoa-specific code,
// so we can just assume its value and delete this definition.
#if PLATFORM(COCOA)
#define HAVE_SEC_TRUST_SET_CLIENT_AUDIT_TOKEN 1
#endif

#if PLATFORM(MAC)
#define HAVE_TOUCH_BAR 1
#endif
Expand Down Expand Up @@ -453,12 +443,6 @@
#define HAVE_ALTERNATIVE_SERVICE 1
#endif

// FIXME: This should be deleted, along with any code that's using it.
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 120000
#define HAVE_SAFARI_FOR_WEBKIT_DEVELOPMENT_REQUIRING_EXTRA_SYMBOLS 1
#define HAVE_NSURLSESSION_EFFECTIVE_CONFIGURATION_OBJECT 1
#endif

#if PLATFORM(MAC)
#define HAVE_CSCHECKFIXDISABLE 1
#endif
Expand Down Expand Up @@ -521,12 +505,6 @@
#define HAVE_NSURLSESSION_WEBSOCKET 1
#endif

// FIXME: The only place this is used is in Cocoa-specific code,
// so we can just assume its value and delete this definition.
#if PLATFORM(COCOA)
#define HAVE_NWPARAMETERS_TRACKER_API 1
#endif

#if PLATFORM(COCOA) && !PLATFORM(MACCATALYST)
#define HAVE_AVPLAYER_RESOURCE_CONSERVATION_LEVEL 1
#endif
Expand Down Expand Up @@ -862,12 +840,6 @@
#define HAVE_AVCONTENTKEYREQUEST_COMPATABILITIY_MODE 1
#endif

// FIXME: The only place this is used is in Cocoa-specific code,
// so we can just assume its value and delete this definition.
#if PLATFORM(COCOA)
#define HAVE_LEVEL_3_SYSTEM_FONT_WIDTH_VALUES 1
#endif

#if __has_include(<AVFoundation/AVPlayerInterstitialEventController.h>)
#if !defined(HAVE_AVFOUNDATION_INTERSTITIAL_EVENTS)
#define HAVE_AVFOUNDATION_INTERSTITIAL_EVENTS 1
Expand Down Expand Up @@ -933,12 +905,6 @@
#define HAVE_VISION 1
#endif

// FIXME: The only place this is used is in Cocoa-specific code,
// so we can just assume its value and delete this definition.
#if PLATFORM(COCOA)
#define HAVE_VM_FLAGS_PERMANENT 1
#endif

#if PLATFORM(COCOA)
#define HAVE_RSA_PSS_OID 1
#endif
Expand Down Expand Up @@ -1007,12 +973,6 @@
#define HAVE_PER_APP_ACCESSIBILITY_PREFERENCES 1
#endif

// FIXME: The only place this is used is in Cocoa-specific code,
// so we can just assume its value and delete this definition.
#if PLATFORM(COCOA)
#define HAVE_APP_SPECIFIC_ACCESSIBILITY_SETTINGS 1
#endif

#if (PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR)) || PLATFORM(MACCATALYST) || PLATFORM(MAC)
#define HAVE_PAC_SHARED_REGION_ID 1
#endif
Expand Down Expand Up @@ -1044,12 +1004,6 @@
#define HAVE_CMPHOTO_TILE_DECODER_AVAILABLE 1
#endif

// FIXME: The only place this is used is in Cocoa-specific code,
// so we can just assume its value and delete this definition.
#if PLATFORM(COCOA)
#define HAVE_AVSAMPLEBUFFERRENDERSYNCHRONIZER_RATEATHOSTTIME 1
#endif

#if (PLATFORM(IOS) || PLATFORM(VISION)) && !PLATFORM(IOS_FAMILY_SIMULATOR)
#define HAVE_SYSTEM_STATUS 1
#endif
Expand Down Expand Up @@ -1086,12 +1040,6 @@
#define HAVE_AUDIOSESSION_PROCESSASSERTION 1
#endif

// FIXME: The only place this is used is in Cocoa-specific code,
// so we can just assume its value and delete this definition.
#if PLATFORM(COCOA)
#define HAVE_NSTEXTLIST_MARKER_FORMATS 1
#endif

// FIXME: Why no catalyst?
#if PLATFORM(IOS) \
|| PLATFORM(WATCHOS) \
Expand Down Expand Up @@ -1142,14 +1090,6 @@
#define HAVE_UNIFORM_TYPE_IDENTIFIERS_FRAMEWORK 1
#endif

#if PLATFORM(COCOA)
#define HAVE_AV_DELEGATING_PLAYBACK_COORDINATOR 1
#endif
// FIXME: This should be deleted, along with any code that's using it.
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 120000
#undef HAVE_AV_DELEGATING_PLAYBACK_COORDINATOR
#endif

#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 130000)
#define HAVE_SCREEN_CAPTURE_KIT 1
#endif
Expand Down Expand Up @@ -1181,12 +1121,6 @@
#define HAVE_PLATFORM_SCROLL_MOMENTUM_INTERRUPTION_REASON 1
#endif

// FIXME: The only place this is used is in Cocoa-specific code,
// so we can just assume its value and delete this definition.
#if PLATFORM(COCOA)
#define HAVE_CFNETWORK_DISABLE_CACHE_SPI 1
#endif

#if PLATFORM(IOS) || PLATFORM(MACCATALYST) || PLATFORM(VISION)
#define HAVE_UIACTIVITYTYPE_SHAREPLAY 1
#endif
Expand Down
5 changes: 0 additions & 5 deletions Source/WTF/wtf/PlatformUse.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,6 @@
#define USE_SANDBOX_EXTENSIONS_FOR_CACHE_AND_TEMP_DIRECTORY_ACCESS 1
#endif

// FIXME: This should be deleted, along with any code that's using it.
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 120000
#define USE_VORBIS_AUDIOCOMPONENT_WORKAROUND 1
#endif

#if !defined(USE_ISO_MALLOC)
#define USE_ISO_MALLOC 1
#endif
Expand Down
9 changes: 2 additions & 7 deletions Source/WTF/wtf/WTFConfig.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Apple Inc. All rights reserved.
* Copyright (C) 2020-2023 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -75,23 +75,18 @@ void setPermissionsOfConfigPage()
static std::once_flag onceFlag;
std::call_once(onceFlag, [] {
mach_vm_address_t addr = bitwise_cast<uintptr_t>(static_cast<void*>(WebConfig::g_config));
auto flags = VM_FLAGS_FIXED | VM_FLAGS_OVERWRITE;
#if HAVE(VM_FLAGS_PERMANENT)
flags |= VM_FLAGS_PERMANENT;
litherum marked this conversation as resolved.
Show resolved Hide resolved
#endif
auto flags = VM_FLAGS_FIXED | VM_FLAGS_OVERWRITE | VM_FLAGS_PERMANENT;

auto attemptVMMapping = [&] {
return mach_vm_map(mach_task_self(), &addr, ConfigSizeToProtect, pageSize() - 1, flags, MEMORY_OBJECT_NULL, 0, false, VM_PROT_READ | VM_PROT_WRITE, VM_PROT_READ | VM_PROT_WRITE, VM_INHERIT_DEFAULT);
};

auto result = attemptVMMapping();

#if HAVE(VM_FLAGS_PERMANENT)
if (result != KERN_SUCCESS) {
litherum marked this conversation as resolved.
Show resolved Hide resolved
flags &= ~VM_FLAGS_PERMANENT;
result = attemptVMMapping();
}
#endif

RELEASE_ASSERT(result == KERN_SUCCESS);
});
Expand Down
4 changes: 1 addition & 3 deletions Source/WTF/wtf/spi/cocoa/SecuritySPI.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2022 Apple Inc. All rights reserved.
* Copyright (C) 2015-2023 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -101,9 +101,7 @@ CF_RETURNS_RETAINED SecTrustRef SecTrustDeserialize(CFDataRef serializedTrust, C

CF_RETURNS_RETAINED CFDictionaryRef SecTrustCopyInfo(SecTrustRef);

#if HAVE(SEC_TRUST_SET_CLIENT_AUDIT_TOKEN)
OSStatus SecTrustSetClientAuditToken(SecTrustRef, CFDataRef);
#endif

extern const CFStringRef kSecTrustInfoExtendedValidationKey;
extern const CFStringRef kSecTrustInfoCompanyNameKey;
Expand Down
4 changes: 0 additions & 4 deletions Source/WTF/wtf/text/WTFString.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,8 @@ class String final {
#endif

#if USE(FOUNDATION) && defined(__OBJC__)
#if HAVE(SAFARI_FOR_WEBKIT_DEVELOPMENT_REQUIRING_EXTRA_SYMBOLS)
WTF_EXPORT_PRIVATE String(NSString *);
#else
String(NSString *string)
: String((__bridge CFStringRef)string) { }
#endif

// This conversion converts the null string to an empty NSString rather than to nil.
// Given Cocoa idioms, this is a more useful default. Clients that need to preserve the
Expand Down
9 changes: 1 addition & 8 deletions Source/WTF/wtf/text/cocoa/StringCocoa.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2006-2021 Apple Inc. All rights reserved.
* Copyright (C) 2006-2023 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
Expand All @@ -26,13 +26,6 @@

namespace WTF {

#if HAVE(SAFARI_FOR_WEBKIT_DEVELOPMENT_REQUIRING_EXTRA_SYMBOLS)
String::String(NSString *string)
: String(bridge_cast(string))
{
}
#endif

RetainPtr<id> makeNSArrayElement(const String& vectorElement)
{
return bridge_cast(vectorElement.createCFString());
Expand Down
6 changes: 1 addition & 5 deletions Source/WebCore/PAL/pal/cf/CoreTextSoftLink.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Apple Inc. All rights reserved.
* Copyright (C) 2021-2023 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand All @@ -24,10 +24,6 @@

#include "config.h"

#if HAVE(CPP20_INCOMPATIBLE_INTERNAL_HEADERS)
#define CGCOLORTAGGEDPOINTER_H_
#endif

#include <pal/spi/cf/CoreTextSPI.h>
#include <wtf/SoftLinking.h>

Expand Down
5 changes: 1 addition & 4 deletions Source/WebCore/PAL/pal/cocoa/AVFoundationSoftLink.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ SOFT_LINK_CLASS_FOR_HEADER(PAL, AVAssetWriterInput)
SOFT_LINK_CLASS_FOR_HEADER(PAL, AVContentKeyReportGroup)
SOFT_LINK_CLASS_FOR_HEADER(PAL, AVContentKeyResponse)
SOFT_LINK_CLASS_FOR_HEADER(PAL, AVContentKeySession)
SOFT_LINK_CLASS_FOR_HEADER(PAL, AVDelegatingPlaybackCoordinator)
SOFT_LINK_CLASS_FOR_HEADER(PAL, AVMediaSelectionGroup)
SOFT_LINK_CLASS_FOR_HEADER(PAL, AVMediaSelectionOption)
SOFT_LINK_CLASS_FOR_HEADER(PAL, AVMetadataItem)
Expand All @@ -70,10 +71,6 @@ SOFT_LINK_CLASS_FOR_HEADER(PAL, AVSpeechUtterance)
SOFT_LINK_CLASS_FOR_HEADER(PAL, AVStreamDataParser)
SOFT_LINK_CLASS_FOR_HEADER(PAL, AVURLAsset)

#if HAVE(AV_DELEGATING_PLAYBACK_COORDINATOR)
SOFT_LINK_CLASS_FOR_HEADER(PAL, AVDelegatingPlaybackCoordinator)
#endif

#if HAVE(AVAUDIOSESSION)
SOFT_LINK_CLASS_FOR_HEADER(PAL, AVAudioSession)
#endif
Expand Down
Loading