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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 #include "net/dns/host_resolver.h" | 84 #include "net/dns/host_resolver.h" |
85 #include "net/dns/mapped_host_resolver.h" | 85 #include "net/dns/mapped_host_resolver.h" |
86 #include "net/http/http_auth_filter.h" | 86 #include "net/http/http_auth_filter.h" |
87 #include "net/http/http_auth_handler_factory.h" | 87 #include "net/http/http_auth_handler_factory.h" |
88 #include "net/http/http_auth_preferences.h" | 88 #include "net/http/http_auth_preferences.h" |
89 #include "net/http/http_network_layer.h" | 89 #include "net/http/http_network_layer.h" |
90 #include "net/http/http_server_properties_impl.h" | 90 #include "net/http/http_server_properties_impl.h" |
91 #include "net/net_features.h" | 91 #include "net/net_features.h" |
92 #include "net/nqe/external_estimate_provider.h" | 92 #include "net/nqe/external_estimate_provider.h" |
93 #include "net/nqe/network_quality_estimator.h" | 93 #include "net/nqe/network_quality_estimator.h" |
| 94 #include "net/nqe/network_quality_estimator_params.h" |
94 #include "net/proxy/proxy_config_service.h" | 95 #include "net/proxy/proxy_config_service.h" |
95 #include "net/proxy/proxy_script_fetcher_impl.h" | 96 #include "net/proxy/proxy_script_fetcher_impl.h" |
96 #include "net/proxy/proxy_service.h" | 97 #include "net/proxy/proxy_service.h" |
97 #include "net/quic/chromium/quic_utils_chromium.h" | 98 #include "net/quic/chromium/quic_utils_chromium.h" |
98 #include "net/socket/ssl_client_socket.h" | 99 #include "net/socket/ssl_client_socket.h" |
99 #include "net/socket/tcp_client_socket.h" | 100 #include "net/socket/tcp_client_socket.h" |
100 #include "net/ssl/channel_id_service.h" | 101 #include "net/ssl/channel_id_service.h" |
101 #include "net/ssl/default_channel_id_store.h" | 102 #include "net/ssl/default_channel_id_store.h" |
102 #include "net/url_request/data_protocol_handler.h" | 103 #include "net/url_request/data_protocol_handler.h" |
103 #include "net/url_request/file_protocol_handler.h" | 104 #include "net/url_request/file_protocol_handler.h" |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 globals_->system_network_delegate = | 554 globals_->system_network_delegate = |
554 globals_->data_use_ascriber->CreateNetworkDelegate( | 555 globals_->data_use_ascriber->CreateNetworkDelegate( |
555 std::move(chrome_network_delegate), GetMetricsDataUseForwarder()); | 556 std::move(chrome_network_delegate), GetMetricsDataUseForwarder()); |
556 | 557 |
557 globals_->host_resolver = CreateGlobalHostResolver(net_log_); | 558 globals_->host_resolver = CreateGlobalHostResolver(net_log_); |
558 | 559 |
559 std::map<std::string, std::string> network_quality_estimator_params; | 560 std::map<std::string, std::string> network_quality_estimator_params; |
560 variations::GetVariationParams(kNetworkQualityEstimatorFieldTrialName, | 561 variations::GetVariationParams(kNetworkQualityEstimatorFieldTrialName, |
561 &network_quality_estimator_params); | 562 &network_quality_estimator_params); |
562 | 563 |
| 564 if (command_line.HasSwitch(switches::kForceEffectiveConnectionType)) { |
| 565 const std::string force_ect_value = |
| 566 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 567 switches::kForceEffectiveConnectionType); |
| 568 |
| 569 if (!force_ect_value.empty()) { |
| 570 // If the effective connection type is forced using command line switch, |
| 571 // it overrides the one set by field trial. |
| 572 network_quality_estimator_params[net::kForceEffectiveConnectionType] = |
| 573 force_ect_value; |
| 574 } |
| 575 } |
| 576 |
563 std::unique_ptr<net::ExternalEstimateProvider> external_estimate_provider; | 577 std::unique_ptr<net::ExternalEstimateProvider> external_estimate_provider; |
564 #if defined(OS_ANDROID) | 578 #if defined(OS_ANDROID) |
565 external_estimate_provider.reset( | 579 external_estimate_provider.reset( |
566 new chrome::android::ExternalEstimateProviderAndroid()); | 580 new chrome::android::ExternalEstimateProviderAndroid()); |
567 #endif // defined(OS_ANDROID) | 581 #endif // defined(OS_ANDROID) |
568 // Pass ownership. | 582 // Pass ownership. |
569 globals_->network_quality_estimator.reset(new net::NetworkQualityEstimator( | 583 globals_->network_quality_estimator.reset(new net::NetworkQualityEstimator( |
570 std::move(external_estimate_provider), network_quality_estimator_params, | 584 std::move(external_estimate_provider), network_quality_estimator_params, |
571 net_log_)); | 585 net_log_)); |
572 | 586 |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 | 1110 |
1097 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1111 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
1098 // system URLRequestContext too. There's no reason this should be tied to a | 1112 // system URLRequestContext too. There's no reason this should be tied to a |
1099 // profile. | 1113 // profile. |
1100 return context; | 1114 return context; |
1101 } | 1115 } |
1102 | 1116 |
1103 metrics::UpdateUsagePrefCallbackType IOThread::GetMetricsDataUseForwarder() { | 1117 metrics::UpdateUsagePrefCallbackType IOThread::GetMetricsDataUseForwarder() { |
1104 return base::Bind(&UpdateMetricsUsagePrefsOnUIThread); | 1118 return base::Bind(&UpdateMetricsUsagePrefsOnUIThread); |
1105 } | 1119 } |
OLD | NEW |