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

Unified 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: Changed forward reference of SavePageRequest to empty stuct for this CL per dewittj feedback. Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/offline_pages/background/request_coordinator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/background/scheduler.h
diff --git a/components/offline_pages/background/scheduler.h b/components/offline_pages/background/scheduler.h
new file mode 100644
index 0000000000000000000000000000000000000000..76a185f6699a296bc33f7a784958f5649274f234
--- /dev/null
+++ b/components/offline_pages/background/scheduler.h
@@ -0,0 +1,34 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_SCHEDULER_H_
+#define COMPONENTS_OFFLINE_PAGES_BACKGROUND_SCHEDULER_H_
+
+namespace offline_pages {
+
+// Interface of a class responsible for scheduling a task to initiate
+// processing of background offlining requests upon select system conditions
+// (such as having a network connection).
+class Scheduler {
+ public:
+ // Defines a set of system conditions to trigger background processing.
+ struct TriggerCondition {
+ // TODO(dougarnett): define network, battery, power conditions.
+ };
+
+ Scheduler() {}
+ virtual ~Scheduler() {}
+
+ // Ensures that the system has a task scheduled for |trigger_conditions|.
+ // This may overwrite any previous scheduled task with a new one for
+ // these conditions.
+ virtual void EnsureScheduled(const TriggerCondition& trigger_condition) = 0;
+
+ // Clears the currently scheduled task, if any.
+ virtual void ClearScheduled() = 0;
+};
+
+} // namespace offline_pages
+
+#endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_SCHEDULER_H_
« no previous file with comments | « components/offline_pages/background/request_coordinator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698