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