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

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

Issue 2821813002: Use Mojo enum types in the C++ USB interface (Closed)
Patch Set: Fix circular dependency 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
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..91804a4576ce757d2df8173b38b00fea86577c0a 100644
--- a/device/usb/public/interfaces/device.mojom
+++ b/device/usb/public/interfaces/device.mojom
@@ -16,7 +16,7 @@ enum UsbOpenDeviceError {
};
enum UsbTransferDirection {
- INBOUND,
+ INBOUND = 0,
OUTBOUND,
};
@@ -34,16 +34,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 +96,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 +124,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 {

Powered by Google App Engine
This is Rietveld 408576698