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

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

Issue 1314273002: Manage UsbService lifetime in DeviceClient implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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_service.cc ('k') | device/usb/usb_service_impl.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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.h" 5 #include "device/usb/usb_service.h"
6 6
7 #include <map> 7 #include <map>
8 #include <queue> 8 #include <queue>
9 #include <set> 9 #include <set>
10 10
(...skipping 21 matching lines...) Expand all
32 typedef struct libusb_context* PlatformUsbContext; 32 typedef struct libusb_context* PlatformUsbContext;
33 33
34 class UsbServiceImpl : 34 class UsbServiceImpl :
35 #if defined(OS_WIN) 35 #if defined(OS_WIN)
36 public DeviceMonitorWin::Observer, 36 public DeviceMonitorWin::Observer,
37 #endif // OS_WIN 37 #endif // OS_WIN
38 public UsbService { 38 public UsbService {
39 public: 39 public:
40 explicit UsbServiceImpl( 40 explicit UsbServiceImpl(
41 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner); 41 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner);
42 ~UsbServiceImpl() override;
42 43
43 private: 44 private:
44 ~UsbServiceImpl() override;
45
46 // device::UsbService implementation 45 // device::UsbService implementation
47 scoped_refptr<UsbDevice> GetDevice(const std::string& guid) override; 46 scoped_refptr<UsbDevice> GetDevice(const std::string& guid) override;
48 void GetDevices(const GetDevicesCallback& callback) override; 47 void GetDevices(const GetDevicesCallback& callback) override;
49 48
50 #if defined(OS_WIN) 49 #if defined(OS_WIN)
51 // device::DeviceMonitorWin::Observer implementation 50 // device::DeviceMonitorWin::Observer implementation
52 void OnDeviceAdded(const GUID& class_guid, 51 void OnDeviceAdded(const GUID& class_guid,
53 const std::string& device_path) override; 52 const std::string& device_path) override;
54 void OnDeviceRemoved(const GUID& class_guid, 53 void OnDeviceRemoved(const GUID& class_guid,
55 const std::string& device_path) override; 54 const std::string& device_path) override;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 #if defined(OS_WIN) 108 #if defined(OS_WIN)
110 ScopedObserver<DeviceMonitorWin, DeviceMonitorWin::Observer> device_observer_; 109 ScopedObserver<DeviceMonitorWin, DeviceMonitorWin::Observer> device_observer_;
111 #endif // OS_WIN 110 #endif // OS_WIN
112 111
113 base::WeakPtrFactory<UsbServiceImpl> weak_factory_; 112 base::WeakPtrFactory<UsbServiceImpl> weak_factory_;
114 113
115 DISALLOW_COPY_AND_ASSIGN(UsbServiceImpl); 114 DISALLOW_COPY_AND_ASSIGN(UsbServiceImpl);
116 }; 115 };
117 116
118 } // namespace device 117 } // namespace device
OLDNEW
« no previous file with comments | « device/usb/usb_service.cc ('k') | device/usb/usb_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698