Skip to content

Commit 4619da3

Browse files
committed
[macOS Big Sur] ASSERTION FAILED: !m_gamepadMap.get(device)./platform/gamepad/mac/HIDGamepadProvider.mm(233) under WebCore::HIDGamepadProvider::deviceAdded
https://bugs.webkit.org/show_bug.cgi?id=216665 <rdar://problem/68641574> Reviewed by Alex Christensen. On macOS Big Sur, it appears we get notified multiple times that the Shenzhen Longshengwei Technology Gamepad is getting added during Gamepad.GCFVersusHID API test. This was causing an assertion to be hit under HIDGamepadProvider::deviceAdded() where we expected the device not not already be in the map. In this patch, we work around this HID quirk on Big Sur by ignoring the notification if we already know about the device. No new tests, fixes existing API test. * platform/gamepad/mac/HIDGamepadProvider.mm: (WebCore::HIDGamepadProvider::deviceAdded): Canonical link: https://commits.webkit.org/229504@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267241 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent e212e1f commit 4619da3

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

Source/WebCore/ChangeLog

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
2020-09-18 Chris Dumez <cdumez@apple.com>
2+
3+
[macOS Big Sur] ASSERTION FAILED: !m_gamepadMap.get(device)./platform/gamepad/mac/HIDGamepadProvider.mm(233) under WebCore::HIDGamepadProvider::deviceAdded
4+
https://bugs.webkit.org/show_bug.cgi?id=216665
5+
<rdar://problem/68641574>
6+
7+
Reviewed by Alex Christensen.
8+
9+
On macOS Big Sur, it appears we get notified multiple times that the Shenzhen Longshengwei Technology Gamepad
10+
is getting added during Gamepad.GCFVersusHID API test. This was causing an assertion to be hit under
11+
HIDGamepadProvider::deviceAdded() where we expected the device not not already be in the map. In this patch,
12+
we work around this HID quirk on Big Sur by ignoring the notification if we already know about the device.
13+
14+
No new tests, fixes existing API test.
15+
16+
* platform/gamepad/mac/HIDGamepadProvider.mm:
17+
(WebCore::HIDGamepadProvider::deviceAdded):
18+
119
2020-09-18 Chris Dumez <cdumez@apple.com>
220

321
Vectorize SetTargetAtTime processing in AudioParamTimeline

Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,9 @@ static GameControllerFrameworkHandlesDevice gameControllerFrameworkWillHandleHID
230230
}
231231
#endif
232232

233-
ASSERT(!m_gamepadMap.get(device));
233+
// HID sometimes notifies us multiple times for the same device.
234+
if (m_gamepadMap.contains(device))
235+
return;
234236

235237
LOG(Gamepad, "HIDGamepadProvider device %p added", device);
236238

0 commit comments

Comments
 (0)