Index: components/offline_pages/background_request_coordinator.h |
diff --git a/components/offline_pages/background_request_coordinator.h b/components/offline_pages/background_request_coordinator.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..bfa21436344f7552b0f086c8a960b0e641723f8c |
--- /dev/null |
+++ b/components/offline_pages/background_request_coordinator.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_REQUEST_COORDINATOR_H_ |
+#define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ |
+ |
+namespace offline_pages { |
+ |
+class SavePageRequest; |
+ |
+// Coordinates queueing and processing save page later requests. |
+class BackgroundRequestCoordinator { |
+ public: |
+ // Callback to report when the processing of a triggered task is complete. |
+ typedef base::Callback<void()> ProcessingDoneCallback; |
+ |
+ virtual ~BackgroundRequestCoordinator() {} |
+ |
+ // Queues |request| to later load and save when system conditions allow. |
+ virtual bool SavePageLater(const SavePageRequest& request) = 0; |
+ |
+ // Starts processing of one or more queued save page later requests. |
Dmitry Titov
2016/04/26 00:20:31
Consider adding comments on:
- can StartProcessing
dougarnett
2016/04/26 15:50:38
Please check updated wording on Start/Stop.
Btw,
|
+ virtual void StartProcessing(const ProcessingDoneCallback& callback) = 0; |
+ |
+ // Stops the current request processing if active. |
+ virtual void StopProcessing() = 0; |
+ |
+ // TODO(dougarnett): add policy support methods. |
+}; |
+ |
+} // namespace offline_pages |
+ |
+#endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ |