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 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1023 globals.trusted_spdy_proxy.CopyToIfSet(¶ms->trusted_spdy_proxy); | 1023 globals.trusted_spdy_proxy.CopyToIfSet(¶ms->trusted_spdy_proxy); |
| 1024 globals.force_spdy_over_ssl.CopyToIfSet(¶ms->force_spdy_over_ssl); | 1024 globals.force_spdy_over_ssl.CopyToIfSet(¶ms->force_spdy_over_ssl); |
| 1025 globals.force_spdy_always.CopyToIfSet(¶ms->force_spdy_always); | 1025 globals.force_spdy_always.CopyToIfSet(¶ms->force_spdy_always); |
| 1026 params->forced_spdy_exclusions = globals.forced_spdy_exclusions; | 1026 params->forced_spdy_exclusions = globals.forced_spdy_exclusions; |
| 1027 globals.use_alternate_protocols.CopyToIfSet( | 1027 globals.use_alternate_protocols.CopyToIfSet( |
| 1028 ¶ms->use_alternate_protocols); | 1028 ¶ms->use_alternate_protocols); |
| 1029 globals.alternate_protocol_probability_threshold.CopyToIfSet( | 1029 globals.alternate_protocol_probability_threshold.CopyToIfSet( |
| 1030 ¶ms->alternate_protocol_probability_threshold); | 1030 ¶ms->alternate_protocol_probability_threshold); |
| 1031 | 1031 |
| 1032 globals.enable_quic.CopyToIfSet(¶ms->enable_quic); | 1032 globals.enable_quic.CopyToIfSet(¶ms->enable_quic); |
| 1033 globals.enable_quic_proxy.CopyToIfSet(¶ms->enable_quic_proxy); | |
| 1033 globals.quic_always_require_handshake_confirmation.CopyToIfSet( | 1034 globals.quic_always_require_handshake_confirmation.CopyToIfSet( |
| 1034 ¶ms->quic_always_require_handshake_confirmation); | 1035 ¶ms->quic_always_require_handshake_confirmation); |
| 1035 globals.quic_disable_connection_pooling.CopyToIfSet( | 1036 globals.quic_disable_connection_pooling.CopyToIfSet( |
| 1036 ¶ms->quic_disable_connection_pooling); | 1037 ¶ms->quic_disable_connection_pooling); |
| 1037 globals.quic_load_server_info_timeout_ms.CopyToIfSet( | 1038 globals.quic_load_server_info_timeout_ms.CopyToIfSet( |
| 1038 ¶ms->quic_load_server_info_timeout_ms); | 1039 ¶ms->quic_load_server_info_timeout_ms); |
| 1039 globals.quic_load_server_info_timeout_srtt_multiplier.CopyToIfSet( | 1040 globals.quic_load_server_info_timeout_srtt_multiplier.CopyToIfSet( |
| 1040 ¶ms->quic_load_server_info_timeout_srtt_multiplier); | 1041 ¶ms->quic_load_server_info_timeout_srtt_multiplier); |
| 1041 globals.quic_enable_truncated_connection_ids.CopyToIfSet( | 1042 globals.quic_enable_truncated_connection_ids.CopyToIfSet( |
| 1042 ¶ms->quic_enable_truncated_connection_ids); | 1043 ¶ms->quic_enable_truncated_connection_ids); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1143 } | 1144 } |
| 1144 | 1145 |
| 1145 // static | 1146 // static |
| 1146 void IOThread::ConfigureQuicGlobals( | 1147 void IOThread::ConfigureQuicGlobals( |
| 1147 const base::CommandLine& command_line, | 1148 const base::CommandLine& command_line, |
| 1148 base::StringPiece quic_trial_group, | 1149 base::StringPiece quic_trial_group, |
| 1149 const VariationParameters& quic_trial_params, | 1150 const VariationParameters& quic_trial_params, |
| 1150 IOThread::Globals* globals) { | 1151 IOThread::Globals* globals) { |
| 1151 bool enable_quic = ShouldEnableQuic(command_line, quic_trial_group); | 1152 bool enable_quic = ShouldEnableQuic(command_line, quic_trial_group); |
| 1152 globals->enable_quic.set(enable_quic); | 1153 globals->enable_quic.set(enable_quic); |
| 1154 bool enable_quic_for_proxies = | |
| 1155 ShouldEnableQuicForProxies(command_line, quic_trial_group); | |
| 1156 globals->enable_quic_proxy.set(enable_quic_for_proxies); | |
| 1153 if (enable_quic) { | 1157 if (enable_quic) { |
| 1154 globals->quic_always_require_handshake_confirmation.set( | 1158 globals->quic_always_require_handshake_confirmation.set( |
| 1155 ShouldQuicAlwaysRequireHandshakeConfirmation(quic_trial_params)); | 1159 ShouldQuicAlwaysRequireHandshakeConfirmation(quic_trial_params)); |
| 1156 globals->quic_disable_connection_pooling.set( | 1160 globals->quic_disable_connection_pooling.set( |
| 1157 ShouldQuicDisableConnectionPooling(quic_trial_params)); | 1161 ShouldQuicDisableConnectionPooling(quic_trial_params)); |
| 1158 int load_server_info_timeout_ms = | 1162 int load_server_info_timeout_ms = |
| 1159 GetQuicLoadServerInfoTimeout(quic_trial_params); | 1163 GetQuicLoadServerInfoTimeout(quic_trial_params); |
| 1160 if (load_server_info_timeout_ms != 0) { | 1164 if (load_server_info_timeout_ms != 0) { |
| 1161 globals->quic_load_server_info_timeout_ms.set( | 1165 globals->quic_load_server_info_timeout_ms.set( |
| 1162 load_server_info_timeout_ms); | 1166 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)) | 1226 if (command_line.HasSwitch(switches::kDisableQuic)) |
| 1223 return false; | 1227 return false; |
| 1224 | 1228 |
| 1225 if (command_line.HasSwitch(switches::kEnableQuic)) | 1229 if (command_line.HasSwitch(switches::kEnableQuic)) |
| 1226 return true; | 1230 return true; |
| 1227 | 1231 |
| 1228 return quic_trial_group.starts_with(kQuicFieldTrialEnabledGroupName) || | 1232 return quic_trial_group.starts_with(kQuicFieldTrialEnabledGroupName) || |
| 1229 quic_trial_group.starts_with(kQuicFieldTrialHttpsEnabledGroupName); | 1233 quic_trial_group.starts_with(kQuicFieldTrialHttpsEnabledGroupName); |
| 1230 } | 1234 } |
| 1231 | 1235 |
| 1236 bool IOThread::ShouldEnableQuicForProxies(const base::CommandLine& command_line, | |
| 1237 base::StringPiece quic_trial_group) { | |
| 1238 return ShouldEnableQuic(command_line, quic_trial_group) || | |
| 1239 base::FieldTrialList::FindFullName( | |
| 1240 "DataReductionProxyUseQUICAsPrimaryOrigin") == "Enabled"; | |
|
bengr
2015/02/07 01:48:48
How about DataReductionProxyUseQUIC?
And why does
Ryan Hamilton
2015/02/08 16:56:35
s/QUIC/Quic/ when used like this. Do you already h
Ryan Hamilton
2015/02/08 16:56:36
I think you need to check the --disable-quic flag?
tbansal1
2015/02/10 19:46:04
Done.
tbansal1
2015/02/10 19:46:04
Done.
tbansal1
2015/02/10 19:46:04
Done.
tbansal1
2015/02/10 19:46:04
Done.
tbansal1
2015/02/10 22:45:41
Done.
tbansal1
2015/02/10 22:45:41
This is the first.
| |
| 1241 } | |
| 1242 | |
| 1232 bool IOThread::ShouldEnableQuicPortSelection( | 1243 bool IOThread::ShouldEnableQuicPortSelection( |
| 1233 const base::CommandLine& command_line) { | 1244 const base::CommandLine& command_line) { |
| 1234 if (command_line.HasSwitch(switches::kDisableQuicPortSelection)) | 1245 if (command_line.HasSwitch(switches::kDisableQuicPortSelection)) |
| 1235 return false; | 1246 return false; |
| 1236 | 1247 |
| 1237 if (command_line.HasSwitch(switches::kEnableQuicPortSelection)) | 1248 if (command_line.HasSwitch(switches::kEnableQuicPortSelection)) |
| 1238 return true; | 1249 return true; |
| 1239 | 1250 |
| 1240 return false; // Default to disabling port selection on all channels. | 1251 return false; // Default to disabling port selection on all channels. |
| 1241 } | 1252 } |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1386 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1397 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
| 1387 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1398 for (size_t i = 0; i < supported_versions.size(); ++i) { |
| 1388 net::QuicVersion version = supported_versions[i]; | 1399 net::QuicVersion version = supported_versions[i]; |
| 1389 if (net::QuicVersionToString(version) == quic_version) { | 1400 if (net::QuicVersionToString(version) == quic_version) { |
| 1390 return version; | 1401 return version; |
| 1391 } | 1402 } |
| 1392 } | 1403 } |
| 1393 | 1404 |
| 1394 return net::QUIC_VERSION_UNSUPPORTED; | 1405 return net::QUIC_VERSION_UNSUPPORTED; |
| 1395 } | 1406 } |
| OLD | NEW |