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

Unified Diff: device/usb/usb_device_impl.h

Issue 601073002: Move string descriptor getters from UsbDeviceHandle to UsbDevice. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: device/usb/usb_device_impl.h
diff --git a/device/usb/usb_device_impl.h b/device/usb/usb_device_impl.h
index e95c8dbc9add72a27033e2a7da9300b4a82d493b..f0d22b251071cd940ee541b97859cc47228ba1ee 100644
--- a/device/usb/usb_device_impl.h
+++ b/device/usb/usb_device_impl.h
@@ -39,6 +39,9 @@ class UsbDeviceImpl : public UsbDevice {
virtual scoped_refptr<UsbDeviceHandle> Open() OVERRIDE;
virtual bool Close(scoped_refptr<UsbDeviceHandle> handle) OVERRIDE;
virtual const UsbConfigDescriptor& GetConfiguration() OVERRIDE;
+ virtual bool GetManufacturer(base::string16* manufacturer) OVERRIDE;
+ virtual bool GetProduct(base::string16* product) OVERRIDE;
+ virtual bool GetSerialNumber(base::string16* serial_number) OVERRIDE;
protected:
friend class UsbServiceImpl;
@@ -60,6 +63,15 @@ class UsbDeviceImpl : public UsbDevice {
base::ThreadChecker thread_checker_;
PlatformUsbDevice platform_device_;
+#if defined(OS_LINUX)
+ // On Linux these properties are read from sysfs when the device is enumerated
+ // to avoid hitting the permission broker on Chrome OS for a real string
+ // descriptor request.
+ std::string manufacturer_;
+ std::string product_;
+ std::string serial_number_;
+#endif
+
// The active configuration descriptor is not read immediately but cached for
// later use.
bool current_configuration_cached_;

Powered by Google App Engine
This is Rietveld 408576698