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

Unified Diff: ui/events/ozone/evdev/event_factory.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/evdev/event_factory.h ('k') | ui/events/ozone/evdev/key_event_converter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/event_factory.cc
diff --git a/ui/events/ozone/evdev/event_factory.cc b/ui/events/ozone/evdev/event_factory.cc
index 95f86a396e922685bb8e62582ad7cf0f13627a5a..8cd0d6371eabf7b8848b3909dc424bbf3227f1fd 100644
--- a/ui/events/ozone/evdev/event_factory.cc
+++ b/ui/events/ozone/evdev/event_factory.cc
@@ -12,6 +12,7 @@
#include "base/debug/trace_event.h"
#include "base/files/file_enumerator.h"
+#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
#include "base/threading/thread_restrictions.h"
#include "ui/events/ozone/evdev/event_device_info.h"
@@ -39,7 +40,7 @@ bool IsTouchScreen(const EventDeviceInfo& devinfo) {
EventFactoryEvdev::EventFactoryEvdev() {}
-EventFactoryEvdev::~EventFactoryEvdev() {}
+EventFactoryEvdev::~EventFactoryEvdev() { STLDeleteValues(&converters_); }
void EventFactoryEvdev::AttachInputDevice(const base::FilePath& path) {
TRACE_EVENT1("ozone", "AttachInputDevice", "path", path.value());
@@ -71,7 +72,7 @@ void EventFactoryEvdev::AttachInputDevice(const base::FilePath& path) {
converter.reset(new KeyEventConverterEvdev(fd, path, &modifiers_));
if (converter) {
- AddEventConverter(fd, converter.Pass());
+ converters_[path] = converter.release();
} else {
close(fd);
}
« no previous file with comments | « ui/events/ozone/evdev/event_factory.h ('k') | ui/events/ozone/evdev/key_event_converter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698