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

Side by Side Diff: components/ntp_snippets/remote/ntp_snippets_scheduler.h

Issue 2557363002: [NTP Snippets] Refactor background scheduling for remote suggestions (Closed)
Patch Set: Fixing the last changes :) Created 3 years, 12 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SCHEDULER_H_
6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SCHEDULER_H_
7
8 #include "base/macros.h"
9 #include "base/time/time.h"
10
11 namespace ntp_snippets {
12
13 // Interface to schedule the periodic fetching of snippets.
14 class NTPSnippetsScheduler {
15 public:
16 // Schedule periodic fetching of snippets, with different periods depending on
17 // network state. The concrete implementation should call
18 // NTPSnippetsService::FetchSnippets once per period.
19 // Any of the periods can be zero to indicate that the corresponding task
20 // should not be scheduled.
21 virtual bool Schedule(base::TimeDelta period_wifi,
22 base::TimeDelta period_fallback) = 0;
23
24 // Cancel any scheduled tasks.
25 virtual bool Unschedule() = 0;
26
27 protected:
28 NTPSnippetsScheduler() = default;
29
30 private:
31 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsScheduler);
32 };
33
34 } // namespace ntp_snippets
35
36 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SCHEDULER_H_
OLDNEW
« no previous file with comments | « components/ntp_snippets/content_suggestions_service.cc ('k') | components/ntp_snippets/remote/persistent_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698