Commit c534927e authored by Min Qin's avatar Min Qin Committed by Commit Bot

Remove in-progress download files when DownloadManagerImpl shuts down

Shutting down the download manager will not remove in-progress file today.
However, in downloadItemImpl::InterruptWithPartialState(), if the download is
in a resuming state while download manager got shudown, then the file is
removed. This behavior is not consistent.
Since desktop already has the warning dialog when user tries to shut down
Chrome while there are in-progress download, we don't need to keep the
in-progress files. Clicking shut down pretty much means canceling the download.

BUG=901642

Change-Id: I7bcf30b21fca59bf2cc57a23f0a41d49f0639ce8
Reviewed-on: https://chromium-review.googlesource.com/c/1321574Reviewed-by: default avatarXing Liu <xingliu@chromium.org>
Commit-Queue: Min Qin <qinmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608563}
parent 292d851b
......@@ -459,7 +459,6 @@ ResumeMode GetDownloadResumeMode(DownloadInterruptReason reason,
case DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN:
case DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED:
case DOWNLOAD_INTERRUPT_REASON_SERVER_UNREACHABLE:
case DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN:
case DOWNLOAD_INTERRUPT_REASON_CRASH:
// It is not clear whether attempting a resumption is acceptable at this
// time or whether it would work at all. Hence allow the user to retry the
......@@ -489,6 +488,7 @@ ResumeMode GetDownloadResumeMode(DownloadInterruptReason reason,
case DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST:
case DOWNLOAD_INTERRUPT_REASON_FILE_VIRUS_INFECTED:
case DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT:
case DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN:
case DOWNLOAD_INTERRUPT_REASON_USER_CANCELED:
case DOWNLOAD_INTERRUPT_REASON_FILE_BLOCKED:
case DOWNLOAD_INTERRUPT_REASON_FILE_SECURITY_CHECK_FAILED:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment