Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: device/usb/usb_device_impl.cc

Issue 1857033002: Include USB device version in chrome.usb.Device fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/usb/usb_device_impl.h ('k') | device/usb/usb_service_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 platform_config->extra + platform_config->extra_length); 137 platform_config->extra + platform_config->extra_length);
138 138
139 configuration->AssignFirstInterfaceNumbers(); 139 configuration->AssignFirstInterfaceNumbers();
140 } 140 }
141 141
142 } // namespace 142 } // namespace
143 143
144 UsbDeviceImpl::UsbDeviceImpl( 144 UsbDeviceImpl::UsbDeviceImpl(
145 scoped_refptr<UsbContext> context, 145 scoped_refptr<UsbContext> context,
146 PlatformUsbDevice platform_device, 146 PlatformUsbDevice platform_device,
147 uint16_t vendor_id, 147 const libusb_device_descriptor& descriptor,
148 uint16_t product_id,
149 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner) 148 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner)
150 : UsbDevice(vendor_id, 149 : UsbDevice(descriptor.bcdUSB,
151 product_id, 150 descriptor.bDeviceClass,
151 descriptor.bDeviceSubClass,
152 descriptor.bDeviceProtocol,
153 descriptor.idVendor,
154 descriptor.idProduct,
155 descriptor.bcdDevice,
152 base::string16(), 156 base::string16(),
153 base::string16(), 157 base::string16(),
154 base::string16()), 158 base::string16()),
155 platform_device_(platform_device), 159 platform_device_(platform_device),
156 context_(context), 160 context_(context),
157 task_runner_(base::ThreadTaskRunnerHandle::Get()), 161 task_runner_(base::ThreadTaskRunnerHandle::Get()),
158 blocking_task_runner_(blocking_task_runner) { 162 blocking_task_runner_(blocking_task_runner) {
159 CHECK(platform_device) << "platform_device cannot be NULL"; 163 CHECK(platform_device) << "platform_device cannot be NULL";
160 libusb_ref_device(platform_device); 164 libusb_ref_device(platform_device);
161 ReadAllConfigurations(); 165 ReadAllConfigurations();
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 void UsbDeviceImpl::Opened(PlatformUsbDeviceHandle platform_handle, 335 void UsbDeviceImpl::Opened(PlatformUsbDeviceHandle platform_handle,
332 const OpenCallback& callback) { 336 const OpenCallback& callback) {
333 DCHECK(thread_checker_.CalledOnValidThread()); 337 DCHECK(thread_checker_.CalledOnValidThread());
334 scoped_refptr<UsbDeviceHandleImpl> device_handle = new UsbDeviceHandleImpl( 338 scoped_refptr<UsbDeviceHandleImpl> device_handle = new UsbDeviceHandleImpl(
335 context_, this, platform_handle, blocking_task_runner_); 339 context_, this, platform_handle, blocking_task_runner_);
336 handles_.push_back(device_handle); 340 handles_.push_back(device_handle);
337 callback.Run(device_handle); 341 callback.Run(device_handle);
338 } 342 }
339 343
340 } // namespace device 344 } // namespace device
OLDNEW
« no previous file with comments | « device/usb/usb_device_impl.h ('k') | device/usb/usb_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698