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..cd421f8cd38a4a6fa71a583a8cba7f2bad821d6e |
--- /dev/null |
+++ b/components/ntp_snippets/ntp_snippets_scheduler.h |
@@ -0,0 +1,24 @@ |
+// 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_ |
+ |
+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; |
noyau (Ping after 24h)
2016/02/22 15:02:31
Add DISALLOW_COPY_AND_ASSIGN()
Marc Treib
2016/02/22 17:13:08
Done. I also had to add a default constructor :-/
|
+}; |
+ |
+} // namespace ntp_snippets |
+ |
+#endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SCHEDULER_H_ |