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

Unified Diff: device/usb/fake_usb_device_handle.cc

Issue 2821813002: Use Mojo enum types in the C++ USB interface (Closed)
Patch Set: Fix up //device/usb dependencies in //extensions/browser/api Created 3 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 | « device/usb/fake_usb_device_handle.h ('k') | device/usb/mock_usb_device_handle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/fake_usb_device_handle.cc
diff --git a/device/usb/fake_usb_device_handle.cc b/device/usb/fake_usb_device_handle.cc
index 27ddfb31c8d9c3e9af458e5524b80ea1e8534f02..78c0134b761a8fa20caa7154276b9e63729c15dd 100644
--- a/device/usb/fake_usb_device_handle.cc
+++ b/device/usb/fake_usb_device_handle.cc
@@ -55,9 +55,9 @@ void FakeUsbDeviceHandle::ClearHalt(uint8_t endpoint,
}
void FakeUsbDeviceHandle::ControlTransfer(
- UsbEndpointDirection direction,
- UsbDeviceHandle::TransferRequestType request_type,
- UsbDeviceHandle::TransferRecipient recipient,
+ UsbTransferDirection direction,
+ UsbControlTransferType request_type,
+ UsbControlTransferRecipient recipient,
uint8_t request,
uint16_t value,
uint16_t index,
@@ -66,7 +66,7 @@ void FakeUsbDeviceHandle::ControlTransfer(
unsigned int timeout,
const UsbDeviceHandle::TransferCallback& callback) {
if (position_ == size_) {
- callback.Run(USB_TRANSFER_DISCONNECT, buffer, 0);
+ callback.Run(UsbTransferStatus::DISCONNECT, buffer, 0);
return;
}
@@ -79,14 +79,14 @@ void FakeUsbDeviceHandle::ControlTransfer(
bytes_transferred = std::min(bytes_transferred, size_ - position_);
}
- if (direction == USB_DIRECTION_INBOUND) {
+ if (direction == UsbTransferDirection::INBOUND) {
memcpy(buffer->data(), &data_[position_], bytes_transferred);
position_ += bytes_transferred;
}
- callback.Run(USB_TRANSFER_COMPLETED, buffer, bytes_transferred);
+ callback.Run(UsbTransferStatus::COMPLETED, buffer, bytes_transferred);
} else {
- callback.Run(USB_TRANSFER_ERROR, buffer, 0);
+ callback.Run(UsbTransferStatus::TRANSFER_ERROR, buffer, 0);
}
}
@@ -107,7 +107,7 @@ void FakeUsbDeviceHandle::IsochronousTransferOut(
NOTIMPLEMENTED();
}
-void FakeUsbDeviceHandle::GenericTransfer(UsbEndpointDirection direction,
+void FakeUsbDeviceHandle::GenericTransfer(UsbTransferDirection direction,
uint8_t endpoint_number,
scoped_refptr<net::IOBuffer> buffer,
size_t length,
« no previous file with comments | « device/usb/fake_usb_device_handle.h ('k') | device/usb/mock_usb_device_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698