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

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

Issue 2197573003: Provide API in RequestCoordinator to remove results by client ID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR feedback per DougArnett Created 4 years, 5 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 13ab786e6ef39a623022bb3190f01917e1410029..fca2ab55c5a334edaf53a8cc4d99a2f6d7c9a3c0 100644
--- a/components/offline_pages/background/request_coordinator.cc
+++ b/components/offline_pages/background/request_coordinator.cc
@@ -70,6 +70,16 @@ bool RequestCoordinator::SavePageLater(
return true;
}
+// If the client does not need the pages after all, then cancel them.
dougarnett 2016/08/01 18:28:35 drop comment here - just keep .h comment up-to-dat
Pete Williamson 2016/08/01 23:23:07 Done.
+void RequestCoordinator::RemoveRequests(
+ const std::vector<ClientId>& client_ids) {
+
+ queue_->RemoveRequestsByClientId(
+ client_ids,
+ base::Bind(&RequestCoordinator::UpdateRequestCallback,
+ weak_ptr_factory_.GetWeakPtr()));
+}
+
void RequestCoordinator::AddRequestResultCallback(
RequestQueue::AddRequestResult result,
const SavePageRequest& request) {

Powered by Google App Engine
This is Rietveld 408576698