| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <utility> | 11 #include <utility> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
| 17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 18 #include "device/usb/usb_descriptors.h" | 18 #include "device/usb/usb_descriptors.h" |
| 19 #include "device/usb/usb_device.h" | 19 #include "device/usb/usb_device.h" |
| 20 #include "device/usb/webusb_descriptors.h" | 20 #include "device/usb/webusb_descriptors.h" |
| 21 | 21 |
| 22 struct libusb_device; | 22 struct libusb_device; |
| 23 struct libusb_device_descriptor; |
| 24 struct libusb_device_handle; |
| 23 struct libusb_config_descriptor; | 25 struct libusb_config_descriptor; |
| 24 struct libusb_device_handle; | |
| 25 | 26 |
| 26 namespace base { | 27 namespace base { |
| 27 class SequencedTaskRunner; | 28 class SequencedTaskRunner; |
| 28 } | 29 } |
| 29 | 30 |
| 30 namespace dbus { | 31 namespace dbus { |
| 31 class FileDescriptor; | 32 class FileDescriptor; |
| 32 } | 33 } |
| 33 | 34 |
| 34 namespace device { | 35 namespace device { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 70 |
| 70 PlatformUsbDevice platform_device() const { return platform_device_; } | 71 PlatformUsbDevice platform_device() const { return platform_device_; } |
| 71 | 72 |
| 72 protected: | 73 protected: |
| 73 friend class UsbServiceImpl; | 74 friend class UsbServiceImpl; |
| 74 friend class UsbDeviceHandleImpl; | 75 friend class UsbDeviceHandleImpl; |
| 75 | 76 |
| 76 // Called by UsbServiceImpl only; | 77 // Called by UsbServiceImpl only; |
| 77 UsbDeviceImpl(scoped_refptr<UsbContext> context, | 78 UsbDeviceImpl(scoped_refptr<UsbContext> context, |
| 78 PlatformUsbDevice platform_device, | 79 PlatformUsbDevice platform_device, |
| 79 uint16_t vendor_id, | 80 const libusb_device_descriptor& descriptor, |
| 80 uint16_t product_id, | |
| 81 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner); | 81 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner); |
| 82 | 82 |
| 83 ~UsbDeviceImpl() override; | 83 ~UsbDeviceImpl() override; |
| 84 | 84 |
| 85 // Called only by UsbServiceImpl. | 85 // Called only by UsbServiceImpl. |
| 86 void set_visited(bool visited) { visited_ = visited; } | 86 void set_visited(bool visited) { visited_ = visited; } |
| 87 bool was_visited() const { return visited_; } | 87 bool was_visited() const { return visited_; } |
| 88 void OnDisconnect(); | 88 void OnDisconnect(); |
| 89 void ReadAllConfigurations(); | 89 void ReadAllConfigurations(); |
| 90 | 90 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 129 |
| 130 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 130 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| 131 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 131 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
| 132 | 132 |
| 133 DISALLOW_COPY_AND_ASSIGN(UsbDeviceImpl); | 133 DISALLOW_COPY_AND_ASSIGN(UsbDeviceImpl); |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 } // namespace device | 136 } // namespace device |
| 137 | 137 |
| 138 #endif // DEVICE_USB_USB_DEVICE_IMPL_H_ | 138 #endif // DEVICE_USB_USB_DEVICE_IMPL_H_ |
| OLD | NEW |