Handle failed fetches/decodes from BitmapFetcher.
[chromium-blink-merge.git] / net / socket / next_proto.cc
blobcfc6578284a9badb2a71f2823b4313a022563103
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(kProtoSPDY4_14);
14 next_protos.push_back(kProtoSPDY4);
15 return next_protos;
18 NextProtoVector NextProtosWithSpdyAndQuic(bool spdy_enabled,
19 bool quic_enabled) {
20 NextProtoVector next_protos;
21 next_protos.push_back(kProtoHTTP11);
22 if (quic_enabled)
23 next_protos.push_back(kProtoQUIC1SPDY3);
24 if (spdy_enabled) {
25 next_protos.push_back(kProtoSPDY31);
26 next_protos.push_back(kProtoSPDY4_14);
27 next_protos.push_back(kProtoSPDY4);
29 return next_protos;
32 NextProtoVector NextProtosSpdy31() {
33 NextProtoVector next_protos;
34 next_protos.push_back(kProtoHTTP11);
35 next_protos.push_back(kProtoQUIC1SPDY3);
36 next_protos.push_back(kProtoSPDY31);
37 return next_protos;
40 bool NextProtoIsSPDY(NextProto next_proto) {
41 return next_proto >= kProtoSPDYMinimumVersion &&
42 next_proto <= kProtoSPDYMaximumVersion;
45 } // namespace net