OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef DEVICE_USB_USB_DEVICE_WIN_H_ |
| 6 #define DEVICE_USB_USB_DEVICE_WIN_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/threading/thread_checker.h" |
| 12 #include "device/usb/usb_device.h" |
| 13 |
| 14 namespace base { |
| 15 class SequencedTaskRunner; |
| 16 } |
| 17 |
| 18 namespace device { |
| 19 |
| 20 class UsbDeviceWin : public UsbDevice { |
| 21 public: |
| 22 // UsbDevice implementation: |
| 23 void Open(const OpenCallback& callback) override; |
| 24 |
| 25 protected: |
| 26 friend class UsbServiceWin; |
| 27 friend class UsbDeviceHandleWin; |
| 28 |
| 29 // Called by UsbServiceWin only; |
| 30 UsbDeviceWin(const std::string& device_path, |
| 31 const std::string& hub_path, |
| 32 int port_number, |
| 33 scoped_refptr<base::SequencedTaskRunner> task_runner); |
| 34 |
| 35 ~UsbDeviceWin() override; |
| 36 |
| 37 const std::string& device_path() const { return device_path_; } |
| 38 int port_number() const { return port_number_; } |
| 39 |
| 40 private: |
| 41 base::ThreadChecker thread_checker_; |
| 42 |
| 43 const std::string device_path_; |
| 44 const std::string hub_path_; |
| 45 const int port_number_; |
| 46 |
| 47 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| 48 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(UsbDeviceWin); |
| 51 }; |
| 52 |
| 53 } // namespace device |
| 54 |
| 55 #endif // DEVICE_USB_USB_DEVICE_WIN_H_ |
OLD | NEW |