Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_OFFLINE_PAGES_BACKGROUND_SCHEDULER_H_ | |
| 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_SCHEDULER_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
|
fgorski
2016/04/25 21:07:38
what is this needed for?
dougarnett
2016/04/25 21:49:08
Done.
| |
| 9 | |
| 10 namespace offline_pages { | |
| 11 | |
| 12 // Interface of a class responsible for scheduling a task to initiate | |
| 13 // processing of background offlining requests upon select system conditions | |
| 14 // (such as having a network connection). | |
| 15 class BackgroundScheduler { | |
| 16 public: | |
| 17 // Defines a set of system conditions to trigger background processing. | |
| 18 struct TriggerCondition { | |
| 19 // TODO(dougarnett): define network, battery, power conditions. | |
| 20 }; | |
| 21 | |
| 22 virtual ~BackgroundScheduler() {} | |
| 23 | |
| 24 // Ensures that the system has a task scheduled for |trigger_conditions|. | |
| 25 // This may overwrite any previous scheduled task with a new one for | |
| 26 // these conditions. | |
| 27 virtual void EnsureScheduled(const TriggerCondition& trigger_condition) = 0; | |
| 28 | |
| 29 // Clears the currently scheduled task, if any. | |
| 30 virtual void ClearScheduled() = 0; | |
| 31 }; | |
| 32 | |
| 33 } // namespace offline_pages | |
| 34 | |
| 35 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_SCHEDULER_H_ | |
| OLD | NEW |