| 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_HANDLE_H_ | 5 #ifndef DEVICE_USB_USB_DEVICE_HANDLE_H_ |
| 6 #define DEVICE_USB_USB_DEVICE_HANDLE_H_ | 6 #define DEVICE_USB_USB_DEVICE_HANDLE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 // Notifies UsbDevice to drop the reference of this object; cancels all the | 45 // Notifies UsbDevice to drop the reference of this object; cancels all the |
| 46 // flying transfers. | 46 // flying transfers. |
| 47 // It is possible that the object has no other reference after this call. So | 47 // It is possible that the object has no other reference after this call. So |
| 48 // if it is called using a raw pointer, it could be invalidated. | 48 // if it is called using a raw pointer, it could be invalidated. |
| 49 // The platform device handle will be closed when UsbDeviceHandle destructs. | 49 // The platform device handle will be closed when UsbDeviceHandle destructs. |
| 50 virtual void Close() = 0; | 50 virtual void Close() = 0; |
| 51 | 51 |
| 52 // Device manipulation operations. These methods are blocking and must be | 52 // Device manipulation operations. These methods are blocking and must be |
| 53 // called on FILE thread. | 53 // called on FILE thread. |
| 54 virtual bool SetConfiguration(int configuration_value) = 0; |
| 54 virtual bool ClaimInterface(int interface_number) = 0; | 55 virtual bool ClaimInterface(int interface_number) = 0; |
| 55 virtual bool ReleaseInterface(int interface_number) = 0; | 56 virtual bool ReleaseInterface(int interface_number) = 0; |
| 56 virtual bool SetInterfaceAlternateSetting(int interface_number, | 57 virtual bool SetInterfaceAlternateSetting(int interface_number, |
| 57 int alternate_setting) = 0; | 58 int alternate_setting) = 0; |
| 58 virtual bool ResetDevice() = 0; | 59 virtual bool ResetDevice() = 0; |
| 59 | 60 |
| 60 // Gets the string descriptor with the given index from the device, or returns | 61 // Gets the string descriptor with the given index from the device, or returns |
| 61 // false. This method is blocking and must be called on the FILE thread. | 62 // false. This method is blocking and must be called on the FILE thread. |
| 62 virtual bool GetStringDescriptor(uint8 string_id, base::string16* string) = 0; | 63 virtual bool GetStringDescriptor(uint8 string_id, base::string16* string) = 0; |
| 63 | 64 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 UsbDeviceHandle() {}; | 103 UsbDeviceHandle() {}; |
| 103 | 104 |
| 104 virtual ~UsbDeviceHandle() {}; | 105 virtual ~UsbDeviceHandle() {}; |
| 105 | 106 |
| 106 DISALLOW_COPY_AND_ASSIGN(UsbDeviceHandle); | 107 DISALLOW_COPY_AND_ASSIGN(UsbDeviceHandle); |
| 107 }; | 108 }; |
| 108 | 109 |
| 109 } // namespace device | 110 } // namespace device |
| 110 | 111 |
| 111 #endif // DEVICE_USB_USB_DEVICE_HANDLE_H_ | 112 #endif // DEVICE_USB_USB_DEVICE_HANDLE_H_ |
| OLD | NEW |