| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 const ResultCallback& callback) override; | 43 const ResultCallback& callback) override; |
| 44 void ClaimInterface(int interface_number, | 44 void ClaimInterface(int interface_number, |
| 45 const ResultCallback& callback) override; | 45 const ResultCallback& callback) override; |
| 46 void ReleaseInterface(int interface_number, | 46 void ReleaseInterface(int interface_number, |
| 47 const ResultCallback& callback) override; | 47 const ResultCallback& callback) override; |
| 48 void SetInterfaceAlternateSetting(int interface_number, | 48 void SetInterfaceAlternateSetting(int interface_number, |
| 49 int alternate_setting, | 49 int alternate_setting, |
| 50 const ResultCallback& callback) override; | 50 const ResultCallback& callback) override; |
| 51 void ResetDevice(const ResultCallback& callback) override; | 51 void ResetDevice(const ResultCallback& callback) override; |
| 52 void ClearHalt(uint8_t endpoint, const ResultCallback& callback) override; | 52 void ClearHalt(uint8_t endpoint, const ResultCallback& callback) override; |
| 53 void ControlTransfer(UsbEndpointDirection direction, | 53 void ControlTransfer(UsbTransferDirection direction, |
| 54 TransferRequestType request_type, | 54 UsbControlTransferType request_type, |
| 55 TransferRecipient recipient, | 55 UsbControlTransferRecipient recipient, |
| 56 uint8_t request, | 56 uint8_t request, |
| 57 uint16_t value, | 57 uint16_t value, |
| 58 uint16_t index, | 58 uint16_t index, |
| 59 scoped_refptr<net::IOBuffer> buffer, | 59 scoped_refptr<net::IOBuffer> buffer, |
| 60 size_t length, | 60 size_t length, |
| 61 unsigned int timeout, | 61 unsigned int timeout, |
| 62 const TransferCallback& callback) override; | 62 const TransferCallback& callback) override; |
| 63 void IsochronousTransferIn( | 63 void IsochronousTransferIn( |
| 64 uint8_t endpoint_number, | 64 uint8_t endpoint_number, |
| 65 const std::vector<uint32_t>& packet_lengths, | 65 const std::vector<uint32_t>& packet_lengths, |
| 66 unsigned int timeout, | 66 unsigned int timeout, |
| 67 const IsochronousTransferCallback& callback) override; | 67 const IsochronousTransferCallback& callback) override; |
| 68 void IsochronousTransferOut( | 68 void IsochronousTransferOut( |
| 69 uint8_t endpoint_number, | 69 uint8_t endpoint_number, |
| 70 scoped_refptr<net::IOBuffer> buffer, | 70 scoped_refptr<net::IOBuffer> buffer, |
| 71 const std::vector<uint32_t>& packet_lengths, | 71 const std::vector<uint32_t>& packet_lengths, |
| 72 unsigned int timeout, | 72 unsigned int timeout, |
| 73 const IsochronousTransferCallback& callback) override; | 73 const IsochronousTransferCallback& callback) override; |
| 74 // To support DevTools this function may be called from any thread and on | 74 // To support DevTools this function may be called from any thread and on |
| 75 // completion |callback| will be run on that thread. | 75 // completion |callback| will be run on that thread. |
| 76 void GenericTransfer(UsbEndpointDirection direction, | 76 void GenericTransfer(UsbTransferDirection direction, |
| 77 uint8_t endpoint_number, | 77 uint8_t endpoint_number, |
| 78 scoped_refptr<net::IOBuffer> buffer, | 78 scoped_refptr<net::IOBuffer> buffer, |
| 79 size_t length, | 79 size_t length, |
| 80 unsigned int timeout, | 80 unsigned int timeout, |
| 81 const TransferCallback& callback) override; | 81 const TransferCallback& callback) override; |
| 82 const UsbInterfaceDescriptor* FindInterfaceByEndpoint( | 82 const UsbInterfaceDescriptor* FindInterfaceByEndpoint( |
| 83 uint8_t endpoint_address) override; | 83 uint8_t endpoint_address) override; |
| 84 | 84 |
| 85 protected: | 85 protected: |
| 86 ~UsbDeviceHandleUsbfs() override; | 86 ~UsbDeviceHandleUsbfs() override; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 112 const ResultCallback& callback); | 112 const ResultCallback& callback); |
| 113 void ReleaseInterfaceComplete(int interface_number, | 113 void ReleaseInterfaceComplete(int interface_number, |
| 114 const ResultCallback& callback); | 114 const ResultCallback& callback); |
| 115 void IsochronousTransferInternal(uint8_t endpoint_address, | 115 void IsochronousTransferInternal(uint8_t endpoint_address, |
| 116 scoped_refptr<net::IOBuffer> buffer, | 116 scoped_refptr<net::IOBuffer> buffer, |
| 117 size_t total_length, | 117 size_t total_length, |
| 118 const std::vector<uint32_t>& packet_lengths, | 118 const std::vector<uint32_t>& packet_lengths, |
| 119 unsigned int timeout, | 119 unsigned int timeout, |
| 120 const IsochronousTransferCallback& callback); | 120 const IsochronousTransferCallback& callback); |
| 121 void GenericTransferInternal( | 121 void GenericTransferInternal( |
| 122 UsbEndpointDirection direction, | 122 UsbTransferDirection direction, |
| 123 uint8_t endpoint_number, | 123 uint8_t endpoint_number, |
| 124 scoped_refptr<net::IOBuffer> buffer, | 124 scoped_refptr<net::IOBuffer> buffer, |
| 125 size_t length, | 125 size_t length, |
| 126 unsigned int timeout, | 126 unsigned int timeout, |
| 127 const TransferCallback& callback, | 127 const TransferCallback& callback, |
| 128 scoped_refptr<base::SingleThreadTaskRunner> callback_runner); | 128 scoped_refptr<base::SingleThreadTaskRunner> callback_runner); |
| 129 void ReapedUrbs(const std::vector<usbdevfs_urb*>& urbs); | 129 void ReapedUrbs(const std::vector<usbdevfs_urb*>& urbs); |
| 130 void TransferComplete(std::unique_ptr<Transfer> transfer); | 130 void TransferComplete(std::unique_ptr<Transfer> transfer); |
| 131 void RefreshEndpointInfo(); | 131 void RefreshEndpointInfo(); |
| 132 void ReportIsochronousError( | 132 void ReportIsochronousError( |
| (...skipping 23 matching lines...) Expand all Loading... |
| 156 // Helper object exists on the blocking task thread and all calls to it and | 156 // Helper object exists on the blocking task thread and all calls to it and |
| 157 // its destruction must be posted there. | 157 // its destruction must be posted there. |
| 158 std::unique_ptr<FileThreadHelper> helper_; | 158 std::unique_ptr<FileThreadHelper> helper_; |
| 159 | 159 |
| 160 std::list<std::unique_ptr<Transfer>> transfers_; | 160 std::list<std::unique_ptr<Transfer>> transfers_; |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 } // namespace device | 163 } // namespace device |
| 164 | 164 |
| 165 #endif // DEVICE_USB_USB_DEVICE_HANDLE_USBFS_H_ | 165 #endif // DEVICE_USB_USB_DEVICE_HANDLE_USBFS_H_ |
| OLD | NEW |