Description[Download Home] Add missing files to map
Problematically, new DownloadItems are created with no file name
when a download first starts. This means that the
DownloadHistoryItemWrapper is added to the wrong part of the
FilePathsToDownloadItemsMap and can't be removed until the user
re-opens Download Home, which correctly records the DownloadItem
in the correct place.
* Change the behavior so a download completion event also triggers
the item to be added to the map -- this time with the correct
file path.
* Also make the FilePathsToDownloadItemsMap use a HashSet for its
secondary data structure. It ends up slightly cleaner IMO.
* Cleans up the StubbedProvider so that it can take in specific
download percentages more easily.
* Add a new test for this behavior.
BUG=670583
TEST=DownloadHistoryAdapterTest*
Review-Url: https://codereview.chromium.org/2626903005
Cr-Commit-Position: refs/heads/master@{#442960}
Committed: https://chromium.googlesource.com/chromium/src/+/ff8ffc7fe93a0348148eea2221b093feb711da9a
Patch Set 1 #Patch Set 2 : Add test #Patch Set 3 : Rebasing #
Messages
Total messages: 12 (7 generated)
|