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

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

Issue 2347783003: [OfflinePages, NetworkQualityEstimator] Use NetworkQualityEstimator to decide on triggering Backgro… (Closed)
Patch Set: Created 4 years, 3 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 d130df002c45d79e744317f8c8faac2b56fba0f8..ccf8dc72545976425fde1f088b7644fa92cffc03 100644
--- a/components/offline_pages/background/request_coordinator.h
+++ b/components/offline_pages/background/request_coordinator.h
@@ -21,6 +21,7 @@
#include "components/offline_pages/background/request_notifier.h"
#include "components/offline_pages/background/request_queue.h"
#include "components/offline_pages/background/scheduler.h"
+#include "net/nqe/network_quality_estimator.h"
#include "url/gurl.h"
namespace offline_pages {
@@ -60,10 +61,13 @@ class RequestCoordinator : public KeyedService,
// Callback to report when no request was available.
typedef base::Callback<void(bool)> RequestNotPickedCallback;
- RequestCoordinator(std::unique_ptr<OfflinerPolicy> policy,
- std::unique_ptr<OfflinerFactory> factory,
- std::unique_ptr<RequestQueue> queue,
- std::unique_ptr<Scheduler> scheduler);
+ RequestCoordinator(
+ std::unique_ptr<OfflinerPolicy> policy,
+ std::unique_ptr<OfflinerFactory> factory,
+ std::unique_ptr<RequestQueue> queue,
+ std::unique_ptr<Scheduler> scheduler,
+ std::unique_ptr<net::NetworkQualityEstimator::NetworkQualityProvider>
+ network_quality_provider);
~RequestCoordinator() override;
@@ -291,6 +295,8 @@ class RequestCoordinator : public KeyedService,
std::unique_ptr<RequestQueue> queue_;
// Scheduler. Used to request a callback when network is available. Owned.
std::unique_ptr<Scheduler> scheduler_;
+ // Network Quality Estimator.
+ std::unique_ptr<net::NetworkQualityEstimator::NetworkQualityProvider> nqe_;
// Holds copy of the active request, if any.
std::unique_ptr<SavePageRequest> active_request_;
// Status of the most recent offlining.

Powered by Google App Engine
This is Rietveld 408576698