OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ssl_client_socket.h" | 5 #include "net/socket/ssl_client_socket.h" |
6 | 6 |
7 #include "base/feature_list.h" | 7 #include "base/feature_list.h" |
8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/metrics/sparse_histogram.h" | 9 #include "base/metrics/sparse_histogram.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // static | 44 // static |
45 const char* SSLClientSocket::NextProtoToString(NextProto next_proto) { | 45 const char* SSLClientSocket::NextProtoToString(NextProto next_proto) { |
46 switch (next_proto) { | 46 switch (next_proto) { |
47 case kProtoHTTP11: | 47 case kProtoHTTP11: |
48 return "http/1.1"; | 48 return "http/1.1"; |
49 case kProtoHTTP2: | 49 case kProtoHTTP2: |
50 return "h2"; | 50 return "h2"; |
51 case kProtoQUIC1SPDY3: | 51 case kProtoQUIC1SPDY3: |
52 return "quic/1+spdy/3"; | 52 return "quic/1+spdy/3"; |
53 case kProtoUnknown: | 53 case kProtoUnknown: |
| 54 case kProtoNumberOfNextProtos: |
54 break; | 55 break; |
55 } | 56 } |
56 return "unknown"; | 57 return "unknown"; |
57 } | 58 } |
58 | 59 |
59 // static | 60 // static |
60 const char* SSLClientSocket::NextProtoStatusToString( | 61 const char* SSLClientSocket::NextProtoStatusToString( |
61 const SSLClientSocket::NextProtoStatus status) { | 62 const SSLClientSocket::NextProtoStatus status) { |
62 switch (status) { | 63 switch (status) { |
63 case kNextProtoUnsupported: | 64 case kNextProtoUnsupported: |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 wire_protos.push_back(proto.size()); | 115 wire_protos.push_back(proto.size()); |
115 for (const char ch : proto) { | 116 for (const char ch : proto) { |
116 wire_protos.push_back(static_cast<uint8_t>(ch)); | 117 wire_protos.push_back(static_cast<uint8_t>(ch)); |
117 } | 118 } |
118 } | 119 } |
119 | 120 |
120 return wire_protos; | 121 return wire_protos; |
121 } | 122 } |
122 | 123 |
123 } // namespace net | 124 } // namespace net |
OLD | NEW |