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

Unified Diff: device/usb/usb_device_impl.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_impl.h
diff --git a/device/usb/usb_device_impl.h b/device/usb/usb_device_impl.h
index 3e9c8d0cc435455626918372c3cd96b9a9e23af4..404838f6a65c4bc307a2d1a61c73babfb7b169d1 100644
--- a/device/usb/usb_device_impl.h
+++ b/device/usb/usb_device_impl.h
@@ -42,7 +42,7 @@ class UsbDeviceImpl : public UsbDevice {
#endif // OS_CHROMEOS
void Open(const OpenCallback& callback) override;
bool Close(scoped_refptr<UsbDeviceHandle> handle) override;
- const UsbConfigDescriptor* GetConfiguration() override;
+ const UsbConfigDescriptor* GetActiveConfiguration() override;
// These functions are used during enumeration only. The values must not
// change during the object's lifetime.
@@ -76,11 +76,13 @@ class UsbDeviceImpl : public UsbDevice {
void set_visited(bool visited) { visited_ = visited; }
bool was_visited() const { return visited_; }
void OnDisconnect();
+ void ReadAllConfigurations();
// Called by UsbDeviceHandleImpl.
- void RefreshConfiguration();
+ void RefreshActiveConfiguration();
private:
+ void GetAllConfigurations();
#if defined(OS_CHROMEOS)
void OnOpenRequestComplete(const OpenCallback& callback,
dbus::FileDescriptor fd);
@@ -100,8 +102,9 @@ class UsbDeviceImpl : public UsbDevice {
std::string device_path_;
// The current device configuration descriptor. May be null if the device is
- // in an unconfigured state.
- scoped_ptr<UsbConfigDescriptor> configuration_;
+ // in an unconfigured state; if not null, it is a pointer to one of the
+ // items at UsbDevice::configurations_.
+ const UsbConfigDescriptor* active_configuration_;
// Retain the context so that it will not be released before UsbDevice.
scoped_refptr<UsbContext> context_;

Powered by Google App Engine
This is Rietveld 408576698