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

Unified Diff: components/offline_pages/background/scheduler.h

Issue 2087633002: Defines TriggerConditions and plumbs up to BackgroundScheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Exposed TriggerConditions object for test 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
« no previous file with comments | « components/offline_pages/background/request_coordinator_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/background/scheduler.h
diff --git a/components/offline_pages/background/scheduler.h b/components/offline_pages/background/scheduler.h
index 8aab4c3576d2bbdfeb56133e478de8704e47cb93..3344aebf1b3978e7c5a714db4b4fc8ee06068da3 100644
--- a/components/offline_pages/background/scheduler.h
+++ b/components/offline_pages/background/scheduler.h
@@ -13,8 +13,14 @@ namespace offline_pages {
class Scheduler {
public:
// Defines a set of system conditions to trigger background processing.
- struct TriggerCondition {
- // TODO(dougarnett): define network, battery, power conditions.
+ struct TriggerConditions {
+ TriggerConditions(bool power, int battery, bool unmetered)
+ : require_power_connected(power),
+ minimum_battery_percentage(battery),
+ require_unmetered_network(unmetered) {}
+ bool require_power_connected;
+ int minimum_battery_percentage;
+ bool require_unmetered_network;
};
Scheduler() {}
@@ -24,7 +30,7 @@ class Scheduler {
// This may overwrite any previous scheduled task with a new one for
// these conditions. That is, only one set of triggering conditions
// is scheduled at a time.
- virtual void Schedule(const TriggerCondition& trigger_condition) = 0;
+ virtual void Schedule(const TriggerConditions& trigger_condition) = 0;
// Unschedules the currently scheduled task, if any.
virtual void Unschedule() = 0;
« no previous file with comments | « components/offline_pages/background/request_coordinator_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698