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

Unified Diff: ui/events/ozone/evdev/event_thread_evdev.h

Issue 873833002: [PATCH 11/11] ozone: evdev: Add dedicated events thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates for events_unittests 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
Index: ui/events/ozone/evdev/event_thread_evdev.h
diff --git a/ui/events/ozone/evdev/event_thread_evdev.h b/ui/events/ozone/evdev/event_thread_evdev.h
new file mode 100644
index 0000000000000000000000000000000000000000..75116a80a1b39f2a0ce481e30799c8233c292a9b
--- /dev/null
+++ b/ui/events/ozone/evdev/event_thread_evdev.h
@@ -0,0 +1,46 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_EVENTS_OZONE_EVDEV_EVENT_THREAD_EVDEV_H_
+#define UI_EVENTS_OZONE_EVDEV_EVENT_THREAD_EVDEV_H_
+
+#include "base/callback.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace base {
+class Thread;
+}
+
+namespace ui {
+
+class CursorDelegateEvdev;
+class DeviceEventDispatcherEvdev;
+class InputDeviceFactoryProxyEvdev;
+
+typedef base::Callback<void(scoped_ptr<InputDeviceFactoryProxyEvdev>)>
+ EventThreadStartCallback;
+
+// Wrapper for events thread.
+class EventThreadEvdev {
+ public:
+ EventThreadEvdev();
+ ~EventThreadEvdev();
+
+ // Start a new events thread. All device events will get sent to the
+ // passed dispatcher. The thread will call directly into cursor, so it
+ // must be synchronized accordingly.
+ void Start(scoped_ptr<DeviceEventDispatcherEvdev> dispatcher,
+ CursorDelegateEvdev* cursor,
+ const EventThreadStartCallback& callback);
+
+ private:
+ // Post a task to dispatch an event.
+ scoped_ptr<base::Thread> thread_;
+
+ DISALLOW_COPY_AND_ASSIGN(EventThreadEvdev);
+};
+
+} // namespace ui
+
+#endif // UI_EVENTS_OZONE_EVDEV_EVENT_THREAD_EVDEV_H_

Powered by Google App Engine
This is Rietveld 408576698