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

Unified Diff: ui/events/ozone/evdev/event_factory_evdev.cc

Issue 882503002: [PATCH 9.2/11] ozone: evdev: Use DeviceEventDispatcherEvdev from InputInjectorEvdev (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/events/ozone/evdev/input_injector_evdev.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/event_factory_evdev.cc
diff --git a/ui/events/ozone/evdev/event_factory_evdev.cc b/ui/events/ozone/evdev/event_factory_evdev.cc
index bee96cd1a39d423642fdadf22d8b7565ab75508c..8b148a3c898267aab18f4a2ef6c73c39a44e5c76 100644
--- a/ui/events/ozone/evdev/event_factory_evdev.cc
+++ b/ui/events/ozone/evdev/event_factory_evdev.cc
@@ -144,8 +144,13 @@ void EventFactoryEvdev::Init() {
}
scoped_ptr<SystemInputInjector> EventFactoryEvdev::CreateSystemInputInjector() {
- return make_scoped_ptr(new InputInjectorEvdev(
- &modifiers_, cursor_, &keyboard_, dispatch_callback_));
+ // Use forwarding dispatcher for the injector rather than dispatching
+ // directly. We cannot assume it is safe to (re-)enter ui::Event dispatch
+ // synchronously from the injection point.
+ scoped_ptr<DeviceEventDispatcherEvdev> dispatcher(
+ new ProxyDeviceEventDispatcher(base::ThreadTaskRunnerHandle::Get(),
+ weak_ptr_factory_.GetWeakPtr()));
+ return make_scoped_ptr(new InputInjectorEvdev(dispatcher.Pass(), cursor_));
}
void EventFactoryEvdev::DispatchKeyEvent(const KeyEventParams& params) {
« no previous file with comments | « no previous file | ui/events/ozone/evdev/input_injector_evdev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698