Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1596)

Unified Diff: chrome/browser/io_thread.cc

Issue 1271793003: Create alternative service field trial group. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make it a QUIC parameter. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/io_thread.cc
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 7e4daa49cb10e0df5729495f1072c100239a1069..f8effe0e6ffa2bd6a070e25d0f10ab9dacc3c922 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -893,13 +893,11 @@ void IOThread::ConfigureSpdyGlobals(
}
if (spdy_trial_group.starts_with(kSpdyFieldTrialSpdy31GroupNamePrefix)) {
globals->next_protos.push_back(net::kProtoSPDY31);
- globals->use_alternative_services.set(true);
return;
}
if (spdy_trial_group.starts_with(kSpdyFieldTrialSpdy4GroupNamePrefix)) {
globals->next_protos.push_back(net::kProtoSPDY31);
globals->next_protos.push_back(net::kProtoHTTP2);
- globals->use_alternative_services.set(true);
return;
}
if (spdy_trial_group.starts_with(kSpdyFieldTrialParametrizedPrefix)) {
@@ -917,14 +915,12 @@ void IOThread::ConfigureSpdyGlobals(
// TODO(bnc): HttpStreamFactory::spdy_enabled_ is redundant with
// globals->next_protos, can it be eliminated?
net::HttpStreamFactory::set_spdy_enabled(spdy_enabled);
- globals->use_alternative_services.set(true);
return;
}
// By default, enable HTTP/2.
globals->next_protos.push_back(net::kProtoSPDY31);
globals->next_protos.push_back(net::kProtoHTTP2);
- globals->use_alternative_services.set(true);
}
void IOThread::RegisterPrefs(PrefRegistrySimple* registry) {
@@ -1163,6 +1159,8 @@ void IOThread::ConfigureQuicGlobals(
ShouldQuicDisableDiskCache(quic_trial_params));
globals->quic_prefer_aes.set(
ShouldQuicPreferAes(quic_trial_params));
+ globals->use_alternative_services.set(
+ ShouldQuicEnableAlternativeServices(quic_trial_params));
int max_number_of_lossy_connections = GetQuicMaxNumberOfLossyConnections(
quic_trial_params);
if (max_number_of_lossy_connections != 0) {
@@ -1373,6 +1371,12 @@ bool IOThread::ShouldQuicPreferAes(
GetVariationParam(quic_trial_params, "prefer_aes"), "true");
}
+bool IOThread::ShouldQuicEnableAlternativeServices(
+ const VariationParameters& quic_trial_params) {
+ return base::LowerCaseEqualsASCII(
+ GetVariationParam(quic_trial_params, "use_alternative_services"), "true");
+}
+
int IOThread::GetQuicMaxNumberOfLossyConnections(
const VariationParameters& quic_trial_params) {
int value;

Powered by Google App Engine
This is Rietveld 408576698