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

Unified Diff: components/offline_pages/background/request_coordinator.h

Issue 1971923004: Add calls to the offliner and unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR feedback per DougArnett 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 side-by-side diff with in-line comments
Download patch
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
index 6dfaa30ce4f3e5e1aa3d11ff23a5c5ec00492d91..4ab1e5a0680833a31c30f79eec2e1cec28cbb932 100644
--- a/components/offline_pages/background/request_coordinator.h
+++ b/components/offline_pages/background/request_coordinator.h
@@ -11,6 +11,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "components/keyed_service/core/keyed_service.h"
+#include "components/offline_pages/background/offliner.h"
#include "components/offline_pages/background/request_queue.h"
#include "url/gurl.h"
@@ -58,10 +59,21 @@ class RequestCoordinator :
Scheduler* GetSchedulerForTesting() { return scheduler_.get(); }
+ // Returns the status of the most recent offlining.
+ Offliner::CompletionStatus last_offlining_status() {
+ return last_offlining_status_;
+ }
+
private:
void AddRequestResultCallback(RequestQueue::AddRequestResult result,
const SavePageRequest& request);
- // OfflinerPolicy. Used to store policies. Owned.
+
+ void SendRequestToOffliner(SavePageRequest& request);
+
+ void OfflinerDoneCallback(const SavePageRequest& request,
+ Offliner::CompletionStatus status);
+
+ // RequestCoordinator takes over ownership of the policy
std::unique_ptr<OfflinerPolicy> policy_;
// OfflinerFactory. Used to create offline pages. Owned.
std::unique_ptr<OfflinerFactory> factory_;
@@ -69,6 +81,8 @@ class RequestCoordinator :
std::unique_ptr<RequestQueue> queue_;
// Scheduler. Used to request a callback when network is available. Owned.
std::unique_ptr<Scheduler> scheduler_;
+ // Status of the most recent offlining.
+ Offliner::CompletionStatus last_offlining_status_;
DISALLOW_COPY_AND_ASSIGN(RequestCoordinator);
};
« no previous file with comments | « components/offline_pages/background/offliner.h ('k') | components/offline_pages/background/request_coordinator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698