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

Unified Diff: ui/events/ozone/event_factory_ozone.cc

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
Index: ui/events/ozone/event_factory_ozone.cc
diff --git a/ui/events/ozone/event_factory_ozone.cc b/ui/events/ozone/event_factory_ozone.cc
index b051e21daeedbce91c9726a4c41415c1718793b1..9c832b7817b8d51dd10257cc05a4a6d04ff7e416 100644
--- a/ui/events/ozone/event_factory_ozone.cc
+++ b/ui/events/ozone/event_factory_ozone.cc
@@ -18,8 +18,6 @@ EventFactoryOzone* EventFactoryOzone::impl_ = NULL;
EventFactoryOzone::EventFactoryOzone() {}
EventFactoryOzone::~EventFactoryOzone() {
- // Always delete watchers before converters to prevent a possible race.
- STLDeleteValues<std::map<int, FDWatcher> >(&watchers_);
STLDeleteValues<std::map<int, Converter> >(&converters_);
}
@@ -35,26 +33,13 @@ void EventFactoryOzone::StartProcessingEvents() {}
void EventFactoryOzone::AddEventConverter(
int fd,
scoped_ptr<EventConverterOzone> converter) {
- CHECK(watchers_.count(fd) == 0 && converters_.count(fd) == 0);
-
- FDWatcher watcher = new base::MessagePumpLibevent::FileDescriptorWatcher();
-
- base::MessagePumpOzone::Current()->WatchFileDescriptor(
- fd,
- true,
- base::MessagePumpLibevent::WATCH_READ,
- watcher,
- converter.get());
-
+ CHECK_EQ(converters_.count(fd), 0);
+ converter->Start();
converters_[fd] = converter.release();
- watchers_[fd] = watcher;
}
void EventFactoryOzone::RemoveEventConverter(int fd) {
- // Always delete watchers before converters to prevent a possible race.
- delete watchers_[fd];
delete converters_[fd];
- watchers_.erase(fd);
converters_.erase(fd);
}
« ui/events/ozone/event_factory_ozone.h ('K') | « ui/events/ozone/event_factory_ozone.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698