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

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

Issue 1544323002: Convert Pass()→std::move() in //device (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 | « device/devices_app/usb/type_converters.cc ('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 "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/threading/thread_restrictions.h" 9 #include "base/threading/thread_restrictions.h"
10 #include "device/udev_linux/udev.h" 10 #include "device/udev_linux/udev.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 DCHECK(thread_checker_.CalledOnValidThread()); 82 DCHECK(thread_checker_.CalledOnValidThread());
83 if (observer) 83 if (observer)
84 observers_.RemoveObserver(observer); 84 observers_.RemoveObserver(observer);
85 } 85 }
86 86
87 ScopedUdevDevicePtr DeviceMonitorLinux::GetDeviceFromPath( 87 ScopedUdevDevicePtr DeviceMonitorLinux::GetDeviceFromPath(
88 const std::string& path) { 88 const std::string& path) {
89 DCHECK(thread_checker_.CalledOnValidThread()); 89 DCHECK(thread_checker_.CalledOnValidThread());
90 ScopedUdevDevicePtr device( 90 ScopedUdevDevicePtr device(
91 udev_device_new_from_syspath(udev_.get(), path.c_str())); 91 udev_device_new_from_syspath(udev_.get(), path.c_str()));
92 return device.Pass(); 92 return device;
93 } 93 }
94 94
95 void DeviceMonitorLinux::Enumerate(const EnumerateCallback& callback) { 95 void DeviceMonitorLinux::Enumerate(const EnumerateCallback& callback) {
96 DCHECK(thread_checker_.CalledOnValidThread()); 96 DCHECK(thread_checker_.CalledOnValidThread());
97 ScopedUdevEnumeratePtr enumerate(udev_enumerate_new(udev_.get())); 97 ScopedUdevEnumeratePtr enumerate(udev_enumerate_new(udev_.get()));
98 98
99 if (!enumerate) { 99 if (!enumerate) {
100 LOG(ERROR) << "Failed to enumerate devices."; 100 LOG(ERROR) << "Failed to enumerate devices.";
101 return; 101 return;
102 } 102 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 void DeviceMonitorLinux::OnFileCanWriteWithoutBlocking(int fd) {} 140 void DeviceMonitorLinux::OnFileCanWriteWithoutBlocking(int fd) {}
141 141
142 DeviceMonitorLinux::~DeviceMonitorLinux() { 142 DeviceMonitorLinux::~DeviceMonitorLinux() {
143 DCHECK(thread_checker_.CalledOnValidThread()); 143 DCHECK(thread_checker_.CalledOnValidThread());
144 base::MessageLoop::current()->RemoveDestructionObserver(this); 144 base::MessageLoop::current()->RemoveDestructionObserver(this);
145 monitor_watcher_.StopWatchingFileDescriptor(); 145 monitor_watcher_.StopWatchingFileDescriptor();
146 close(monitor_fd_); 146 close(monitor_fd_);
147 } 147 }
148 148
149 } // namespace device 149 } // namespace device
OLDNEW
« no previous file with comments | « device/devices_app/usb/type_converters.cc ('k') | device/hid/hid_connection_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698