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

Unified Diff: components/ntp_snippets/ntp_snippets_scheduler.h

Issue 1699143002: [NTP Snippets] Schedule periodic fetching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snippets_feature
Patch Set: fix bots Created 4 years, 10 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/ntp_snippets.gypi ('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
new file mode 100644
index 0000000000000000000000000000000000000000..afa60d91061a9aa02c98b3ba7ba8af10b2f98005
--- /dev/null
+++ b/components/ntp_snippets/ntp_snippets_scheduler.h
@@ -0,0 +1,32 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SCHEDULER_H_
+#define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SCHEDULER_H_
+
+#include "base/macros.h"
+
+namespace ntp_snippets {
+
+// Interface to schedule the periodic fetching of snippets.
+class NTPSnippetsScheduler {
+ public:
+ // Schedule periodic fetching of snippets every |period_seconds|. The
+ // concrete implementation should call NTPSnippetsService::FetchSnippets once
+ // per period.
+ virtual bool Schedule(int period_seconds) = 0;
+
+ // Cancel the scheduled fetching task, if any.
+ virtual bool Unschedule() = 0;
+
+ protected:
+ NTPSnippetsScheduler() = default;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NTPSnippetsScheduler);
+};
+
+} // namespace ntp_snippets
+
+#endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SCHEDULER_H_
« no previous file with comments | « components/ntp_snippets.gypi ('k') | components/ntp_snippets/ntp_snippets_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698