| 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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 globals_->data_use_ascriber = | 508 globals_->data_use_ascriber = |
| 509 base::MakeUnique<data_use_measurement::ChromeDataUseAscriber>(); | 509 base::MakeUnique<data_use_measurement::ChromeDataUseAscriber>(); |
| 510 | 510 |
| 511 globals_->data_use_aggregator.reset(new data_usage::DataUseAggregator( | 511 globals_->data_use_aggregator.reset(new data_usage::DataUseAggregator( |
| 512 std::unique_ptr<data_usage::DataUseAnnotator>( | 512 std::unique_ptr<data_usage::DataUseAnnotator>( |
| 513 new chrome_browser_data_usage::TabIdAnnotator()), | 513 new chrome_browser_data_usage::TabIdAnnotator()), |
| 514 std::move(data_use_amortizer))); | 514 std::move(data_use_amortizer))); |
| 515 | 515 |
| 516 std::unique_ptr<ChromeNetworkDelegate> chrome_network_delegate( | 516 std::unique_ptr<ChromeNetworkDelegate> chrome_network_delegate( |
| 517 new ChromeNetworkDelegate(extension_event_router_forwarder(), | 517 new ChromeNetworkDelegate(extension_event_router_forwarder(), |
| 518 &system_enable_referrers_, | 518 &system_enable_referrers_)); |
| 519 metrics_data_use_forwarder_)); | |
| 520 // By default, data usage is considered off the record. | 519 // By default, data usage is considered off the record. |
| 521 chrome_network_delegate->set_data_use_aggregator( | 520 chrome_network_delegate->set_data_use_aggregator( |
| 522 globals_->data_use_aggregator.get(), | 521 globals_->data_use_aggregator.get(), |
| 523 true /* is_data_usage_off_the_record */); | 522 true /* is_data_usage_off_the_record */); |
| 524 | 523 |
| 525 #if BUILDFLAG(ANDROID_JAVA_UI) | 524 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 526 globals_->external_data_use_observer.reset( | 525 globals_->external_data_use_observer.reset( |
| 527 new chrome::android::ExternalDataUseObserver( | 526 new chrome::android::ExternalDataUseObserver( |
| 528 globals_->data_use_aggregator.get(), | 527 globals_->data_use_aggregator.get(), |
| 529 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), | 528 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), |
| 530 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI))); | 529 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI))); |
| 531 #endif | 530 #endif |
| 532 | 531 |
| 533 globals_->system_network_delegate = | 532 globals_->system_network_delegate = |
| 534 globals_->data_use_ascriber->CreateNetworkDelegate( | 533 globals_->data_use_ascriber->CreateNetworkDelegate( |
| 535 std::move(chrome_network_delegate)); | 534 std::move(chrome_network_delegate), metrics_data_use_forwarder_); |
| 536 | 535 |
| 537 globals_->host_resolver = CreateGlobalHostResolver(net_log_); | 536 globals_->host_resolver = CreateGlobalHostResolver(net_log_); |
| 538 | 537 |
| 539 std::map<std::string, std::string> network_quality_estimator_params; | 538 std::map<std::string, std::string> network_quality_estimator_params; |
| 540 variations::GetVariationParams(kNetworkQualityEstimatorFieldTrialName, | 539 variations::GetVariationParams(kNetworkQualityEstimatorFieldTrialName, |
| 541 &network_quality_estimator_params); | 540 &network_quality_estimator_params); |
| 542 | 541 |
| 543 std::unique_ptr<net::ExternalEstimateProvider> external_estimate_provider; | 542 std::unique_ptr<net::ExternalEstimateProvider> external_estimate_provider; |
| 544 #if BUILDFLAG(ANDROID_JAVA_UI) | 543 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 545 external_estimate_provider.reset( | 544 external_estimate_provider.reset( |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1075 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
| 1077 // system URLRequestContext too. There's no reason this should be tied to a | 1076 // system URLRequestContext too. There's no reason this should be tied to a |
| 1078 // profile. | 1077 // profile. |
| 1079 return context; | 1078 return context; |
| 1080 } | 1079 } |
| 1081 | 1080 |
| 1082 const metrics::UpdateUsagePrefCallbackType& | 1081 const metrics::UpdateUsagePrefCallbackType& |
| 1083 IOThread::GetMetricsDataUseForwarder() { | 1082 IOThread::GetMetricsDataUseForwarder() { |
| 1084 return metrics_data_use_forwarder_; | 1083 return metrics_data_use_forwarder_; |
| 1085 } | 1084 } |
| OLD | NEW |