OLD | NEW |
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> |
| 11 #include <memory> |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 #include "base/callback_forward.h" | 14 #include "base/callback_forward.h" |
14 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | |
16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
17 | 17 |
18 namespace device { | 18 namespace device { |
19 | 19 |
20 class UsbDeviceHandle; | 20 class UsbDeviceHandle; |
21 | 21 |
22 // A Java counterpart will be generated for this enum. | 22 // A Java counterpart will be generated for this enum. |
23 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.device.usb | 23 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.device.usb |
24 enum UsbTransferType { | 24 enum UsbTransferType { |
25 USB_TRANSFER_CONTROL = 0, | 25 USB_TRANSFER_CONTROL = 0, |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 uint16_t maximum_power; | 110 uint16_t maximum_power; |
111 std::vector<UsbInterfaceDescriptor> interfaces; | 111 std::vector<UsbInterfaceDescriptor> interfaces; |
112 std::vector<uint8_t> extra_data; | 112 std::vector<uint8_t> extra_data; |
113 }; | 113 }; |
114 | 114 |
115 bool ParseUsbStringDescriptor(const std::vector<uint8_t>& descriptor, | 115 bool ParseUsbStringDescriptor(const std::vector<uint8_t>& descriptor, |
116 base::string16* output); | 116 base::string16* output); |
117 | 117 |
118 void ReadUsbStringDescriptors( | 118 void ReadUsbStringDescriptors( |
119 scoped_refptr<UsbDeviceHandle> device_handle, | 119 scoped_refptr<UsbDeviceHandle> device_handle, |
120 scoped_ptr<std::map<uint8_t, base::string16>> index_map, | 120 std::unique_ptr<std::map<uint8_t, base::string16>> index_map, |
121 const base::Callback<void(scoped_ptr<std::map<uint8_t, base::string16>>)>& | 121 const base::Callback< |
122 callback); | 122 void(std::unique_ptr<std::map<uint8_t, base::string16>>)>& callback); |
123 | 123 |
124 } // namespace device | 124 } // namespace device |
125 | 125 |
126 #endif // DEVICE_USB_USB_DESCRIPTORS_H_ | 126 #endif // DEVICE_USB_USB_DESCRIPTORS_H_ |
OLD | NEW |