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

Unified Diff: ui/events/ozone/evdev/event_converter.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/events/ozone/evdev/event_converter.cc » ('j') | ui/events/ozone/event_converter_ozone.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/event_converter.h
diff --git a/ui/events/ozone/evdev/event_converter.h b/ui/events/ozone/evdev/event_converter.h
index 8aab7cdc455c3ecf6353eaf485375a3fab4a9880..4b68fb9a476fac365852cdfe90b32827f2185e03 100644
--- a/ui/events/ozone/evdev/event_converter.h
+++ b/ui/events/ozone/evdev/event_converter.h
@@ -16,7 +16,8 @@ struct input_event;
namespace ui {
-class EVENTS_EXPORT EventConverterEvdev : public EventConverterOzone {
+class EVENTS_EXPORT EventConverterEvdev : public EventConverterOzone,
+ base::MessagePumpLibevent::Watcher {
public:
EventConverterEvdev(int fd,
base::FilePath path,
@@ -27,6 +28,10 @@ class EVENTS_EXPORT EventConverterEvdev : public EventConverterOzone {
virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE;
+ // Overridden from EventConverterOzone.
+ void Start() OVERRIDE;
+ void Stop() OVERRIDE;
+
protected:
// Process & dispatch events read from the device.
virtual void ProcessEvents(const struct input_event* inputs, int count) = 0;
@@ -40,6 +45,9 @@ class EVENTS_EXPORT EventConverterEvdev : public EventConverterOzone {
// Shared modifier state.
EventModifiersEvdev* modifiers_;
+ // Controller for watching the input fd.
+ base::MessagePumpLibevent::FileDescriptorWatcher controller_;
+
private:
DISALLOW_COPY_AND_ASSIGN(EventConverterEvdev);
};
« no previous file with comments | « no previous file | ui/events/ozone/evdev/event_converter.cc » ('j') | ui/events/ozone/event_converter_ozone.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698