Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(755)

Unified Diff: content/browser/download/download_worker.cc

Issue 2786523002: Add control to use If-Range header for range request. (Closed)
Patch Set: Rebase. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/download/download_worker.cc
diff --git a/content/browser/download/download_worker.cc b/content/browser/download/download_worker.cc
index 35639b5738c9b34a7e5321dee68033ae981fb836..3572c258d6d3e937598011c0e40e94c365d28e6e 100644
--- a/content/browser/download/download_worker.cc
+++ b/content/browser/download/download_worker.cc
@@ -89,14 +89,17 @@ void DownloadWorker::OnUrlDownloaderStarted(
return;
}
- // TODO(xingliu): Add the interrupt reason and metric data for precondition
- // failure. Make DownloadRequestCore know if it should return error if the
- // the server gives a different part of the content, e.g. "If-Match" return
- // http 200.
+ // TODO(xingliu): Add metric for error handling.
if (create_info->result !=
DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_NONE) {
VLOG(kVerboseLevel) << "Parallel download sub-request failed. reason = "
<< create_info->result;
+
+ // Ignore HTTP 416 for the workers.
+ if (create_info->result ==
qinmin 2017/03/30 05:21:43 {} needed as this if statement spans multiple line
xingliu 2017/03/30 17:16:46 Done.
+ DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE)
+ return;
+
delegate_->OnServerResponseError(this, create_info->result);
return;
}

Powered by Google App Engine
This is Rietveld 408576698