[Nearby] Clean up removed outgoing share targets
Before this CL, failed or cancelled send attempts resulted in duplicate share targets in the UI on the next send attempt. The root cause of this behavior was that the share target from the failed/cancelled attempt was overwritten in the endpoint-ID --> outgoing-share-target map during the second share attempt (using the same endpoint ID), and observers were not notified that the previous share target was removed. In this CL, we handle removal of outgoing share targets in a consistent way. The removal process is as follows: - The share target is removed from the |outgoing_share_target_map_|. - File payloads are released. - The share target info is removed from |outgoing_share_target_info_map_|. - Send-discovery observers are notified that a share target was lost. Fixed: 1133824 Change-Id: Ia5faf674ae50e86a1d813d4e2f58d770248c95b9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2491221Reviewed-by:James Vecore <vecore@google.com> Commit-Queue: Josh Nohle <nohle@chromium.org> Cr-Commit-Position: refs/heads/master@{#819807}
Showing
Please register or sign in to comment