| OLD | NEW |
| 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "device/base/device_client.h" | 8 #include "device/base/device_client.h" |
| 9 | 9 |
| 10 namespace base { | 10 namespace base { |
| 11 class SingleThreadTaskRunner; | 11 class SingleThreadTaskRunner; |
| 12 } | 12 } |
| 13 | 13 |
| 14 namespace device { | 14 namespace device { |
| 15 | 15 |
| 16 class HidService; | 16 class HidService; |
| 17 class UsbService; | 17 class UsbService; |
| 18 | 18 |
| 19 class TestDeviceClient : public DeviceClient { | 19 class TestDeviceClient : public DeviceClient { |
| 20 public: | 20 public: |
| 21 TestDeviceClient(scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 21 TestDeviceClient(scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
| 22 |
| 23 // Must be destroyed when tasks can still be posted to |task_runner|. |
| 22 ~TestDeviceClient() override; | 24 ~TestDeviceClient() override; |
| 23 | 25 |
| 24 HidService* GetHidService() override; | 26 HidService* GetHidService() override; |
| 25 UsbService* GetUsbService() override; | 27 UsbService* GetUsbService() override; |
| 26 | 28 |
| 27 private: | 29 private: |
| 28 std::unique_ptr<HidService> hid_service_; | 30 std::unique_ptr<HidService> hid_service_; |
| 29 std::unique_ptr<UsbService> usb_service_; | 31 std::unique_ptr<UsbService> usb_service_; |
| 30 scoped_refptr<base::SingleThreadTaskRunner> blocking_task_runner_; | 32 scoped_refptr<base::SingleThreadTaskRunner> blocking_task_runner_; |
| 31 }; | 33 }; |
| 32 | 34 |
| 33 } // namespace device | 35 } // namespace device |
| OLD | NEW |