OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "device/usb/usb_device_handle_usbfs.h" | 5 #include "device/usb/usb_device_handle_usbfs.h" |
6 | 6 |
7 #if defined(OS_ANDROID) && __ANDROID_API__ < 21 | 7 #if defined(OS_ANDROID) && __ANDROID_API__ < 21 |
8 #include <linux/usb_ch9.h> | 8 #include <linux/usb_ch9.h> |
9 #else | 9 #else |
10 #include <linux/usb/ch9.h> | 10 #include <linux/usb/ch9.h> |
11 #endif | 11 #endif |
12 | 12 |
13 #include <linux/usbdevice_fs.h> | 13 #include <linux/usbdevice_fs.h> |
14 #include <sys/ioctl.h> | 14 #include <sys/ioctl.h> |
15 | 15 |
16 #include <numeric> | 16 #include <numeric> |
17 | 17 |
18 #include "base/bind.h" | 18 #include "base/bind.h" |
19 #include "base/cancelable_callback.h" | 19 #include "base/cancelable_callback.h" |
20 #include "base/logging.h" | 20 #include "base/logging.h" |
21 #include "base/message_loop/message_loop.h" | 21 #include "base/message_loop/message_loop.h" |
22 #include "base/message_loop/message_pump_libevent.h" | 22 #include "base/message_loop/message_pump_libevent.h" |
23 #include "base/posix/eintr_wrapper.h" | 23 #include "base/posix/eintr_wrapper.h" |
24 #include "base/stl_util.h" | 24 #include "base/stl_util.h" |
25 #include "base/thread_task_runner_handle.h" | |
26 #include "base/threading/thread_restrictions.h" | 25 #include "base/threading/thread_restrictions.h" |
| 26 #include "base/threading/thread_task_runner_handle.h" |
27 #include "components/device_event_log/device_event_log.h" | 27 #include "components/device_event_log/device_event_log.h" |
28 #include "device/usb/usb_device_impl.h" | 28 #include "device/usb/usb_device_impl.h" |
29 #include "net/base/io_buffer.h" | 29 #include "net/base/io_buffer.h" |
30 | 30 |
31 namespace device { | 31 namespace device { |
32 | 32 |
33 namespace { | 33 namespace { |
34 | 34 |
35 uint8_t ConvertEndpointDirection(UsbEndpointDirection direction) { | 35 uint8_t ConvertEndpointDirection(UsbEndpointDirection direction) { |
36 switch (direction) { | 36 switch (direction) { |
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 packets[i].transferred_length = 0; | 846 packets[i].transferred_length = 0; |
847 packets[i].status = status; | 847 packets[i].status = status; |
848 } | 848 } |
849 transfer->RunIsochronousCallback(packets); | 849 transfer->RunIsochronousCallback(packets); |
850 } else { | 850 } else { |
851 transfer->RunCallback(status, 0); | 851 transfer->RunCallback(status, 0); |
852 } | 852 } |
853 } | 853 } |
854 | 854 |
855 } // namespace device | 855 } // namespace device |
OLD | NEW |