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

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

Issue 2087633002: Defines TriggerConditions and plumbs up to BackgroundScheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 d5e87d26a47a8fd93aa7af30aa2dacef1ad23837..b791a235a23ecd7a4520861fc9d81fcc73d6bf7a 100644
--- a/components/offline_pages/background/request_coordinator.cc
+++ b/components/offline_pages/background/request_coordinator.cc
@@ -18,6 +18,13 @@
namespace offline_pages {
+namespace {
+const Scheduler::TriggerConditions kUserRequestTriggerConditions(
+ false /* require_power_connected */,
+ 50 /* minimum_battery_percentage */,
+ false /* require_unmetered_network */);
+} // namespace
+
RequestCoordinator::RequestCoordinator(std::unique_ptr<OfflinerPolicy> policy,
std::unique_ptr<OfflinerFactory> factory,
std::unique_ptr<RequestQueue> queue,
@@ -63,9 +70,8 @@ void RequestCoordinator::AddRequestResultCallback(
const SavePageRequest& request) {
// Inform the scheduler that we have an outstanding task.
- // TODO(petewil): Define proper TriggerConditions and set them.
- Scheduler::TriggerCondition conditions;
- scheduler_->Schedule(conditions);
+ // TODO(petewil): Determine trigger conditions from policy.
+ scheduler_->Schedule(kUserRequestTriggerConditions);
}
// Called in response to updating a request in the request queue.

Powered by Google App Engine
This is Rietveld 408576698