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

Side by Side Diff: device/hid/device_monitor_linux.cc

Issue 674703002: Linux: Dynamically load libudev. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scoped_udev
Patch Set: rebase to head, which includes third_party/libudev already Created 6 years, 1 month 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 | « device/hid/BUILD.gn ('k') | device/hid/hid_connection_linux.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 "device/hid/device_monitor_linux.h" 5 #include "device/hid/device_monitor_linux.h"
6 6
7 #include <libudev.h>
8
9 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
10 #include "base/logging.h" 8 #include "base/logging.h"
11 #include "base/threading/thread_restrictions.h" 9 #include "base/threading/thread_restrictions.h"
10 #include "device/udev_linux/udev.h"
12 11
13 namespace device { 12 namespace device {
14 13
15 namespace { 14 namespace {
16 15
17 const char kUdevName[] = "udev"; 16 const char kUdevName[] = "udev";
18 const char kUdevActionAdd[] = "add"; 17 const char kUdevActionAdd[] = "add";
19 const char kUdevActionRemove[] = "remove"; 18 const char kUdevActionRemove[] = "remove";
20 19
21 // The instance will be reset when message loop destroys. 20 // The instance will be reset when message loop destroys.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 void DeviceMonitorLinux::OnFileCanWriteWithoutBlocking(int fd) {} 140 void DeviceMonitorLinux::OnFileCanWriteWithoutBlocking(int fd) {}
142 141
143 DeviceMonitorLinux::~DeviceMonitorLinux() { 142 DeviceMonitorLinux::~DeviceMonitorLinux() {
144 DCHECK(thread_checker_.CalledOnValidThread()); 143 DCHECK(thread_checker_.CalledOnValidThread());
145 base::MessageLoop::current()->RemoveDestructionObserver(this); 144 base::MessageLoop::current()->RemoveDestructionObserver(this);
146 monitor_watcher_.StopWatchingFileDescriptor(); 145 monitor_watcher_.StopWatchingFileDescriptor();
147 close(monitor_fd_); 146 close(monitor_fd_);
148 } 147 }
149 148
150 } // namespace device 149 } // namespace device
OLDNEW
« no previous file with comments | « device/hid/BUILD.gn ('k') | device/hid/hid_connection_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698