| Index: components/offline_pages/background/request_coordinator.cc
|
| diff --git a/components/offline_pages/background/request_coordinator.cc b/components/offline_pages/background/request_coordinator.cc
|
| index 19906d787e04ab3d617c23b9e6e6c912599b289f..b554b119485a36a4cfd7876a91488b17c449c5e0 100644
|
| --- a/components/offline_pages/background/request_coordinator.cc
|
| +++ b/components/offline_pages/background/request_coordinator.cc
|
| @@ -281,9 +281,13 @@ void RequestCoordinator::OfflinerDoneCallback(const SavePageRequest& request,
|
| updated_request.client_id()));
|
|
|
| } else if (status == Offliner::RequestStatus::SAVED ||
|
| - request.attempt_count() >= policy_->GetMaxTries()) {
|
| + request.completed_attempt_count() + 1 >=
|
| + policy_->GetMaxCompletedTries()) {
|
| // Remove the request from the queue if it either succeeded or exceeded the
|
| - // max number of retries.
|
| + // max number of retries. The +1 represents the request that just
|
| + // completed. Since we call MarkAttemptCompleted within the if branches,
|
| + // the completed_attempt_count has not yet been updated when we are checking
|
| + // the if condition.
|
| queue_->RemoveRequest(
|
| request.request_id(),
|
| base::Bind(&RequestCoordinator::UpdateRequestCallback,
|
|
|