| 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_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 Loading... |
| 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_ |
| OLD | NEW |