| 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_IMPL_H_ | 5 #ifndef DEVICE_USB_USB_INTERFACE_IMPL_H_ |
| 6 #define COMPONENTS_USB_SERVICE_USB_INTERFACE_IMPL_H_ | 6 #define DEVICE_USB_USB_INTERFACE_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "components/usb_service/usb_interface.h" | 9 #include "device/usb/usb_interface.h" |
| 10 #include "components/usb_service/usb_service_export.h" | |
| 11 | 10 |
| 12 struct libusb_config_descriptor; | 11 struct libusb_config_descriptor; |
| 13 struct libusb_endpoint_descriptor; | 12 struct libusb_endpoint_descriptor; |
| 14 struct libusb_interface; | 13 struct libusb_interface; |
| 15 struct libusb_interface_descriptor; | 14 struct libusb_interface_descriptor; |
| 16 | 15 |
| 17 namespace usb_service { | 16 namespace device { |
| 18 | 17 |
| 19 typedef libusb_config_descriptor* PlatformUsbConfigDescriptor; | 18 typedef libusb_config_descriptor* PlatformUsbConfigDescriptor; |
| 20 typedef const libusb_endpoint_descriptor* PlatformUsbEndpointDescriptor; | 19 typedef const libusb_endpoint_descriptor* PlatformUsbEndpointDescriptor; |
| 21 typedef const libusb_interface* PlatformUsbInterface; | 20 typedef const libusb_interface* PlatformUsbInterface; |
| 22 typedef const libusb_interface_descriptor* PlatformUsbInterfaceDescriptor; | 21 typedef const libusb_interface_descriptor* PlatformUsbInterfaceDescriptor; |
| 23 | 22 |
| 24 class UsbConfigDescriptorImpl; | 23 class UsbConfigDescriptorImpl; |
| 25 class UsbInterfaceAltSettingDescriptor; | 24 class UsbInterfaceAltSettingDescriptor; |
| 26 | 25 |
| 27 class UsbEndpointDescriptorImpl : public UsbEndpointDescriptor { | 26 class UsbEndpointDescriptorImpl : public UsbEndpointDescriptor { |
| 28 public: | 27 public: |
| 29 virtual int GetAddress() const OVERRIDE; | 28 virtual int GetAddress() const OVERRIDE; |
| 30 virtual UsbEndpointDirection GetDirection() const OVERRIDE; | 29 virtual UsbEndpointDirection GetDirection() const OVERRIDE; |
| 31 virtual int GetMaximumPacketSize() const OVERRIDE; | 30 virtual int GetMaximumPacketSize() const OVERRIDE; |
| 32 virtual UsbSynchronizationType GetSynchronizationType() const OVERRIDE; | 31 virtual UsbSynchronizationType GetSynchronizationType() const OVERRIDE; |
| 33 virtual UsbTransferType GetTransferType() const OVERRIDE; | 32 virtual UsbTransferType GetTransferType() const OVERRIDE; |
| 34 virtual UsbUsageType GetUsageType() const OVERRIDE; | 33 virtual UsbUsageType GetUsageType() const OVERRIDE; |
| 35 virtual int GetPollingInterval() const OVERRIDE; | 34 virtual int GetPollingInterval() const OVERRIDE; |
| 36 | 35 |
| 37 private: | 36 private: |
| 38 friend class base::RefCounted<const UsbEndpointDescriptorImpl>; | 37 friend class base::RefCounted<const UsbEndpointDescriptorImpl>; |
| 39 friend class UsbInterfaceAltSettingDescriptorImpl; | 38 friend class UsbInterfaceAltSettingDescriptorImpl; |
| 40 | 39 |
| 41 UsbEndpointDescriptorImpl(scoped_refptr<const UsbConfigDescriptor> config, | 40 UsbEndpointDescriptorImpl(scoped_refptr<const UsbConfigDescriptor> config, |
| 42 PlatformUsbEndpointDescriptor descriptor); | 41 PlatformUsbEndpointDescriptor descriptor); |
| 43 virtual ~UsbEndpointDescriptorImpl(); | 42 virtual ~UsbEndpointDescriptorImpl(); |
| 44 | 43 |
| 45 scoped_refptr<const UsbConfigDescriptor> config_; | 44 scoped_refptr<const UsbConfigDescriptor> config_; |
| 46 PlatformUsbEndpointDescriptor descriptor_; | 45 PlatformUsbEndpointDescriptor descriptor_; |
| 47 | 46 |
| 48 DISALLOW_COPY_AND_ASSIGN(UsbEndpointDescriptorImpl); | 47 DISALLOW_COPY_AND_ASSIGN(UsbEndpointDescriptorImpl); |
| 49 }; | 48 }; |
| 50 | 49 |
| 51 class UsbInterfaceAltSettingDescriptorImpl | 50 class UsbInterfaceAltSettingDescriptorImpl |
| 52 : public UsbInterfaceAltSettingDescriptor { | 51 : public UsbInterfaceAltSettingDescriptor { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 friend class UsbDeviceImpl; | 105 friend class UsbDeviceImpl; |
| 107 | 106 |
| 108 explicit UsbConfigDescriptorImpl(PlatformUsbConfigDescriptor config); | 107 explicit UsbConfigDescriptorImpl(PlatformUsbConfigDescriptor config); |
| 109 virtual ~UsbConfigDescriptorImpl(); | 108 virtual ~UsbConfigDescriptorImpl(); |
| 110 | 109 |
| 111 PlatformUsbConfigDescriptor config_; | 110 PlatformUsbConfigDescriptor config_; |
| 112 | 111 |
| 113 DISALLOW_COPY_AND_ASSIGN(UsbConfigDescriptorImpl); | 112 DISALLOW_COPY_AND_ASSIGN(UsbConfigDescriptorImpl); |
| 114 }; | 113 }; |
| 115 | 114 |
| 116 } // namespace usb_service; | 115 } // namespace device |
| 117 | 116 |
| 118 #endif // COMPONENTS_USB_SERVICE_USB_INTERFACE_IMPL_H_ | 117 #endif // DEVICE_USB_USB_INTERFACE_IMPL_H_ |
| OLD | NEW |