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

Unified Diff: chrome/browser/android/offline_pages/request_coordinator_factory.cc

Issue 2347783003: [OfflinePages, NetworkQualityEstimator] Use NetworkQualityEstimator to decide on triggering Backgro… (Closed)
Patch Set: Addressed feedback 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
« no previous file with comments | « no previous file | chrome/browser/net/nqe/ui_network_quality_estimator_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/offline_pages/request_coordinator_factory.cc
diff --git a/chrome/browser/android/offline_pages/request_coordinator_factory.cc b/chrome/browser/android/offline_pages/request_coordinator_factory.cc
index f453dd2c1fe01b9121165cb27478f90f439c110a..89cffad81553bbb1a11c38a73f0831772742ff22 100644
--- a/chrome/browser/android/offline_pages/request_coordinator_factory.cc
+++ b/chrome/browser/android/offline_pages/request_coordinator_factory.cc
@@ -12,6 +12,8 @@
#include "chrome/browser/android/offline_pages/background_scheduler_bridge.h"
#include "chrome/browser/android/offline_pages/downloads/offline_page_notification_bridge.h"
#include "chrome/browser/android/offline_pages/prerendering_offliner_factory.h"
+#include "chrome/browser/net/nqe/ui_network_quality_estimator_service.h"
+#include "chrome/browser/net/nqe/ui_network_quality_estimator_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_constants.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
@@ -24,6 +26,7 @@
#include "components/offline_pages/background/scheduler.h"
#include "components/offline_pages/downloads/download_notifying_observer.h"
#include "content/public/browser/browser_thread.h"
+#include "net/nqe/network_quality_estimator.h"
namespace offline_pages {
@@ -53,20 +56,23 @@ KeyedService* RequestCoordinatorFactory::BuildServiceInstanceFor(
scoped_refptr<base::SequencedTaskRunner> background_task_runner =
content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(
content::BrowserThread::GetBlockingPool()->GetSequenceToken());
+ Profile* profile = Profile::FromBrowserContext(context);
base::FilePath queue_store_path =
- Profile::FromBrowserContext(context)->GetPath().Append(
- chrome::kOfflinePageRequestQueueDirname);
+ profile->GetPath().Append(chrome::kOfflinePageRequestQueueDirname);
std::unique_ptr<RequestQueueStoreSQL> queue_store(
new RequestQueueStoreSQL(background_task_runner, queue_store_path));
std::unique_ptr<RequestQueue> queue(new RequestQueue(std::move(queue_store)));
std::unique_ptr<Scheduler>
scheduler(new android::BackgroundSchedulerBridge());
+ net::NetworkQualityEstimator::NetworkQualityProvider*
+ network_quality_estimator =
+ UINetworkQualityEstimatorServiceFactory::GetForProfile(profile);
// TODO(fgorski): Something needs to keep the handle to the Notification
// dispatcher.
- RequestCoordinator* request_coordinator =
- new RequestCoordinator(std::move(policy), std::move(prerenderer_offliner),
- std::move(queue), std::move(scheduler));
+ RequestCoordinator* request_coordinator = new RequestCoordinator(
+ std::move(policy), std::move(prerenderer_offliner), std::move(queue),
+ std::move(scheduler), network_quality_estimator);
DownloadNotifyingObserver::CreateAndStartObserving(
request_coordinator,
« no previous file with comments | « no previous file | chrome/browser/net/nqe/ui_network_quality_estimator_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698