Chromium Code Reviews| 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 <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 #include "chrome/browser/net/sth_distributor_provider.h" | 42 #include "chrome/browser/net/sth_distributor_provider.h" |
| 43 #include "chrome/common/channel_info.h" | 43 #include "chrome/common/channel_info.h" |
| 44 #include "chrome/common/chrome_content_client.h" | 44 #include "chrome/common/chrome_content_client.h" |
| 45 #include "chrome/common/chrome_switches.h" | 45 #include "chrome/common/chrome_switches.h" |
| 46 #include "chrome/common/pref_names.h" | 46 #include "chrome/common/pref_names.h" |
| 47 #include "components/certificate_transparency/tree_state_tracker.h" | 47 #include "components/certificate_transparency/tree_state_tracker.h" |
| 48 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h" | 48 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h" |
| 49 #include "components/data_usage/core/data_use_aggregator.h" | 49 #include "components/data_usage/core/data_use_aggregator.h" |
| 50 #include "components/data_usage/core/data_use_amortizer.h" | 50 #include "components/data_usage/core/data_use_amortizer.h" |
| 51 #include "components/data_usage/core/data_use_annotator.h" | 51 #include "components/data_usage/core/data_use_annotator.h" |
| 52 #include "components/data_use_measurement/content/data_use_measurement_util.h" | |
| 52 #include "components/data_use_measurement/core/data_use_ascriber.h" | 53 #include "components/data_use_measurement/core/data_use_ascriber.h" |
| 54 #include "components/data_use_measurement/core/data_use_measurement.h" | |
| 53 #include "components/metrics/metrics_service.h" | 55 #include "components/metrics/metrics_service.h" |
| 54 #include "components/net_log/chrome_net_log.h" | 56 #include "components/net_log/chrome_net_log.h" |
| 55 #include "components/network_session_configurator/network_session_configurator.h " | 57 #include "components/network_session_configurator/network_session_configurator.h " |
| 56 #include "components/policy/core/common/policy_service.h" | 58 #include "components/policy/core/common/policy_service.h" |
| 57 #include "components/policy/policy_constants.h" | 59 #include "components/policy/policy_constants.h" |
| 58 #include "components/prefs/pref_registry_simple.h" | 60 #include "components/prefs/pref_registry_simple.h" |
| 59 #include "components/prefs/pref_service.h" | 61 #include "components/prefs/pref_service.h" |
| 60 #include "components/proxy_config/pref_proxy_config_tracker.h" | 62 #include "components/proxy_config/pref_proxy_config_tracker.h" |
| 61 #include "components/variations/variations_associated_data.h" | 63 #include "components/variations/variations_associated_data.h" |
| 62 #include "components/version_info/version_info.h" | 64 #include "components/version_info/version_info.h" |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 507 globals_->data_use_ascriber = | 509 globals_->data_use_ascriber = |
| 508 base::MakeUnique<data_use_measurement::ChromeDataUseAscriber>(); | 510 base::MakeUnique<data_use_measurement::ChromeDataUseAscriber>(); |
| 509 | 511 |
| 510 globals_->data_use_aggregator.reset(new data_usage::DataUseAggregator( | 512 globals_->data_use_aggregator.reset(new data_usage::DataUseAggregator( |
| 511 std::unique_ptr<data_usage::DataUseAnnotator>( | 513 std::unique_ptr<data_usage::DataUseAnnotator>( |
| 512 new chrome_browser_data_usage::TabIdAnnotator()), | 514 new chrome_browser_data_usage::TabIdAnnotator()), |
| 513 std::move(data_use_amortizer))); | 515 std::move(data_use_amortizer))); |
| 514 | 516 |
| 515 std::unique_ptr<ChromeNetworkDelegate> chrome_network_delegate( | 517 std::unique_ptr<ChromeNetworkDelegate> chrome_network_delegate( |
| 516 new ChromeNetworkDelegate(extension_event_router_forwarder(), | 518 new ChromeNetworkDelegate(extension_event_router_forwarder(), |
| 517 &system_enable_referrers_, | 519 &system_enable_referrers_)); |
| 518 metrics_data_use_forwarder_)); | |
| 519 // By default, data usage is considered off the record. | 520 // By default, data usage is considered off the record. |
| 520 chrome_network_delegate->set_data_use_aggregator( | 521 chrome_network_delegate->set_data_use_aggregator( |
| 521 globals_->data_use_aggregator.get(), | 522 globals_->data_use_aggregator.get(), |
| 522 true /* is_data_usage_off_the_record */); | 523 true /* is_data_usage_off_the_record */); |
| 523 | 524 |
| 524 #if BUILDFLAG(ANDROID_JAVA_UI) | 525 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 525 globals_->external_data_use_observer.reset( | 526 globals_->external_data_use_observer.reset( |
| 526 new chrome::android::ExternalDataUseObserver( | 527 new chrome::android::ExternalDataUseObserver( |
| 527 globals_->data_use_aggregator.get(), | 528 globals_->data_use_aggregator.get(), |
| 528 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), | 529 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), |
| 529 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI))); | 530 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI))); |
| 530 #endif | 531 #endif |
| 531 | 532 |
| 532 globals_->system_network_delegate = | 533 globals_->system_network_delegate = |
| 533 globals_->data_use_ascriber->CreateNetworkDelegate( | 534 globals_->data_use_ascriber->CreateNetworkDelegate( |
| 534 std::move(chrome_network_delegate)); | 535 std::move(chrome_network_delegate), |
| 536 data_use_measurement::GetIsUserInitiatedRequestCallback(), | |
|
Not at Google. Contact bengr
2016/11/09 22:04:10
This method call seems awkward in this file. We sh
| |
| 537 metrics_data_use_forwarder_); | |
| 535 | 538 |
| 536 globals_->host_resolver = CreateGlobalHostResolver(net_log_); | 539 globals_->host_resolver = CreateGlobalHostResolver(net_log_); |
| 537 | 540 |
| 538 std::map<std::string, std::string> network_quality_estimator_params; | 541 std::map<std::string, std::string> network_quality_estimator_params; |
| 539 variations::GetVariationParams(kNetworkQualityEstimatorFieldTrialName, | 542 variations::GetVariationParams(kNetworkQualityEstimatorFieldTrialName, |
| 540 &network_quality_estimator_params); | 543 &network_quality_estimator_params); |
| 541 | 544 |
| 542 std::unique_ptr<net::ExternalEstimateProvider> external_estimate_provider; | 545 std::unique_ptr<net::ExternalEstimateProvider> external_estimate_provider; |
| 543 #if BUILDFLAG(ANDROID_JAVA_UI) | 546 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 544 external_estimate_provider.reset( | 547 external_estimate_provider.reset( |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1075 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1078 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
| 1076 // system URLRequestContext too. There's no reason this should be tied to a | 1079 // system URLRequestContext too. There's no reason this should be tied to a |
| 1077 // profile. | 1080 // profile. |
| 1078 return context; | 1081 return context; |
| 1079 } | 1082 } |
| 1080 | 1083 |
| 1081 const metrics::UpdateUsagePrefCallbackType& | 1084 const metrics::UpdateUsagePrefCallbackType& |
| 1082 IOThread::GetMetricsDataUseForwarder() { | 1085 IOThread::GetMetricsDataUseForwarder() { |
| 1083 return metrics_data_use_forwarder_; | 1086 return metrics_data_use_forwarder_; |
| 1084 } | 1087 } |
| OLD | NEW |