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

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

Issue 2395213002: Implement disabled list (Closed)
Patch Set: set pointer -> const ref Created 4 years, 2 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 ff8eec1ad020625b8663a900d533ad0ed913e3bb..53a3165f0c8262b5610e69885e6eedd64805b41e 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,
@@ -433,7 +438,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.
@@ -575,7 +581,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) {}
« no previous file with comments | « components/offline_pages/background/request_coordinator.h ('k') | components/offline_pages/background/request_picker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698