| 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 COMPONENTS_USB_SERVICE_USB_INTERFACE_H_ | 5 #ifndef COMPONENTS_USB_SERVICE_USB_INTERFACE_H_ |
| 6 #define COMPONENTS_USB_SERVICE_USB_INTERFACE_H_ | 6 #define COMPONENTS_USB_SERVICE_USB_INTERFACE_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "components/usb_service/usb_service_export.h" | 9 #include "components/usb_service/usb_service_export.h" |
| 10 | 10 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 scoped_refptr<const UsbConfigDescriptor> config_; | 120 scoped_refptr<const UsbConfigDescriptor> config_; |
| 121 PlatformUsbInterface interface_; | 121 PlatformUsbInterface interface_; |
| 122 | 122 |
| 123 DISALLOW_COPY_AND_ASSIGN(UsbInterfaceDescriptor); | 123 DISALLOW_COPY_AND_ASSIGN(UsbInterfaceDescriptor); |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 class USB_SERVICE_EXPORT UsbConfigDescriptor | 126 class USB_SERVICE_EXPORT UsbConfigDescriptor |
| 127 : public base::RefCounted<UsbConfigDescriptor> { | 127 : public base::RefCounted<UsbConfigDescriptor> { |
| 128 public: | 128 public: |
| 129 size_t GetNumInterfaces() const; | 129 virtual size_t GetNumInterfaces() const; |
| 130 scoped_refptr<const UsbInterfaceDescriptor> GetInterface(size_t index) const; | 130 virtual scoped_refptr<const UsbInterfaceDescriptor> GetInterface( |
| 131 size_t index) const; |
| 132 |
| 133 protected: |
| 134 // Constructor called in test only |
| 135 UsbConfigDescriptor(); |
| 136 virtual ~UsbConfigDescriptor(); |
| 131 | 137 |
| 132 private: | 138 private: |
| 133 friend class base::RefCounted<UsbConfigDescriptor>; | 139 friend class base::RefCounted<UsbConfigDescriptor>; |
| 134 friend class UsbDevice; | 140 friend class UsbDevice; |
| 135 | 141 |
| 136 explicit UsbConfigDescriptor(PlatformUsbConfigDescriptor config); | 142 explicit UsbConfigDescriptor(PlatformUsbConfigDescriptor config); |
| 137 ~UsbConfigDescriptor(); | |
| 138 | 143 |
| 139 PlatformUsbConfigDescriptor config_; | 144 PlatformUsbConfigDescriptor config_; |
| 140 | 145 |
| 141 DISALLOW_COPY_AND_ASSIGN(UsbConfigDescriptor); | 146 DISALLOW_COPY_AND_ASSIGN(UsbConfigDescriptor); |
| 142 }; | 147 }; |
| 143 | 148 |
| 144 } // namespace usb_service; | 149 } // namespace usb_service; |
| 145 | 150 |
| 146 #endif // COMPONENTS_USB_SERVICE_USB_INTERFACE_H_ | 151 #endif // COMPONENTS_USB_SERVICE_USB_INTERFACE_H_ |
| OLD | NEW |