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 #include "device/usb/usb_device_impl.h" | 5 #include "device/usb/usb_device_impl.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/posix/eintr_wrapper.h" | 14 #include "base/posix/eintr_wrapper.h" |
15 #include "base/sequenced_task_runner.h" | 15 #include "base/sequenced_task_runner.h" |
16 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
17 #include "base/stl_util.h" | 17 #include "base/stl_util.h" |
18 #include "base/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.h" |
19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
20 #include "components/device_event_log/device_event_log.h" | 20 #include "components/device_event_log/device_event_log.h" |
21 #include "device/usb/usb_context.h" | 21 #include "device/usb/usb_context.h" |
22 #include "device/usb/usb_descriptors.h" | 22 #include "device/usb/usb_descriptors.h" |
23 #include "device/usb/usb_error.h" | 23 #include "device/usb/usb_error.h" |
24 #include "third_party/libusb/src/libusb/libusb.h" | 24 #include "third_party/libusb/src/libusb/libusb.h" |
25 | 25 |
26 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_LINUX) | 26 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) || defined(OS_LINUX) |
27 #include "device/usb/usb_device_handle_usbfs.h" | 27 #include "device/usb/usb_device_handle_usbfs.h" |
28 #else | 28 #else |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 DCHECK(thread_checker_.CalledOnValidThread()); | 361 DCHECK(thread_checker_.CalledOnValidThread()); |
362 scoped_refptr<UsbDeviceHandle> device_handle = new UsbDeviceHandleImpl( | 362 scoped_refptr<UsbDeviceHandle> device_handle = new UsbDeviceHandleImpl( |
363 context_, this, platform_handle, blocking_task_runner_); | 363 context_, this, platform_handle, blocking_task_runner_); |
364 handles_.push_back(device_handle.get()); | 364 handles_.push_back(device_handle.get()); |
365 callback.Run(device_handle); | 365 callback.Run(device_handle); |
366 } | 366 } |
367 | 367 |
368 #endif // defined(OS_LINUX) | 368 #endif // defined(OS_LINUX) |
369 | 369 |
370 } // namespace device | 370 } // namespace device |
OLD | NEW |