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

Side by Side Diff: ui/events/ozone/device/udev/device_manager_udev.cc

Issue 2695593009: Use the location where FileDescriptorWatcher is created to track the libevent handlers (Closed)
Patch Set: fix mac. Created 3 years, 10 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
« no previous file with comments | « net/socket/udp_socket_posix.cc ('k') | ui/events/ozone/evdev/event_converter_evdev.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/device/udev/device_manager_udev.h" 5 #include "ui/events/ozone/device/udev/device_manager_udev.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 LOG(ERROR) << "Failed to start receiving events from udev"; 75 LOG(ERROR) << "Failed to start receiving events from udev";
76 } else { 76 } else {
77 LOG(ERROR) << "Failed to create udev monitor"; 77 LOG(ERROR) << "Failed to create udev monitor";
78 } 78 }
79 79
80 return device::ScopedUdevMonitorPtr(monitor); 80 return device::ScopedUdevMonitorPtr(monitor);
81 } 81 }
82 82
83 } // namespace 83 } // namespace
84 84
85 DeviceManagerUdev::DeviceManagerUdev() : udev_(UdevCreate()) { 85 DeviceManagerUdev::DeviceManagerUdev()
86 } 86 : udev_(UdevCreate()), controller_(FROM_HERE) {}
87 87
88 DeviceManagerUdev::~DeviceManagerUdev() { 88 DeviceManagerUdev::~DeviceManagerUdev() {
89 } 89 }
90 90
91 void DeviceManagerUdev::CreateMonitor() { 91 void DeviceManagerUdev::CreateMonitor() {
92 if (monitor_) 92 if (monitor_)
93 return; 93 return;
94 monitor_ = UdevCreateMonitor(udev_.get()); 94 monitor_ = UdevCreateMonitor(udev_.get());
95 if (monitor_) { 95 if (monitor_) {
96 int fd = device::udev_monitor_get_fd(monitor_.get()); 96 int fd = device::udev_monitor_get_fd(monitor_.get());
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 else if (!strcmp(action, "change")) 185 else if (!strcmp(action, "change"))
186 action_type = DeviceEvent::CHANGE; 186 action_type = DeviceEvent::CHANGE;
187 else 187 else
188 return nullptr; 188 return nullptr;
189 189
190 return base::MakeUnique<DeviceEvent>(device_type, action_type, 190 return base::MakeUnique<DeviceEvent>(device_type, action_type,
191 base::FilePath(path)); 191 base::FilePath(path));
192 } 192 }
193 193
194 } // namespace ui 194 } // namespace ui
OLDNEW
« no previous file with comments | « net/socket/udp_socket_posix.cc ('k') | ui/events/ozone/evdev/event_converter_evdev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698