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

Unified Diff: net/socket/next_proto.cc

Issue 1020363003: Independently enable SPDY versions from field trial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Keep NextProtosSpdy31() for compatibility; reorder params. Created 5 years, 9 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
« net/socket/next_proto.h ('K') | « net/socket/next_proto.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/next_proto.cc
diff --git a/net/socket/next_proto.cc b/net/socket/next_proto.cc
index 6b5ee3e028f32077a9ac5795669807201b15375f..aa9db7207fd6a0514de0ec9e883fa04b29e49940 100644
--- a/net/socket/next_proto.cc
+++ b/net/socket/next_proto.cc
@@ -6,51 +6,34 @@
namespace net {
-NextProtoVector NextProtosHttpOnly() {
- NextProtoVector next_protos;
- next_protos.push_back(kProtoHTTP11);
- return next_protos;
-}
-
-NextProtoVector NextProtosDefaults() {
- NextProtoVector next_protos;
- next_protos.push_back(kProtoHTTP11);
- next_protos.push_back(kProtoSPDY31);
- next_protos.push_back(kProtoSPDY4_14);
- next_protos.push_back(kProtoSPDY4);
- return next_protos;
-}
-
-NextProtoVector NextProtosWithSpdyAndQuic(bool spdy_enabled,
- bool quic_enabled) {
+NextProtoVector NextProtos(bool quic_enabled,
+ bool spdy31_enabled,
+ bool h2_14_enabled,
+ bool h2_enabled) {
NextProtoVector next_protos;
next_protos.push_back(kProtoHTTP11);
if (quic_enabled)
next_protos.push_back(kProtoQUIC1SPDY3);
- if (spdy_enabled) {
+ if (spdy31_enabled)
next_protos.push_back(kProtoSPDY31);
+ if (h2_14_enabled)
next_protos.push_back(kProtoSPDY4_14);
+ if (h2_enabled)
next_protos.push_back(kProtoSPDY4);
- }
return next_protos;
}
+NextProtoVector NextProtosDefaults() {
+ return NextProtos(false, true, true, true);
+}
+
NextProtoVector NextProtosSpdy31() {
- NextProtoVector next_protos;
- next_protos.push_back(kProtoHTTP11);
- next_protos.push_back(kProtoQUIC1SPDY3);
- next_protos.push_back(kProtoSPDY31);
- return next_protos;
+ return NextProtos(true, true, false, false);
Ryan Hamilton 2015/03/20 23:38:07 Lots of booleans is a recipe for typos. How about
Bence 2015/03/23 14:19:13 Okay, you convinced me. I'm moving the logic to i
}
-NextProtoVector NextProtosSpdy4Http2() {
- NextProtoVector next_protos;
- next_protos.push_back(kProtoHTTP11);
- next_protos.push_back(kProtoQUIC1SPDY3);
- next_protos.push_back(kProtoSPDY31);
- next_protos.push_back(kProtoSPDY4_14);
- next_protos.push_back(kProtoSPDY4);
- return next_protos;
+NextProtoVector NextProtosWithSpdyAndQuic(bool spdy_enabled,
+ bool quic_enabled) {
+ return NextProtos(spdy_enabled, spdy_enabled, spdy_enabled, quic_enabled);
}
} // namespace net
« net/socket/next_proto.h ('K') | « net/socket/next_proto.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698