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

Unified Diff: chrome/browser/io_thread.cc

Issue 1390993005: Amortize data usage using TrafficStats on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@data_use_buffering
Patch Set: Fixed nit Created 5 years, 1 month 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: chrome/browser/io_thread.cc
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index ec1f91ea53b194c38c7fba023763b418ef0660fb..35ed57e46105cec561116b820744ba8a09afa885 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -43,6 +43,7 @@
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_prefs.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_names.h"
+#include "components/data_usage/core/data_use_amortizer.h"
#include "components/net_log/chrome_net_log.h"
#include "components/policy/core/common/policy_service.h"
#include "components/proxy_config/pref_proxy_config_tracker.h"
@@ -115,6 +116,7 @@
#include "base/android/build_info.h"
#include "chrome/browser/android/data_usage/external_data_use_observer.h"
#include "chrome/browser/android/net/external_estimate_provider_android.h"
+#include "components/data_usage/android/traffic_stats_amortizer.h"
#endif
#if defined(OS_CHROMEOS)
@@ -606,9 +608,15 @@ void IOThread::Init() {
extension_event_router_forwarder_;
#endif
+ scoped_ptr<data_usage::DataUseAmortizer> data_use_amortizer;
+#if defined(OS_ANDROID)
+ data_use_amortizer.reset(new data_usage::android::TrafficStatsAmortizer());
+#endif
+
data_use_aggregator_.reset(new data_usage::DataUseAggregator(
scoped_ptr<data_usage::DataUseAnnotator>(
- new chrome_browser_data_usage::TabIdAnnotator())));
+ new chrome_browser_data_usage::TabIdAnnotator()),
+ data_use_amortizer.Pass()));
// TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
// is fixed.

Powered by Google App Engine
This is Rietveld 408576698