Summary: | [WK2] Don't monitor gamepads at all unless an interested WebPageProxy is in the active window | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Brady Eidson <beidson> | ||||||
Component: | WebKit2 | Assignee: | Brady Eidson <beidson> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, thorton | ||||||
Priority: | P2 | ||||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 134076, 134675 | ||||||||
Attachments: |
|
Description
Brady Eidson
2016-08-10 17:00:50 PDT
Created attachment 285786 [details]
Patch v1
Comment on attachment 285786 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=285786&action=review > Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm:1061 > + UIGamepadProvider::singleton().webPageBecameActive(m_page.get()); Don't know if this is the best name for this. It's not about a "web page". > Source/WebKit2/UIProcess/Gamepad/UIGamepadProvider.cpp:160 > +void UIGamepadProvider::webPageBecameActive(WebPageProxy& page) Don't you want windowIsKey && webViewIsFirstResponder? Or is the first-responderiness covered by m_processPoolsUsingGamepads? > Source/WebKit2/UIProcess/Gamepad/UIGamepadProvider.h:83 > + WebCore::Timer m_gamepadSyncTimer; > + WebCore::Timer m_disableMonitoringTimer; Isn't using WebCore::Timer in the UI process a big no-no? (because of coexistence with the Web thread) I think you should be using the runloop timer thingy. (In reply to comment #2) > Comment on attachment 285786 [details] > Patch v1 > > View in context: > https://bugs.webkit.org/attachment.cgi?id=285786&action=review > > > Source/WebKit2/UIProcess/Gamepad/UIGamepadProvider.cpp:160 > > +void UIGamepadProvider::webPageBecameActive(WebPageProxy& page) > > Don't you want windowIsKey && webViewIsFirstResponder? Or is the > first-responderiness covered by m_processPoolsUsingGamepads? > As we need it both at registration time and "event firing" time, first responderiness is covered by platformWebPageProxyForGamepadInput, Fixing the other stuff and building ATM Created attachment 285877 [details]
PFL
Comment on attachment 285877 [details] PFL Clearing flags on attachment: 285877 Committed r204401: <http://trac.webkit.org/changeset/204401> This works. |