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

Unified Diff: components/offline_pages/background/request_coordinator.cc

Issue 2218403002: Change database scheme - add state and start tracking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Stop clearing last request time Created 4 years, 4 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: 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,

Powered by Google App Engine
This is Rietveld 408576698