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

Add interrupt reasons if response was not started before it completes

If a download is getting no response while it completes, it shouldn't carry
the DOWNLOAD_INTERRUPT_REASON_NONE reason.
Otherwise, it will fail the DCHECK in InProgressDownloadManager::StartDownload().
This CL fixes the issue by adding the NETWORK_FAILED reason to the download.

BUG=900149

Change-Id: Ic068691f8bc5146fba92e75894eec74ce5c54bc8
Reviewed-on: https://chromium-review.googlesource.com/c/1308672Reviewed-by: default avatarXing Liu <xingliu@chromium.org>
Commit-Queue: Min Qin <qinmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604813}
parent abcdc459
...@@ -224,7 +224,9 @@ void DownloadResponseHandler::OnComplete( ...@@ -224,7 +224,9 @@ void DownloadResponseHandler::OnComplete(
// happen when the request was aborted. // happen when the request was aborted.
if (!create_info_) if (!create_info_)
create_info_ = CreateDownloadCreateInfo(network::ResourceResponseHead()); create_info_ = CreateDownloadCreateInfo(network::ResourceResponseHead());
create_info_->result = reason; create_info_->result = reason == DOWNLOAD_INTERRUPT_REASON_NONE
? DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED
: reason;
OnResponseStarted(mojom::DownloadStreamHandlePtr()); OnResponseStarted(mojom::DownloadStreamHandlePtr());
delegate_->OnResponseCompleted(); delegate_->OnResponseCompleted();
......
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