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

Side by Side Diff: components/offline_pages/background_scheduler.h

Issue 1922533003: Defines initial inner circle of interfaces for background offlining. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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_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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698