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

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

Issue 2849953003: Use the task scheduler for blocking tasks in the USB service on Linux (Closed)
Patch Set: Remove more passing of the SequencedTaskRunner Created 3 years, 7 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_android.cc ('k') | device/usb/usb_service_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 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
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
OLDNEW
« no previous file with comments | « device/usb/usb_service_android.cc ('k') | device/usb/usb_service_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698