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

Unified Diff: chrome/browser/io_thread.cc

Issue 1373373002: Create component to expose network usage stats to consumers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rough implementation for sanity check Created 5 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: chrome/browser/io_thread.cc
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index ac24cd6912b3a713943af2960c79113cd1874e16..03ee35ce8499dd82533f59c743b3d51fc1e3a7b9 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -40,6 +40,7 @@
#include "chrome/common/pref_names.h"
#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/net_log/chrome_net_log.h"
#include "components/policy/core/common/policy_service.h"
#include "components/proxy_config/pref_proxy_config_tracker.h"
@@ -567,6 +568,8 @@ void IOThread::Init() {
extension_event_router_forwarder_;
#endif
+ globals_->data_use_aggregator = data_usage::DataUseAggregator::Create();
+
// TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
// is fixed.
tracked_objects::ScopedTracker tracking_profile3(
@@ -575,6 +578,10 @@ void IOThread::Init() {
scoped_ptr<ChromeNetworkDelegate> chrome_network_delegate(
new ChromeNetworkDelegate(extension_event_router_forwarder(),
&system_enable_referrers_));
+ // By default, data usage is considered off the record.
+ chrome_network_delegate->set_data_use_aggregator(
tbansal1 2015/10/01 20:30:43 May be move this after tracking_profile4 (right no
sclittle 2015/10/03 03:27:52 It's part of the setup for ChromeNetworkDelegate,
+ globals_->data_use_aggregator.get(),
+ true /* is_data_usage_off_the_record */);
// TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
// is fixed.

Powered by Google App Engine
This is Rietveld 408576698