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 { |