| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "net/socket/next_proto.h" | 5 #include "net/socket/next_proto.h" |
| 6 | 6 |
| 7 namespace net { | 7 namespace net { |
| 8 | 8 |
| 9 NextProtoVector NextProtosHttpOnly() { | 9 NextProtoVector NextProtosHttpOnly() { |
| 10 NextProtoVector next_protos; | 10 NextProtoVector next_protos; |
| 11 next_protos.push_back(kProtoHTTP11); | 11 next_protos.push_back(kProtoHTTP11); |
| 12 return next_protos; | 12 return next_protos; |
| 13 } | 13 } |
| 14 | 14 |
| 15 NextProtoVector NextProtosDefaults() { | 15 NextProtoVector NextProtosDefaults() { |
| 16 NextProtoVector next_protos; | 16 NextProtoVector next_protos; |
| 17 next_protos.push_back(kProtoHTTP11); | 17 next_protos.push_back(kProtoHTTP11); |
| 18 next_protos.push_back(kProtoSPDY31); | 18 next_protos.push_back(kProtoSPDY31); |
| 19 next_protos.push_back(kProtoSPDY4_14); | 19 next_protos.push_back(kProtoSPDY4_14); |
| 20 next_protos.push_back(kProtoSPDY4); |
| 20 return next_protos; | 21 return next_protos; |
| 21 } | 22 } |
| 22 | 23 |
| 23 NextProtoVector NextProtosWithSpdyAndQuic(bool spdy_enabled, | 24 NextProtoVector NextProtosWithSpdyAndQuic(bool spdy_enabled, |
| 24 bool quic_enabled) { | 25 bool quic_enabled) { |
| 25 NextProtoVector next_protos; | 26 NextProtoVector next_protos; |
| 26 next_protos.push_back(kProtoHTTP11); | 27 next_protos.push_back(kProtoHTTP11); |
| 27 if (quic_enabled) | 28 if (quic_enabled) |
| 28 next_protos.push_back(kProtoQUIC1SPDY3); | 29 next_protos.push_back(kProtoQUIC1SPDY3); |
| 29 if (spdy_enabled) { | 30 if (spdy_enabled) { |
| 30 next_protos.push_back(kProtoSPDY31); | 31 next_protos.push_back(kProtoSPDY31); |
| 31 next_protos.push_back(kProtoSPDY4_14); | 32 next_protos.push_back(kProtoSPDY4_14); |
| 33 next_protos.push_back(kProtoSPDY4); |
| 32 } | 34 } |
| 33 return next_protos; | 35 return next_protos; |
| 34 } | 36 } |
| 35 | 37 |
| 36 NextProtoVector NextProtosSpdy31() { | 38 NextProtoVector NextProtosSpdy31() { |
| 37 NextProtoVector next_protos; | 39 NextProtoVector next_protos; |
| 38 next_protos.push_back(kProtoHTTP11); | 40 next_protos.push_back(kProtoHTTP11); |
| 39 next_protos.push_back(kProtoQUIC1SPDY3); | 41 next_protos.push_back(kProtoQUIC1SPDY3); |
| 40 next_protos.push_back(kProtoSPDY31); | 42 next_protos.push_back(kProtoSPDY31); |
| 41 return next_protos; | 43 return next_protos; |
| 42 } | 44 } |
| 43 | 45 |
| 44 NextProtoVector NextProtosSpdy4Http2() { | 46 NextProtoVector NextProtosSpdy4Http2() { |
| 45 NextProtoVector next_protos; | 47 NextProtoVector next_protos; |
| 46 next_protos.push_back(kProtoHTTP11); | 48 next_protos.push_back(kProtoHTTP11); |
| 47 next_protos.push_back(kProtoQUIC1SPDY3); | 49 next_protos.push_back(kProtoQUIC1SPDY3); |
| 48 next_protos.push_back(kProtoSPDY31); | 50 next_protos.push_back(kProtoSPDY31); |
| 49 next_protos.push_back(kProtoSPDY4_14); | 51 next_protos.push_back(kProtoSPDY4_14); |
| 52 next_protos.push_back(kProtoSPDY4); |
| 50 return next_protos; | 53 return next_protos; |
| 51 } | 54 } |
| 52 | 55 |
| 53 } // namespace net | 56 } // namespace net |
| OLD | NEW |