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

Unified Diff: components/ntp_snippets/ntp_snippets_scheduler.h

Issue 1869323003: [NTP Snippets] Scheduler: Fetch on Wifi (without charging) only 6AM-10PM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snippets_merge_controller
Patch Set: rebase Created 4 years, 8 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/ntp_snippets/ntp_snippets_scheduler.h
diff --git a/components/ntp_snippets/ntp_snippets_scheduler.h b/components/ntp_snippets/ntp_snippets_scheduler.h
index c374409c0b0b96b47d566caa38536b358e464e85..df6fe04c2aca81c15f0ab9a939fbb54c10c586e0 100644
--- a/components/ntp_snippets/ntp_snippets_scheduler.h
+++ b/components/ntp_snippets/ntp_snippets_scheduler.h
@@ -14,13 +14,18 @@ namespace ntp_snippets {
class NTPSnippetsScheduler {
public:
// Schedule periodic fetching of snippets, with different period depending on
- // network and charging state. The concrete implementation should call
- // NTPSnippetsService::FetchSnippets once per period.
+ // network and charging state, and also set up a delay after which the periods
+ // may change. The concrete implementation should call
+ // NTPSnippetsService::FetchSnippets once per period, and
+ // NTPSnippetsService::RescheduleFetching after |reschedule_delay|.
+ // Any of the TimeDeltas can be zero to indicate that the corresponding task
+ // should not be scheduled.
virtual bool Schedule(base::TimeDelta period_wifi_charging,
base::TimeDelta period_wifi,
- base::TimeDelta period_fallback) = 0;
+ base::TimeDelta period_fallback,
+ base::TimeDelta reschedule_delay) = 0;
Bernhard Bauer 2016/04/18 08:03:00 Would it make more sense to pass this as an absolu
Marc Treib 2016/04/19 11:32:13 Done.
- // Cancel the scheduled fetching task, if any.
+ // Cancel any scheduled tasks.
virtual bool Unschedule() = 0;
protected:

Powered by Google App Engine
This is Rietveld 408576698