OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 */); | |
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
| |
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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1585 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); | 1592 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); |
1586 | 1593 |
1587 context->set_job_factory( | 1594 context->set_job_factory( |
1588 globals->proxy_script_fetcher_url_request_job_factory.get()); | 1595 globals->proxy_script_fetcher_url_request_job_factory.get()); |
1589 | 1596 |
1590 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1597 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
1591 // system URLRequestContext too. There's no reason this should be tied to a | 1598 // system URLRequestContext too. There's no reason this should be tied to a |
1592 // profile. | 1599 // profile. |
1593 return context; | 1600 return context; |
1594 } | 1601 } |
OLD | NEW |