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

Unified Diff: device/usb/usb_device_impl.h

Issue 659943003: Cache important USB string descriptors all at once. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed typo. Created 6 years, 2 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 | « no previous file | 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 9a1494724d9f3ee9ce34082e044419c4eb555878..2718998578be520bf74acbc96be71ece70bd4931 100644
--- a/device/usb/usb_device_impl.h
+++ b/device/usb/usb_device_impl.h
@@ -56,20 +56,25 @@ class UsbDeviceImpl : public UsbDevice {
virtual ~UsbDeviceImpl();
- // Called only be UsbService.
+ // Called only by UsbService.
void OnDisconnect();
private:
base::ThreadChecker thread_checker_;
PlatformUsbDevice platform_device_;
-#if defined(USE_UDEV)
// 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_;
+ base::string16 manufacturer_;
+ base::string16 product_;
+ base::string16 serial_number_;
+#if !defined(USE_UDEV)
+ // On other platforms the device must be opened in order to cache them. This
+ // should be delayed until the strings are needed to avoid poor interactions
+ // with other applications.
+ void CacheStrings();
+ bool strings_cached_;
#endif
// The active configuration descriptor is not read immediately but cached for
« no previous file with comments | « no previous file | device/usb/usb_device_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698