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

Unified Diff: components/offline_pages/background/request_coordinator.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: RequestCoordinator now extends KeyedService and also now has empty ctor 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/offliner.h ('k') | components/offline_pages/background/scheduler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..da1ff1677cfca71ea3ebfbd2d9fae07d1d8870f0
--- /dev/null
+++ b/components/offline_pages/background/request_coordinator.h
@@ -0,0 +1,40 @@
+// 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 RequestCoordinator : public KeyedService {
Pete Williamson 2016/04/26 00:52:19 KeyedService -> BrowserContextKeyedService Once w
Pete Williamson 2016/04/26 00:56:13 Oops, my bad, it looks like it is KeyedService aft
dougarnett 2016/04/26 15:50:38 I'm happy to take out KeyedService for this CL or
Pete Williamson 2016/04/26 16:40:59 Let's take out the KeyedService, and add it back w
+ public:
+ // Callback to report when the processing of a triggered task is complete.
+ typedef base::Callback<void()> ProcessingDoneCallback;
+
+ // TODO(dougarnett): How to inject Offliner factories and policy objects.
+ RequestCoordinator();
+
+ virtual ~RequestCoordinator() {}
+
+ // Handles shutdown of KeyedService.
+ virtual void Shutdown() = 0;
Pete Williamson 2016/04/26 00:52:19 Why make these pure virtual? We don't really need
dougarnett 2016/04/26 15:50:38 Done.
+
+ // 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.
+ 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_
« no previous file with comments | « components/offline_pages/background/offliner.h ('k') | components/offline_pages/background/scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698