| 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 <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
| 16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
| 17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
| 18 #include "base/thread_task_runner_handle.h" | 18 #include "base/thread_task_runner_handle.h" |
| 19 #include "components/device_event_log/device_event_log.h" | 19 #include "components/device_event_log/device_event_log.h" |
| 20 #include "device/usb/usb_context.h" | 20 #include "device/usb/usb_context.h" |
| 21 #include "device/usb/usb_descriptors.h" | 21 #include "device/usb/usb_descriptors.h" |
| 22 #include "device/usb/usb_device_impl.h" | 22 #include "device/usb/usb_device_impl.h" |
| 23 #include "device/usb/usb_error.h" | 23 #include "device/usb/usb_error.h" |
| 24 #include "device/usb/usb_service.h" | 24 #include "device/usb/usb_service.h" |
| 25 #include "net/base/io_buffer.h" |
| 25 #include "third_party/libusb/src/libusb/libusb.h" | 26 #include "third_party/libusb/src/libusb/libusb.h" |
| 26 | 27 |
| 27 namespace device { | 28 namespace device { |
| 28 | 29 |
| 29 typedef libusb_device* PlatformUsbDevice; | 30 typedef libusb_device* PlatformUsbDevice; |
| 30 | 31 |
| 31 void HandleTransferCompletion(PlatformUsbTransferHandle transfer); | 32 void HandleTransferCompletion(PlatformUsbTransferHandle transfer); |
| 32 | 33 |
| 33 namespace { | 34 namespace { |
| 34 | 35 |
| (...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 // Attempt-release all the interfaces. | 1012 // Attempt-release all the interfaces. |
| 1012 // It will be retained until the transfer cancellation is finished. | 1013 // It will be retained until the transfer cancellation is finished. |
| 1013 claimed_interfaces_.clear(); | 1014 claimed_interfaces_.clear(); |
| 1014 | 1015 |
| 1015 // Cannot close device handle here. Need to wait for libusb_cancel_transfer to | 1016 // Cannot close device handle here. Need to wait for libusb_cancel_transfer to |
| 1016 // finish. | 1017 // finish. |
| 1017 device_ = NULL; | 1018 device_ = NULL; |
| 1018 } | 1019 } |
| 1019 | 1020 |
| 1020 } // namespace device | 1021 } // namespace device |
| OLD | NEW |