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

Side by Side Diff: ui/events/ozone/event_converter_ozone.h

Issue 144233006: evdev: Fix infinite loop when devices are unplugged (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_EVENTS_OZONE_EVENT_CONVERTER_OZONE_H_ 5 #ifndef UI_EVENTS_OZONE_EVENT_CONVERTER_OZONE_H_
6 #define UI_EVENTS_OZONE_EVENT_CONVERTER_OZONE_H_ 6 #define UI_EVENTS_OZONE_EVENT_CONVERTER_OZONE_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_pump_libevent.h"
10 #include "ui/events/events_export.h" 9 #include "ui/events/events_export.h"
11 10
12 namespace ui { 11 namespace ui {
13 class Event; 12 class Event;
14 13
15 // In ozone, Chrome reads events from file descriptors created from Linux device 14 // Ozone implementations can generate input events in whatever way is
16 // drivers. The |MessagePumpLibevent::Watcher| parent class provides the 15 // appropriate for the platform.
17 // functionality to watch a file descriptor for the arrival of new data and 16 // This class provides the functionality needed in common across all
18 // notify its subclasses. Device-specific event converters turn bytes read from 17 // converters: dispatching the |ui::Event| to aura.
19 // the file descriptor into |ui::Event| instances. This class provides the 18 class EVENTS_EXPORT EventConverterOzone {
20 // functionality needed in common across all converters: dispatching the
21 // |ui::Event| to aura.
22 class EVENTS_EXPORT EventConverterOzone
23 : public base::MessagePumpLibevent::Watcher {
24 public: 19 public:
25 EventConverterOzone(); 20 EventConverterOzone();
26 virtual ~EventConverterOzone(); 21 virtual ~EventConverterOzone();
27 22
23 // Start processing events.
rjkroege 2014/01/27 19:03:16 Is it re-startable? I.e.: would one ever call Stop
24 virtual void Start() = 0;
25
26 // Stop processing events.
27 virtual void Stop() = 0;
28
28 protected: 29 protected:
29 // Subclasses should use this method to post a task that will dispatch 30 // Subclasses should use this method to post a task that will dispatch
30 // |event| from the UI message loop. This method takes ownership of 31 // |event| from the UI message loop. This method takes ownership of
31 // |event|. |event| will be deleted at the end of the posted task. 32 // |event|. |event| will be deleted at the end of the posted task.
32 virtual void DispatchEvent(scoped_ptr<ui::Event> event); 33 virtual void DispatchEvent(scoped_ptr<ui::Event> event);
33 34
34 private: 35 private:
35 DISALLOW_COPY_AND_ASSIGN(EventConverterOzone); 36 DISALLOW_COPY_AND_ASSIGN(EventConverterOzone);
36 }; 37 };
37 38
38 } // namespace ui 39 } // namespace ui
39 40
40 #endif // UI_EVENTS_OZONE_EVENT_CONVERTER_OZONE_H_ 41 #endif // UI_EVENTS_OZONE_EVENT_CONVERTER_OZONE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698