Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1144)

Issue 1052273006: ozone: evdev: Make cancellation of repeats on key up more robust (Closed)

Created:
5 years, 8 months ago by spang
Modified:
5 years, 8 months ago
CC:
chromium-reviews, kalyank, jdduke+watch_chromium.org, ozone-reviews_chromium.org, tdresser+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

ozone: evdev: Make cancellation of repeats on key up more robust Key releases enqueue a task on KeyboardEvdev that dispatches the release ui::Event as well as cancels any scheduled repeats for that key. The release itself is enqueued from the dedicated evdev thread and so can be expected to arrive in a timely manner. Unfotunately, due to the way base::Timer works, this is not robust when the UI thread is very busy. The base::Timer object posts a delayed task, and upon running checks to see if enough real time has passed (see Timer::RunScheduledTask). If so, it runs the timer callback immediately. This is fine, except that base::Timer also reuses scheduled tasks from previous calls to Start() if they are still in the future (see Timer::Reset). This can mean the timeout callback runs from a task that was scheduled before the current timer was started. The net effect of this is that the timer task may run first even if (initial timer start + delay) > (key release task timestamp). The message loop queue itself would have run the tasks in the correct order. So, if we simply use PostDelayedTask() ourselves, there's no cleverness in base::Timer to worry about and the tasks run in the needed order. BUG=473446 TEST=Press Ctrl-W to close a tab with lots of activity (multiple copies of gmail loading, etc). Only one tab closes. Also tested with simulated jank (1s delay in tab closure). Committed: https://crrev.com/50e43d96539246fe55b282e5e161b12ed39c42eb Cr-Commit-Position: refs/heads/master@{#324081}

Patch Set 1 #

Total comments: 2

Patch Set 2 : merge DispatchKeyRepeat #

Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -21 lines) Patch
M ui/events/ozone/evdev/keyboard_evdev.h View 1 2 chunks +5 lines, -4 lines 0 comments Download
M ui/events/ozone/evdev/keyboard_evdev.cc View 1 3 chunks +20 lines, -17 lines 0 comments Download

Messages

Total messages: 12 (5 generated)
spang
5 years, 8 months ago (2015-04-07 18:03:07 UTC) #2
alexst (slow to review)
lgtm with a nit. https://codereview.chromium.org/1052273006/diff/1/ui/events/ozone/evdev/keyboard_evdev.cc File ui/events/ozone/evdev/keyboard_evdev.cc (right): https://codereview.chromium.org/1052273006/diff/1/ui/events/ozone/evdev/keyboard_evdev.cc#newcode173 ui/events/ozone/evdev/keyboard_evdev.cc:173: DispatchKeyRepeat(repeat_key_); Probably worth just moving ...
5 years, 8 months ago (2015-04-07 18:20:58 UTC) #3
kpschoedel
LGTM 2.0
5 years, 8 months ago (2015-04-07 18:24:14 UTC) #4
spang
https://codereview.chromium.org/1052273006/diff/1/ui/events/ozone/evdev/keyboard_evdev.cc File ui/events/ozone/evdev/keyboard_evdev.cc (right): https://codereview.chromium.org/1052273006/diff/1/ui/events/ozone/evdev/keyboard_evdev.cc#newcode173 ui/events/ozone/evdev/keyboard_evdev.cc:173: DispatchKeyRepeat(repeat_key_); On 2015/04/07 18:20:58, alexst wrote: > Probably worth ...
5 years, 8 months ago (2015-04-07 18:28:50 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1052273006/20001
5 years, 8 months ago (2015-04-07 18:31:46 UTC) #10
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 8 months ago (2015-04-07 18:56:21 UTC) #11
commit-bot: I haz the power
5 years, 8 months ago (2015-04-07 18:57:53 UTC) #12
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/50e43d96539246fe55b282e5e161b12ed39c42eb
Cr-Commit-Position: refs/heads/master@{#324081}

Powered by Google App Engine
This is Rietveld 408576698