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

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: Polished and added tests 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 ac24cd6912b3a713943af2960c79113cd1874e16..478335a8015a5663eb7ea0dde73fa21bedc866dc 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.reset(new data_usage::DataUseAggregator());
+
// 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(
+ globals_->data_use_aggregator.get(),
+ true /* is_data_usage_off_the_record */);
bengr 2015/10/06 19:30:27 Why the underscores?
sclittle 2015/10/07 01:07:55 Because that's what the argument name is, |is_data
tbansal1 2015/10/08 04:22:44 nit, I think the right syntax is: /*is_data_usage_
sclittle 2015/10/08 19:44:13 It looks like both styles are used, most of the ca
// TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
// is fixed.

Powered by Google App Engine
This is Rietveld 408576698