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

Unified Diff: device/usb/usb_device_handle.h

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/usb_descriptors_unittest.cc ('k') | device/usb/usb_device_handle_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_device_handle.h
diff --git a/device/usb/usb_device_handle.h b/device/usb/usb_device_handle.h
index 32d25f39a604dbe685bd6e33b25748f07645407b..d592a8d4b2e48ce868a30262308cf1047708db94 100644
--- a/device/usb/usb_device_handle.h
+++ b/device/usb/usb_device_handle.h
@@ -16,6 +16,7 @@
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
#include "base/threading/thread_checker.h"
+#include "device/usb/public/interfaces/device.mojom.h"
#include "device/usb/usb_descriptors.h"
namespace net {
@@ -26,16 +27,9 @@ namespace device {
class UsbDevice;
-enum UsbTransferStatus {
- USB_TRANSFER_COMPLETED = 0,
- USB_TRANSFER_ERROR,
- USB_TRANSFER_TIMEOUT,
- USB_TRANSFER_CANCELLED,
- USB_TRANSFER_STALLED,
- USB_TRANSFER_DISCONNECT,
- USB_TRANSFER_OVERFLOW,
- USB_TRANSFER_LENGTH_SHORT,
-};
+using UsbTransferStatus = mojom::UsbTransferStatus;
+using UsbControlTransferType = mojom::UsbControlTransferType;
+using UsbControlTransferRecipient = mojom::UsbControlTransferRecipient;
// UsbDeviceHandle class provides basic I/O related functionalities.
class UsbDeviceHandle : public base::RefCountedThreadSafe<UsbDeviceHandle> {
@@ -53,9 +47,6 @@ class UsbDeviceHandle : public base::RefCountedThreadSafe<UsbDeviceHandle> {
base::Callback<void(scoped_refptr<net::IOBuffer>,
const std::vector<IsochronousPacket>& packets)>;
- enum TransferRequestType { STANDARD, CLASS, VENDOR, RESERVED };
- enum TransferRecipient { DEVICE, INTERFACE, ENDPOINT, OTHER };
-
virtual scoped_refptr<UsbDevice> GetDevice() const = 0;
// Notifies UsbDevice to drop the reference of this object; cancels all the
@@ -80,9 +71,9 @@ class UsbDeviceHandle : public base::RefCountedThreadSafe<UsbDeviceHandle> {
// The transfer functions may be called from any thread. The provided callback
// will be run on the caller's thread.
- virtual void ControlTransfer(UsbEndpointDirection direction,
- TransferRequestType request_type,
- TransferRecipient recipient,
+ virtual void ControlTransfer(UsbTransferDirection direction,
+ UsbControlTransferType request_type,
+ UsbControlTransferRecipient recipient,
uint8_t request,
uint16_t value,
uint16_t index,
@@ -104,7 +95,7 @@ class UsbDeviceHandle : public base::RefCountedThreadSafe<UsbDeviceHandle> {
unsigned int timeout,
const IsochronousTransferCallback& callback) = 0;
- virtual void GenericTransfer(UsbEndpointDirection direction,
+ virtual void GenericTransfer(UsbTransferDirection direction,
uint8_t endpoint_number,
scoped_refptr<net::IOBuffer> buffer,
size_t length,
« no previous file with comments | « device/usb/usb_descriptors_unittest.cc ('k') | device/usb/usb_device_handle_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698