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

Side by Side Diff: device/usb/usb_descriptors.h

Issue 1697863003: Revert of Parse USB interface association descriptors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | device/usb/usb_descriptors.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef DEVICE_USB_USB_DESCRIPTORS_H_ 5 #ifndef DEVICE_USB_USB_DESCRIPTORS_H_
6 #define DEVICE_USB_USB_DESCRIPTORS_H_ 6 #define DEVICE_USB_USB_DESCRIPTORS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 UsbInterfaceDescriptor() = delete; 78 UsbInterfaceDescriptor() = delete;
79 ~UsbInterfaceDescriptor(); 79 ~UsbInterfaceDescriptor();
80 80
81 uint8_t interface_number; 81 uint8_t interface_number;
82 uint8_t alternate_setting; 82 uint8_t alternate_setting;
83 uint8_t interface_class; 83 uint8_t interface_class;
84 uint8_t interface_subclass; 84 uint8_t interface_subclass;
85 uint8_t interface_protocol; 85 uint8_t interface_protocol;
86 std::vector<UsbEndpointDescriptor> endpoints; 86 std::vector<UsbEndpointDescriptor> endpoints;
87 std::vector<uint8_t> extra_data; 87 std::vector<uint8_t> extra_data;
88 // First interface of the function to which this interface belongs.
89 uint8_t first_interface;
90 }; 88 };
91 89
92 struct UsbConfigDescriptor { 90 struct UsbConfigDescriptor {
93 UsbConfigDescriptor(uint8_t configuration_value, 91 UsbConfigDescriptor(uint8_t configuration_value,
94 bool self_powered, 92 bool self_powered,
95 bool remote_wakeup, 93 bool remote_wakeup,
96 uint16_t maximum_power); 94 uint16_t maximum_power);
97 UsbConfigDescriptor() = delete; 95 UsbConfigDescriptor() = delete;
98 ~UsbConfigDescriptor(); 96 ~UsbConfigDescriptor();
99 97
100 // Scans through |extra_data| for interface association descriptors and
101 // populates |first_interface| for each interface in this configuration.
102 void AssignFirstInterfaceNumbers();
103
104 uint8_t configuration_value; 98 uint8_t configuration_value;
105 bool self_powered; 99 bool self_powered;
106 bool remote_wakeup; 100 bool remote_wakeup;
107 uint16_t maximum_power; 101 uint16_t maximum_power;
108 std::vector<UsbInterfaceDescriptor> interfaces; 102 std::vector<UsbInterfaceDescriptor> interfaces;
109 std::vector<uint8_t> extra_data; 103 std::vector<uint8_t> extra_data;
110 }; 104 };
111 105
112 bool ParseUsbStringDescriptor(const std::vector<uint8_t>& descriptor, 106 bool ParseUsbStringDescriptor(const std::vector<uint8_t>& descriptor,
113 base::string16* output); 107 base::string16* output);
114 108
115 void ReadUsbStringDescriptors( 109 void ReadUsbStringDescriptors(
116 scoped_refptr<UsbDeviceHandle> device_handle, 110 scoped_refptr<UsbDeviceHandle> device_handle,
117 scoped_ptr<std::map<uint8_t, base::string16>> index_map, 111 scoped_ptr<std::map<uint8_t, base::string16>> index_map,
118 const base::Callback<void(scoped_ptr<std::map<uint8_t, base::string16>>)>& 112 const base::Callback<void(scoped_ptr<std::map<uint8_t, base::string16>>)>&
119 callback); 113 callback);
120 114
121 } // namespace device 115 } // namespace device
122 116
123 #endif // DEVICE_USB_USB_DESCRIPTORS_H_ 117 #endif // DEVICE_USB_USB_DESCRIPTORS_H_
OLDNEW
« no previous file with comments | « no previous file | device/usb/usb_descriptors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698