Track libusb_transfer lifetime in a separate class.
commit30c6291b559f48df49b94c08d604c9dc6c10e101
authorreillyg <reillyg@chromium.org>
Mon, 1 Dec 2014 22:14:52 +0000 (1 14:14 -0800)
committerCommit bot <commit-bot@chromium.org>
Mon, 1 Dec 2014 22:15:32 +0000 (1 22:15 +0000)
tree291bdf85dd3d1535419c15dc284e4f1f32cdab36
parent1c11807f324926dc029025636f2630aeee63eca0
Track libusb_transfer lifetime in a separate class.

This change makes UsbDeviceHandleImpl::Transfer a full class that is now
responsible for the lifetime of the libusb_transfer object that it
holds. Accessors are provided to make it easy to construct the right
type of transfer. The pointer back to the UsbDeviceHandle is weak so
that if a transfer outlasts the object that owns it the completion will
be safely discarded.

BUG=434800

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

Cr-Commit-Position: refs/heads/master@{#306268}
device/usb/usb_device_handle_impl.cc
device/usb/usb_device_handle_impl.h