| 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 "net/socket/next_proto.h" |
| 6 |
| 7 #include "base/logging.h" |
| 6 | 8 |
| 7 namespace net { | 9 namespace net { |
| 8 | 10 |
| 11 unsigned int SpdyProtoPermanentValue(NextProto protocol) { |
| 12 // These values are collected by UMA, do not change or reuse them. When |
| 13 // adding new values, do not forget to update spdyProtoPermanentValueBoundary. |
| 14 switch (protocol) { |
| 15 case kProtoDeprecatedSPDY2: |
| 16 return 1; |
| 17 case kProtoSPDY3: |
| 18 return 2; |
| 19 case kProtoSPDY31: |
| 20 return 3; |
| 21 // SPDY4 currently is HTTP/2 draft-14. |
| 22 // TODO(bnc): increment when we update to new draft or final specification. |
| 23 case kProtoSPDY4: |
| 24 return 4; |
| 25 default: |
| 26 NOTREACHED() << "Invalid SPDY protocol."; |
| 27 return 0; |
| 28 } |
| 29 } |
| 30 |
| 9 NextProtoVector NextProtosHttpOnly() { | 31 NextProtoVector NextProtosHttpOnly() { |
| 10 NextProtoVector next_protos; | 32 NextProtoVector next_protos; |
| 11 next_protos.push_back(kProtoHTTP11); | 33 next_protos.push_back(kProtoHTTP11); |
| 12 return next_protos; | 34 return next_protos; |
| 13 } | 35 } |
| 14 | 36 |
| 15 NextProtoVector NextProtosDefaults() { | 37 NextProtoVector NextProtosDefaults() { |
| 16 NextProtoVector next_protos; | 38 NextProtoVector next_protos; |
| 17 next_protos.push_back(kProtoHTTP11); | 39 next_protos.push_back(kProtoHTTP11); |
| 18 next_protos.push_back(kProtoSPDY3); | 40 next_protos.push_back(kProtoSPDY3); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 NextProtoVector next_protos; | 86 NextProtoVector next_protos; |
| 65 next_protos.push_back(kProtoHTTP11); | 87 next_protos.push_back(kProtoHTTP11); |
| 66 next_protos.push_back(kProtoQUIC1SPDY3); | 88 next_protos.push_back(kProtoQUIC1SPDY3); |
| 67 next_protos.push_back(kProtoSPDY3); | 89 next_protos.push_back(kProtoSPDY3); |
| 68 next_protos.push_back(kProtoSPDY31); | 90 next_protos.push_back(kProtoSPDY31); |
| 69 next_protos.push_back(kProtoSPDY4); | 91 next_protos.push_back(kProtoSPDY4); |
| 70 return next_protos; | 92 return next_protos; |
| 71 } | 93 } |
| 72 | 94 |
| 73 } // namespace net | 95 } // namespace net |
| OLD | NEW |