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 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_load_server_info_if_already_spoke_quic.CopyToIfSet( | |
| 1057 ¶ms->quic_load_server_info_if_already_spoke_quic); | |
| 1056 globals.enable_quic_port_selection.CopyToIfSet( | 1058 globals.enable_quic_port_selection.CopyToIfSet( |
| 1057 ¶ms->enable_quic_port_selection); | 1059 ¶ms->enable_quic_port_selection); |
| 1058 globals.quic_max_packet_length.CopyToIfSet(¶ms->quic_max_packet_length); | 1060 globals.quic_max_packet_length.CopyToIfSet(¶ms->quic_max_packet_length); |
| 1059 globals.quic_user_agent_id.CopyToIfSet(¶ms->quic_user_agent_id); | 1061 globals.quic_user_agent_id.CopyToIfSet(¶ms->quic_user_agent_id); |
| 1060 globals.quic_supported_versions.CopyToIfSet( | 1062 globals.quic_supported_versions.CopyToIfSet( |
| 1061 ¶ms->quic_supported_versions); | 1063 ¶ms->quic_supported_versions); |
| 1062 params->quic_connection_options = globals.quic_connection_options; | 1064 params->quic_connection_options = globals.quic_connection_options; |
| 1063 | 1065 |
| 1064 globals.origin_to_force_quic_on.CopyToIfSet( | 1066 globals.origin_to_force_quic_on.CopyToIfSet( |
| 1065 ¶ms->origin_to_force_quic_on); | 1067 ¶ms->origin_to_force_quic_on); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1196 globals->quic_always_require_handshake_confirmation.set( | 1198 globals->quic_always_require_handshake_confirmation.set( |
| 1197 ShouldQuicAlwaysRequireHandshakeConfirmation(quic_trial_params)); | 1199 ShouldQuicAlwaysRequireHandshakeConfirmation(quic_trial_params)); |
| 1198 globals->quic_disable_connection_pooling.set( | 1200 globals->quic_disable_connection_pooling.set( |
| 1199 ShouldQuicDisableConnectionPooling(quic_trial_params)); | 1201 ShouldQuicDisableConnectionPooling(quic_trial_params)); |
| 1200 int load_server_info_timeout_ms = | 1202 int load_server_info_timeout_ms = |
| 1201 GetQuicLoadServerInfoTimeout(quic_trial_params); | 1203 GetQuicLoadServerInfoTimeout(quic_trial_params); |
| 1202 if (load_server_info_timeout_ms != 0) { | 1204 if (load_server_info_timeout_ms != 0) { |
| 1203 globals->quic_load_server_info_timeout_ms.set( | 1205 globals->quic_load_server_info_timeout_ms.set( |
| 1204 load_server_info_timeout_ms); | 1206 load_server_info_timeout_ms); |
| 1205 } | 1207 } |
| 1208 globals->quic_load_server_info_if_already_spoke_quic.set( | |
| 1209 ShouldQuicLoadServerInfoIfAlreadySpokeQuic(quic_trial_params)); | |
| 1206 globals->enable_quic_port_selection.set( | 1210 globals->enable_quic_port_selection.set( |
| 1207 ShouldEnableQuicPortSelection(command_line)); | 1211 ShouldEnableQuicPortSelection(command_line)); |
| 1208 globals->quic_connection_options = | 1212 globals->quic_connection_options = |
| 1209 GetQuicConnectionOptions(command_line, quic_trial_params); | 1213 GetQuicConnectionOptions(command_line, quic_trial_params); |
| 1210 if (ShouldEnableQuicPacing(command_line, quic_trial_group, | 1214 if (ShouldEnableQuicPacing(command_line, quic_trial_group, |
| 1211 quic_trial_params)) { | 1215 quic_trial_params)) { |
| 1212 globals->quic_connection_options.push_back(net::kPACE); | 1216 globals->quic_connection_options.push_back(net::kPACE); |
| 1213 } | 1217 } |
| 1214 } | 1218 } |
| 1215 | 1219 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1360 int value; | 1364 int value; |
| 1361 if (base::StringToInt(GetVariationParam(quic_trial_params, | 1365 if (base::StringToInt(GetVariationParam(quic_trial_params, |
| 1362 "load_server_info_timeout"), | 1366 "load_server_info_timeout"), |
| 1363 &value)) { | 1367 &value)) { |
| 1364 return value; | 1368 return value; |
| 1365 } | 1369 } |
| 1366 return 0; | 1370 return 0; |
| 1367 } | 1371 } |
| 1368 | 1372 |
| 1369 // static | 1373 // static |
| 1374 bool IOThread::ShouldQuicLoadServerInfoIfAlreadySpokeQuic( | |
| 1375 const VariationParameters& quic_trial_params) { | |
| 1376 return LowerCaseEqualsASCII(GetVariationParam( | |
| 1377 quic_trial_params, "load_server_info_if_already_spoke_quic"), "true"); | |
|
Ryan Hamilton
2014/12/18 19:19:12
To confirm, are you expecting to get the old behav
ramant (doing other things)
2014/12/18 20:51:10
Old behavior in the default case. New behavior whe
| |
| 1378 } | |
| 1379 | |
| 1380 // static | |
| 1370 size_t IOThread::GetQuicMaxPacketLength( | 1381 size_t IOThread::GetQuicMaxPacketLength( |
| 1371 const CommandLine& command_line, | 1382 const CommandLine& command_line, |
| 1372 base::StringPiece quic_trial_group, | 1383 base::StringPiece quic_trial_group, |
| 1373 const VariationParameters& quic_trial_params) { | 1384 const VariationParameters& quic_trial_params) { |
| 1374 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { | 1385 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { |
| 1375 unsigned value; | 1386 unsigned value; |
| 1376 if (!base::StringToUint( | 1387 if (!base::StringToUint( |
| 1377 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), | 1388 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), |
| 1378 &value)) { | 1389 &value)) { |
| 1379 return 0; | 1390 return 0; |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 1407 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1418 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
| 1408 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1419 for (size_t i = 0; i < supported_versions.size(); ++i) { |
| 1409 net::QuicVersion version = supported_versions[i]; | 1420 net::QuicVersion version = supported_versions[i]; |
| 1410 if (net::QuicVersionToString(version) == quic_version) { | 1421 if (net::QuicVersionToString(version) == quic_version) { |
| 1411 return version; | 1422 return version; |
| 1412 } | 1423 } |
| 1413 } | 1424 } |
| 1414 | 1425 |
| 1415 return net::QUIC_VERSION_UNSUPPORTED; | 1426 return net::QUIC_VERSION_UNSUPPORTED; |
| 1416 } | 1427 } |
| OLD | NEW |