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_DEVICE_H_ | 5 #ifndef COMPONENTS_USB_SERVICE_USB_DEVICE_H_ |
6 #define COMPONENTS_USB_SERVICE_USB_DEVICE_H_ | 6 #define COMPONENTS_USB_SERVICE_USB_DEVICE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // Closing a closed handle is a safe | 54 // Closing a closed handle is a safe |
55 // Blocking method. Must be called on FILE thread. | 55 // Blocking method. Must be called on FILE thread. |
56 virtual bool Close(scoped_refptr<UsbDeviceHandle> handle); | 56 virtual bool Close(scoped_refptr<UsbDeviceHandle> handle); |
57 | 57 |
58 // Lists the interfaces provided by the device and fills the given | 58 // Lists the interfaces provided by the device and fills the given |
59 // UsbConfigDescriptor. | 59 // UsbConfigDescriptor. |
60 // Blocking method. Must be called on FILE thread. | 60 // Blocking method. Must be called on FILE thread. |
61 virtual scoped_refptr<UsbConfigDescriptor> ListInterfaces(); | 61 virtual scoped_refptr<UsbConfigDescriptor> ListInterfaces(); |
62 | 62 |
63 protected: | 63 protected: |
64 friend class UsbService; | 64 friend class UsbServiceImpl; |
65 friend class base::RefCountedThreadSafe<UsbDevice>; | 65 friend class base::RefCountedThreadSafe<UsbDevice>; |
66 | 66 |
67 // Called by UsbService only; | 67 // Called by UsbService only; |
68 UsbDevice(scoped_refptr<UsbContext> context, | 68 UsbDevice(scoped_refptr<UsbContext> context, |
69 PlatformUsbDevice platform_device, | 69 PlatformUsbDevice platform_device, |
70 uint16 vendor_id, | 70 uint16 vendor_id, |
71 uint16 product_id, | 71 uint16 product_id, |
72 uint32 unique_id); | 72 uint32 unique_id); |
73 | 73 |
74 // Constructor called in test only. | 74 // Constructor called in test only. |
(...skipping 17 matching lines...) Expand all Loading... |
92 HandlesVector handles_; | 92 HandlesVector handles_; |
93 | 93 |
94 base::ThreadChecker thread_checker_; | 94 base::ThreadChecker thread_checker_; |
95 | 95 |
96 DISALLOW_COPY_AND_ASSIGN(UsbDevice); | 96 DISALLOW_COPY_AND_ASSIGN(UsbDevice); |
97 }; | 97 }; |
98 | 98 |
99 } // namespace usb_service | 99 } // namespace usb_service |
100 | 100 |
101 #endif // COMPONENTS_USB_SERVICE_USB_DEVICE_H_ | 101 #endif // COMPONENTS_USB_SERVICE_USB_DEVICE_H_ |
OLD | NEW |