| 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 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
| 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 kNextProtoUnsupported = 0, // The server doesn't support NPN. | 76 kNextProtoUnsupported = 0, // The server doesn't support NPN. |
| 77 kNextProtoNegotiated = 1, // We agreed on a protocol. | 77 kNextProtoNegotiated = 1, // We agreed on a protocol. |
| 78 kNextProtoNoOverlap = 2, // No protocols in common. We requested | 78 kNextProtoNoOverlap = 2, // No protocols in common. We requested |
| 79 // the first protocol in our list. | 79 // the first protocol in our list. |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 // StreamSocket: | 82 // StreamSocket: |
| 83 virtual bool WasNpnNegotiated() const OVERRIDE; | 83 virtual bool WasNpnNegotiated() const OVERRIDE; |
| 84 virtual NextProto GetNegotiatedProtocol() const OVERRIDE; | 84 virtual NextProto GetNegotiatedProtocol() const OVERRIDE; |
| 85 | 85 |
| 86 // Formats a unique key for the SSL session cache. This method | 86 // Computes a unique key string for the SSL session cache. |
| 87 // is necessary so that all classes create cache keys in a consistent | 87 virtual std::string GetSessionCacheKey() const = 0; |
| 88 // manner. | |
| 89 // TODO(mshelley) This method will be deleted in an upcoming CL when | |
| 90 // it will no longer be necessary to generate a cache key outside of | |
| 91 // an SSLClientSocket. | |
| 92 static std::string CreateSessionCacheKey( | |
| 93 const HostPortPair& host_and_port, | |
| 94 const std::string& ssl_session_cache_shard); | |
| 95 | 88 |
| 96 // Returns true if there is a cache entry in the SSL session cache | 89 // Returns true if there is a cache entry in the SSL session cache |
| 97 // for the cache key of the SSL socket. | 90 // for the cache key of the SSL socket. |
| 98 // | 91 // |
| 99 // The cache key consists of a host and port concatenated with a session | 92 // The cache key consists of a host and port concatenated with a session |
| 100 // cache shard. These two strings are passed to the constructor of most | 93 // cache shard. These two strings are passed to the constructor of most |
| 101 // subclasses of SSLClientSocket. | 94 // subclasses of SSLClientSocket. |
| 102 virtual bool InSessionCache() const = 0; | 95 virtual bool InSessionCache() const = 0; |
| 103 | 96 |
| 104 // Sets |callback| to be run when the handshake has fully completed. | 97 // Sets |callback| to be run when the handshake has fully completed. |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 bool channel_id_sent_; | 217 bool channel_id_sent_; |
| 225 // True if SCTs were received via a TLS extension. | 218 // True if SCTs were received via a TLS extension. |
| 226 bool signed_cert_timestamps_received_; | 219 bool signed_cert_timestamps_received_; |
| 227 // True if a stapled OCSP response was received. | 220 // True if a stapled OCSP response was received. |
| 228 bool stapled_ocsp_response_received_; | 221 bool stapled_ocsp_response_received_; |
| 229 }; | 222 }; |
| 230 | 223 |
| 231 } // namespace net | 224 } // namespace net |
| 232 | 225 |
| 233 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 226 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
| OLD | NEW |