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 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 if (command_line.HasSwitch(switches::kEnableQuicTimeBasedLossDetection)) | 1156 if (command_line.HasSwitch(switches::kEnableQuicTimeBasedLossDetection)) |
1157 return true; | 1157 return true; |
1158 | 1158 |
1159 if (command_line.HasSwitch(switches::kDisableQuicTimeBasedLossDetection)) | 1159 if (command_line.HasSwitch(switches::kDisableQuicTimeBasedLossDetection)) |
1160 return false; | 1160 return false; |
1161 | 1161 |
1162 return quic_trial_group.ends_with( | 1162 return quic_trial_group.ends_with( |
1163 kQuicFieldTrialTimeBasedLossDetectionSuffix); | 1163 kQuicFieldTrialTimeBasedLossDetectionSuffix); |
1164 } | 1164 } |
1165 | 1165 |
| 1166 // TODO(rtenneti): Delete this method after the merge. |
1166 bool IOThread::ShouldEnableQuicPersistServerInfo( | 1167 bool IOThread::ShouldEnableQuicPersistServerInfo( |
1167 const CommandLine& command_line) { | 1168 const CommandLine& command_line) { |
1168 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | |
1169 // Avoid persisting of Quic server config information to disk cache when we | |
1170 // have a beta or stable release. Allow in all other cases, including when we | |
1171 // do a developer build (CHANNEL_UNKNOWN). | |
1172 if (channel == chrome::VersionInfo::CHANNEL_STABLE || | |
1173 channel == chrome::VersionInfo::CHANNEL_BETA) { | |
1174 return false; | |
1175 } | |
1176 return true; | 1169 return true; |
1177 } | 1170 } |
1178 | 1171 |
1179 size_t IOThread::GetQuicMaxPacketLength(const CommandLine& command_line, | 1172 size_t IOThread::GetQuicMaxPacketLength(const CommandLine& command_line, |
1180 base::StringPiece quic_trial_group) { | 1173 base::StringPiece quic_trial_group) { |
1181 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { | 1174 if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { |
1182 unsigned value; | 1175 unsigned value; |
1183 if (!base::StringToUint( | 1176 if (!base::StringToUint( |
1184 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), | 1177 command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), |
1185 &value)) { | 1178 &value)) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1217 std::string version_flag = | 1210 std::string version_flag = |
1218 command_line.GetSwitchValueASCII(switches::kQuicVersion); | 1211 command_line.GetSwitchValueASCII(switches::kQuicVersion); |
1219 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1212 for (size_t i = 0; i < supported_versions.size(); ++i) { |
1220 net::QuicVersion version = supported_versions[i]; | 1213 net::QuicVersion version = supported_versions[i]; |
1221 if (net::QuicVersionToString(version) == version_flag) { | 1214 if (net::QuicVersionToString(version) == version_flag) { |
1222 return version; | 1215 return version; |
1223 } | 1216 } |
1224 } | 1217 } |
1225 return net::QUIC_VERSION_UNSUPPORTED; | 1218 return net::QUIC_VERSION_UNSUPPORTED; |
1226 } | 1219 } |
OLD | NEW |