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

Side by Side Diff: device/usb/usb_service_impl.cc

Issue 2108923002: device: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: device Created 4 years, 5 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/usb/usb_device_handle_usbfs.cc ('k') | device/vr/test/fake_vr_device_provider.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/usb/usb_service_impl.h" 5 #include "device/usb/usb_service_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <list> 9 #include <list>
10 #include <memory> 10 #include <memory>
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 DeviceMonitorWin* device_monitor = DeviceMonitorWin::GetForAllInterfaces(); 229 DeviceMonitorWin* device_monitor = DeviceMonitorWin::GetForAllInterfaces();
230 if (device_monitor) { 230 if (device_monitor) {
231 device_observer_.Add(device_monitor); 231 device_observer_.Add(device_monitor);
232 } 232 }
233 #endif // OS_WIN 233 #endif // OS_WIN
234 } 234 }
235 235
236 UsbServiceImpl::~UsbServiceImpl() { 236 UsbServiceImpl::~UsbServiceImpl() {
237 if (hotplug_enabled_) 237 if (hotplug_enabled_)
238 libusb_hotplug_deregister_callback(context_->context(), hotplug_handle_); 238 libusb_hotplug_deregister_callback(context_->context(), hotplug_handle_);
239 for (const auto& platform_device : ignored_devices_) 239 for (auto* platform_device : ignored_devices_)
240 libusb_unref_device(platform_device); 240 libusb_unref_device(platform_device);
241 } 241 }
242 242
243 void UsbServiceImpl::GetDevices(const GetDevicesCallback& callback) { 243 void UsbServiceImpl::GetDevices(const GetDevicesCallback& callback) {
244 DCHECK(CalledOnValidThread()); 244 DCHECK(CalledOnValidThread());
245 245
246 if (!context_) { 246 if (!context_) {
247 task_runner()->PostTask( 247 task_runner()->PostTask(
248 FROM_HERE, 248 FROM_HERE,
249 base::Bind(callback, std::vector<scoped_refptr<UsbDevice>>())); 249 base::Bind(callback, std::vector<scoped_refptr<UsbDevice>>()));
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 } 535 }
536 536
537 void UsbServiceImpl::EnumerationFailed(PlatformUsbDevice platform_device, 537 void UsbServiceImpl::EnumerationFailed(PlatformUsbDevice platform_device,
538 const base::Closure& refresh_complete) { 538 const base::Closure& refresh_complete) {
539 libusb_ref_device(platform_device); 539 libusb_ref_device(platform_device);
540 ignored_devices_.insert(platform_device); 540 ignored_devices_.insert(platform_device);
541 refresh_complete.Run(); 541 refresh_complete.Run();
542 } 542 }
543 543
544 } // namespace device 544 } // namespace device
OLDNEW
« no previous file with comments | « device/usb/usb_device_handle_usbfs.cc ('k') | device/vr/test/fake_vr_device_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698