Fetch USB device strings asynchronously to avoid libusb race conditions.
commit91fa99545857ef7fe11c573c98be90bd640b5eeb
authorreillyg <reillyg@chromium.org>
Mon, 15 Jun 2015 21:47:19 +0000 (15 14:47 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 15 Jun 2015 21:48:02 +0000 (15 21:48 +0000)
treec10a59680220e9933c42c5bc6b32378431990da8
parente989c09f64fd1be30a630852420ca172408718d7
Fetch USB device strings asynchronously to avoid libusb race conditions.

libusb offers both synchronous and asynchronous APIs however it is
dangerous to mix them as this can result in races between the thread
running the libusb I/O loop and the thread making the synchronous
request. This patch ditches calls to libusb_get_string_descriptor for a
brand new asynchronous path using the existing I/O methods available in
UsbDeviceHandle.

BUG=439594

Review URL: https://codereview.chromium.org/1181773004

Cr-Commit-Position: refs/heads/master@{#334466}
device/usb/usb_device.cc
device/usb/usb_device.h
device/usb/usb_device_impl.cc
device/usb/usb_device_impl.h
device/usb/usb_service_impl.cc
device/usb/usb_service_impl.h