OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_DEVICE_IMPL_H_ | 5 #ifndef DEVICE_DEVICES_APP_USB_DEVICE_IMPL_H_ |
6 #define DEVICE_USB_DEVICE_IMPL_H_ | 6 #define DEVICE_DEVICES_APP_USB_DEVICE_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "device/devices_app/usb/public/interfaces/device.mojom.h" | 14 #include "device/devices_app/usb/public/interfaces/device.mojom.h" |
15 #include "device/devices_app/usb/public/interfaces/permission_provider.mojom.h" | 15 #include "device/devices_app/usb/public/interfaces/permission_provider.mojom.h" |
16 #include "device/usb/usb_device_handle.h" | 16 #include "device/usb/usb_device_handle.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 void GenericTransferIn(uint8_t endpoint_number, | 77 void GenericTransferIn(uint8_t endpoint_number, |
78 uint32_t length, | 78 uint32_t length, |
79 uint32_t timeout, | 79 uint32_t timeout, |
80 const GenericTransferInCallback& callback) override; | 80 const GenericTransferInCallback& callback) override; |
81 void GenericTransferOut(uint8_t endpoint_number, | 81 void GenericTransferOut(uint8_t endpoint_number, |
82 mojo::Array<uint8_t> data, | 82 mojo::Array<uint8_t> data, |
83 uint32_t timeout, | 83 uint32_t timeout, |
84 const GenericTransferOutCallback& callback) override; | 84 const GenericTransferOutCallback& callback) override; |
85 void IsochronousTransferIn( | 85 void IsochronousTransferIn( |
86 uint8_t endpoint_number, | 86 uint8_t endpoint_number, |
87 uint32_t num_packets, | 87 mojo::Array<uint32_t> packet_lengths, |
88 uint32_t packet_length, | |
89 uint32_t timeout, | 88 uint32_t timeout, |
90 const IsochronousTransferInCallback& callback) override; | 89 const IsochronousTransferInCallback& callback) override; |
91 void IsochronousTransferOut( | 90 void IsochronousTransferOut( |
92 uint8_t endpoint_number, | 91 uint8_t endpoint_number, |
93 mojo::Array<mojo::Array<uint8_t>> packets, | 92 mojo::Array<uint8_t> data, |
| 93 mojo::Array<uint32_t> packet_lengths, |
94 uint32_t timeout, | 94 uint32_t timeout, |
95 const IsochronousTransferOutCallback& callback) override; | 95 const IsochronousTransferOutCallback& callback) override; |
96 | 96 |
97 mojo::Binding<Device> binding_; | 97 mojo::Binding<Device> binding_; |
98 | 98 |
99 scoped_refptr<UsbDevice> device_; | 99 scoped_refptr<UsbDevice> device_; |
100 // The device handle. Will be null before the device is opened and after it | 100 // The device handle. Will be null before the device is opened and after it |
101 // has been closed. | 101 // has been closed. |
102 scoped_refptr<UsbDeviceHandle> device_handle_; | 102 scoped_refptr<UsbDeviceHandle> device_handle_; |
103 PermissionProviderPtr permission_provider_; | 103 PermissionProviderPtr permission_provider_; |
104 | 104 |
105 base::WeakPtrFactory<DeviceImpl> weak_factory_; | 105 base::WeakPtrFactory<DeviceImpl> weak_factory_; |
106 | 106 |
107 DISALLOW_COPY_AND_ASSIGN(DeviceImpl); | 107 DISALLOW_COPY_AND_ASSIGN(DeviceImpl); |
108 }; | 108 }; |
109 | 109 |
110 } // namespace usb | 110 } // namespace usb |
111 } // namespace device | 111 } // namespace device |
112 | 112 |
113 #endif // DEVICE_USB_DEVICE_IMPL_H_ | 113 #endif // DEVICE_DEVICES_APP_USB_DEVICE_IMPL_H_ |
OLD | NEW |