commit | acd7c7eaac795286ab4c46dfd11571705a4d2c4f | [log] [tgz] |
---|---|---|
author | Matt Reynolds <mattreynolds@chromium.org> | Mon Feb 05 22:14:06 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Mon Feb 05 22:14:06 2018 |
tree | d0030b978683f1852c28a0491afce0c92f8ac719 | |
parent | df42e1a12bec272f7406d41fa1cb0e3768bc6c3e [diff] |
Split GamepadActiveState into separate flags The Gamepad service allows gamepads to be enumerated by a number of distinct data fetchers which feed into a central gamepad provider. The provider is responsible for managing the state and ordering of connected gamepads as well as issuing notifications when gamepads are connected or disconnected. PadState's |active_state| member indicates the gamepad's current connection status as "inactive" (not receiving updates), "active" (recently received an update), or "newly active" (just connected). This state used for three tasks: * A connection event is fired when the gamepad is first connected. * A disconnection event is fired when the gamepad is no longer connected. * The data fetcher performs some first-time initialization when the gamepad is first connected. This CL splits |active_state| into separate flags to address each case. * |is_active| is used to detect the current connection status. It is initialized to false for each polling cycle and set to true once the PadState is accessed. If this flag is false after a polling cycle, the gamepad is considered disconnected. * |is_newly_active| is initialized to true when the PadState slot is allocated and set to false once the gamepad connection event has been issued. * |is_initialized| is initialized to false when the PadState slot is allocated and may be set to true by the data fetcher to indicate that it has performed first-time initialization for this gamepad. BUG=749295 Change-Id: I2c99e766c900c9c92a5bffecb12ec283739f2597 Reviewed-on: https://chromium-review.googlesource.com/896028 Reviewed-by: Brandon Jones <bajones@chromium.org> Commit-Queue: Matt Reynolds <mattreynolds@chromium.org> Cr-Commit-Position: refs/heads/master@{#534503}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .