| 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 "next_proto.h" | 5 #include "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(kProtoSPDY3); | |
| 19 next_protos.push_back(kProtoSPDY31); | 18 next_protos.push_back(kProtoSPDY31); |
| 20 return next_protos; | 19 return next_protos; |
| 21 } | 20 } |
| 22 | 21 |
| 23 NextProtoVector NextProtosWithSpdyAndQuic(bool spdy_enabled, | 22 NextProtoVector NextProtosWithSpdyAndQuic(bool spdy_enabled, |
| 24 bool quic_enabled) { | 23 bool quic_enabled) { |
| 25 NextProtoVector next_protos; | 24 NextProtoVector next_protos; |
| 26 next_protos.push_back(kProtoHTTP11); | 25 next_protos.push_back(kProtoHTTP11); |
| 27 if (quic_enabled) | 26 if (quic_enabled) |
| 28 next_protos.push_back(kProtoQUIC1SPDY3); | 27 next_protos.push_back(kProtoQUIC1SPDY3); |
| 29 if (spdy_enabled) { | 28 if (spdy_enabled) { |
| 30 next_protos.push_back(kProtoSPDY3); | |
| 31 next_protos.push_back(kProtoSPDY31); | 29 next_protos.push_back(kProtoSPDY31); |
| 32 } | 30 } |
| 33 return next_protos; | 31 return next_protos; |
| 34 } | 32 } |
| 35 | 33 |
| 36 NextProtoVector NextProtosSpdy3() { | 34 NextProtoVector NextProtosSpdy3() { |
| 37 NextProtoVector next_protos; | 35 NextProtoVector next_protos; |
| 38 next_protos.push_back(kProtoHTTP11); | 36 next_protos.push_back(kProtoHTTP11); |
| 39 next_protos.push_back(kProtoQUIC1SPDY3); | 37 next_protos.push_back(kProtoQUIC1SPDY3); |
| 40 next_protos.push_back(kProtoSPDY3); | |
| 41 return next_protos; | 38 return next_protos; |
| 42 } | 39 } |
| 43 | 40 |
| 44 NextProtoVector NextProtosSpdy31() { | 41 NextProtoVector NextProtosSpdy31() { |
| 45 NextProtoVector next_protos; | 42 NextProtoVector next_protos; |
| 46 next_protos.push_back(kProtoHTTP11); | 43 next_protos.push_back(kProtoHTTP11); |
| 47 next_protos.push_back(kProtoQUIC1SPDY3); | 44 next_protos.push_back(kProtoQUIC1SPDY3); |
| 48 next_protos.push_back(kProtoSPDY3); | |
| 49 next_protos.push_back(kProtoSPDY31); | 45 next_protos.push_back(kProtoSPDY31); |
| 50 return next_protos; | 46 return next_protos; |
| 51 } | 47 } |
| 52 | 48 |
| 53 NextProtoVector NextProtosSpdy31WithSpdy2() { | 49 NextProtoVector NextProtosSpdy31WithSpdy2() { |
| 54 NextProtoVector next_protos; | 50 NextProtoVector next_protos; |
| 55 next_protos.push_back(kProtoHTTP11); | 51 next_protos.push_back(kProtoHTTP11); |
| 56 next_protos.push_back(kProtoQUIC1SPDY3); | 52 next_protos.push_back(kProtoQUIC1SPDY3); |
| 57 next_protos.push_back(kProtoDeprecatedSPDY2); | 53 next_protos.push_back(kProtoDeprecatedSPDY2); |
| 58 next_protos.push_back(kProtoSPDY3); | |
| 59 next_protos.push_back(kProtoSPDY31); | 54 next_protos.push_back(kProtoSPDY31); |
| 60 return next_protos; | 55 return next_protos; |
| 61 } | 56 } |
| 62 | 57 |
| 63 NextProtoVector NextProtosSpdy4Http2() { | 58 NextProtoVector NextProtosSpdy4Http2() { |
| 64 NextProtoVector next_protos; | 59 NextProtoVector next_protos; |
| 65 next_protos.push_back(kProtoHTTP11); | 60 next_protos.push_back(kProtoHTTP11); |
| 66 next_protos.push_back(kProtoQUIC1SPDY3); | 61 next_protos.push_back(kProtoQUIC1SPDY3); |
| 67 next_protos.push_back(kProtoSPDY3); | |
| 68 next_protos.push_back(kProtoSPDY31); | 62 next_protos.push_back(kProtoSPDY31); |
| 69 next_protos.push_back(kProtoSPDY4); | 63 next_protos.push_back(kProtoSPDY4); |
| 70 return next_protos; | 64 return next_protos; |
| 71 } | 65 } |
| 72 | 66 |
| 73 } // namespace net | 67 } // namespace net |
| OLD | NEW |