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

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

Issue 1971033002: Call scheduler when we get a save page later request. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR feedback per FGorski and 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 44d937409fb97010c523edc2dec773567af07c30..6dfaa30ce4f3e5e1aa3d11ff23a5c5ec00492d91 100644
--- a/components/offline_pages/background/request_coordinator.h
+++ b/components/offline_pages/background/request_coordinator.h
@@ -21,6 +21,7 @@ class OfflinerPolicy;
class OfflinerFactory;
class Offliner;
class SavePageRequest;
+class Scheduler;
// Coordinates queueing and processing save page later requests.
class RequestCoordinator :
@@ -32,7 +33,8 @@ class RequestCoordinator :
RequestCoordinator(std::unique_ptr<OfflinerPolicy> policy,
std::unique_ptr<OfflinerFactory> factory,
- std::unique_ptr<RequestQueue> queue);
+ std::unique_ptr<RequestQueue> queue,
+ std::unique_ptr<Scheduler> scheduler);
~RequestCoordinator() override;
@@ -54,6 +56,8 @@ class RequestCoordinator :
// Returns the request queue used for requests. Coordinator keeps ownership.
RequestQueue* GetQueue() { return queue_.get(); }
+ Scheduler* GetSchedulerForTesting() { return scheduler_.get(); }
+
private:
void AddRequestResultCallback(RequestQueue::AddRequestResult result,
const SavePageRequest& request);
@@ -63,6 +67,8 @@ class RequestCoordinator :
std::unique_ptr<OfflinerFactory> factory_;
// RequestQueue. Used to store incoming requests. Owned.
std::unique_ptr<RequestQueue> queue_;
+ // Scheduler. Used to request a callback when network is available. Owned.
+ std::unique_ptr<Scheduler> scheduler_;
DISALLOW_COPY_AND_ASSIGN(RequestCoordinator);
};

Powered by Google App Engine
This is Rietveld 408576698