Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1009)

Side by Side Diff: device/usb/usb_device_handle_usbfs.h

Issue 2274343002: Tell the kernel to discard USB requests when they time out. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | device/usb/usb_device_handle_usbfs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 const TransferCallback& callback, 132 const TransferCallback& callback,
133 scoped_refptr<base::SingleThreadTaskRunner> callback_runner); 133 scoped_refptr<base::SingleThreadTaskRunner> callback_runner);
134 void ReapedUrbs(const std::vector<usbdevfs_urb*>& urbs); 134 void ReapedUrbs(const std::vector<usbdevfs_urb*>& urbs);
135 void TransferComplete(std::unique_ptr<Transfer> transfer); 135 void TransferComplete(std::unique_ptr<Transfer> transfer);
136 void RefreshEndpointInfo(); 136 void RefreshEndpointInfo();
137 void ReportIsochronousError( 137 void ReportIsochronousError(
138 const std::vector<uint32_t>& packet_lengths, 138 const std::vector<uint32_t>& packet_lengths,
139 const UsbDeviceHandle::IsochronousTransferCallback& callback, 139 const UsbDeviceHandle::IsochronousTransferCallback& callback,
140 UsbTransferStatus status); 140 UsbTransferStatus status);
141 void SetUpTimeoutCallback(Transfer* transfer, unsigned int timeout); 141 void SetUpTimeoutCallback(Transfer* transfer, unsigned int timeout);
142 142 std::unique_ptr<Transfer> RemoveFromTransferList(Transfer* transfer);
143 static void CancelTransfer(Transfer* transfer, UsbTransferStatus status); 143 void CancelTransfer(Transfer* transfer, UsbTransferStatus status);
144 void DiscardUrbBlocking(Transfer* transfer);
145 void UrbDiscarded(Transfer* transfer);
144 146
145 scoped_refptr<UsbDevice> device_; 147 scoped_refptr<UsbDevice> device_;
146 base::ScopedFD fd_; 148 base::ScopedFD fd_;
147 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 149 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
148 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; 150 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
149 151
150 // Maps claimed interfaces by interface number to their current alternate 152 // Maps claimed interfaces by interface number to their current alternate
151 // setting. 153 // setting.
152 std::map<uint8_t, InterfaceInfo> interfaces_; 154 std::map<uint8_t, InterfaceInfo> interfaces_;
153 155
154 // Maps endpoints (by endpoint address) to the interface they are a part of. 156 // Maps endpoints (by endpoint address) to the interface they are a part of.
155 // Only endpoints of currently claimed and selected interface alternates are 157 // Only endpoints of currently claimed and selected interface alternates are
156 // included in the map. 158 // included in the map.
157 std::map<uint8_t, EndpointInfo> endpoints_; 159 std::map<uint8_t, EndpointInfo> endpoints_;
158 160
159 // Helper object owned by the blocking task thread. It will be freed if that 161 // Helper object owned by the blocking task thread. It will be freed if that
160 // thread's message loop is destroyed but can also be freed by this class on 162 // thread's message loop is destroyed but can also be freed by this class on
161 // destruction. 163 // destruction.
162 FileThreadHelper* helper_; 164 FileThreadHelper* helper_;
163 165
164 std::list<std::unique_ptr<Transfer>> transfers_; 166 std::list<std::unique_ptr<Transfer>> transfers_;
165 }; 167 };
166 168
167 } // namespace device 169 } // namespace device
168 170
169 #endif // DEVICE_USB_USB_DEVICE_HANDLE_USBFS_H_ 171 #endif // DEVICE_USB_USB_DEVICE_HANDLE_USBFS_H_
OLDNEW
« no previous file with comments | « no previous file | device/usb/usb_device_handle_usbfs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698