Skip to content

Commit

Permalink
Minor PlatformHave cleanup
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=265022

Reviewed by Wenson Hsieh.

Removes

- HAVE_FIG_PHOTO_DECOMPRESSION_SET_HARDWARE_CUTOFF
- HAVE_NSSHARINGSERVICEPICKER_ASYNC_MENUS
- HAVE_AVOUTPUTDEVICE_SPATIALAUDIO
- HAVE_LIBXSLT_FIX_FOR_RADAR_71864140

* Source/WTF/wtf/PlatformHave.h:
* Source/WebCore/PAL/pal/avfoundation/OutputDevice.mm:
(PAL::OutputDevice::supportsSpatialAudio const):
* Source/WebCore/xml/XSLTProcessorLibxslt.cpp:
(WebCore::xsltParamArrayFromParameterMap):
* Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::getStandardShareMenuItem):
* Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

Canonical link: https://commits.webkit.org/270896@main
  • Loading branch information
annevk authored and nt1m committed Nov 17, 2023
1 parent c15c265 commit 11c211c
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 23 deletions.
13 changes: 0 additions & 13 deletions Source/WTF/wtf/PlatformHave.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,6 @@
#define HAVE_CELESTIAL 1
#endif

#if PLATFORM(MAC)
#define HAVE_FIG_PHOTO_DECOMPRESSION_SET_HARDWARE_CUTOFF 1
#endif

#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
#define HAVE_CORE_ANIMATION_RENDER_SERVER 1
#endif
Expand Down Expand Up @@ -309,10 +305,6 @@
#define HAVE_NSCURSOR 1
#endif

#if PLATFORM(MAC)
#define HAVE_NSSHARINGSERVICEPICKER_ASYNC_MENUS 1
#endif

#if !defined(HAVE_QOS_CLASSES) && PLATFORM(COCOA)
#define HAVE_QOS_CLASSES 1
#endif
Expand Down Expand Up @@ -825,10 +817,6 @@
#define HAVE_CNCONTACTPICKERVIEWCONTROLLER 1
#endif

#if PLATFORM(COCOA)
#define HAVE_AVOUTPUTDEVICE_SPATIALAUDIO 1
#endif

#if PLATFORM(COCOA) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)
#define HAVE_SPEECHRECOGNIZER 1
#endif
Expand All @@ -848,7 +836,6 @@

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

#if PLATFORM(IOS) || PLATFORM(VISION)
Expand Down
4 changes: 0 additions & 4 deletions Source/WebCore/PAL/pal/avfoundation/OutputDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,12 @@ - (BOOL)allowsHeadTrackedSpatialAudio;

bool OutputDevice::supportsSpatialAudio() const
{
#if HAVE(AVOUTPUTDEVICE_SPATIALAUDIO)
if (![m_device respondsToSelector:@selector(supportsHeadTrackedSpatialAudio)]
|| ![m_device supportsHeadTrackedSpatialAudio])
return false;

return ![m_device respondsToSelector:@selector(allowsHeadTrackedSpatialAudio)]
|| [m_device allowsHeadTrackedSpatialAudio];
#else
return false;
#endif
}

}
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/xml/XSLTProcessorLibxslt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ static const char** xsltParamArrayFromParameterMap(XSLTProcessor::ParameterMap&
}
parameterArray[index] = nullptr;

#if !PLATFORM(WIN) && !HAVE(LIBXSLT_FIX_FOR_RADAR_71864140)
#if !PLATFORM(WIN) && !PLATFORM(COCOA)
RELEASE_ASSERT(index <= std::numeric_limits<int>::max());
#endif

Expand Down
4 changes: 0 additions & 4 deletions Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ - (void)menuDidClose:(NSMenu *)menu
#if !HAVE(SHARING_SERVICE_PICKER_STANDARD_SHARE_MENU_ITEM)
static void getStandardShareMenuItem(NSArray *items, void (^completionHandler)(NSMenuItem *))
{
#if HAVE(NSSHARINGSERVICEPICKER_ASYNC_MENUS)
// FIXME (<rdar://problem/54551500>): Replace this with the async variant of +[NSMenuItem standardShareMenuItemForItems:] when it's available.
auto sharingServicePicker = adoptNS([[NSSharingServicePicker alloc] initWithItems:items]);
[sharingServicePicker setStyle:NSSharingServicePickerStyleMenu];
Expand All @@ -400,9 +399,6 @@ static void getStandardShareMenuItem(NSArray *items, void (^completionHandler)(N
[shareMenuItem setSubmenu:shareMenu];
completionHandler(shareMenuItem.get());
}];
#else
completionHandler([NSMenuItem standardShareMenuItemForItems:items]);
#endif
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ static void setVideoDecoderBehaviors(OptionSet<VideoDecoderBehavior> videoDecode

WebCore::sleepDisablerClient() = makeUnique<WebSleepDisablerClient>();

#if HAVE(FIG_PHOTO_DECOMPRESSION_SET_HARDWARE_CUTOFF) && !ENABLE(HARDWARE_JPEG)
#if PLATFORM(MAC) && !ENABLE(HARDWARE_JPEG)
if (PAL::isMediaToolboxFrameworkAvailable() && PAL::canLoad_MediaToolbox_FigPhotoDecompressionSetHardwareCutoff())
PAL::softLinkMediaToolboxFigPhotoDecompressionSetHardwareCutoff(kPALFigPhotoContainerFormat_JFIF, INT_MAX);
#endif
Expand Down

0 comments on commit 11c211c

Please sign in to comment.