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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_THREAD_EVDEV_H_
6 #define UI_EVENTS_OZONE_EVDEV_EVENT_THREAD_EVDEV_H_
7
8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h"
10
11 namespace base {
12 class Thread;
13 }
14
15 namespace ui {
16
17 class CursorDelegateEvdev;
18 class DeviceEventDispatcherEvdev;
19 class InputDeviceFactoryProxyEvdev;
20
21 typedef base::Callback<void(scoped_ptr<InputDeviceFactoryProxyEvdev>)>
22 EventThreadStartCallback;
23
24 // Wrapper for events thread.
25 class EventThreadEvdev {
26 public:
27 EventThreadEvdev();
28 ~EventThreadEvdev();
29
30 // Start a new events thread. All device events will get sent to the
31 // passed dispatcher. The thread will call directly into cursor, so it
32 // must be synchronized accordingly.
33 void Start(scoped_ptr<DeviceEventDispatcherEvdev> dispatcher,
34 CursorDelegateEvdev* cursor,
35 const EventThreadStartCallback& callback);
36
37 private:
38 // Post a task to dispatch an event.
39 scoped_ptr<base::Thread> thread_;
40
41 DISALLOW_COPY_AND_ASSIGN(EventThreadEvdev);
42 };
43
44 } // namespace ui
45
46 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_THREAD_EVDEV_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698