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_IMPL_H_ | 5 #ifndef DEVICE_USB_USB_DEVICE_IMPL_H_ |
6 #define DEVICE_USB_USB_DEVICE_IMPL_H_ | 6 #define DEVICE_USB_USB_DEVICE_IMPL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 virtual ~UsbDeviceImpl(); | 57 virtual ~UsbDeviceImpl(); |
58 | 58 |
59 // Called only be UsbService. | 59 // Called only be UsbService. |
60 void OnDisconnect(); | 60 void OnDisconnect(); |
61 | 61 |
62 private: | 62 private: |
63 base::ThreadChecker thread_checker_; | 63 base::ThreadChecker thread_checker_; |
64 PlatformUsbDevice platform_device_; | 64 PlatformUsbDevice platform_device_; |
65 | 65 |
66 #if defined(OS_LINUX) | 66 #if defined(USE_UDEV) |
67 // On Linux these properties are read from sysfs when the device is enumerated | 67 // On Linux these properties are read from sysfs when the device is enumerated |
68 // to avoid hitting the permission broker on Chrome OS for a real string | 68 // to avoid hitting the permission broker on Chrome OS for a real string |
69 // descriptor request. | 69 // descriptor request. |
70 std::string manufacturer_; | 70 std::string manufacturer_; |
71 std::string product_; | 71 std::string product_; |
72 std::string serial_number_; | 72 std::string serial_number_; |
73 #endif | 73 #endif |
74 | 74 |
75 // The active configuration descriptor is not read immediately but cached for | 75 // The active configuration descriptor is not read immediately but cached for |
76 // later use. | 76 // later use. |
77 bool current_configuration_cached_; | 77 bool current_configuration_cached_; |
78 UsbConfigDescriptor current_configuration_; | 78 UsbConfigDescriptor current_configuration_; |
79 | 79 |
80 // Retain the context so that it will not be released before UsbDevice. | 80 // Retain the context so that it will not be released before UsbDevice. |
81 scoped_refptr<UsbContext> context_; | 81 scoped_refptr<UsbContext> context_; |
82 | 82 |
83 // Opened handles. | 83 // Opened handles. |
84 typedef std::vector<scoped_refptr<UsbDeviceHandleImpl> > HandlesVector; | 84 typedef std::vector<scoped_refptr<UsbDeviceHandleImpl> > HandlesVector; |
85 HandlesVector handles_; | 85 HandlesVector handles_; |
86 | 86 |
87 // Reference to the UI thread for permission-broker calls. | 87 // Reference to the UI thread for permission-broker calls. |
88 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 88 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
89 | 89 |
90 DISALLOW_COPY_AND_ASSIGN(UsbDeviceImpl); | 90 DISALLOW_COPY_AND_ASSIGN(UsbDeviceImpl); |
91 }; | 91 }; |
92 | 92 |
93 } // namespace device | 93 } // namespace device |
94 | 94 |
95 #endif // DEVICE_USB_USB_DEVICE_IMPL_H_ | 95 #endif // DEVICE_USB_USB_DEVICE_IMPL_H_ |
OLD | NEW |