OLD | NEW |
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.h" | 5 #include "device/usb/usb_service.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 class UsbServiceImpl : public UsbService, | 31 class UsbServiceImpl : public UsbService, |
32 private base::MessageLoop::DestructionObserver { | 32 private base::MessageLoop::DestructionObserver { |
33 public: | 33 public: |
34 explicit UsbServiceImpl( | 34 explicit UsbServiceImpl( |
35 PlatformUsbContext context, | 35 PlatformUsbContext context, |
36 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 36 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
37 virtual ~UsbServiceImpl(); | 37 virtual ~UsbServiceImpl(); |
38 | 38 |
39 private: | 39 private: |
40 // device::UsbService implementation | 40 // device::UsbService implementation |
41 virtual scoped_refptr<UsbDevice> GetDeviceById(uint32 unique_id) OVERRIDE; | 41 virtual scoped_refptr<UsbDevice> GetDeviceById(uint32 unique_id) override; |
42 virtual void GetDevices( | 42 virtual void GetDevices( |
43 std::vector<scoped_refptr<UsbDevice> >* devices) OVERRIDE; | 43 std::vector<scoped_refptr<UsbDevice> >* devices) override; |
44 | 44 |
45 // base::MessageLoop::DestructionObserver implementation. | 45 // base::MessageLoop::DestructionObserver implementation. |
46 virtual void WillDestroyCurrentMessageLoop() OVERRIDE; | 46 virtual void WillDestroyCurrentMessageLoop() override; |
47 | 47 |
48 // Enumerate USB devices from OS and update devices_ map. | 48 // Enumerate USB devices from OS and update devices_ map. |
49 void RefreshDevices(); | 49 void RefreshDevices(); |
50 | 50 |
51 scoped_refptr<UsbContext> context_; | 51 scoped_refptr<UsbContext> context_; |
52 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 52 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
53 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 53 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
54 | 54 |
55 // TODO(reillyg): Figure out a better solution. | 55 // TODO(reillyg): Figure out a better solution. |
56 uint32 next_unique_id_; | 56 uint32 next_unique_id_; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 } | 198 } |
199 return instance; | 199 return instance; |
200 } | 200 } |
201 | 201 |
202 // static | 202 // static |
203 void UsbService::SetInstanceForTest(UsbService* instance) { | 203 void UsbService::SetInstanceForTest(UsbService* instance) { |
204 g_usb_service_instance.Get().reset(instance); | 204 g_usb_service_instance.Get().reset(instance); |
205 } | 205 } |
206 | 206 |
207 } // namespace device | 207 } // namespace device |
OLD | NEW |