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/string_util.h" | 7 #include "base/string_util.h" |
8 | 8 |
9 namespace net { | 9 namespace net { |
10 | 10 |
11 SSLClientSocket::SSLClientSocket() | 11 SSLClientSocket::SSLClientSocket() |
12 : was_npn_negotiated_(false), | 12 : was_npn_negotiated_(false), |
13 was_spdy_negotiated_(false), | 13 was_spdy_negotiated_(false), |
14 protocol_negotiated_(kProtoUnknown), | 14 protocol_negotiated_(kProtoUnknown), |
15 origin_bound_cert_type_(CLIENT_CERT_INVALID_TYPE) { | 15 domain_bound_cert_type_(CLIENT_CERT_INVALID_TYPE) { |
16 } | 16 } |
17 | 17 |
18 SSLClientSocket::NextProto SSLClientSocket::NextProtoFromString( | 18 SSLClientSocket::NextProto SSLClientSocket::NextProtoFromString( |
19 const std::string& proto_string) { | 19 const std::string& proto_string) { |
20 if (proto_string == "http1.1" || proto_string == "http/1.1") { | 20 if (proto_string == "http1.1" || proto_string == "http/1.1") { |
21 return kProtoHTTP11; | 21 return kProtoHTTP11; |
22 } else if (proto_string == "spdy/1") { | 22 } else if (proto_string == "spdy/1") { |
23 return kProtoSPDY1; | 23 return kProtoSPDY1; |
24 } else if (proto_string == "spdy/2") { | 24 } else if (proto_string == "spdy/2") { |
25 return kProtoSPDY2; | 25 return kProtoSPDY2; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 SSLClientSocket::NextProto SSLClientSocket::protocol_negotiated() const { | 118 SSLClientSocket::NextProto SSLClientSocket::protocol_negotiated() const { |
119 return protocol_negotiated_; | 119 return protocol_negotiated_; |
120 } | 120 } |
121 | 121 |
122 void SSLClientSocket::set_protocol_negotiated( | 122 void SSLClientSocket::set_protocol_negotiated( |
123 SSLClientSocket::NextProto protocol_negotiated) { | 123 SSLClientSocket::NextProto protocol_negotiated) { |
124 protocol_negotiated_ = protocol_negotiated; | 124 protocol_negotiated_ = protocol_negotiated; |
125 } | 125 } |
126 | 126 |
127 bool SSLClientSocket::WasOriginBoundCertSent() const { | 127 bool SSLClientSocket::WasDomainBoundCertSent() const { |
128 return origin_bound_cert_type_ != CLIENT_CERT_INVALID_TYPE; | 128 return domain_bound_cert_type_ != CLIENT_CERT_INVALID_TYPE; |
129 } | 129 } |
130 | 130 |
131 SSLClientCertType SSLClientSocket::origin_bound_cert_type() const { | 131 SSLClientCertType SSLClientSocket::domain_bound_cert_type() const { |
132 return origin_bound_cert_type_; | 132 return domain_bound_cert_type_; |
133 } | 133 } |
134 | 134 |
135 SSLClientCertType SSLClientSocket::set_origin_bound_cert_type( | 135 SSLClientCertType SSLClientSocket::set_domain_bound_cert_type( |
136 SSLClientCertType type) { | 136 SSLClientCertType type) { |
137 return origin_bound_cert_type_ = type; | 137 return domain_bound_cert_type_ = type; |
138 } | 138 } |
139 | 139 |
140 } // namespace net | 140 } // namespace net |
OLD | NEW |