Chromium Code Reviews| 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 |