| 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 #ifndef DEVICE_USB_USB_DEVICE_HANDLE_USBFS_H_ | 5 #ifndef DEVICE_USB_USB_DEVICE_HANDLE_USBFS_H_ |
| 6 #define DEVICE_USB_USB_DEVICE_HANDLE_USBFS_H_ | 6 #define DEVICE_USB_USB_DEVICE_HANDLE_USBFS_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 const UsbDeviceHandle::IsochronousTransferCallback& callback, | 130 const UsbDeviceHandle::IsochronousTransferCallback& callback, |
| 131 UsbTransferStatus status); | 131 UsbTransferStatus status); |
| 132 void SetUpTimeoutCallback(Transfer* transfer, unsigned int timeout); | 132 void SetUpTimeoutCallback(Transfer* transfer, unsigned int timeout); |
| 133 | 133 |
| 134 static void CancelTransfer(Transfer* transfer, UsbTransferStatus status); | 134 static void CancelTransfer(Transfer* transfer, UsbTransferStatus status); |
| 135 | 135 |
| 136 scoped_refptr<UsbDevice> device_; | 136 scoped_refptr<UsbDevice> device_; |
| 137 base::ScopedFD fd_; | 137 base::ScopedFD fd_; |
| 138 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 138 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 139 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 139 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
| 140 base::ThreadChecker thread_checker_; | |
| 141 | 140 |
| 142 // Maps claimed interfaces by interface number to their current alternate | 141 // Maps claimed interfaces by interface number to their current alternate |
| 143 // setting. | 142 // setting. |
| 144 std::map<uint8_t, InterfaceInfo> interfaces_; | 143 std::map<uint8_t, InterfaceInfo> interfaces_; |
| 145 | 144 |
| 146 // Maps endpoints (by endpoint address) to the interface they are a part of. | 145 // Maps endpoints (by endpoint address) to the interface they are a part of. |
| 147 // Only endpoints of currently claimed and selected interface alternates are | 146 // Only endpoints of currently claimed and selected interface alternates are |
| 148 // included in the map. | 147 // included in the map. |
| 149 std::map<uint8_t, EndpointInfo> endpoints_; | 148 std::map<uint8_t, EndpointInfo> endpoints_; |
| 150 | 149 |
| 151 // Helper object owned by the blocking task thread. It will be freed if that | 150 // Helper object owned by the blocking task thread. It will be freed if that |
| 152 // thread's message loop is destroyed but can also be freed by this class on | 151 // thread's message loop is destroyed but can also be freed by this class on |
| 153 // destruction. | 152 // destruction. |
| 154 FileThreadHelper* helper_; | 153 FileThreadHelper* helper_; |
| 155 | 154 |
| 156 std::list<std::unique_ptr<Transfer>> transfers_; | 155 std::list<std::unique_ptr<Transfer>> transfers_; |
| 157 }; | 156 }; |
| 158 | 157 |
| 159 } // namespace device | 158 } // namespace device |
| 160 | 159 |
| 161 #endif // DEVICE_USB_USB_DEVICE_HANDLE_USBFS_H_ | 160 #endif // DEVICE_USB_USB_DEVICE_HANDLE_USBFS_H_ |
| OLD | NEW |