Reland "Attach UsbContext to libusb_device(_handle) pointers" This is a reland of daa348fab9cae0919ebe9ded50782c6f7aa38be5 Original change's description: > Attach UsbContext to libusb_device(_handle) pointers > > This change modifies ScopedLibusbDeviceRef and adds a new class > ScopedLibusbDeviceHandle. This now explicitly own a reference to the > UsbContext object (which reference counts a libusb_context) in addition > to the libusb_device or libusb_device_handle they are wrapping. > > This resolves potential use-after-frees possible when posting tasks > with a ScopedLibusbDeviceRef since the UsbService the task is being > posted to could be destroyed before the task is executed. The > libusb_device would then be released after its libusb_context has been > destroyed. > > This is based on https://crrev.com/c/1131949 after I realized there > where additional issues that needed to be addressed. > > Bug: 838947 > Change-Id: Idee02828bf615bd477033e585fffe03cf4d20595 > Reviewed-on: https://chromium-review.googlesource.com/1145910 > Reviewed-by: Ken Rockot <rockot@chromium.org> > Commit-Queue: Reilly Grant <reillyg@chromium.org> > Cr-Commit-Position: refs/heads/master@{#577329} Bug: 838947 Change-Id: Ibb916b6dea86f05f0b6d2fdfa2d3b71f8c1e8c66 Reviewed-on: https://chromium-review.googlesource.com/1158770 Commit-Queue: Reilly Grant <reillyg@chromium.org> Reviewed-by: Matt Reynolds <mattreynolds@chromium.org> Cr-Commit-Position: refs/heads/master@{#581997}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .