[webkit-reviews] review granted: [Bug 214664] Hard code some MFi controller devices instead of dynamically managing HID vs GameController.framework : [Attachment 405191] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 24 16:11:07 PDT 2020


Tim Horton <thorton at apple.com> has granted Brady Eidson <beidson at apple.com>'s
request for review:
Bug 214664: Hard code some MFi controller devices instead of dynamically
managing HID vs GameController.framework
https://bugs.webkit.org/show_bug.cgi?id=214664

Attachment 405191: Patch

https://bugs.webkit.org/attachment.cgi?id=405191&action=review




--- Comment #8 from Tim Horton <thorton at apple.com> ---
Comment on attachment 405191
  --> https://bugs.webkit.org/attachment.cgi?id=405191
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=405191&action=review

Vast majority of this is a rs (test code)

> Source/WebCore/platform/gamepad/cocoa/GameControllerGamepadProvider.mm:42
> +bool GameControllerGamepadProvider::willHandleVendorAndProduct(uint16_t
vendorID, uint16_t productID)

Allow me to register my objection at this code living in WebKit :D

> Source/WebCore/platform/gamepad/mac/HIDGamepadProvider.mm:206
> +    CFNumberGetValue(cfVendorID, kCFNumberIntType, &vendorID);
> +    CFNumberGetValue(cfProductID, kCFNumberIntType, &productID);

Please don't use this; toll-free bridge to NSNumber and use the not-scary API.
Even though it's fine in this case, it's nonideal to promote the dangerous one
by using it.


More information about the webkit-reviews mailing list