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

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

Issue 133233008: evdev: Move EventConverterOzone ownership from EventFactoryOzone to subclass (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unbreak events_unittests 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 | « ui/events/ozone/event_factory_ozone.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..409befde5b96e6fe7e6f912dfad1330d51d1a89c 100644
--- a/ui/events/ozone/event_factory_ozone.cc
+++ b/ui/events/ozone/event_factory_ozone.cc
@@ -6,7 +6,6 @@
#include "base/command_line.h"
#include "base/message_loop/message_pump_ozone.h"
-#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
#include "ui/events/event_switches.h"
@@ -17,11 +16,7 @@ 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_);
-}
+EventFactoryOzone::~EventFactoryOzone() {}
EventFactoryOzone* EventFactoryOzone::GetInstance() {
CHECK(impl_) << "No EventFactoryOzone implementation set.";
@@ -32,30 +27,4 @@ void EventFactoryOzone::SetInstance(EventFactoryOzone* impl) { impl_ = impl; }
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());
-
- 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);
-}
-
} // namespace ui
« no previous file with comments | « 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