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

Unified Diff: extensions/common/api/usb.idl

Issue 558373002: Add chrome.usb.getConfiguration and expose extra descriptors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased to tip of tree. Created 6 years, 3 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 | « extensions/browser/extension_function_histogram_value.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/api/usb.idl
diff --git a/extensions/common/api/usb.idl b/extensions/common/api/usb.idl
index 18dd1f352d5a058804b854a492e9099708a73f84..af6d55054c261a7b123e729536c8fda7414e36c6 100644
--- a/extensions/common/api/usb.idl
+++ b/extensions/common/api/usb.idl
@@ -60,6 +60,8 @@ namespace usb {
UsageType? usage;
// Polling interval (interrupt and isochronous only).
long? pollingInterval;
+ // Extra descriptor data associated with this endpoint.
+ ArrayBuffer extra_data;
};
[noinline_doc] dictionary InterfaceDescriptor {
@@ -77,6 +79,25 @@ namespace usb {
DOMString? description;
// Available endpoints.
EndpointDescriptor[] endpoints;
+ // Extra descriptor data associated with this interface.
+ ArrayBuffer extra_data;
+ };
+
+ [noinline_doc] dictionary ConfigDescriptor {
+ // The configuration number.
+ long configurationValue;
+ // Description of the configuration.
+ DOMString? description;
+ // The device is self-powered.
+ boolean selfPowered;
+ // The device supports remote wakeup.
+ boolean remoteWakeup;
+ // The maximum power needed by this device in milliamps (mA).
+ long maxPower;
+ // Available interfaces.
+ InterfaceDescriptor[] interfaces;
+ // Extra descriptor data associated with this configuration.
+ ArrayBuffer extra_data;
};
dictionary ControlTransferInfo {
@@ -181,6 +202,7 @@ namespace usb {
callback RequestAccessCallback = void (boolean success);
callback OpenDeviceCallback = void (ConnectionHandle handle);
callback FindDevicesCallback = void (ConnectionHandle[] handles);
+ callback GetConfigurationCallback = void (ConfigDescriptor config);
callback ListInterfacesCallback = void (InterfaceDescriptor[] descriptors);
callback CloseDeviceCallback = void ();
callback TransferCallback = void (TransferResultInfo info);
@@ -232,6 +254,12 @@ namespace usb {
static void closeDevice(ConnectionHandle handle,
optional CloseDeviceCallback callback);
+ // Gets the configuration descriptor for the currently selected
+ // configuration.
+ // |handle|: An open connection to the device.
+ static void getConfiguration(ConnectionHandle handle,
+ GetConfigurationCallback callback);
+
// Lists all interfaces on a USB device.
// |handle|: An open connection to the device.
static void listInterfaces(ConnectionHandle handle,
« no previous file with comments | « extensions/browser/extension_function_histogram_value.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698