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

Side by Side Diff: ui/events/ozone/evdev/device_manager_udev.cc

Issue 231643005: ozone: Remove the libevent message-pump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 6 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "ui/events/ozone/evdev/device_manager_udev.h" 5 #include "ui/events/ozone/evdev/device_manager_udev.h"
6 6
7 #include <libudev.h> 7 #include <libudev.h>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/message_loop/message_pump_ozone.h"
13 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
14 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
15 #include "ui/events/ozone/evdev/device_manager_evdev.h" 14 #include "ui/events/ozone/evdev/device_manager_evdev.h"
16 #include "ui/events/ozone/evdev/event_factory_evdev.h" 15 #include "ui/events/ozone/evdev/event_factory_evdev.h"
17 #include "ui/events/ozone/evdev/scoped_udev.h" 16 #include "ui/events/ozone/evdev/scoped_udev.h"
18 17
19 namespace ui { 18 namespace ui {
20 19
21 namespace { 20 namespace {
22 21
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // Grab monitor socket. 181 // Grab monitor socket.
183 int fd = udev_monitor_get_fd(udev_monitor_.get()); 182 int fd = udev_monitor_get_fd(udev_monitor_.get());
184 if (fd < 0) 183 if (fd < 0)
185 return false; 184 return false;
186 185
187 // Save callbacks. 186 // Save callbacks.
188 device_added_ = device_added; 187 device_added_ = device_added;
189 device_removed_ = device_removed; 188 device_removed_ = device_removed;
190 189
191 // Watch for incoming events on monitor socket. 190 // Watch for incoming events on monitor socket.
192 return base::MessagePumpOzone::Current()->WatchFileDescriptor( 191 return base::MessageLoopForUI::current()->WatchFileDescriptor(
193 fd, true, base::MessagePumpOzone::WATCH_READ, &controller_, this); 192 fd, true, base::MessagePumpLibevent::WATCH_READ, &controller_, this);
194 } 193 }
195 194
196 // Udev daemon connection. 195 // Udev daemon connection.
197 scoped_udev udev_; 196 scoped_udev udev_;
198 197
199 // Udev device change monitor. 198 // Udev device change monitor.
200 scoped_udev_monitor udev_monitor_; 199 scoped_udev_monitor udev_monitor_;
201 200
202 // Callbacks for device changes. 201 // Callbacks for device changes.
203 EvdevDeviceCallback device_added_; 202 EvdevDeviceCallback device_added_;
204 EvdevDeviceCallback device_removed_; 203 EvdevDeviceCallback device_removed_;
205 204
206 // Watcher for uevent netlink socket. 205 // Watcher for uevent netlink socket.
207 base::MessagePumpLibevent::FileDescriptorWatcher controller_; 206 base::MessagePumpLibevent::FileDescriptorWatcher controller_;
208 207
209 DISALLOW_COPY_AND_ASSIGN(DeviceManagerUdev); 208 DISALLOW_COPY_AND_ASSIGN(DeviceManagerUdev);
210 }; 209 };
211 210
212 } // namespace 211 } // namespace
213 212
214 scoped_ptr<DeviceManagerEvdev> CreateDeviceManagerUdev() { 213 scoped_ptr<DeviceManagerEvdev> CreateDeviceManagerUdev() {
215 return make_scoped_ptr<DeviceManagerEvdev>(new DeviceManagerUdev()); 214 return make_scoped_ptr<DeviceManagerEvdev>(new DeviceManagerUdev());
216 } 215 }
217 216
218 } // namespace ui 217 } // namespace ui
OLDNEW
« no previous file with comments | « base/message_loop/message_pump_ozone.cc ('k') | ui/events/ozone/evdev/key_event_converter_evdev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698