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

Unified Diff: device/usb/usb_device_impl.h

Issue 826283002: Add support for sending a USB SET_CONFIGURATION request. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 11 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 | « device/usb/usb_device_handle_impl.cc ('k') | device/usb/usb_device_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_device_impl.h
diff --git a/device/usb/usb_device_impl.h b/device/usb/usb_device_impl.h
index 379d4019854de018a6b9c9536e0a23e150631238..eca7c982fc41fa22bc4cfe4cb5bc827e159f8db8 100644
--- a/device/usb/usb_device_impl.h
+++ b/device/usb/usb_device_impl.h
@@ -38,13 +38,14 @@ class UsbDeviceImpl : public UsbDevice {
#endif // OS_CHROMEOS
scoped_refptr<UsbDeviceHandle> Open() override;
bool Close(scoped_refptr<UsbDeviceHandle> handle) override;
- const UsbConfigDescriptor& GetConfiguration() override;
+ const UsbConfigDescriptor* GetConfiguration() override;
bool GetManufacturer(base::string16* manufacturer) override;
bool GetProduct(base::string16* product) override;
bool GetSerialNumber(base::string16* serial_number) override;
protected:
friend class UsbServiceImpl;
+ friend class UsbDeviceHandleImpl;
// Called by UsbServiceImpl only;
UsbDeviceImpl(scoped_refptr<UsbContext> context,
@@ -56,9 +57,12 @@ class UsbDeviceImpl : public UsbDevice {
~UsbDeviceImpl() override;
- // Called only by UsbService.
+ // Called only by UsbServiceImpl.
void OnDisconnect();
+ // Called by UsbDeviceHandleImpl.
+ void RefreshConfiguration();
+
private:
base::ThreadChecker thread_checker_;
PlatformUsbDevice platform_device_;
@@ -82,10 +86,9 @@ class UsbDeviceImpl : public UsbDevice {
std::string devnode_;
#endif
- // The active configuration descriptor is not read immediately but cached for
- // later use.
- bool current_configuration_cached_;
- UsbConfigDescriptor current_configuration_;
+ // The current device configuration descriptor. May be null if the device is
+ // in an unconfigured state.
+ scoped_ptr<UsbConfigDescriptor> configuration_;
// Retain the context so that it will not be released before UsbDevice.
scoped_refptr<UsbContext> context_;
« no previous file with comments | « device/usb/usb_device_handle_impl.cc ('k') | device/usb/usb_device_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698