[WK2] Don't monitor gamepads at all unless an interested WebPageProxy is in the activ...
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Aug 2016 01:29:52 +0000 (01:29 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Aug 2016 01:29:52 +0000 (01:29 +0000)
commit79ab6907e389760f10c312e08ed022f505fe8671
treed95e9f1d67b309eb824b1da541cfb9e27a24882a
parentd8004c203d9f626ab7967cbf1729d41dc9bc32c9
[WK2] Don't monitor gamepads at all unless an interested WebPageProxy is in the active window.
https://bugs.webkit.org/show_bug.cgi?id=160760

Reviewed by Tim Horton.

This patch makes it such that the UIProcess will only listen to the platform gamepad mechanism
if a WebPageProxy that is interested in gamepads is in the active window.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::windowDidBecomeKey):
(WebKit::WebViewImpl::windowDidResignKey):

* UIProcess/Gamepad/UIGamepadProvider.cpp:
(WebKit::UIGamepadProvider::UIGamepadProvider):
(WebKit::UIGamepadProvider::gamepadSyncTimerFired):
(WebKit::UIGamepadProvider::scheduleGamepadStateSync):
(WebKit::UIGamepadProvider::platformGamepadConnected):
(WebKit::UIGamepadProvider::platformGamepadDisconnected):
(WebKit::UIGamepadProvider::platformGamepadInputActivity):
(WebKit::UIGamepadProvider::processPoolStartedUsingGamepads):
(WebKit::UIGamepadProvider::processPoolStoppedUsingGamepads):
(WebKit::UIGamepadProvider::viewBecameActive):
(WebKit::UIGamepadProvider::viewBecameInactive):
(WebKit::UIGamepadProvider::scheduleDisableGamepadMonitoring):
(WebKit::UIGamepadProvider::disableMonitoringTimerFired):
(WebKit::UIGamepadProvider::startMonitoringGamepads):
(WebKit::UIGamepadProvider::stopMonitoringGamepads):
(WebKit::UIGamepadProvider::updateTimerFired): Deleted.
(WebKit::UIGamepadProvider::startOrStopSynchingGamepadState): Deleted.
* UIProcess/Gamepad/UIGamepadProvider.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204401 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit2/UIProcess/Gamepad/UIGamepadProvider.cpp
Source/WebKit2/UIProcess/Gamepad/UIGamepadProvider.h