Summary: | The user pressing a button on a gamepad should cause gamepads to become visible to all NavigatorGamepads | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Brady Eidson <beidson> | ||||
Component: | WebCore Misc. | Assignee: | Brady Eidson <beidson> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | dino | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 134076 | ||||||
Attachments: |
|
Description
Brady Eidson
2014-06-26 18:30:27 PDT
Created attachment 233967 [details]
Patch v1
Ignore the can't-buildness that EWS sees - In my tree this patch is built on previous patches. I will pass it through EWS before landing. Comment on attachment 233967 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=233967&action=review > Source/WebCore/Modules/gamepad/GamepadManager.cpp:81 > + const Vector<PlatformGamepad*>& platformGamepads = GamepadProvider::shared().platformGamepads(); Seems like a good place to use auto, although maybe Alexey wouldn’t agree. > Source/WebCore/Modules/gamepad/GamepadManager.cpp:82 > + for (unsigned i = 0; i < platformGamepads.size(); ++i) { Normally it’s an anti-pattern to actually call size each time through. My own preference is to put it into a local variable named size, either inside the for or just before it: for (unsigned i = 0, size = platformGamepads.size(); i < size; ++i) > Source/WebCore/platform/mac/HIDGamepadProvider.cpp:85 > + , m_inputNotificationTimer(this, &HIDGamepadProvider::inputNotificationTimerFired) Consider the new style Timer that uses a function/lambda instead of a pointer to member function. > Source/WebCore/platform/mac/HIDGamepadProvider.cpp:215 > + if (!m_inputNotificationTimer.isActive()) > + m_inputNotificationTimer.startOneShot(InputNotificationDelay); A why comment would be good here to explain why the isActive check. We want to delay from the time of the first input, not postpone when we get additional input, I assume. |