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