[webkit-reviews] review granted: [Bug 247368] Crash in gamepads in WKWebView apps that also listen to the GameController framework themselves : [Attachment 463363] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 2 10:38:13 PDT 2022


Geoffrey Garen <ggaren at apple.com> has granted Brady Eidson
<beidson at apple.com>'s request for review:
Bug 247368: Crash in gamepads in WKWebView apps that also listen to the
GameController framework themselves
https://bugs.webkit.org/show_bug.cgi?id=247368

Attachment 463363: Patch

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




--- Comment #3 from Geoffrey Garen <ggaren at apple.com> ---
Comment on attachment 463363
  --> https://bugs.webkit.org/attachment.cgi?id=463363
Patch

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

r=me

> Source/WebKit/UIProcess/Gamepad/UIGamepadProvider.cpp:118
> +    for (size_t i = 0; i < m_gamepads.size() && i < platformGamepads.size();
++i) {

You can compute 'auto end = std::min(m_gamepads.size(),
platformGamepads.size())' outside the loop. A bit clearer and a bit more
efficient.


More information about the webkit-reviews mailing list