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

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: remove fudge 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
« no previous file with comments | « chrome/browser/android/ntp/ntp_snippets_launcher.cc ('k') | components/ntp_snippets/ntp_snippets_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d46e03b182e326c7ca0218af446eb1d8dd3e878f 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 at |reschedule_time|.
+ // Any of the values 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::Time reschedule_time) = 0;
- // Cancel the scheduled fetching task, if any.
+ // Cancel any scheduled tasks.
virtual bool Unschedule() = 0;
protected:
« no previous file with comments | « chrome/browser/android/ntp/ntp_snippets_launcher.cc ('k') | components/ntp_snippets/ntp_snippets_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698