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

Unified Diff: ui/events/ozone/evdev/event_converter_evdev_impl.cc

Issue 2657533008: Merge "Fix double-close in EventConverterEvdevImpl" (Closed)
Patch Set: Created 3 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/evdev/event_converter_evdev_impl.cc
diff --git a/ui/events/ozone/evdev/event_converter_evdev_impl.cc b/ui/events/ozone/evdev/event_converter_evdev_impl.cc
index 5da4f6b966934f9aeb3e49deb4dea75dfb5495cb..ca6fda55b2c92662a38a42a15a0fa3fe0152141d 100644
--- a/ui/events/ozone/evdev/event_converter_evdev_impl.cc
+++ b/ui/events/ozone/evdev/event_converter_evdev_impl.cc
@@ -15,6 +15,7 @@
#include "ui/events/keycodes/dom/keycode_converter.h"
#include "ui/events/ozone/evdev/device_event_dispatcher_evdev.h"
#include "ui/events/ozone/evdev/keyboard_util_evdev.h"
+#include "ui/events/ozone/evdev/scoped_input_device.h"
namespace ui {
@@ -30,29 +31,28 @@ const int kSwitchStylusInserted = 15;
} // namespace
EventConverterEvdevImpl::EventConverterEvdevImpl(
- int fd,
+ ScopedInputDevice fd,
base::FilePath path,
int id,
const EventDeviceInfo& devinfo,
CursorDelegateEvdev* cursor,
DeviceEventDispatcherEvdev* dispatcher)
- : EventConverterEvdev(fd,
+ : EventConverterEvdev(fd.get(),
path,
id,
devinfo.device_type(),
devinfo.name(),
devinfo.vendor_id(),
devinfo.product_id()),
+ input_device_fd_(std::move(fd)),
has_keyboard_(devinfo.HasKeyboard()),
has_touchpad_(devinfo.HasTouchpad()),
has_caps_lock_led_(devinfo.HasLedEvent(LED_CAPSL)),
cursor_(cursor),
- dispatcher_(dispatcher) {
-}
+ dispatcher_(dispatcher) {}
EventConverterEvdevImpl::~EventConverterEvdevImpl() {
DCHECK(!enabled_);
- close(fd_);
}
void EventConverterEvdevImpl::OnFileCanReadWithoutBlocking(int fd) {
« no previous file with comments | « ui/events/ozone/evdev/event_converter_evdev_impl.h ('k') | ui/events/ozone/evdev/event_converter_evdev_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698