Roll src/third_party/WebKit a3b4a2e:7441784 (svn 202551:202552)
[chromium-blink-merge.git] / net / socket / next_proto.cc
blob0a803728ec8553598cf3f22fc76a07fa9b94abe7
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
3 // found in the LICENSE file.
5 #include "net/socket/next_proto.h"
7 namespace net {
9 NextProtoVector NextProtosDefaults() {
10 NextProtoVector next_protos;
11 next_protos.push_back(kProtoHTTP11);
12 next_protos.push_back(kProtoSPDY31);
13 next_protos.push_back(kProtoHTTP2);
14 return next_protos;
17 NextProtoVector NextProtosWithSpdyAndQuic(bool spdy_enabled,
18 bool quic_enabled) {
19 NextProtoVector next_protos;
20 next_protos.push_back(kProtoHTTP11);
21 if (quic_enabled)
22 next_protos.push_back(kProtoQUIC1SPDY3);
23 if (spdy_enabled) {
24 next_protos.push_back(kProtoSPDY31);
25 next_protos.push_back(kProtoHTTP2);
27 return next_protos;
30 NextProtoVector NextProtosSpdy31() {
31 NextProtoVector next_protos;
32 next_protos.push_back(kProtoHTTP11);
33 next_protos.push_back(kProtoQUIC1SPDY3);
34 next_protos.push_back(kProtoSPDY31);
35 return next_protos;
38 bool NextProtoIsSPDY(NextProto next_proto) {
39 return next_proto >= kProtoSPDYMinimumVersion &&
40 next_proto <= kProtoSPDYMaximumVersion;
43 } // namespace net