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

Unified Diff: device/usb/usb_device_handle_impl.cc

Issue 827433002: Resolve two USB transfer handling regressions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_device_handle_impl.cc
diff --git a/device/usb/usb_device_handle_impl.cc b/device/usb/usb_device_handle_impl.cc
index 587bbc66d8e1df0fe8d963eead818a603258ea65..a4d521b170b0a8172961433b57386a4cd0a31505 100644
--- a/device/usb/usb_device_handle_impl.cc
+++ b/device/usb/usb_device_handle_impl.cc
@@ -158,8 +158,8 @@ class UsbDeviceHandleImpl::Transfer {
static scoped_ptr<Transfer> CreateControlTransfer(
uint8 type,
uint8 request,
- uint8 value,
- uint8 index,
+ uint16 value,
+ uint16 index,
uint16 length,
scoped_refptr<net::IOBuffer> buffer,
unsigned int timeout,
@@ -220,8 +220,8 @@ scoped_ptr<UsbDeviceHandleImpl::Transfer>
UsbDeviceHandleImpl::Transfer::CreateControlTransfer(
uint8 type,
uint8 request,
- uint8 value,
- uint8 index,
+ uint16 value,
+ uint16 index,
uint16 length,
scoped_refptr<net::IOBuffer> buffer,
unsigned int timeout,
@@ -232,6 +232,7 @@ UsbDeviceHandleImpl::Transfer::CreateControlTransfer(
transfer->platform_transfer_ = libusb_alloc_transfer(0);
if (!transfer->platform_transfer_) {
+ LOG(ERROR) << "Failed to allocate control transfer.";
return nullptr;
}
@@ -259,6 +260,7 @@ UsbDeviceHandleImpl::Transfer::CreateBulkTransfer(
transfer->platform_transfer_ = libusb_alloc_transfer(0);
if (!transfer->platform_transfer_) {
+ LOG(ERROR) << "Failed to allocate bulk transfer.";
return nullptr;
}
@@ -285,6 +287,7 @@ UsbDeviceHandleImpl::Transfer::CreateInterruptTransfer(
transfer->platform_transfer_ = libusb_alloc_transfer(0);
if (!transfer->platform_transfer_) {
+ LOG(ERROR) << "Failed to allocate interrupt transfer.";
return nullptr;
}
@@ -314,8 +317,9 @@ UsbDeviceHandleImpl::Transfer::CreateIsochronousTransfer(
scoped_ptr<Transfer> transfer(
new Transfer(USB_TRANSFER_ISOCHRONOUS, buffer, length, callback));
- transfer->platform_transfer_ = libusb_alloc_transfer(0);
+ transfer->platform_transfer_ = libusb_alloc_transfer(packets);
if (!transfer->platform_transfer_) {
+ LOG(ERROR) << "Failed to allocate isochronous transfer.";
return nullptr;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698