[hid] Avoid calling UnlinkTransfer after Close
This CL addresses two issues: In HidServiceWin, |platform_device_id_map| is initialized incorrectly for devices that do not use report IDs. The item added to the map incorrectly has an empty |report_ids| vector which effectively means that the corresponding device ID will never be used. To fix it, the |report_ids| vector is initialized with a single element with value 0, indicating that the corresponding device ID should be used for all reports. In HidConnectionWin, when the connection is closed the |transfers_| list is cleared. If |transfers_| was non-empty, this will invoke the destructor of any PendingHidTransfer objects that were in the list. If the callback calls UnlinkTransfer, the DCHECK is hit since |transfers_| is already cleared. To fix it, the callbacks should check |signaled| and only call UnlinkTransfer when the file handle was signaled by the OS. Bug: 1163277 Change-Id: Ic7897a9373afdd0a2045c8bc89bce7478f9ddf29 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2612505Reviewed-by:Reilly Grant <reillyg@chromium.org> Commit-Queue: Matt Reynolds <mattreynolds@chromium.org> Cr-Commit-Position: refs/heads/master@{#840755}
Showing
Please register or sign in to comment