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

Unified Diff: device/usb/usb_device_handle_usbfs.h

Issue 1916053006: Support USB transfers from arbitrary threads in the new Linux backend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | device/usb/usb_device_handle_usbfs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_device_handle_usbfs.h
diff --git a/device/usb/usb_device_handle_usbfs.h b/device/usb/usb_device_handle_usbfs.h
index 01ead0557b836cc4491ea4df901ca6865727ce12..34d68341a7bb65406def7f5da91d1196e6f5e634 100644
--- a/device/usb/usb_device_handle_usbfs.h
+++ b/device/usb/usb_device_handle_usbfs.h
@@ -17,6 +17,7 @@ struct usbdevfs_urb;
namespace base {
class SequencedTaskRunner;
+class SingleThreadTaskRunner;
}
namespace device {
@@ -62,13 +63,14 @@ class UsbDeviceHandleUsbfs : public UsbDeviceHandle {
const std::vector<uint32_t>& packet_lengths,
unsigned int timeout,
const IsochronousTransferCallback& callback) override;
-
void IsochronousTransferOut(
uint8_t endpoint_number,
scoped_refptr<net::IOBuffer> buffer,
const std::vector<uint32_t>& packet_lengths,
unsigned int timeout,
const IsochronousTransferCallback& callback) override;
+ // To support DevTools this function may be called from any thread and on
+ // completion |callback| will be run on that thread.
void GenericTransfer(UsbEndpointDirection direction,
uint8_t endpoint_number,
scoped_refptr<net::IOBuffer> buffer,
@@ -112,6 +114,14 @@ class UsbDeviceHandleUsbfs : public UsbDeviceHandle {
const std::vector<uint32_t>& packet_lengths,
unsigned int timeout,
const IsochronousTransferCallback& callback);
+ void GenericTransferInternal(
+ UsbEndpointDirection direction,
+ uint8_t endpoint_number,
+ scoped_refptr<net::IOBuffer> buffer,
+ size_t length,
+ unsigned int timeout,
+ const TransferCallback& callback,
+ scoped_refptr<base::SingleThreadTaskRunner> callback_runner);
void ReapedUrbs(const std::vector<usbdevfs_urb*>& urbs);
void TransferComplete(std::unique_ptr<Transfer> transfer);
void RefreshEndpointInfo();
@@ -125,7 +135,7 @@ class UsbDeviceHandleUsbfs : public UsbDeviceHandle {
scoped_refptr<UsbDevice> device_;
base::ScopedFD fd_;
- scoped_refptr<base::SequencedTaskRunner> task_runner_;
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
base::ThreadChecker thread_checker_;
« 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