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

Side by Side Diff: ui/events/ozone/event_factory_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_FACTORY_OZONE_H_ 5 #ifndef UI_EVENTS_OZONE_EVENT_FACTORY_OZONE_H_
6 #define UI_EVENTS_OZONE_EVENT_FACTORY_OZONE_H_ 6 #define UI_EVENTS_OZONE_EVENT_FACTORY_OZONE_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/message_loop/message_pump_libevent.h" 11 #include "base/message_loop/message_pump_libevent.h"
12 #include "ui/events/events_export.h" 12 #include "ui/events/events_export.h"
13 #include "ui/events/ozone/event_converter_ozone.h" 13 #include "ui/events/ozone/event_converter_ozone.h"
14 14
15 namespace ui { 15 namespace ui {
16 16
17 // Creates and dispatches |ui.Event|'s. Ozone assumes that events arrive on file 17 // Creates and dispatches |ui.Event|'s. Ozone assumes that events arrive on file
rjkroege 2014/01/27 19:03:16 You have convinced me that altering the assumption
18 // descriptors with one |EventConverterOzone| instance for each descriptor. 18 // descriptors with one |EventConverterOzone| instance for each descriptor.
19 // Ozone presumes that the set of file desctiprtors can vary at runtime so this 19 // Ozone presumes that the set of file desctiprtors can vary at runtime so this
20 // class supports dynamically adding and removing |EventConverterOzone| 20 // class supports dynamically adding and removing |EventConverterOzone|
21 // instances as necessary. 21 // instances as necessary.
22 class EVENTS_EXPORT EventFactoryOzone { 22 class EVENTS_EXPORT EventFactoryOzone {
23 public: 23 public:
24 EventFactoryOzone(); 24 EventFactoryOzone();
25 virtual ~EventFactoryOzone(); 25 virtual ~EventFactoryOzone();
26 26
27 // Called from WindowTreeHostOzone to initialize and start processing events. 27 // Called from WindowTreeHostOzone to initialize and start processing events.
(...skipping 13 matching lines...) Expand all
41 // Add an |EventConverterOzone| instances for the given file descriptor. 41 // Add an |EventConverterOzone| instances for the given file descriptor.
42 // Transfers ownership of the |EventConverterOzone| to this class. 42 // Transfers ownership of the |EventConverterOzone| to this class.
43 void AddEventConverter(int fd, scoped_ptr<EventConverterOzone> converter); 43 void AddEventConverter(int fd, scoped_ptr<EventConverterOzone> converter);
44 44
45 // Remote the |EventConverterOzone| 45 // Remote the |EventConverterOzone|
46 void RemoveEventConverter(int fd); 46 void RemoveEventConverter(int fd);
47 47
48 private: 48 private:
49 // |EventConverterOzone| for each file descriptor. 49 // |EventConverterOzone| for each file descriptor.
50 typedef EventConverterOzone* Converter; 50 typedef EventConverterOzone* Converter;
51 typedef base::MessagePumpLibevent::FileDescriptorWatcher* FDWatcher;
52 std::map<int, Converter> converters_; 51 std::map<int, Converter> converters_;
53 std::map<int, FDWatcher> watchers_;
54 52
55 static EventFactoryOzone* impl_; // not owned 53 static EventFactoryOzone* impl_; // not owned
56 54
57 DISALLOW_COPY_AND_ASSIGN(EventFactoryOzone); 55 DISALLOW_COPY_AND_ASSIGN(EventFactoryOzone);
58 }; 56 };
59 57
60 } // namespace ui 58 } // namespace ui
61 59
62 #endif // UI_EVENTS_OZONE_EVENT_FACTORY_OZONE_H_ 60 #endif // UI_EVENTS_OZONE_EVENT_FACTORY_OZONE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698