| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/usb/usb_device.h" | 5 #include "chrome/browser/usb/usb_device.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "base/synchronization/lock.h" | 8 #include "base/synchronization/lock.h" |
| 9 #include "chrome/browser/usb/usb_service.h" | 9 #include "chrome/browser/usb/usb_service.h" |
| 10 #include "third_party/libusb/libusb/libusb.h" | 10 #include "third_party/libusb/libusb.h" |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 static uint8 ConvertTransferDirection( | 14 static uint8 ConvertTransferDirection( |
| 15 const UsbDevice::TransferDirection direction) { | 15 const UsbDevice::TransferDirection direction) { |
| 16 switch (direction) { | 16 switch (direction) { |
| 17 case UsbDevice::INBOUND: | 17 case UsbDevice::INBOUND: |
| 18 return LIBUSB_ENDPOINT_IN; | 18 return LIBUSB_ENDPOINT_IN; |
| 19 case UsbDevice::OUTBOUND: | 19 case UsbDevice::OUTBOUND: |
| 20 return LIBUSB_ENDPOINT_OUT; | 20 return LIBUSB_ENDPOINT_OUT; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 const net::CompletionCallback& callback) { | 156 const net::CompletionCallback& callback) { |
| 157 Transfer transfer; | 157 Transfer transfer; |
| 158 transfer.buffer = buffer; | 158 transfer.buffer = buffer; |
| 159 transfer.callback = callback; | 159 transfer.callback = callback; |
| 160 | 160 |
| 161 { | 161 { |
| 162 base::AutoLock lock(lock_); | 162 base::AutoLock lock(lock_); |
| 163 transfers_[handle] = transfer; | 163 transfers_[handle] = transfer; |
| 164 } | 164 } |
| 165 } | 165 } |
| OLD | NEW |