Skip to content

Commit

Permalink
[MacCatalyst] Stop soft-linking UIKit in WebProcessCocoa.mm
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=271890
<rdar://125613749>

Reviewed by Per Arne Vollan.

* Source/WebKit/Platform/spi/ios/UIKitSPI.h:
- Import the appropriate header for internal SDK builds, and declare the
  method for public SDK builds.
* Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):
- Remove soft-linking and availability check since this method is always
  available since at least macOS 11.3.

Canonical link: https://commits.webkit.org/276832@main
  • Loading branch information
David Kilzer authored and ddkilzer committed Mar 29, 2024
1 parent 641e3aa commit f2ae07c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
5 changes: 5 additions & 0 deletions Source/WebKit/Platform/spi/ios/UIKitSPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#import <UIKit/NSTextAlternatives.h>
#import <UIKit/UIActivityViewController_Private.h>
#import <UIKit/UIAlertController_Private.h>
#import <UIKit/UIApplication+iOSMac_Private.h>
#import <UIKit/UIApplication_Private.h>
#import <UIKit/UIBarButtonItem_Private.h>
#import <UIKit/UIBlurEffect_Private.h>
Expand Down Expand Up @@ -1014,6 +1015,10 @@ extern NSNotificationName const _UIWindowSceneDidEndLiveResizeNotification;

#endif // HAVE(UI_WINDOW_SCENE_LIVE_RESIZE)

#if HAVE(CATALYST_USER_INTERFACE_IDIOM_AND_SCALE_FACTOR)
extern void _UIApplicationCatalystRequestViewServiceIdiomAndScaleFactor(UIUserInterfaceIdiom, CGFloat scaleFactor);
#endif

#endif // USE(APPLE_INTERNAL_SDK)

#if ENABLE(OVERLAY_REGIONS_IN_EVENT_REGION)
Expand Down
14 changes: 3 additions & 11 deletions Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,6 @@
#import <pal/cocoa/DataDetectorsCoreSoftLink.h>
#import <pal/cocoa/MediaToolboxSoftLink.h>

#if HAVE(CATALYST_USER_INTERFACE_IDIOM_AND_SCALE_FACTOR)
// FIXME: This is only for binary compatibility with versions of UIKit in macOS 11 that are missing the change in <rdar://problem/68524148>.
SOFT_LINK_FRAMEWORK(UIKit)
SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebKit, UIKit, _UIApplicationCatalystRequestViewServiceIdiomAndScaleFactor, void, (UIUserInterfaceIdiom idiom, CGFloat scaleFactor), (idiom, scaleFactor))
#endif

#define RELEASE_LOG_SESSION_ID (m_sessionID ? m_sessionID->toUInt64() : 0)
#define WEBPROCESS_RELEASE_LOG(channel, fmt, ...) RELEASE_LOG(channel, "%p - [sessionID=%" PRIu64 "] WebProcess::" fmt, this, RELEASE_LOG_SESSION_ID, ##__VA_ARGS__)
#define WEBPROCESS_RELEASE_LOG_ERROR(channel, fmt, ...) RELEASE_LOG_ERROR(channel, "%p - [sessionID=%" PRIu64 "] WebProcess::" fmt, this, RELEASE_LOG_SESSION_ID, ##__VA_ARGS__)
Expand Down Expand Up @@ -348,12 +342,10 @@ static void setVideoDecoderBehaviors(OptionSet<VideoDecoderBehavior> videoDecode
applyProcessCreationParameters(parameters.auxiliaryProcessParameters);

setQOS(parameters.latencyQOS, parameters.throughputQOS);

#if HAVE(CATALYST_USER_INTERFACE_IDIOM_AND_SCALE_FACTOR)
if (canLoad_UIKit__UIApplicationCatalystRequestViewServiceIdiomAndScaleFactor()) {
auto [overrideUserInterfaceIdiom, overrideScaleFactor] = parameters.overrideUserInterfaceIdiomAndScale;
softLink_UIKit__UIApplicationCatalystRequestViewServiceIdiomAndScaleFactor(static_cast<UIUserInterfaceIdiom>(overrideUserInterfaceIdiom), overrideScaleFactor);
}
auto [overrideUserInterfaceIdiom, overrideScaleFactor] = parameters.overrideUserInterfaceIdiomAndScale;
_UIApplicationCatalystRequestViewServiceIdiomAndScaleFactor(static_cast<UIUserInterfaceIdiom>(overrideUserInterfaceIdiom), overrideScaleFactor);
#endif

populateMobileGestaltCache(WTFMove(parameters.mobileGestaltExtensionHandle));
Expand Down

0 comments on commit f2ae07c

Please sign in to comment.