• Min Qin's avatar
    Solve an issue that OnDownloadCreated may not be called in LoadHistoryDownloads · 67332adc
    Min Qin authored
    When in-progress DB is enabled, DownloadHistory will wait for in-progress
    DB to load first before loading its own downloads.
    If a download item exists in both DB, then onDownloadCreated() will be called
    before DownloadHistory load the same item.
    As a result, when LoadHistoryDownloads() is called, the OnDownloadCreated()
    reentrance call will not happen for that download.
    This causes the DownloadHistoryData::PERSISTED to not get set.
    And later on when the download is deleted, it will be skipped by DownloadHistory, thus showing inconsistent result.
    
    This CL fixes the problem by explicitly adding the
    DownloadHistoryData::PERSISTED after each item is loaded in
    LoadHistoryDownload() call.
    
    BUG=842245
    
    Change-Id: Id15762e46992644e11d6c9bfd46ead39bb64b13b
    Reviewed-on: https://chromium-review.googlesource.com/1145865Reviewed-by: default avatarXing Liu <xingliu@chromium.org>
    Commit-Queue: Min Qin <qinmin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#577984}
    67332adc
download_history.h 6.54 KB