OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_PERSISTENT_SCHEDULER_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_PERSISTENT_SCHEDULER_H_ |
6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_PERSISTENT_SCHEDULER_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_PERSISTENT_SCHEDULER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 // depending on network state. Any of the periods can be zero to indicate that | 28 // depending on network state. Any of the periods can be zero to indicate that |
29 // the corresponding task should not be scheduled. Returns whether the | 29 // the corresponding task should not be scheduled. Returns whether the |
30 // scheduling was successful. | 30 // scheduling was successful. |
31 virtual bool Schedule(base::TimeDelta period_wifi, | 31 virtual bool Schedule(base::TimeDelta period_wifi, |
32 base::TimeDelta period_fallback) = 0; | 32 base::TimeDelta period_fallback) = 0; |
33 | 33 |
34 // Cancel any scheduled tasks. Equivalent to Schedule(0, 0). Returns whether | 34 // Cancel any scheduled tasks. Equivalent to Schedule(0, 0). Returns whether |
35 // the scheduling was successful. | 35 // the scheduling was successful. |
36 virtual bool Unschedule() = 0; | 36 virtual bool Unschedule() = 0; |
37 | 37 |
| 38 // TODO(jkrcal): Get this information exposed in the platform-independent |
| 39 // net::NetworkChangeNotifier and remove this function. |
| 40 virtual bool IsOnUnmeteredConnection() = 0; |
| 41 |
38 protected: | 42 protected: |
39 PersistentScheduler() = default; | 43 PersistentScheduler() = default; |
40 | 44 |
41 private: | 45 private: |
42 DISALLOW_COPY_AND_ASSIGN(PersistentScheduler); | 46 DISALLOW_COPY_AND_ASSIGN(PersistentScheduler); |
43 }; | 47 }; |
44 | 48 |
45 } // namespace ntp_snippets | 49 } // namespace ntp_snippets |
46 | 50 |
47 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_PERSISTENT_SCHEDULER_H_ | 51 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_PERSISTENT_SCHEDULER_H_ |
OLD | NEW |