| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 // Field trial for network quality estimator. Seeds RTT and downstream | 176 // Field trial for network quality estimator. Seeds RTT and downstream |
| 177 // throughput observations with values that correspond to the connection type | 177 // throughput observations with values that correspond to the connection type |
| 178 // determined by the operating system. | 178 // determined by the operating system. |
| 179 const char kNetworkQualityEstimatorFieldTrialName[] = "NetworkQualityEstimator"; | 179 const char kNetworkQualityEstimatorFieldTrialName[] = "NetworkQualityEstimator"; |
| 180 | 180 |
| 181 // Field trial for NPN. | 181 // Field trial for NPN. |
| 182 const char kNpnTrialName[] = "NPN"; | 182 const char kNpnTrialName[] = "NPN"; |
| 183 const char kNpnTrialEnabledGroupNamePrefix[] = "Enable"; | 183 const char kNpnTrialEnabledGroupNamePrefix[] = "Enable"; |
| 184 const char kNpnTrialDisabledGroupNamePrefix[] = "Disable"; | 184 const char kNpnTrialDisabledGroupNamePrefix[] = "Disable"; |
| 185 | 185 |
| 186 // Field trial for priority dependencies. |
| 187 const char kSpdyDependenciesFieldTrial[] = "SpdyEnableDependencies"; |
| 188 const char kSpdyDependenciesFieldTrialEnable[] = "Enable"; |
| 189 const char kSpdyDepencenciesFieldTrialDisable[] = "Disable"; |
| 190 |
| 186 #if defined(OS_MACOSX) | 191 #if defined(OS_MACOSX) |
| 187 void ObserveKeychainEvents() { | 192 void ObserveKeychainEvents() { |
| 188 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 193 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 189 net::CertDatabase::GetInstance()->SetMessageLoopForKeychainEvents(); | 194 net::CertDatabase::GetInstance()->SetMessageLoopForKeychainEvents(); |
| 190 } | 195 } |
| 191 #endif | 196 #endif |
| 192 | 197 |
| 193 // Gets file path into ssl_keylog_file from command line argument or | 198 // Gets file path into ssl_keylog_file from command line argument or |
| 194 // environment variable. Command line argument has priority when | 199 // environment variable. Command line argument has priority when |
| 195 // both specified. | 200 // both specified. |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 | 805 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 |
| 801 // is fixed. | 806 // is fixed. |
| 802 tracked_objects::ScopedTracker tracking_profile12_5( | 807 tracked_objects::ScopedTracker tracking_profile12_5( |
| 803 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 808 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 804 "466432 IOThread::InitAsync::QuicConfiguration")); | 809 "466432 IOThread::InitAsync::QuicConfiguration")); |
| 805 ConfigureQuic(command_line); | 810 ConfigureQuic(command_line); |
| 806 if (command_line.HasSwitch( | 811 if (command_line.HasSwitch( |
| 807 switches::kEnableUserAlternateProtocolPorts)) { | 812 switches::kEnableUserAlternateProtocolPorts)) { |
| 808 globals_->enable_user_alternate_protocol_ports = true; | 813 globals_->enable_user_alternate_protocol_ports = true; |
| 809 } | 814 } |
| 815 ConfigurePriorityDependencies(); |
| 810 globals_->enable_brotli.set( | 816 globals_->enable_brotli.set( |
| 811 base::FeatureList::IsEnabled(features::kBrotliEncoding)); | 817 base::FeatureList::IsEnabled(features::kBrotliEncoding)); |
| 812 globals_->enable_token_binding = | 818 globals_->enable_token_binding = |
| 813 base::FeatureList::IsEnabled(features::kTokenBinding); | 819 base::FeatureList::IsEnabled(features::kTokenBinding); |
| 814 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 | 820 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 |
| 815 // is fixed. | 821 // is fixed. |
| 816 tracked_objects::ScopedTracker tracking_profile13( | 822 tracked_objects::ScopedTracker tracking_profile13( |
| 817 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 823 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 818 "466432 IOThread::InitAsync::InitializeNetworkOptions")); | 824 "466432 IOThread::InitAsync::InitializeNetworkOptions")); |
| 819 InitializeNetworkOptions(command_line); | 825 InitializeNetworkOptions(command_line); |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 ¶ms->parse_alternative_services); | 1108 ¶ms->parse_alternative_services); |
| 1103 globals.enable_alternative_service_with_different_host.CopyToIfSet( | 1109 globals.enable_alternative_service_with_different_host.CopyToIfSet( |
| 1104 ¶ms->enable_alternative_service_with_different_host); | 1110 ¶ms->enable_alternative_service_with_different_host); |
| 1105 globals.alternative_service_probability_threshold.CopyToIfSet( | 1111 globals.alternative_service_probability_threshold.CopyToIfSet( |
| 1106 ¶ms->alternative_service_probability_threshold); | 1112 ¶ms->alternative_service_probability_threshold); |
| 1107 | 1113 |
| 1108 globals.enable_npn.CopyToIfSet(¶ms->enable_npn); | 1114 globals.enable_npn.CopyToIfSet(¶ms->enable_npn); |
| 1109 | 1115 |
| 1110 globals.enable_brotli.CopyToIfSet(¶ms->enable_brotli); | 1116 globals.enable_brotli.CopyToIfSet(¶ms->enable_brotli); |
| 1111 | 1117 |
| 1118 globals.enable_priority_dependencies.CopyToIfSet( |
| 1119 ¶ms->enable_priority_dependencies); |
| 1120 |
| 1112 globals.enable_quic.CopyToIfSet(¶ms->enable_quic); | 1121 globals.enable_quic.CopyToIfSet(¶ms->enable_quic); |
| 1113 globals.disable_quic_on_timeout_with_open_streams.CopyToIfSet( | 1122 globals.disable_quic_on_timeout_with_open_streams.CopyToIfSet( |
| 1114 ¶ms->disable_quic_on_timeout_with_open_streams); | 1123 ¶ms->disable_quic_on_timeout_with_open_streams); |
| 1115 globals.enable_quic_for_proxies.CopyToIfSet(¶ms->enable_quic_for_proxies); | 1124 globals.enable_quic_for_proxies.CopyToIfSet(¶ms->enable_quic_for_proxies); |
| 1116 globals.quic_always_require_handshake_confirmation.CopyToIfSet( | 1125 globals.quic_always_require_handshake_confirmation.CopyToIfSet( |
| 1117 ¶ms->quic_always_require_handshake_confirmation); | 1126 ¶ms->quic_always_require_handshake_confirmation); |
| 1118 globals.quic_disable_connection_pooling.CopyToIfSet( | 1127 globals.quic_disable_connection_pooling.CopyToIfSet( |
| 1119 ¶ms->quic_disable_connection_pooling); | 1128 ¶ms->quic_disable_connection_pooling); |
| 1120 globals.quic_load_server_info_timeout_srtt_multiplier.CopyToIfSet( | 1129 globals.quic_load_server_info_timeout_srtt_multiplier.CopyToIfSet( |
| 1121 ¶ms->quic_load_server_info_timeout_srtt_multiplier); | 1130 ¶ms->quic_load_server_info_timeout_srtt_multiplier); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1208 quick_check_enabled_.GetValue()); | 1217 quick_check_enabled_.GetValue()); |
| 1209 | 1218 |
| 1210 globals_->system_request_context.reset( | 1219 globals_->system_request_context.reset( |
| 1211 ConstructSystemRequestContext(globals_, net_log_)); | 1220 ConstructSystemRequestContext(globals_, net_log_)); |
| 1212 } | 1221 } |
| 1213 | 1222 |
| 1214 void IOThread::UpdateDnsClientEnabled() { | 1223 void IOThread::UpdateDnsClientEnabled() { |
| 1215 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); | 1224 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); |
| 1216 } | 1225 } |
| 1217 | 1226 |
| 1227 void IOThread::ConfigurePriorityDependencies() { |
| 1228 std::string group = |
| 1229 base::FieldTrialList::FindFullName(kSpdyDependenciesFieldTrial); |
| 1230 if (group == kSpdyDependenciesFieldTrialEnable) { |
| 1231 globals_->enable_priority_dependencies.set(true); |
| 1232 } else if (group == kSpdyDepencenciesFieldTrialDisable) { |
| 1233 globals_->enable_priority_dependencies.set(false); |
| 1234 } |
| 1235 } |
| 1236 |
| 1218 void IOThread::ConfigureQuic(const base::CommandLine& command_line) { | 1237 void IOThread::ConfigureQuic(const base::CommandLine& command_line) { |
| 1219 // Always fetch the field trial group to ensure it is reported correctly. | 1238 // Always fetch the field trial group to ensure it is reported correctly. |
| 1220 // The command line flags will be associated with a group that is reported | 1239 // The command line flags will be associated with a group that is reported |
| 1221 // so long as trial is actually queried. | 1240 // so long as trial is actually queried. |
| 1222 std::string group = | 1241 std::string group = |
| 1223 base::FieldTrialList::FindFullName(kQuicFieldTrialName); | 1242 base::FieldTrialList::FindFullName(kQuicFieldTrialName); |
| 1224 VariationParameters params; | 1243 VariationParameters params; |
| 1225 if (!variations::GetVariationParams(kQuicFieldTrialName, ¶ms)) { | 1244 if (!variations::GetVariationParams(kQuicFieldTrialName, ¶ms)) { |
| 1226 params.clear(); | 1245 params.clear(); |
| 1227 } | 1246 } |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1783 std::move(job_factory); | 1802 std::move(job_factory); |
| 1784 | 1803 |
| 1785 context->set_job_factory( | 1804 context->set_job_factory( |
| 1786 globals->proxy_script_fetcher_url_request_job_factory.get()); | 1805 globals->proxy_script_fetcher_url_request_job_factory.get()); |
| 1787 | 1806 |
| 1788 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1807 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
| 1789 // system URLRequestContext too. There's no reason this should be tied to a | 1808 // system URLRequestContext too. There's no reason this should be tied to a |
| 1790 // profile. | 1809 // profile. |
| 1791 return context; | 1810 return context; |
| 1792 } | 1811 } |
| OLD | NEW |