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_handle_impl.h" | 5 #include "device/usb/usb_device_handle_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <numeric> | 9 #include <numeric> |
10 #include <utility> | 10 #include <utility> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/location.h" | 14 #include "base/location.h" |
15 #include "base/macros.h" | 15 #include "base/macros.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/strings/string16.h" | 18 #include "base/strings/string16.h" |
19 #include "base/synchronization/lock.h" | 19 #include "base/synchronization/lock.h" |
20 #include "base/thread_task_runner_handle.h" | 20 #include "base/threading/thread_task_runner_handle.h" |
21 #include "components/device_event_log/device_event_log.h" | 21 #include "components/device_event_log/device_event_log.h" |
22 #include "device/usb/usb_context.h" | 22 #include "device/usb/usb_context.h" |
23 #include "device/usb/usb_descriptors.h" | 23 #include "device/usb/usb_descriptors.h" |
24 #include "device/usb/usb_device_impl.h" | 24 #include "device/usb/usb_device_impl.h" |
25 #include "device/usb/usb_error.h" | 25 #include "device/usb/usb_error.h" |
26 #include "device/usb/usb_service.h" | 26 #include "device/usb/usb_service.h" |
27 #include "net/base/io_buffer.h" | 27 #include "net/base/io_buffer.h" |
28 #include "third_party/libusb/src/libusb/libusb.h" | 28 #include "third_party/libusb/src/libusb/libusb.h" |
29 | 29 |
30 namespace device { | 30 namespace device { |
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 } else { | 1121 } else { |
1122 transfer->callback_task_runner()->PostTask(FROM_HERE, callback); | 1122 transfer->callback_task_runner()->PostTask(FROM_HERE, callback); |
1123 } | 1123 } |
1124 | 1124 |
1125 // libusb_free_transfer races with libusb_submit_transfer and only work- | 1125 // libusb_free_transfer races with libusb_submit_transfer and only work- |
1126 // around is to make sure to call them on the same thread. | 1126 // around is to make sure to call them on the same thread. |
1127 blocking_task_runner_->DeleteSoon(FROM_HERE, transfer); | 1127 blocking_task_runner_->DeleteSoon(FROM_HERE, transfer); |
1128 } | 1128 } |
1129 | 1129 |
1130 } // namespace device | 1130 } // namespace device |
OLD | NEW |