Commit 782037c3 authored by Devlin Cronin's avatar Devlin Cronin Committed by Commit Bot

[Extensions] Retry downloading an extension if programmatically canceled

URLRequests terminate with a status of canceled if the device is
suspended during download. In order to accommodate for this when
downloading an extension, add this to the cases in which we retry
automatically.

Bug: 824454

Change-Id: Ia3187c0ca0150968d8eae67f8f265bb6f7e7ab6e
Reviewed-on: https://chromium-review.googlesource.com/1079689Reviewed-by: default avatarIstiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563042}
parent 65ecf031
...@@ -116,8 +116,11 @@ bool ShouldRetryRequest(const net::URLRequestStatus& status, ...@@ -116,8 +116,11 @@ bool ShouldRetryRequest(const net::URLRequestStatus& status,
int response_code) { int response_code) {
// Retry if the response code is a server error, or the request failed because // Retry if the response code is a server error, or the request failed because
// of network errors as opposed to file errors. // of network errors as opposed to file errors.
return ((response_code >= 500 && status.is_success()) || return (response_code >= 500 && status.is_success()) ||
status.status() == net::URLRequestStatus::FAILED); status.status() == net::URLRequestStatus::FAILED ||
// Note: URLRequestJob::OnSuspend() results in a canceled status; if
// the request is suspended, we should retry.
status.status() == net::URLRequestStatus::CANCELED;
} }
// This parses and updates a URL query such that the value of the |authuser| // This parses and updates a URL query such that the value of the |authuser|
......
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