Chromium Code Reviews| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 #include "chrome/browser/net/chrome_network_delegate.h" | 34 #include "chrome/browser/net/chrome_network_delegate.h" |
| 35 #include "chrome/browser/net/connect_interceptor.h" | 35 #include "chrome/browser/net/connect_interceptor.h" |
| 36 #include "chrome/browser/net/dns_probe_service.h" | 36 #include "chrome/browser/net/dns_probe_service.h" |
| 37 #include "chrome/browser/net/pref_proxy_config_tracker.h" | 37 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
| 38 #include "chrome/browser/net/proxy_service_factory.h" | 38 #include "chrome/browser/net/proxy_service_factory.h" |
| 39 #include "chrome/common/chrome_content_client.h" | 39 #include "chrome/common/chrome_content_client.h" |
| 40 #include "chrome/common/chrome_switches.h" | 40 #include "chrome/common/chrome_switches.h" |
| 41 #include "chrome/common/chrome_version_info.h" | 41 #include "chrome/common/chrome_version_info.h" |
| 42 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
| 43 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h" | 43 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h" |
| 44 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" | |
| 44 #include "components/policy/core/common/policy_service.h" | 45 #include "components/policy/core/common/policy_service.h" |
| 45 #include "components/variations/variations_associated_data.h" | 46 #include "components/variations/variations_associated_data.h" |
| 46 #include "content/public/browser/browser_thread.h" | 47 #include "content/public/browser/browser_thread.h" |
| 47 #include "content/public/browser/cookie_store_factory.h" | 48 #include "content/public/browser/cookie_store_factory.h" |
| 48 #include "net/base/host_mapping_rules.h" | 49 #include "net/base/host_mapping_rules.h" |
| 49 #include "net/base/net_util.h" | 50 #include "net/base/net_util.h" |
| 50 #include "net/cert/cert_policy_enforcer.h" | 51 #include "net/cert/cert_policy_enforcer.h" |
| 51 #include "net/cert/cert_verifier.h" | 52 #include "net/cert/cert_verifier.h" |
| 52 #include "net/cert/cert_verify_proc.h" | 53 #include "net/cert/cert_verify_proc.h" |
| 53 #include "net/cert/ct_known_logs.h" | 54 #include "net/cert/ct_known_logs.h" |
| (...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1023 globals.trusted_spdy_proxy.CopyToIfSet(¶ms->trusted_spdy_proxy); | 1024 globals.trusted_spdy_proxy.CopyToIfSet(¶ms->trusted_spdy_proxy); |
| 1024 globals.force_spdy_over_ssl.CopyToIfSet(¶ms->force_spdy_over_ssl); | 1025 globals.force_spdy_over_ssl.CopyToIfSet(¶ms->force_spdy_over_ssl); |
| 1025 globals.force_spdy_always.CopyToIfSet(¶ms->force_spdy_always); | 1026 globals.force_spdy_always.CopyToIfSet(¶ms->force_spdy_always); |
| 1026 params->forced_spdy_exclusions = globals.forced_spdy_exclusions; | 1027 params->forced_spdy_exclusions = globals.forced_spdy_exclusions; |
| 1027 globals.use_alternate_protocols.CopyToIfSet( | 1028 globals.use_alternate_protocols.CopyToIfSet( |
| 1028 ¶ms->use_alternate_protocols); | 1029 ¶ms->use_alternate_protocols); |
| 1029 globals.alternate_protocol_probability_threshold.CopyToIfSet( | 1030 globals.alternate_protocol_probability_threshold.CopyToIfSet( |
| 1030 ¶ms->alternate_protocol_probability_threshold); | 1031 ¶ms->alternate_protocol_probability_threshold); |
| 1031 | 1032 |
| 1032 globals.enable_quic.CopyToIfSet(¶ms->enable_quic); | 1033 globals.enable_quic.CopyToIfSet(¶ms->enable_quic); |
| 1034 globals.enable_quic_for_proxies.CopyToIfSet(¶ms->enable_quic_for_proxies); | |
| 1033 globals.quic_always_require_handshake_confirmation.CopyToIfSet( | 1035 globals.quic_always_require_handshake_confirmation.CopyToIfSet( |
| 1034 ¶ms->quic_always_require_handshake_confirmation); | 1036 ¶ms->quic_always_require_handshake_confirmation); |
| 1035 globals.quic_disable_connection_pooling.CopyToIfSet( | 1037 globals.quic_disable_connection_pooling.CopyToIfSet( |
| 1036 ¶ms->quic_disable_connection_pooling); | 1038 ¶ms->quic_disable_connection_pooling); |
| 1037 globals.quic_load_server_info_timeout_ms.CopyToIfSet( | 1039 globals.quic_load_server_info_timeout_ms.CopyToIfSet( |
| 1038 ¶ms->quic_load_server_info_timeout_ms); | 1040 ¶ms->quic_load_server_info_timeout_ms); |
| 1039 globals.quic_load_server_info_timeout_srtt_multiplier.CopyToIfSet( | 1041 globals.quic_load_server_info_timeout_srtt_multiplier.CopyToIfSet( |
| 1040 ¶ms->quic_load_server_info_timeout_srtt_multiplier); | 1042 ¶ms->quic_load_server_info_timeout_srtt_multiplier); |
| 1041 globals.quic_enable_truncated_connection_ids.CopyToIfSet( | 1043 globals.quic_enable_truncated_connection_ids.CopyToIfSet( |
| 1042 ¶ms->quic_enable_truncated_connection_ids); | 1044 ¶ms->quic_enable_truncated_connection_ids); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1143 } | 1145 } |
| 1144 | 1146 |
| 1145 // static | 1147 // static |
| 1146 void IOThread::ConfigureQuicGlobals( | 1148 void IOThread::ConfigureQuicGlobals( |
| 1147 const base::CommandLine& command_line, | 1149 const base::CommandLine& command_line, |
| 1148 base::StringPiece quic_trial_group, | 1150 base::StringPiece quic_trial_group, |
| 1149 const VariationParameters& quic_trial_params, | 1151 const VariationParameters& quic_trial_params, |
| 1150 IOThread::Globals* globals) { | 1152 IOThread::Globals* globals) { |
| 1151 bool enable_quic = ShouldEnableQuic(command_line, quic_trial_group); | 1153 bool enable_quic = ShouldEnableQuic(command_line, quic_trial_group); |
| 1152 globals->enable_quic.set(enable_quic); | 1154 globals->enable_quic.set(enable_quic); |
| 1155 bool enable_quic_for_proxies = ShouldEnableQuicForProxies(command_line, | |
| 1156 quic_trial_group); | |
| 1157 globals->enable_quic_for_proxies.set(enable_quic_for_proxies); | |
| 1153 if (enable_quic) { | 1158 if (enable_quic) { |
| 1154 globals->quic_always_require_handshake_confirmation.set( | 1159 globals->quic_always_require_handshake_confirmation.set( |
| 1155 ShouldQuicAlwaysRequireHandshakeConfirmation(quic_trial_params)); | 1160 ShouldQuicAlwaysRequireHandshakeConfirmation(quic_trial_params)); |
| 1156 globals->quic_disable_connection_pooling.set( | 1161 globals->quic_disable_connection_pooling.set( |
| 1157 ShouldQuicDisableConnectionPooling(quic_trial_params)); | 1162 ShouldQuicDisableConnectionPooling(quic_trial_params)); |
| 1158 int load_server_info_timeout_ms = | 1163 int load_server_info_timeout_ms = |
| 1159 GetQuicLoadServerInfoTimeout(quic_trial_params); | 1164 GetQuicLoadServerInfoTimeout(quic_trial_params); |
| 1160 if (load_server_info_timeout_ms != 0) { | 1165 if (load_server_info_timeout_ms != 0) { |
| 1161 globals->quic_load_server_info_timeout_ms.set( | 1166 globals->quic_load_server_info_timeout_ms.set( |
| 1162 load_server_info_timeout_ms); | 1167 load_server_info_timeout_ms); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1222 if (command_line.HasSwitch(switches::kDisableQuic)) | 1227 if (command_line.HasSwitch(switches::kDisableQuic)) |
| 1223 return false; | 1228 return false; |
| 1224 | 1229 |
| 1225 if (command_line.HasSwitch(switches::kEnableQuic)) | 1230 if (command_line.HasSwitch(switches::kEnableQuic)) |
| 1226 return true; | 1231 return true; |
| 1227 | 1232 |
| 1228 return quic_trial_group.starts_with(kQuicFieldTrialEnabledGroupName) || | 1233 return quic_trial_group.starts_with(kQuicFieldTrialEnabledGroupName) || |
| 1229 quic_trial_group.starts_with(kQuicFieldTrialHttpsEnabledGroupName); | 1234 quic_trial_group.starts_with(kQuicFieldTrialHttpsEnabledGroupName); |
| 1230 } | 1235 } |
| 1231 | 1236 |
| 1237 // static | |
| 1238 std::string IOThread::QuicTrialGroup() { | |
| 1239 std::string group = | |
| 1240 base::FieldTrialList::FindFullName(kQuicFieldTrialName); | |
|
bengr
2015/02/11 23:57:27
Indentation is off.
tbansal1
2015/02/12 02:27:21
Done.
| |
| 1241 return group; | |
| 1242 } | |
| 1243 | |
| 1244 // static | |
| 1245 bool IOThread::ShouldEnableQuicForProxies( | |
| 1246 const base::CommandLine& command_line, | |
| 1247 base::StringPiece quic_trial_group) { | |
| 1248 if (command_line.HasSwitch(switches::kDisableQuic)) | |
| 1249 return false; | |
| 1250 | |
| 1251 return ShouldEnableQuic(command_line, quic_trial_group) || | |
| 1252 data_reduction_proxy::DataReductionProxyParams:: | |
| 1253 IsIncludedInUseQUICFieldTrial(); | |
|
bengr
2015/02/11 23:57:27
I'd rename as IsIncludedInQuicFieldTrial()
also,
tbansal1
2015/02/12 02:27:21
Done.
| |
| 1254 } | |
| 1255 | |
| 1232 bool IOThread::ShouldEnableQuicPortSelection( | 1256 bool IOThread::ShouldEnableQuicPortSelection( |
| 1233 const base::CommandLine& command_line) { | 1257 const base::CommandLine& command_line) { |
| 1234 if (command_line.HasSwitch(switches::kDisableQuicPortSelection)) | 1258 if (command_line.HasSwitch(switches::kDisableQuicPortSelection)) |
| 1235 return false; | 1259 return false; |
| 1236 | 1260 |
| 1237 if (command_line.HasSwitch(switches::kEnableQuicPortSelection)) | 1261 if (command_line.HasSwitch(switches::kEnableQuicPortSelection)) |
| 1238 return true; | 1262 return true; |
| 1239 | 1263 |
| 1240 return false; // Default to disabling port selection on all channels. | 1264 return false; // Default to disabling port selection on all channels. |
| 1241 } | 1265 } |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1386 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1410 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
| 1387 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1411 for (size_t i = 0; i < supported_versions.size(); ++i) { |
| 1388 net::QuicVersion version = supported_versions[i]; | 1412 net::QuicVersion version = supported_versions[i]; |
| 1389 if (net::QuicVersionToString(version) == quic_version) { | 1413 if (net::QuicVersionToString(version) == quic_version) { |
| 1390 return version; | 1414 return version; |
| 1391 } | 1415 } |
| 1392 } | 1416 } |
| 1393 | 1417 |
| 1394 return net::QUIC_VERSION_UNSUPPORTED; | 1418 return net::QUIC_VERSION_UNSUPPORTED; |
| 1395 } | 1419 } |
| OLD | NEW |