Skip to content

Commit c2d92fd

Browse files
Limit MultiGamepadProvider to Catalina and Big Sur.
https://bugs.webkit.org/show_bug.cgi?id=214190 Unreviewed build fix. Source/WebCore: * platform/gamepad/cocoa/GameControllerSPI.h: * platform/gamepad/cocoa/GameControllerSoftLink.h: * platform/gamepad/cocoa/GameControllerSoftLink.mm: * platform/gamepad/mac/HIDGamepadProvider.mm: (WebCore::HIDGamepadProvider::deviceAdded): * platform/gamepad/mac/MultiGamepadProvider.h: * platform/gamepad/mac/MultiGamepadProvider.mm: Source/WebKit: * UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm: (WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@264232 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 32a3f92 commit c2d92fd

File tree

11 files changed

+52
-11
lines changed

11 files changed

+52
-11
lines changed

Diff for: Source/WTF/wtf/PlatformHave.h

+4
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,10 @@
570570
#define HAVE_GCEXTENDEDGAMEPAD_BUTTONS_THUMBSTICK 1
571571
#endif
572572

573+
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
574+
#define HAVE_MULTIGAMEPADPROVIDER_SUPPORT 1
575+
#endif
576+
573577
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101600) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
574578
#define HAVE_WEBP 1
575579
#endif

Diff for: Source/WebCore/ChangeLog

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
2020-07-10 Brady Eidson <[email protected]>
2+
3+
Limit MultiGamepadProvider to Catalina and Big Sur.
4+
https://bugs.webkit.org/show_bug.cgi?id=214190
5+
6+
Unreviewed build fix.
7+
8+
* platform/gamepad/cocoa/GameControllerSPI.h:
9+
* platform/gamepad/cocoa/GameControllerSoftLink.h:
10+
* platform/gamepad/cocoa/GameControllerSoftLink.mm:
11+
* platform/gamepad/mac/HIDGamepadProvider.mm:
12+
(WebCore::HIDGamepadProvider::deviceAdded):
13+
* platform/gamepad/mac/MultiGamepadProvider.h:
14+
* platform/gamepad/mac/MultiGamepadProvider.mm:
15+
116
2020-07-10 Sam Weinig <[email protected]>
217

318
Part 4 of SimpleColor and SRGBA<uint8_t> are essentially the same - let's converge them

Diff for: Source/WebCore/PAL/pal/spi/mac/IOKitSPIMac.h

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#else
3434

3535
WTF_EXTERN_C_BEGIN
36+
typedef struct CF_BRIDGED_TYPE(id) __IOHIDServiceClient * IOHIDServiceClientRef;
3637
typedef struct CF_BRIDGED_TYPE(id) __IOHIDEventSystemClient * IOHIDEventSystemClientRef;
3738
IOHIDEventSystemClientRef IOHIDEventSystemClientCreate(CFAllocatorRef);
3839
void IOHIDEventSystemClientSetMatching(IOHIDEventSystemClientRef, CFDictionaryRef);

Diff for: Source/WebCore/platform/gamepad/cocoa/GameControllerSPI.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
+ (void)__openXPC_and_CBApplicationDidBecomeActive__;
3232
@end
3333

34-
#if PLATFORM(MAC)
34+
#if HAVE(MULTIGAMEPADPROVIDER_SUPPORT)
3535
#if USE(APPLE_INTERNAL_SDK)
3636

3737
WTF_EXTERN_C_BEGIN
@@ -41,10 +41,10 @@ WTF_EXTERN_C_END
4141
#else
4242

4343
WTF_EXTERN_C_BEGIN
44-
typedef struct CF_BRIDGED_TYPE(id) IOHIDServiceClient * IOHIDServiceClientRef;
44+
typedef struct CF_BRIDGED_TYPE(id) __IOHIDServiceClient * IOHIDServiceClientRef;
4545
Class ControllerClassForService(IOHIDServiceClientRef);
4646
WTF_EXTERN_C_END
4747

4848
#endif // USE(APPLE_INTERNAL_SDK)
49-
#endif // PLATFORM(MAC)
49+
#endif // HAVE(MULTIGAMEPADPROVIDER_SUPPORT)
5050
#endif // ENABLE(GAMEPAD) && PLATFORM(COCOA)

Diff for: Source/WebCore/platform/gamepad/cocoa/GameControllerSoftLink.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ SOFT_LINK_CLASS_FOR_HEADER(WebCore, GCController)
3636
SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(WebCore, GameController, GCControllerDidConnectNotification, NSString *)
3737
SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(WebCore, GameController, GCControllerDidDisconnectNotification, NSString *)
3838

39-
#if PLATFORM(MAC)
39+
#if HAVE(MULTIGAMEPADPROVIDER_SUPPORT)
4040
SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, GameController, ControllerClassForService, Class, (IOHIDServiceClientRef service), (service))
4141
#endif
4242

Diff for: Source/WebCore/platform/gamepad/cocoa/GameControllerSoftLink.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE(WebCore, GameController, GCControllerDidConnectNotification, NSString *)
3737
SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE(WebCore, GameController, GCControllerDidDisconnectNotification, NSString *)
3838

39-
#if PLATFORM(MAC)
39+
#if HAVE(MULTIGAMEPADPROVIDER_SUPPORT)
4040
SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, GameController, ControllerClassForService, Class, (IOHIDServiceClientRef service), (service))
4141
#endif
4242

Diff for: Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.mm

+6
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ static void deviceValuesChangedCallback(void* context, IOReturn result, void*, I
179179
closeAndUnscheduleManager();
180180
}
181181

182+
#if HAVE(MULTIGAMEPADPROVIDER_SUPPORT)
182183
static bool gameControllerFrameworkWillHandleHIDDevice(IOHIDDeviceRef device)
183184
{
184185
if (!isGameControllerFrameworkAvailable())
@@ -222,14 +223,19 @@ static bool gameControllerFrameworkWillHandleHIDDevice(IOHIDDeviceRef device)
222223

223224
return ControllerClassForService(serviceClient.get());
224225
}
226+
#endif // HAVE(MULTIGAMEPADPROVIDER_SUPPORT)
227+
228+
225229

226230
void HIDGamepadProvider::deviceAdded(IOHIDDeviceRef device)
227231
{
232+
#if HAVE(MULTIGAMEPADPROVIDER_SUPPORT)
228233
if (m_ignoresGameControllerFrameworkDevices && gameControllerFrameworkWillHandleHIDDevice(device)) {
229234
LOG(Gamepad, "GameController framework will handle attached device %p - HIDGamepadProvider ignoring it", device);
230235
m_gameControllerManagedGamepads.add(device);
231236
return;
232237
}
238+
#endif // HAVE(MULTIGAMEPADPROVIDER_SUPPORT)
233239

234240
ASSERT(!m_gamepadMap.get(device));
235241

Diff for: Source/WebCore/platform/gamepad/mac/MultiGamepadProvider.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
#pragma once
2727

28-
#if ENABLE(GAMEPAD) && PLATFORM(MAC)
28+
#if ENABLE(GAMEPAD) && HAVE(MULTIGAMEPADPROVIDER_SUPPORT)
2929

3030
#include "GamepadProvider.h"
3131
#include "GamepadProviderClient.h"
@@ -91,4 +91,4 @@ class MultiGamepadProvider : public GamepadProvider, public GamepadProviderClien
9191

9292
} // namespace WebCore
9393

94-
#endif // ENABLE(GAMEPAD) && PLATFORM(MAC)
94+
#endif // ENABLE(GAMEPAD) && HAVE(MULTIGAMEPADPROVIDER_SUPPORT)

Diff for: Source/WebCore/platform/gamepad/mac/MultiGamepadProvider.mm

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "config.h"
2727
#include "MultiGamepadProvider.h"
2828

29-
#if ENABLE(GAMEPAD) && PLATFORM(MAC)
29+
#if ENABLE(GAMEPAD) && HAVE(MULTIGAMEPADPROVIDER_SUPPORT)
3030

3131
#import "GameControllerGamepadProvider.h"
3232
#import "HIDGamepadProvider.h"
@@ -129,4 +129,4 @@
129129

130130
} // namespace WebCore
131131

132-
#endif // ENABLE(GAMEPAD) && PLATFORM(MAC)
132+
#endif // ENABLE(GAMEPAD) && HAVE(MULTIGAMEPADPROVIDER_SUPPORT)

Diff for: Source/WebKit/ChangeLog

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2020-07-10 Brady Eidson <[email protected]>
2+
3+
Limit MultiGamepadProvider to Catalina and Big Sur.
4+
https://bugs.webkit.org/show_bug.cgi?id=214190
5+
6+
Unreviewed build fix.
7+
8+
* UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm:
9+
(WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):
10+
111
2020-07-10 Brent Fulgham <[email protected]>
212

313
[IPC hardening] Use MESSAGE_CHECK in WebPageProxy::setColorPickerColor()

Diff for: Source/WebKit/UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm

+7-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,14 @@
5353
#else
5454
if (useGameControllerFramework)
5555
GamepadProvider::setSharedProvider(GameControllerGamepadProvider::singleton());
56-
else
56+
else {
57+
#if HAVE(MULTIGAMEPADPROVIDER_SUPPORT)
5758
GamepadProvider::setSharedProvider(MultiGamepadProvider::singleton());
58-
#endif
59+
#else
60+
GamepadProvider::setSharedProvider(HIDGamepadProvider::singleton());
61+
#endif // HAVE(MULTIGAMEPADPROVIDER_SUPPORT)
62+
}
63+
#endif // PLATFORM(IOS_FAMILY)
5964
}
6065

6166
void UIGamepadProvider::platformStopMonitoringInput()

0 commit comments

Comments
 (0)