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 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 globals.alternate_protocol_probability_threshold.CopyToIfSet( | 1046 globals.alternate_protocol_probability_threshold.CopyToIfSet( |
1047 ¶ms->alternate_protocol_probability_threshold); | 1047 ¶ms->alternate_protocol_probability_threshold); |
1048 | 1048 |
1049 globals.enable_quic.CopyToIfSet(¶ms->enable_quic); | 1049 globals.enable_quic.CopyToIfSet(¶ms->enable_quic); |
1050 globals.quic_always_require_handshake_confirmation.CopyToIfSet( | 1050 globals.quic_always_require_handshake_confirmation.CopyToIfSet( |
1051 ¶ms->quic_always_require_handshake_confirmation); | 1051 ¶ms->quic_always_require_handshake_confirmation); |
1052 globals.quic_disable_connection_pooling.CopyToIfSet( | 1052 globals.quic_disable_connection_pooling.CopyToIfSet( |
1053 ¶ms->quic_disable_connection_pooling); | 1053 ¶ms->quic_disable_connection_pooling); |
1054 globals.quic_load_server_info_timeout_ms.CopyToIfSet( | 1054 globals.quic_load_server_info_timeout_ms.CopyToIfSet( |
1055 ¶ms->quic_load_server_info_timeout_ms); | 1055 ¶ms->quic_load_server_info_timeout_ms); |
1056 globals.quic_disable_loading_server_info_for_new_servers.CopyToIfSet( | |
1057 ¶ms->quic_disable_loading_server_info_for_new_servers); | |
1058 globals.quic_load_server_info_timeout_srtt_multiplier.CopyToIfSet( | 1056 globals.quic_load_server_info_timeout_srtt_multiplier.CopyToIfSet( |
1059 ¶ms->quic_load_server_info_timeout_srtt_multiplier); | 1057 ¶ms->quic_load_server_info_timeout_srtt_multiplier); |
1060 globals.quic_enable_truncated_connection_ids.CopyToIfSet( | 1058 globals.quic_enable_truncated_connection_ids.CopyToIfSet( |
1061 ¶ms->quic_enable_truncated_connection_ids); | 1059 ¶ms->quic_enable_truncated_connection_ids); |
1062 globals.enable_quic_port_selection.CopyToIfSet( | 1060 globals.enable_quic_port_selection.CopyToIfSet( |
1063 ¶ms->enable_quic_port_selection); | 1061 ¶ms->enable_quic_port_selection); |
1064 globals.quic_max_packet_length.CopyToIfSet(¶ms->quic_max_packet_length); | 1062 globals.quic_max_packet_length.CopyToIfSet(¶ms->quic_max_packet_length); |
1065 globals.quic_user_agent_id.CopyToIfSet(¶ms->quic_user_agent_id); | 1063 globals.quic_user_agent_id.CopyToIfSet(¶ms->quic_user_agent_id); |
1066 globals.quic_supported_versions.CopyToIfSet( | 1064 globals.quic_supported_versions.CopyToIfSet( |
1067 ¶ms->quic_supported_versions); | 1065 ¶ms->quic_supported_versions); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 globals->quic_always_require_handshake_confirmation.set( | 1208 globals->quic_always_require_handshake_confirmation.set( |
1211 ShouldQuicAlwaysRequireHandshakeConfirmation(quic_trial_params)); | 1209 ShouldQuicAlwaysRequireHandshakeConfirmation(quic_trial_params)); |
1212 globals->quic_disable_connection_pooling.set( | 1210 globals->quic_disable_connection_pooling.set( |
1213 ShouldQuicDisableConnectionPooling(quic_trial_params)); | 1211 ShouldQuicDisableConnectionPooling(quic_trial_params)); |
1214 int load_server_info_timeout_ms = | 1212 int load_server_info_timeout_ms = |
1215 GetQuicLoadServerInfoTimeout(quic_trial_params); | 1213 GetQuicLoadServerInfoTimeout(quic_trial_params); |
1216 if (load_server_info_timeout_ms != 0) { | 1214 if (load_server_info_timeout_ms != 0) { |
1217 globals->quic_load_server_info_timeout_ms.set( | 1215 globals->quic_load_server_info_timeout_ms.set( |
1218 load_server_info_timeout_ms); | 1216 load_server_info_timeout_ms); |
1219 } | 1217 } |
1220 globals->quic_disable_loading_server_info_for_new_servers.set( | |
1221 ShouldDisableLoadingServerInfoForNewServers(quic_trial_params)); | |
1222 float load_server_info_timeout_srtt_multiplier = | 1218 float load_server_info_timeout_srtt_multiplier = |
1223 GetQuicLoadServerInfoTimeoutSrttMultiplier(quic_trial_params); | 1219 GetQuicLoadServerInfoTimeoutSrttMultiplier(quic_trial_params); |
1224 globals->quic_enable_truncated_connection_ids.set( | 1220 globals->quic_enable_truncated_connection_ids.set( |
1225 ShouldQuicEnableTruncatedConnectionIds(quic_trial_params)); | 1221 ShouldQuicEnableTruncatedConnectionIds(quic_trial_params)); |
1226 if (load_server_info_timeout_srtt_multiplier != 0) { | 1222 if (load_server_info_timeout_srtt_multiplier != 0) { |
1227 globals->quic_load_server_info_timeout_srtt_multiplier.set( | 1223 globals->quic_load_server_info_timeout_srtt_multiplier.set( |
1228 load_server_info_timeout_srtt_multiplier); | 1224 load_server_info_timeout_srtt_multiplier); |
1229 } | 1225 } |
1230 globals->enable_quic_port_selection.set( | 1226 globals->enable_quic_port_selection.set( |
1231 ShouldEnableQuicPortSelection(command_line)); | 1227 ShouldEnableQuicPortSelection(command_line)); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 int value; | 1374 int value; |
1379 if (base::StringToInt(GetVariationParam(quic_trial_params, | 1375 if (base::StringToInt(GetVariationParam(quic_trial_params, |
1380 "load_server_info_timeout"), | 1376 "load_server_info_timeout"), |
1381 &value)) { | 1377 &value)) { |
1382 return value; | 1378 return value; |
1383 } | 1379 } |
1384 return 0; | 1380 return 0; |
1385 } | 1381 } |
1386 | 1382 |
1387 // static | 1383 // static |
1388 bool IOThread::ShouldDisableLoadingServerInfoForNewServers( | |
1389 const VariationParameters& quic_trial_params) { | |
1390 return LowerCaseEqualsASCII( | |
1391 GetVariationParam(quic_trial_params, | |
1392 "disable_loading_server_info_for_new_servers"), | |
1393 "true"); | |
1394 } | |
1395 | |
1396 // static | |
1397 float IOThread::GetQuicLoadServerInfoTimeoutSrttMultiplier( | 1384 float IOThread::GetQuicLoadServerInfoTimeoutSrttMultiplier( |
1398 const VariationParameters& quic_trial_params) { | 1385 const VariationParameters& quic_trial_params) { |
1399 double value; | 1386 double value; |
1400 if (base::StringToDouble(GetVariationParam(quic_trial_params, | 1387 if (base::StringToDouble(GetVariationParam(quic_trial_params, |
1401 "load_server_info_time_to_srtt"), | 1388 "load_server_info_time_to_srtt"), |
1402 &value)) { | 1389 &value)) { |
1403 return (float)value; | 1390 return (float)value; |
1404 } | 1391 } |
1405 return 0.0f; | 1392 return 0.0f; |
1406 } | 1393 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1440 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
1454 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1441 for (size_t i = 0; i < supported_versions.size(); ++i) { |
1455 net::QuicVersion version = supported_versions[i]; | 1442 net::QuicVersion version = supported_versions[i]; |
1456 if (net::QuicVersionToString(version) == quic_version) { | 1443 if (net::QuicVersionToString(version) == quic_version) { |
1457 return version; | 1444 return version; |
1458 } | 1445 } |
1459 } | 1446 } |
1460 | 1447 |
1461 return net::QUIC_VERSION_UNSUPPORTED; | 1448 return net::QUIC_VERSION_UNSUPPORTED; |
1462 } | 1449 } |
OLD | NEW |