| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // Field trial for network quality estimator. Seeds RTT and downstream | 173 // Field trial for network quality estimator. Seeds RTT and downstream |
| 174 // throughput observations with values that correspond to the connection type | 174 // throughput observations with values that correspond to the connection type |
| 175 // determined by the operating system. | 175 // determined by the operating system. |
| 176 const char kNetworkQualityEstimatorFieldTrialName[] = "NetworkQualityEstimator"; | 176 const char kNetworkQualityEstimatorFieldTrialName[] = "NetworkQualityEstimator"; |
| 177 | 177 |
| 178 // Field trial for NPN. | 178 // Field trial for NPN. |
| 179 const char kNpnTrialName[] = "NPN"; | 179 const char kNpnTrialName[] = "NPN"; |
| 180 const char kNpnTrialEnabledGroupNamePrefix[] = "Enable"; | 180 const char kNpnTrialEnabledGroupNamePrefix[] = "Enable"; |
| 181 const char kNpnTrialDisabledGroupNamePrefix[] = "Disable"; | 181 const char kNpnTrialDisabledGroupNamePrefix[] = "Disable"; |
| 182 | 182 |
| 183 // Field trial for priority dependencies. |
| 184 const char kSpdyDependenciesFieldTrial[] = "SpdyEnableDependencies"; |
| 185 const char kSpdyDependenciesFieldTrialEnable[] = "Enable"; |
| 186 const char kSpdyDepencenciesFieldTrialDisable[] = "Disable"; |
| 187 |
| 183 #if defined(OS_MACOSX) | 188 #if defined(OS_MACOSX) |
| 184 void ObserveKeychainEvents() { | 189 void ObserveKeychainEvents() { |
| 185 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 190 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 186 net::CertDatabase::GetInstance()->SetMessageLoopForKeychainEvents(); | 191 net::CertDatabase::GetInstance()->SetMessageLoopForKeychainEvents(); |
| 187 } | 192 } |
| 188 #endif | 193 #endif |
| 189 | 194 |
| 190 // Gets file path into ssl_keylog_file from command line argument or | 195 // Gets file path into ssl_keylog_file from command line argument or |
| 191 // environment variable. Command line argument has priority when | 196 // environment variable. Command line argument has priority when |
| 192 // both specified. | 197 // both specified. |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 | 800 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 |
| 796 // is fixed. | 801 // is fixed. |
| 797 tracked_objects::ScopedTracker tracking_profile12_5( | 802 tracked_objects::ScopedTracker tracking_profile12_5( |
| 798 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 803 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 799 "466432 IOThread::InitAsync::QuicConfiguration")); | 804 "466432 IOThread::InitAsync::QuicConfiguration")); |
| 800 ConfigureQuic(command_line); | 805 ConfigureQuic(command_line); |
| 801 if (command_line.HasSwitch( | 806 if (command_line.HasSwitch( |
| 802 switches::kEnableUserAlternateProtocolPorts)) { | 807 switches::kEnableUserAlternateProtocolPorts)) { |
| 803 globals_->enable_user_alternate_protocol_ports = true; | 808 globals_->enable_user_alternate_protocol_ports = true; |
| 804 } | 809 } |
| 810 ConfigurePriorityDependencies(); |
| 805 globals_->enable_brotli.set( | 811 globals_->enable_brotli.set( |
| 806 base::FeatureList::IsEnabled(features::kBrotliEncoding)); | 812 base::FeatureList::IsEnabled(features::kBrotliEncoding)); |
| 807 globals_->enable_token_binding = | 813 globals_->enable_token_binding = |
| 808 base::FeatureList::IsEnabled(features::kTokenBinding); | 814 base::FeatureList::IsEnabled(features::kTokenBinding); |
| 809 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 | 815 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 |
| 810 // is fixed. | 816 // is fixed. |
| 811 tracked_objects::ScopedTracker tracking_profile13( | 817 tracked_objects::ScopedTracker tracking_profile13( |
| 812 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 818 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 813 "466432 IOThread::InitAsync::InitializeNetworkOptions")); | 819 "466432 IOThread::InitAsync::InitializeNetworkOptions")); |
| 814 InitializeNetworkOptions(command_line); | 820 InitializeNetworkOptions(command_line); |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1095 globals.enable_http2.CopyToIfSet(¶ms->enable_http2); | 1101 globals.enable_http2.CopyToIfSet(¶ms->enable_http2); |
| 1096 globals.parse_alternative_services.CopyToIfSet( | 1102 globals.parse_alternative_services.CopyToIfSet( |
| 1097 ¶ms->parse_alternative_services); | 1103 ¶ms->parse_alternative_services); |
| 1098 globals.enable_alternative_service_with_different_host.CopyToIfSet( | 1104 globals.enable_alternative_service_with_different_host.CopyToIfSet( |
| 1099 ¶ms->enable_alternative_service_with_different_host); | 1105 ¶ms->enable_alternative_service_with_different_host); |
| 1100 | 1106 |
| 1101 globals.enable_npn.CopyToIfSet(¶ms->enable_npn); | 1107 globals.enable_npn.CopyToIfSet(¶ms->enable_npn); |
| 1102 | 1108 |
| 1103 globals.enable_brotli.CopyToIfSet(¶ms->enable_brotli); | 1109 globals.enable_brotli.CopyToIfSet(¶ms->enable_brotli); |
| 1104 | 1110 |
| 1111 globals.enable_priority_dependencies.CopyToIfSet( |
| 1112 ¶ms->enable_priority_dependencies); |
| 1113 |
| 1105 globals.enable_quic.CopyToIfSet(¶ms->enable_quic); | 1114 globals.enable_quic.CopyToIfSet(¶ms->enable_quic); |
| 1106 globals.disable_quic_on_timeout_with_open_streams.CopyToIfSet( | 1115 globals.disable_quic_on_timeout_with_open_streams.CopyToIfSet( |
| 1107 ¶ms->disable_quic_on_timeout_with_open_streams); | 1116 ¶ms->disable_quic_on_timeout_with_open_streams); |
| 1108 globals.enable_quic_for_proxies.CopyToIfSet(¶ms->enable_quic_for_proxies); | 1117 globals.enable_quic_for_proxies.CopyToIfSet(¶ms->enable_quic_for_proxies); |
| 1109 globals.quic_always_require_handshake_confirmation.CopyToIfSet( | 1118 globals.quic_always_require_handshake_confirmation.CopyToIfSet( |
| 1110 ¶ms->quic_always_require_handshake_confirmation); | 1119 ¶ms->quic_always_require_handshake_confirmation); |
| 1111 globals.quic_disable_connection_pooling.CopyToIfSet( | 1120 globals.quic_disable_connection_pooling.CopyToIfSet( |
| 1112 ¶ms->quic_disable_connection_pooling); | 1121 ¶ms->quic_disable_connection_pooling); |
| 1113 globals.quic_load_server_info_timeout_srtt_multiplier.CopyToIfSet( | 1122 globals.quic_load_server_info_timeout_srtt_multiplier.CopyToIfSet( |
| 1114 ¶ms->quic_load_server_info_timeout_srtt_multiplier); | 1123 ¶ms->quic_load_server_info_timeout_srtt_multiplier); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 quick_check_enabled_.GetValue()); | 1210 quick_check_enabled_.GetValue()); |
| 1202 | 1211 |
| 1203 globals_->system_request_context.reset( | 1212 globals_->system_request_context.reset( |
| 1204 ConstructSystemRequestContext(globals_, net_log_)); | 1213 ConstructSystemRequestContext(globals_, net_log_)); |
| 1205 } | 1214 } |
| 1206 | 1215 |
| 1207 void IOThread::UpdateDnsClientEnabled() { | 1216 void IOThread::UpdateDnsClientEnabled() { |
| 1208 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); | 1217 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); |
| 1209 } | 1218 } |
| 1210 | 1219 |
| 1220 void IOThread::ConfigurePriorityDependencies() { |
| 1221 std::string group = |
| 1222 base::FieldTrialList::FindFullName(kSpdyDependenciesFieldTrial); |
| 1223 if (group == kSpdyDependenciesFieldTrialEnable) { |
| 1224 globals_->enable_priority_dependencies.set(true); |
| 1225 } else if (group == kSpdyDepencenciesFieldTrialDisable) { |
| 1226 globals_->enable_priority_dependencies.set(false); |
| 1227 } |
| 1228 } |
| 1229 |
| 1211 void IOThread::ConfigureQuic(const base::CommandLine& command_line) { | 1230 void IOThread::ConfigureQuic(const base::CommandLine& command_line) { |
| 1212 // Always fetch the field trial group to ensure it is reported correctly. | 1231 // Always fetch the field trial group to ensure it is reported correctly. |
| 1213 // The command line flags will be associated with a group that is reported | 1232 // The command line flags will be associated with a group that is reported |
| 1214 // so long as trial is actually queried. | 1233 // so long as trial is actually queried. |
| 1215 std::string group = | 1234 std::string group = |
| 1216 base::FieldTrialList::FindFullName(kQuicFieldTrialName); | 1235 base::FieldTrialList::FindFullName(kQuicFieldTrialName); |
| 1217 VariationParameters params; | 1236 VariationParameters params; |
| 1218 if (!variations::GetVariationParams(kQuicFieldTrialName, ¶ms)) { | 1237 if (!variations::GetVariationParams(kQuicFieldTrialName, ¶ms)) { |
| 1219 params.clear(); | 1238 params.clear(); |
| 1220 } | 1239 } |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1735 std::move(job_factory); | 1754 std::move(job_factory); |
| 1736 | 1755 |
| 1737 context->set_job_factory( | 1756 context->set_job_factory( |
| 1738 globals->proxy_script_fetcher_url_request_job_factory.get()); | 1757 globals->proxy_script_fetcher_url_request_job_factory.get()); |
| 1739 | 1758 |
| 1740 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1759 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
| 1741 // system URLRequestContext too. There's no reason this should be tied to a | 1760 // system URLRequestContext too. There's no reason this should be tied to a |
| 1742 // profile. | 1761 // profile. |
| 1743 return context; | 1762 return context; |
| 1744 } | 1763 } |
| OLD | NEW |