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

Side by Side 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: Addressed nits 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/net/chrome_network_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/io_thread.h" 5 #include "chrome/browser/io_thread.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 22 matching lines...) Expand all
33 #include "chrome/browser/net/chrome_network_delegate.h" 33 #include "chrome/browser/net/chrome_network_delegate.h"
34 #include "chrome/browser/net/connect_interceptor.h" 34 #include "chrome/browser/net/connect_interceptor.h"
35 #include "chrome/browser/net/dns_probe_service.h" 35 #include "chrome/browser/net/dns_probe_service.h"
36 #include "chrome/browser/net/proxy_service_factory.h" 36 #include "chrome/browser/net/proxy_service_factory.h"
37 #include "chrome/common/channel_info.h" 37 #include "chrome/common/channel_info.h"
38 #include "chrome/common/chrome_content_client.h" 38 #include "chrome/common/chrome_content_client.h"
39 #include "chrome/common/chrome_switches.h" 39 #include "chrome/common/chrome_switches.h"
40 #include "chrome/common/pref_names.h" 40 #include "chrome/common/pref_names.h"
41 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h" 41 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h"
42 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" 42 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h"
43 #include "components/data_usage/core/data_use_aggregator.h"
43 #include "components/net_log/chrome_net_log.h" 44 #include "components/net_log/chrome_net_log.h"
44 #include "components/policy/core/common/policy_service.h" 45 #include "components/policy/core/common/policy_service.h"
45 #include "components/proxy_config/pref_proxy_config_tracker.h" 46 #include "components/proxy_config/pref_proxy_config_tracker.h"
46 #include "components/variations/variations_associated_data.h" 47 #include "components/variations/variations_associated_data.h"
47 #include "components/version_info/version_info.h" 48 #include "components/version_info/version_info.h"
48 #include "content/public/browser/browser_thread.h" 49 #include "content/public/browser/browser_thread.h"
49 #include "content/public/browser/cookie_store_factory.h" 50 #include "content/public/browser/cookie_store_factory.h"
50 #include "content/public/common/user_agent.h" 51 #include "content/public/common/user_agent.h"
51 #include "net/base/external_estimate_provider.h" 52 #include "net/base/external_estimate_provider.h"
52 #include "net/base/host_mapping_rules.h" 53 #include "net/base/host_mapping_rules.h"
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 new LoggingNetworkChangeObserver(net_log_)); 561 new LoggingNetworkChangeObserver(net_log_));
561 562
562 // Setup the HistogramWatcher to run on the IO thread. 563 // Setup the HistogramWatcher to run on the IO thread.
563 net::NetworkChangeNotifier::InitHistogramWatcher(); 564 net::NetworkChangeNotifier::InitHistogramWatcher();
564 565
565 #if defined(ENABLE_EXTENSIONS) 566 #if defined(ENABLE_EXTENSIONS)
566 globals_->extension_event_router_forwarder = 567 globals_->extension_event_router_forwarder =
567 extension_event_router_forwarder_; 568 extension_event_router_forwarder_;
568 #endif 569 #endif
569 570
571 globals_->data_use_aggregator.reset(new data_usage::DataUseAggregator());
572
570 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 573 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
571 // is fixed. 574 // is fixed.
572 tracked_objects::ScopedTracker tracking_profile3( 575 tracked_objects::ScopedTracker tracking_profile3(
573 FROM_HERE_WITH_EXPLICIT_FUNCTION( 576 FROM_HERE_WITH_EXPLICIT_FUNCTION(
574 "466432 IOThread::InitAsync::ChromeNetworkDelegate")); 577 "466432 IOThread::InitAsync::ChromeNetworkDelegate"));
575 scoped_ptr<ChromeNetworkDelegate> chrome_network_delegate( 578 scoped_ptr<ChromeNetworkDelegate> chrome_network_delegate(
576 new ChromeNetworkDelegate(extension_event_router_forwarder(), 579 new ChromeNetworkDelegate(extension_event_router_forwarder(),
577 &system_enable_referrers_)); 580 &system_enable_referrers_));
581 // By default, data usage is considered off the record.
582 chrome_network_delegate->set_data_use_aggregator(
583 globals_->data_use_aggregator.get(),
584 true /* is_data_usage_off_the_record */);
578 585
579 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 586 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
580 // is fixed. 587 // is fixed.
581 tracked_objects::ScopedTracker tracking_profile4( 588 tracked_objects::ScopedTracker tracking_profile4(
582 FROM_HERE_WITH_EXPLICIT_FUNCTION( 589 FROM_HERE_WITH_EXPLICIT_FUNCTION(
583 "466432 IOThread::InitAsync::CreateGlobalHostResolver")); 590 "466432 IOThread::InitAsync::CreateGlobalHostResolver"));
584 globals_->system_network_delegate = chrome_network_delegate.Pass(); 591 globals_->system_network_delegate = chrome_network_delegate.Pass();
585 globals_->host_resolver = CreateGlobalHostResolver(net_log_); 592 globals_->host_resolver = CreateGlobalHostResolver(net_log_);
586 593
587 std::map<std::string, std::string> network_quality_estimator_params; 594 std::map<std::string, std::string> network_quality_estimator_params;
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); 1590 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass();
1584 1591
1585 context->set_job_factory( 1592 context->set_job_factory(
1586 globals->proxy_script_fetcher_url_request_job_factory.get()); 1593 globals->proxy_script_fetcher_url_request_job_factory.get());
1587 1594
1588 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the 1595 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the
1589 // system URLRequestContext too. There's no reason this should be tied to a 1596 // system URLRequestContext too. There's no reason this should be tied to a
1590 // profile. 1597 // profile.
1591 return context; 1598 return context;
1592 } 1599 }
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/net/chrome_network_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698