• Min Qin's avatar
    Clear cancelled or non-resumable interrupted download from Download DB · 306ca843
    Min Qin authored
    We already started removing cancelled and non-resumable download from history
    DB. And we should do the same for download DB.
    This CL moves all the logic of clearing those download into DownloadManagerImpl.
    Here is the work flow:
    1. when in-progress download manager is loaded, clear all the non-resumable
    downloads.
    2. When DownloadHistory loads all the history items, a nullptr will be
    returned if the history item should be cleaned, and history DB will remove
    the item.
    3. After DownloadHistory finished loading, in-progress download manager will
    remove all the non-resumable downloads, so that we are guaranteed that changes
    in Download DB are propagated to DownloadHistory
    
    This CL also fixes issues that cancelled download in Download DB are not
    propagated to history DB.
    
    BUG=851650
    
    Change-Id: Ieeec319cd429ecca7a327e463e2a869dd00a7f4e
    Reviewed-on: https://chromium-review.googlesource.com/c/1285318Reviewed-by: default avatarXing Liu <xingliu@chromium.org>
    Commit-Queue: Min Qin <qinmin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#601367}
    306ca843
download_history.cc 22 KB