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 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1219 | 1219 |
1220 bool IOThread::ShouldEnableQuic(const base::CommandLine& command_line, | 1220 bool IOThread::ShouldEnableQuic(const base::CommandLine& command_line, |
1221 base::StringPiece quic_trial_group) { | 1221 base::StringPiece quic_trial_group) { |
1222 if (command_line.HasSwitch(switches::kDisableQuic)) | 1222 if (command_line.HasSwitch(switches::kDisableQuic)) |
1223 return false; | 1223 return false; |
1224 | 1224 |
1225 if (command_line.HasSwitch(switches::kEnableQuic)) | 1225 if (command_line.HasSwitch(switches::kEnableQuic)) |
1226 return true; | 1226 return true; |
1227 | 1227 |
1228 return quic_trial_group.starts_with(kQuicFieldTrialEnabledGroupName) || | 1228 return quic_trial_group.starts_with(kQuicFieldTrialEnabledGroupName) || |
1229 quic_trial_group.starts_with(kQuicFieldTrialHttpsEnabledGroupName); | 1229 quic_trial_group.starts_with(kQuicFieldTrialHttpsEnabledGroupName) || |
1230 base::FieldTrialList::FindFullName( | |
1231 "DataReductionProxyUseQUICAsPrimaryOrigin") == "Enabled"; | |
Ryan Hamilton
2015/02/06 22:23:52
Ah, I see. Hm, I'm not super in love this this. Th
| |
1230 } | 1232 } |
1231 | 1233 |
1232 bool IOThread::ShouldEnableQuicPortSelection( | 1234 bool IOThread::ShouldEnableQuicPortSelection( |
1233 const base::CommandLine& command_line) { | 1235 const base::CommandLine& command_line) { |
1234 if (command_line.HasSwitch(switches::kDisableQuicPortSelection)) | 1236 if (command_line.HasSwitch(switches::kDisableQuicPortSelection)) |
1235 return false; | 1237 return false; |
1236 | 1238 |
1237 if (command_line.HasSwitch(switches::kEnableQuicPortSelection)) | 1239 if (command_line.HasSwitch(switches::kEnableQuicPortSelection)) |
1238 return true; | 1240 return true; |
1239 | 1241 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1386 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); | 1388 net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); |
1387 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1389 for (size_t i = 0; i < supported_versions.size(); ++i) { |
1388 net::QuicVersion version = supported_versions[i]; | 1390 net::QuicVersion version = supported_versions[i]; |
1389 if (net::QuicVersionToString(version) == quic_version) { | 1391 if (net::QuicVersionToString(version) == quic_version) { |
1390 return version; | 1392 return version; |
1391 } | 1393 } |
1392 } | 1394 } |
1393 | 1395 |
1394 return net::QUIC_VERSION_UNSUPPORTED; | 1396 return net::QUIC_VERSION_UNSUPPORTED; |
1395 } | 1397 } |
OLD | NEW |