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

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

Issue 2221323003: Add an API to Pause and Resume background offlining requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test break introduced by merge 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_picker.cc
diff --git a/components/offline_pages/background/request_picker.cc b/components/offline_pages/background/request_picker.cc
index 47bff566b5f7b6764e6d08b460c21bd1f16eaba2..84b73056f9d88eec7a65fd207fb7c113f22b83da 100644
--- a/components/offline_pages/background/request_picker.cc
+++ b/components/offline_pages/background/request_picker.cc
@@ -121,6 +121,10 @@ bool RequestPicker::RequestConditionsSatisfied(const SavePageRequest& request) {
if (request.completed_attempt_count() >= policy_->GetMaxCompletedTries())
return false;
+ // If the request is paused, do not consider it.
+ if (request.request_state() == SavePageRequest::RequestState::PAUSED)
+ return false;
+
// If the request is expired, do not consider it.
// TODO(petewil): We need to remove this from the queue.
base::TimeDelta requestAge = base::Time::Now() - request.creation_time();
« no previous file with comments | « components/offline_pages/background/request_coordinator.cc ('k') | components/offline_pages/background/request_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698