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 f82a7a95bdb64f84c881a63ff22c1901c9551520..337ce093ce1537fc9a9fbeaf0b0402288be7d2d3 100644 |
--- a/components/offline_pages/background/request_coordinator.cc |
+++ b/components/offline_pages/background/request_coordinator.cc |
@@ -124,6 +124,11 @@ int64_t RequestCoordinator::SavePageLater(const GURL& url, |
offline_pages::SavePageRequest request(id, url, client_id, base::Time::Now(), |
user_requested); |
+ // If the download manager is not done with the request, put it on the |
+ // disabled list. |
+ if (availability == RequestAvailability::DISABLED_FOR_OFFLINER) |
+ disabled_requests_.insert(id); |
+ |
// Put the request on the request queue. |
queue_->AddRequest(request, |
base::Bind(&RequestCoordinator::AddRequestResultCallback, |
@@ -421,7 +426,8 @@ void RequestCoordinator::TryNextRequest() { |
weak_ptr_factory_.GetWeakPtr()), |
base::Bind(&RequestCoordinator::RequestNotPicked, |
weak_ptr_factory_.GetWeakPtr()), |
- current_conditions_.get()); |
+ current_conditions_.get(), |
+ &disabled_requests_); |
} |
// Called by the request picker when a request has been picked. |
@@ -563,7 +569,9 @@ void RequestCoordinator::OfflinerDoneCallback(const SavePageRequest& request, |
} |
} |
-void RequestCoordinator::EnableForOffliner(int64_t request_id) {} |
+void RequestCoordinator::EnableForOffliner(int64_t request_id) { |
+ disabled_requests_.erase(request_id); |
+} |
void RequestCoordinator::MarkRequestCompleted(int64_t request_id) {} |