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

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: Created 5 years, 2 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: chrome/browser/io_thread.cc
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 165bf37aaafac32b370109297fbcd70c6021dfa4..7915609f340560767feab0ab24917ebf51ab2c74 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -41,6 +41,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_usage/core/data_use_aggregator.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"
@@ -109,6 +110,7 @@
#if defined(OS_ANDROID)
#include "base/android/build_info.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)
@@ -568,7 +570,12 @@ void IOThread::Init() {
extension_event_router_forwarder_;
#endif
- globals_->data_use_aggregator.reset(new data_usage::DataUseAggregator());
+ scoped_ptr<data_usage::DataUseAmortizer> data_use_amortizer;
+#if defined(OS_ANDROID)
+ data_use_amortizer.reset(new data_usage::android::TrafficStatsAmortizer());
+#endif
+ globals_->data_use_aggregator.reset(
+ new data_usage::DataUseAggregator(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