OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <list> | 5 #include <list> |
6 #include <memory> | 6 #include <memory> |
7 #include <unordered_map> | 7 #include <unordered_map> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "device/usb/usb_service.h" | 11 #include "device/usb/usb_service.h" |
12 | 12 |
13 namespace base { | |
14 class SequencedTaskRunner; | |
15 } | |
16 | |
17 namespace device { | 13 namespace device { |
18 | 14 |
19 struct UsbDeviceDescriptor; | 15 struct UsbDeviceDescriptor; |
20 class UsbDeviceLinux; | 16 class UsbDeviceLinux; |
21 | 17 |
22 class UsbServiceLinux : public UsbService { | 18 class UsbServiceLinux : public UsbService { |
23 public: | 19 public: |
24 explicit UsbServiceLinux( | 20 UsbServiceLinux(); |
25 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_in); | |
26 ~UsbServiceLinux() override; | 21 ~UsbServiceLinux() override; |
27 | 22 |
28 // device::UsbService implementation | 23 // device::UsbService implementation |
29 void Shutdown() override; | 24 void Shutdown() override; |
30 void GetDevices(const GetDevicesCallback& callback) override; | 25 void GetDevices(const GetDevicesCallback& callback) override; |
31 | 26 |
32 private: | 27 private: |
33 using DeviceMap = | 28 using DeviceMap = |
34 std::unordered_map<std::string, scoped_refptr<UsbDeviceLinux>>; | 29 std::unordered_map<std::string, scoped_refptr<UsbDeviceLinux>>; |
35 | 30 |
(...skipping 24 matching lines...) Expand all Loading... |
60 | 55 |
61 std::unique_ptr<FileThreadHelper> helper_; | 56 std::unique_ptr<FileThreadHelper> helper_; |
62 DeviceMap devices_by_path_; | 57 DeviceMap devices_by_path_; |
63 | 58 |
64 base::WeakPtrFactory<UsbServiceLinux> weak_factory_; | 59 base::WeakPtrFactory<UsbServiceLinux> weak_factory_; |
65 | 60 |
66 DISALLOW_COPY_AND_ASSIGN(UsbServiceLinux); | 61 DISALLOW_COPY_AND_ASSIGN(UsbServiceLinux); |
67 }; | 62 }; |
68 | 63 |
69 } // namespace device | 64 } // namespace device |
OLD | NEW |