Commit 4a3710bb authored by Matt Reynolds's avatar Matt Reynolds Committed by Commit Bot

[usb] Preserve device GUID when reading device descriptor

When a USB device descriptor is read, a UsbDeviceInfo object is
created with information about the device. This info is used to
update the UsbDeviceInfo held by the UsbDevice object. However,
some UsbDeviceInfo fields are not filled when the device descriptor
is read and must be preserved from the original UsbDeviceInfo.

This CL adds |guid| to the list of fields that must be preserved
from the UsbDeviceInfo held by the UsbDevice object.

BUG=1012862

Change-Id: Ib97c2e63155c432141fd57477687ca70bbfdd212
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1850414Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750850}
parent 40605a20
...@@ -83,7 +83,9 @@ void UsbDeviceWin::OnReadDescriptors( ...@@ -83,7 +83,9 @@ void UsbDeviceWin::OnReadDescriptors(
return; return;
} }
// Keep |bus_number| and |port_number| before updating the |device_info_|. // Keep |guid|, |bus_number| and |port_number| before updating the
// |device_info_|.
descriptor->device_info->guid = device_info_->guid,
descriptor->device_info->bus_number = device_info_->bus_number, descriptor->device_info->bus_number = device_info_->bus_number,
descriptor->device_info->port_number = device_info_->port_number, descriptor->device_info->port_number = device_info_->port_number,
device_info_ = std::move(descriptor->device_info); device_info_ = std::move(descriptor->device_info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment