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 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 globals.alternate_protocol_probability_threshold.CopyToIfSet( | 1031 globals.alternate_protocol_probability_threshold.CopyToIfSet( |
1032 ¶ms->alternate_protocol_probability_threshold); | 1032 ¶ms->alternate_protocol_probability_threshold); |
1033 globals.enable_websocket_over_spdy.CopyToIfSet( | 1033 globals.enable_websocket_over_spdy.CopyToIfSet( |
1034 ¶ms->enable_websocket_over_spdy); | 1034 ¶ms->enable_websocket_over_spdy); |
1035 | 1035 |
1036 globals.enable_quic.CopyToIfSet(¶ms->enable_quic); | 1036 globals.enable_quic.CopyToIfSet(¶ms->enable_quic); |
1037 globals.enable_quic_time_based_loss_detection.CopyToIfSet( | 1037 globals.enable_quic_time_based_loss_detection.CopyToIfSet( |
1038 ¶ms->enable_quic_time_based_loss_detection); | 1038 ¶ms->enable_quic_time_based_loss_detection); |
1039 globals.quic_always_require_handshake_confirmation.CopyToIfSet( | 1039 globals.quic_always_require_handshake_confirmation.CopyToIfSet( |
1040 ¶ms->quic_always_require_handshake_confirmation); | 1040 ¶ms->quic_always_require_handshake_confirmation); |
| 1041 globals.quic_disable_connection_pooling.CopyToIfSet( |
| 1042 ¶ms->quic_disable_connection_pooling); |
1041 globals.enable_quic_port_selection.CopyToIfSet( | 1043 globals.enable_quic_port_selection.CopyToIfSet( |
1042 ¶ms->enable_quic_port_selection); | 1044 ¶ms->enable_quic_port_selection); |
1043 globals.quic_max_packet_length.CopyToIfSet(¶ms->quic_max_packet_length); | 1045 globals.quic_max_packet_length.CopyToIfSet(¶ms->quic_max_packet_length); |
1044 globals.quic_user_agent_id.CopyToIfSet(¶ms->quic_user_agent_id); | 1046 globals.quic_user_agent_id.CopyToIfSet(¶ms->quic_user_agent_id); |
1045 globals.quic_supported_versions.CopyToIfSet( | 1047 globals.quic_supported_versions.CopyToIfSet( |
1046 ¶ms->quic_supported_versions); | 1048 ¶ms->quic_supported_versions); |
1047 params->quic_connection_options = globals.quic_connection_options; | 1049 params->quic_connection_options = globals.quic_connection_options; |
1048 | 1050 |
1049 globals.origin_to_force_quic_on.CopyToIfSet( | 1051 globals.origin_to_force_quic_on.CopyToIfSet( |
1050 ¶ms->origin_to_force_quic_on); | 1052 ¶ms->origin_to_force_quic_on); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1146 const VariationParameters& quic_trial_params, | 1148 const VariationParameters& quic_trial_params, |
1147 IOThread::Globals* globals) { | 1149 IOThread::Globals* globals) { |
1148 bool enable_quic = ShouldEnableQuic(command_line, quic_trial_group); | 1150 bool enable_quic = ShouldEnableQuic(command_line, quic_trial_group); |
1149 globals->enable_quic.set(enable_quic); | 1151 globals->enable_quic.set(enable_quic); |
1150 if (enable_quic) { | 1152 if (enable_quic) { |
1151 globals->enable_quic_time_based_loss_detection.set( | 1153 globals->enable_quic_time_based_loss_detection.set( |
1152 ShouldEnableQuicTimeBasedLossDetection(command_line, quic_trial_group, | 1154 ShouldEnableQuicTimeBasedLossDetection(command_line, quic_trial_group, |
1153 quic_trial_params)); | 1155 quic_trial_params)); |
1154 globals->quic_always_require_handshake_confirmation.set( | 1156 globals->quic_always_require_handshake_confirmation.set( |
1155 ShouldQuicAlwaysRequireHandshakeConfirmation(quic_trial_params)); | 1157 ShouldQuicAlwaysRequireHandshakeConfirmation(quic_trial_params)); |
| 1158 globals->quic_disable_connection_pooling.set( |
| 1159 ShouldQuicDisableConnectionPooling(quic_trial_params)); |
1156 globals->enable_quic_port_selection.set( | 1160 globals->enable_quic_port_selection.set( |
1157 ShouldEnableQuicPortSelection(command_line)); | 1161 ShouldEnableQuicPortSelection(command_line)); |
1158 globals->quic_connection_options = | 1162 globals->quic_connection_options = |
1159 GetQuicConnectionOptions(command_line, quic_trial_params); | 1163 GetQuicConnectionOptions(command_line, quic_trial_params); |
1160 if (ShouldEnableQuicPacing(command_line, quic_trial_group, | 1164 if (ShouldEnableQuicPacing(command_line, quic_trial_group, |
1161 quic_trial_params)) { | 1165 quic_trial_params)) { |
1162 globals->quic_connection_options.push_back(net::kPACE); | 1166 globals->quic_connection_options.push_back(net::kPACE); |
1163 } | 1167 } |
1164 } | 1168 } |
1165 | 1169 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1330 // static | 1334 // static |
1331 bool IOThread::ShouldQuicAlwaysRequireHandshakeConfirmation( | 1335 bool IOThread::ShouldQuicAlwaysRequireHandshakeConfirmation( |
1332 const VariationParameters& quic_trial_params) { | 1336 const VariationParameters& quic_trial_params) { |
1333 return LowerCaseEqualsASCII( | 1337 return LowerCaseEqualsASCII( |
1334 GetVariationParam(quic_trial_params, | 1338 GetVariationParam(quic_trial_params, |
1335 "always_require_handshake_confirmation"), | 1339 "always_require_handshake_confirmation"), |
1336 "true"); | 1340 "true"); |
1337 } | 1341 } |
1338 | 1342 |
1339 // static | 1343 // static |
| 1344 bool IOThread::ShouldQuicDisableConnectionPooling( |
| 1345 const VariationParameters& quic_trial_params) { |
| 1346 return LowerCaseEqualsASCII( |
| 1347 GetVariationParam(quic_trial_params, "disable_connection_pooling"), |
| 1348 "true"); |
| 1349 } |
| 1350 |
| 1351 // static |
1340 size_t IOThread::GetQuicMaxPacketLength( | 1352 size_t IOThread::GetQuicMaxPacketLength( |
1341 const CommandLine& command_line, | 1353 const CommandLine& command_line, |
1342 base::StringPiece quic_trial_group, | 1354 base::StringPiece quic_trial_group, |
1343 const VariationParameters& quic_trial_params) { | 1355 const VariationParameters& quic_trial_params) { |
1344 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { | 1356 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { |
1345 unsigned value; | 1357 unsigned value; |
1346 if (!base::StringToUint( | 1358 if (!base::StringToUint( |
1347 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), | 1359 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), |
1348 &value)) { | 1360 &value)) { |
1349 return 0; | 1361 return 0; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1395 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1407 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
1396 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1408 for (size_t i = 0; i < supported_versions.size(); ++i) { |
1397 net::QuicVersion version = supported_versions[i]; | 1409 net::QuicVersion version = supported_versions[i]; |
1398 if (net::QuicVersionToString(version) == quic_version) { | 1410 if (net::QuicVersionToString(version) == quic_version) { |
1399 return version; | 1411 return version; |
1400 } | 1412 } |
1401 } | 1413 } |
1402 | 1414 |
1403 return net::QUIC_VERSION_UNSUPPORTED; | 1415 return net::QUIC_VERSION_UNSUPPORTED; |
1404 } | 1416 } |
OLD | NEW |