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_OFFLINE_PAGES_BACKGROUND_SCHEDULER_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_SCHEDULER_H_ |
6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_SCHEDULER_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_SCHEDULER_H_ |
7 | 7 |
8 namespace offline_pages { | 8 namespace offline_pages { |
9 | 9 |
10 // Interface of a class responsible for scheduling a task to initiate | 10 // Interface of a class responsible for scheduling a task to initiate |
(...skipping 12 matching lines...) Expand all Loading... |
23 bool require_unmetered_network; | 23 bool require_unmetered_network; |
24 }; | 24 }; |
25 | 25 |
26 Scheduler() {} | 26 Scheduler() {} |
27 virtual ~Scheduler() {} | 27 virtual ~Scheduler() {} |
28 | 28 |
29 // Schedules the triggering of a task subject to |trigger_conditions|. | 29 // Schedules the triggering of a task subject to |trigger_conditions|. |
30 // This may overwrite any previous scheduled task with a new one for | 30 // This may overwrite any previous scheduled task with a new one for |
31 // these conditions. That is, only one set of triggering conditions | 31 // these conditions. That is, only one set of triggering conditions |
32 // is scheduled at a time. | 32 // is scheduled at a time. |
33 virtual void Schedule(const TriggerConditions& trigger_condition) = 0; | 33 virtual void Schedule(const TriggerConditions& trigger_conditions) = 0; |
| 34 |
| 35 // Schedules the triggering of a task in case Chromium is killed, |
| 36 // so we can continue processing background download requests. This will |
| 37 // not overwrite existing tasks. |
| 38 virtual void BackupSchedule(const TriggerConditions& trigger_conditions, |
| 39 long delay_in_seconds) = 0; |
34 | 40 |
35 // Unschedules the currently scheduled task, if any. | 41 // Unschedules the currently scheduled task, if any. |
36 virtual void Unschedule() = 0; | 42 virtual void Unschedule() = 0; |
37 }; | 43 }; |
38 | 44 |
39 } // namespace offline_pages | 45 } // namespace offline_pages |
40 | 46 |
41 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_SCHEDULER_H_ | 47 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_SCHEDULER_H_ |
OLD | NEW |