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

Unified Diff: device/usb/public/interfaces/device.mojom

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/mojo/type_converters.cc ('k') | device/usb/usb_descriptors.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/public/interfaces/device.mojom
diff --git a/device/usb/public/interfaces/device.mojom b/device/usb/public/interfaces/device.mojom
index e23406ada26a5c6491a6cdcdf108935f721cf965..d1c139aad8f53df0a7593f9cf86b45751cd41cfb 100644
--- a/device/usb/public/interfaces/device.mojom
+++ b/device/usb/public/interfaces/device.mojom
@@ -15,8 +15,9 @@ enum UsbOpenDeviceError {
ALREADY_OPEN,
};
+// Corresponds to the USBDirection WebIDL type.
enum UsbTransferDirection {
- INBOUND,
+ INBOUND = 0,
OUTBOUND,
};
@@ -27,6 +28,7 @@ enum UsbControlTransferType {
RESERVED
};
+// Corresponds to the USBRecipient WebIDL type.
enum UsbControlTransferRecipient {
DEVICE,
INTERFACE,
@@ -34,16 +36,17 @@ enum UsbControlTransferRecipient {
OTHER
};
-enum UsbEndpointType {
+enum UsbTransferType {
+ CONTROL = 0,
+ ISOCHRONOUS,
BULK,
INTERRUPT,
- ISOCHRONOUS,
};
struct UsbEndpointInfo {
uint8 endpoint_number;
UsbTransferDirection direction;
- UsbEndpointType type;
+ UsbTransferType type;
uint32 packet_size;
};
@@ -95,16 +98,15 @@ struct UsbControlTransferParams {
uint16 index;
};
+// This enum is exposed through the chrome.usb extension API so existing values
+// should not be changed or reordered.
enum UsbTransferStatus {
// The transfer completed successfully.
- COMPLETED,
+ COMPLETED = 0,
// The transfer failed due to a non-specific error.
TRANSFER_ERROR,
- // The transfer was not allowed.
- PERMISSION_DENIED,
-
// The transfer timed out.
TIMEOUT,
@@ -124,6 +126,9 @@ enum UsbTransferStatus {
// The transfer succeeded, but the device sent less data than was requested.
// This applies only to inbound transfers.
SHORT_PACKET,
+
+ // The transfer was not allowed.
+ PERMISSION_DENIED,
};
struct UsbIsochronousPacket {
« no previous file with comments | « device/usb/mojo/type_converters.cc ('k') | device/usb/usb_descriptors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698