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

Unified Diff: device/usb/usb_device.h

Issue 1265833005: Get all the UsbConfigDescriptor for the device configuration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use const auto Created 5 years, 4 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/usb_device.h
diff --git a/device/usb/usb_device.h b/device/usb/usb_device.h
index 53087c8c79ddc5e7fb16f1cf1362824a1f9b513a..21676b64b2ff015c6a48c7a14be6128ec86e2929 100644
--- a/device/usb/usb_device.h
+++ b/device/usb/usb_device.h
@@ -5,15 +5,17 @@
#ifndef DEVICE_USB_USB_DEVICE_H_
#define DEVICE_USB_USB_DEVICE_H_
+#include <vector>
+
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
+#include "device/usb/usb_descriptors.h"
namespace device {
class UsbDeviceHandle;
-struct UsbConfigDescriptor;
// A UsbDevice object represents a detected USB device, providing basic
// information about it. Methods other than simple property accessors must be
@@ -52,7 +54,12 @@ class UsbDevice : public base::RefCountedThreadSafe<UsbDevice> {
// Gets the UsbConfigDescriptor for the active device configuration or nullptr
// if the device is unconfigured.
- virtual const UsbConfigDescriptor* GetConfiguration() = 0;
+ virtual const UsbConfigDescriptor* GetActiveConfiguration() = 0;
+
+ // Gets all of the device's UsbConfigDescriptors.
+ const std::vector<UsbConfigDescriptor>& configurations() {
+ return configurations_;
+ }
protected:
UsbDevice(uint16 vendor_id,
@@ -69,6 +76,9 @@ class UsbDevice : public base::RefCountedThreadSafe<UsbDevice> {
base::string16 product_string_;
base::string16 serial_number_;
+ // All of the device's configuration descriptors.
+ std::vector<UsbConfigDescriptor> configurations_;
+
private:
friend class base::RefCountedThreadSafe<UsbDevice>;

Powered by Google App Engine
This is Rietveld 408576698