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

Side by Side Diff: components/offline_pages/background/scheduler.h

Issue 1928813002: Adds initial JNI bridge code for Background Scheduler implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: C++ style guide change 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
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 // processing of background offlining requests upon select system conditions 11 // processing of background offlining requests upon select system conditions
12 // (such as having a network connection). 12 // (such as having a network connection).
13 class Scheduler { 13 class Scheduler {
14 public: 14 public:
15 // Defines a set of system conditions to trigger background processing. 15 // Defines a set of system conditions to trigger background processing.
16 struct TriggerCondition { 16 struct TriggerCondition {
17 // TODO(dougarnett): define network, battery, power conditions. 17 // TODO(dougarnett): define network, battery, power conditions.
18 }; 18 };
19 19
20 Scheduler() {} 20 Scheduler() {}
21 virtual ~Scheduler() {} 21 virtual ~Scheduler() {}
22 22
23 // Ensures that the system has a task scheduled for |trigger_conditions|. 23 // Schedules the triggering of a task subject to |trigger_conditions|.
24 // This may overwrite any previous scheduled task with a new one for 24 // This may overwrite any previous scheduled task with a new one for
25 // these conditions. 25 // these conditions. That is, only one set of triggering conditions
26 virtual void EnsureScheduled(const TriggerCondition& trigger_condition) = 0; 26 // is scheduled at a time.
27 virtual void Schedule(const TriggerCondition& trigger_condition) = 0;
27 28
28 // Clears the currently scheduled task, if any. 29 // Unschedules the currently scheduled task, if any.
29 virtual void ClearScheduled() = 0; 30 virtual void Unschedule() = 0;
30 }; 31 };
31 32
32 } // namespace offline_pages 33 } // namespace offline_pages
33 34
34 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_SCHEDULER_H_ 35 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_SCHEDULER_H_
OLDNEW
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698