| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 platform_alt_setting->extra, | 128 platform_alt_setting->extra, |
| 129 platform_alt_setting->extra + platform_alt_setting->extra_length); | 129 platform_alt_setting->extra + platform_alt_setting->extra_length); |
| 130 | 130 |
| 131 configuration->interfaces.push_back(interface); | 131 configuration->interfaces.push_back(interface); |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 | 134 |
| 135 configuration->extra_data.assign( | 135 configuration->extra_data.assign( |
| 136 platform_config->extra, | 136 platform_config->extra, |
| 137 platform_config->extra + platform_config->extra_length); | 137 platform_config->extra + platform_config->extra_length); |
| 138 |
| 139 configuration->AssignFirstInterfaceNumbers(); |
| 138 } | 140 } |
| 139 | 141 |
| 140 } // namespace | 142 } // namespace |
| 141 | 143 |
| 142 UsbDeviceImpl::UsbDeviceImpl( | 144 UsbDeviceImpl::UsbDeviceImpl( |
| 143 scoped_refptr<UsbContext> context, | 145 scoped_refptr<UsbContext> context, |
| 144 PlatformUsbDevice platform_device, | 146 PlatformUsbDevice platform_device, |
| 145 uint16_t vendor_id, | 147 uint16_t vendor_id, |
| 146 uint16_t product_id, | 148 uint16_t product_id, |
| 147 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner) | 149 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner) |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 void UsbDeviceImpl::Opened(PlatformUsbDeviceHandle platform_handle, | 331 void UsbDeviceImpl::Opened(PlatformUsbDeviceHandle platform_handle, |
| 330 const OpenCallback& callback) { | 332 const OpenCallback& callback) { |
| 331 DCHECK(thread_checker_.CalledOnValidThread()); | 333 DCHECK(thread_checker_.CalledOnValidThread()); |
| 332 scoped_refptr<UsbDeviceHandleImpl> device_handle = new UsbDeviceHandleImpl( | 334 scoped_refptr<UsbDeviceHandleImpl> device_handle = new UsbDeviceHandleImpl( |
| 333 context_, this, platform_handle, blocking_task_runner_); | 335 context_, this, platform_handle, blocking_task_runner_); |
| 334 handles_.push_back(device_handle); | 336 handles_.push_back(device_handle); |
| 335 callback.Run(device_handle); | 337 callback.Run(device_handle); |
| 336 } | 338 } |
| 337 | 339 |
| 338 } // namespace device | 340 } // namespace device |
| OLD | NEW |