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

Side by Side Diff: device/usb/usb_device.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_descriptors_unittest.cc ('k') | device/usb/usb_device_filter.h » ('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_DEVICE_H_ 5 #ifndef DEVICE_USB_USB_DEVICE_H_
6 #define DEVICE_USB_USB_DEVICE_H_ 6 #define DEVICE_USB_USB_DEVICE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory>
10 #include <string> 11 #include <string>
11 #include <vector> 12 #include <vector>
12 13
13 #include "base/callback.h" 14 #include "base/callback.h"
14 #include "base/macros.h" 15 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
16 #include "base/observer_list.h" 17 #include "base/observer_list.h"
17 #include "base/strings/string16.h" 18 #include "base/strings/string16.h"
18 #include "device/usb/usb_descriptors.h" 19 #include "device/usb/usb_descriptors.h"
19 #include "url/gurl.h" 20 #include "url/gurl.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 virtual ~UsbDevice(); 102 virtual ~UsbDevice();
102 103
103 void NotifyDeviceRemoved(); 104 void NotifyDeviceRemoved();
104 105
105 // These members must be mutable by subclasses as necessary during device 106 // These members must be mutable by subclasses as necessary during device
106 // enumeration. To preserve the thread safety of this object they must remain 107 // enumeration. To preserve the thread safety of this object they must remain
107 // constant afterwards. 108 // constant afterwards.
108 base::string16 manufacturer_string_; 109 base::string16 manufacturer_string_;
109 base::string16 product_string_; 110 base::string16 product_string_;
110 base::string16 serial_number_; 111 base::string16 serial_number_;
111 scoped_ptr<WebUsbAllowedOrigins> webusb_allowed_origins_; 112 std::unique_ptr<WebUsbAllowedOrigins> webusb_allowed_origins_;
112 GURL webusb_landing_page_; 113 GURL webusb_landing_page_;
113 114
114 // All of the device's configuration descriptors. 115 // All of the device's configuration descriptors.
115 std::vector<UsbConfigDescriptor> configurations_; 116 std::vector<UsbConfigDescriptor> configurations_;
116 117
117 private: 118 private:
118 friend class base::RefCountedThreadSafe<UsbDevice>; 119 friend class base::RefCountedThreadSafe<UsbDevice>;
119 120
120 const std::string guid_; 121 const std::string guid_;
121 const uint16_t usb_version_; 122 const uint16_t usb_version_;
122 const uint8_t device_class_; 123 const uint8_t device_class_;
123 const uint8_t device_subclass_; 124 const uint8_t device_subclass_;
124 const uint8_t device_protocol_; 125 const uint8_t device_protocol_;
125 const uint16_t vendor_id_; 126 const uint16_t vendor_id_;
126 const uint16_t product_id_; 127 const uint16_t product_id_;
127 const uint16_t device_version_; 128 const uint16_t device_version_;
128 129
129 base::ObserverList<Observer, true> observer_list_; 130 base::ObserverList<Observer, true> observer_list_;
130 131
131 DISALLOW_COPY_AND_ASSIGN(UsbDevice); 132 DISALLOW_COPY_AND_ASSIGN(UsbDevice);
132 }; 133 };
133 134
134 } // namespace device 135 } // namespace device
135 136
136 #endif // DEVICE_USB_USB_DEVICE_H_ 137 #endif // DEVICE_USB_USB_DEVICE_H_
OLDNEW
« no previous file with comments | « device/usb/usb_descriptors_unittest.cc ('k') | device/usb/usb_device_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698