Chromium Code Reviews| 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 16 matching lines...) Expand all Loading... | |
| 27 SSLClientSocket::SSLClientSocket() | 27 SSLClientSocket::SSLClientSocket() |
| 28 : signed_cert_timestamps_received_(false), | 28 : signed_cert_timestamps_received_(false), |
| 29 stapled_ocsp_response_received_(false) {} | 29 stapled_ocsp_response_received_(false) {} |
| 30 | 30 |
| 31 // static | 31 // static |
| 32 NextProto SSLClientSocket::NextProtoFromString(base::StringPiece proto_string) { | 32 NextProto SSLClientSocket::NextProtoFromString(base::StringPiece proto_string) { |
| 33 if (proto_string == "http1.1" || proto_string == "http/1.1") { | 33 if (proto_string == "http1.1" || proto_string == "http/1.1") { |
| 34 return kProtoHTTP11; | 34 return kProtoHTTP11; |
| 35 } else if (proto_string == "h2") { | 35 } else if (proto_string == "h2") { |
| 36 return kProtoHTTP2; | 36 return kProtoHTTP2; |
| 37 } else if (proto_string == "quic/1+spdy/3") { | 37 } else if (proto_string == "quic/1+spdy/3") { |
|
Ryan Hamilton
2016/10/19 23:07:52
(And here and below). Weird that we have these st
Bence
2016/10/20 12:22:50
Indeed. From e-mail thread consensus it seems lik
| |
| 38 return kProtoQUIC1SPDY3; | 38 return kProtoQUIC; |
| 39 } else { | 39 } else { |
| 40 return kProtoUnknown; | 40 return kProtoUnknown; |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 | 43 |
| 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 kProtoQUIC: |
| 52 return "quic/1+spdy/3"; | 52 return "quic/1+spdy/3"; |
| 53 case kProtoUnknown: | 53 case kProtoUnknown: |
| 54 break; | 54 break; |
| 55 } | 55 } |
| 56 return "unknown"; | 56 return "unknown"; |
| 57 } | 57 } |
| 58 | 58 |
| 59 // static | 59 // static |
| 60 void SSLClientSocket::SetSSLKeyLogFile( | 60 void SSLClientSocket::SetSSLKeyLogFile( |
| 61 const base::FilePath& path, | 61 const base::FilePath& path, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 wire_protos.push_back(proto.size()); | 100 wire_protos.push_back(proto.size()); |
| 101 for (const char ch : proto) { | 101 for (const char ch : proto) { |
| 102 wire_protos.push_back(static_cast<uint8_t>(ch)); | 102 wire_protos.push_back(static_cast<uint8_t>(ch)); |
| 103 } | 103 } |
| 104 } | 104 } |
| 105 | 105 |
| 106 return wire_protos; | 106 return wire_protos; |
| 107 } | 107 } |
| 108 | 108 |
| 109 } // namespace net | 109 } // namespace net |
| OLD | NEW |