Introduce throttle mechanism to EventAutoRepeatHandler::Delegate

This CL introduces a way for EventAutoRepeatHandler clients to
throttle key auto repeats, and eliminate spurious key events
dispatching under janky scenarios.

More specifically, a new hook is added to the delegate class, which
allows clients to flush the input queue before dispatching a key
auto repeat event - in case there has been an "key up" event, for
instance.

For the sake of easier review, this CL only touches KeyboardEvdev
although the existing behavior remains unchanged. The Ozone/Wayland
changes are going to be submitted in a follow up CL:
https://crrev.com/c/874670.

BUG=578890

Change-Id: I06695c94d6e8ada8a24cfe651d62fcc6957e7f5f
Reviewed-on: https://chromium-review.googlesource.com/874650
Reviewed-by: Michael Spang <spang@chromium.org>
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Cr-Commit-Position: refs/heads/master@{#530911}
4 files changed