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

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

Issue 1874313002: Convert device to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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 | « device/usb/usb_context.h ('k') | 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>
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
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_
OLDNEW
« no previous file with comments | « device/usb/usb_context.h ('k') | device/usb/usb_descriptors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698