| 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 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 bool IOThread::ShouldEnableQuicPacing( | 1238 bool IOThread::ShouldEnableQuicPacing( |
| 1239 const CommandLine& command_line, | 1239 const CommandLine& command_line, |
| 1240 base::StringPiece quic_trial_group, | 1240 base::StringPiece quic_trial_group, |
| 1241 const VariationParameters& quic_trial_params) { | 1241 const VariationParameters& quic_trial_params) { |
| 1242 if (command_line.HasSwitch(switches::kEnableQuicPacing)) | 1242 if (command_line.HasSwitch(switches::kEnableQuicPacing)) |
| 1243 return true; | 1243 return true; |
| 1244 | 1244 |
| 1245 if (command_line.HasSwitch(switches::kDisableQuicPacing)) | 1245 if (command_line.HasSwitch(switches::kDisableQuicPacing)) |
| 1246 return false; | 1246 return false; |
| 1247 | 1247 |
| 1248 if (LowerCaseEqualsASCII( | 1248 if (base::LowerCaseEqualsASCII( |
| 1249 GetVariationParam(quic_trial_params, "enable_pacing"), | 1249 GetVariationParam(quic_trial_params, "enable_pacing"), |
| 1250 "true")) | 1250 "true")) |
| 1251 return true; | 1251 return true; |
| 1252 | 1252 |
| 1253 return quic_trial_group.ends_with(kQuicFieldTrialPacingSuffix); | 1253 return quic_trial_group.ends_with(kQuicFieldTrialPacingSuffix); |
| 1254 } | 1254 } |
| 1255 | 1255 |
| 1256 net::QuicTagVector IOThread::GetQuicConnectionOptions( | 1256 net::QuicTagVector IOThread::GetQuicConnectionOptions( |
| 1257 const CommandLine& command_line, | 1257 const CommandLine& command_line, |
| 1258 const VariationParameters& quic_trial_params) { | 1258 const VariationParameters& quic_trial_params) { |
| 1259 if (command_line.HasSwitch(switches::kQuicConnectionOptions)) { | 1259 if (command_line.HasSwitch(switches::kQuicConnectionOptions)) { |
| 1260 return ParseQuicConnectionOptions( | 1260 return ParseQuicConnectionOptions( |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 bool IOThread::ShouldEnableQuicTimeBasedLossDetection( | 1316 bool IOThread::ShouldEnableQuicTimeBasedLossDetection( |
| 1317 const CommandLine& command_line, | 1317 const CommandLine& command_line, |
| 1318 base::StringPiece quic_trial_group, | 1318 base::StringPiece quic_trial_group, |
| 1319 const VariationParameters& quic_trial_params) { | 1319 const VariationParameters& quic_trial_params) { |
| 1320 if (command_line.HasSwitch(switches::kEnableQuicTimeBasedLossDetection)) | 1320 if (command_line.HasSwitch(switches::kEnableQuicTimeBasedLossDetection)) |
| 1321 return true; | 1321 return true; |
| 1322 | 1322 |
| 1323 if (command_line.HasSwitch(switches::kDisableQuicTimeBasedLossDetection)) | 1323 if (command_line.HasSwitch(switches::kDisableQuicTimeBasedLossDetection)) |
| 1324 return false; | 1324 return false; |
| 1325 | 1325 |
| 1326 if (LowerCaseEqualsASCII( | 1326 if (base::LowerCaseEqualsASCII( |
| 1327 GetVariationParam(quic_trial_params, "enable_time_based_loss_detection"), | 1327 GetVariationParam(quic_trial_params, |
| 1328 "true")) | 1328 "enable_time_based_loss_detection"), |
| 1329 "true")) |
| 1329 return true; | 1330 return true; |
| 1330 | 1331 |
| 1331 return quic_trial_group.ends_with( | 1332 return quic_trial_group.ends_with( |
| 1332 kQuicFieldTrialTimeBasedLossDetectionSuffix); | 1333 kQuicFieldTrialTimeBasedLossDetectionSuffix); |
| 1333 } | 1334 } |
| 1334 | 1335 |
| 1335 // static | 1336 // static |
| 1336 size_t IOThread::GetQuicMaxPacketLength( | 1337 size_t IOThread::GetQuicMaxPacketLength( |
| 1337 const CommandLine& command_line, | 1338 const CommandLine& command_line, |
| 1338 base::StringPiece quic_trial_group, | 1339 base::StringPiece quic_trial_group, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1391 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1392 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
| 1392 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1393 for (size_t i = 0; i < supported_versions.size(); ++i) { |
| 1393 net::QuicVersion version = supported_versions[i]; | 1394 net::QuicVersion version = supported_versions[i]; |
| 1394 if (net::QuicVersionToString(version) == quic_version) { | 1395 if (net::QuicVersionToString(version) == quic_version) { |
| 1395 return version; | 1396 return version; |
| 1396 } | 1397 } |
| 1397 } | 1398 } |
| 1398 | 1399 |
| 1399 return net::QUIC_VERSION_UNSUPPORTED; | 1400 return net::QUIC_VERSION_UNSUPPORTED; |
| 1400 } | 1401 } |
| OLD | NEW |