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

Unified Diff: device/usb/usb_device_win.h

Issue 2702623002: Add support for reading USB descriptors to the new Windows backend. (Closed)
Patch Set: Addressed rockot@'s feedback and rebased. Created 3 years, 10 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_win.cc ('k') | device/usb/usb_device_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_device_win.h
diff --git a/device/usb/usb_device_win.h b/device/usb/usb_device_win.h
index 0a74c06cf00edb2bae5fc0dcbc56fbd3fd0cfb4e..2c43a52f9004f367aa85ee5b0cfda468144fddae 100644
--- a/device/usb/usb_device_win.h
+++ b/device/usb/usb_device_win.h
@@ -17,6 +17,8 @@ class SequencedTaskRunner;
namespace device {
+struct UsbDeviceDescriptor;
+
class UsbDeviceWin : public UsbDevice {
public:
// UsbDevice implementation:
@@ -37,6 +39,20 @@ class UsbDeviceWin : public UsbDevice {
const std::string& device_path() const { return device_path_; }
int port_number() const { return port_number_; }
+ // Opens the device's parent hub in order to read the device, configuration
+ // and string descriptors.
+ void ReadDescriptors(const base::Callback<void(bool)>& callback);
+
+ private:
+ void OpenOnBlockingThread(const OpenCallback& callback);
+ void OnReadDescriptors(const base::Callback<void(bool)>& callback,
+ scoped_refptr<UsbDeviceHandle> device_handle,
+ std::unique_ptr<UsbDeviceDescriptor> descriptor);
+ void OnReadStringDescriptors(
+ const base::Callback<void(bool)>& callback,
+ scoped_refptr<UsbDeviceHandle> device_handle,
+ std::unique_ptr<std::map<uint8_t, base::string16>> string_map);
+
private:
base::ThreadChecker thread_checker_;
« no previous file with comments | « device/usb/usb_device_handle_win.cc ('k') | device/usb/usb_device_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698