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 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 } | 1104 } |
1105 | 1105 |
1106 bool IOThread::ShouldEnableQuicPortSelection( | 1106 bool IOThread::ShouldEnableQuicPortSelection( |
1107 const CommandLine& command_line) { | 1107 const CommandLine& command_line) { |
1108 if (command_line.HasSwitch(switches::kDisableQuicPortSelection)) | 1108 if (command_line.HasSwitch(switches::kDisableQuicPortSelection)) |
1109 return false; | 1109 return false; |
1110 | 1110 |
1111 if (command_line.HasSwitch(switches::kEnableQuicPortSelection)) | 1111 if (command_line.HasSwitch(switches::kEnableQuicPortSelection)) |
1112 return true; | 1112 return true; |
1113 | 1113 |
1114 #if defined(OS_WIN) | 1114 return false; // Default to disabling port selection on all channels. |
1115 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | |
1116 // Avoid picking ports (which might induce a security dialog) when we have a | |
1117 // beta or stable release. Allow in all other cases, including when we do a | |
1118 // developer build (CHANNEL_UNKNOWN). | |
1119 if (channel == chrome::VersionInfo::CHANNEL_STABLE || | |
1120 channel == chrome::VersionInfo::CHANNEL_BETA) { | |
1121 // TODO(grt) bug=329255: Detect presence of rule on Windows that allows us | |
1122 // to do port selection without inducing a dialog. | |
1123 // When we have an API to see if the administrative security manager will | |
1124 // allow port selection without a security dialog, we may return true if | |
1125 // we're sure there will be no security dialog. | |
1126 return false; | |
1127 } | |
1128 return true; | |
1129 #else | |
1130 return true; | |
1131 #endif | |
1132 } | 1115 } |
1133 | 1116 |
1134 bool IOThread::ShouldEnableQuicPacing(const CommandLine& command_line, | 1117 bool IOThread::ShouldEnableQuicPacing(const CommandLine& command_line, |
1135 base::StringPiece quic_trial_group) { | 1118 base::StringPiece quic_trial_group) { |
1136 if (command_line.HasSwitch(switches::kEnableQuicPacing)) | 1119 if (command_line.HasSwitch(switches::kEnableQuicPacing)) |
1137 return true; | 1120 return true; |
1138 | 1121 |
1139 if (command_line.HasSwitch(switches::kDisableQuicPacing)) | 1122 if (command_line.HasSwitch(switches::kDisableQuicPacing)) |
1140 return false; | 1123 return false; |
1141 | 1124 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1209 std::string version_flag = | 1192 std::string version_flag = |
1210 command_line.GetSwitchValueASCII(switches::kQuicVersion); | 1193 command_line.GetSwitchValueASCII(switches::kQuicVersion); |
1211 for (size_t i = 0; i < supported_versions.size(); ++i) { | 1194 for (size_t i = 0; i < supported_versions.size(); ++i) { |
1212 net::QuicVersion version = supported_versions[i]; | 1195 net::QuicVersion version = supported_versions[i]; |
1213 if (net::QuicVersionToString(version) == version_flag) { | 1196 if (net::QuicVersionToString(version) == version_flag) { |
1214 return version; | 1197 return version; |
1215 } | 1198 } |
1216 } | 1199 } |
1217 return net::QUIC_VERSION_UNSUPPORTED; | 1200 return net::QUIC_VERSION_UNSUPPORTED; |
1218 } | 1201 } |
OLD | NEW |