Chromium Code Reviews| Index: net/socket/ssl_session_cache_openssl.cc |
| diff --git a/net/socket/ssl_session_cache_openssl.cc b/net/socket/ssl_session_cache_openssl.cc |
| index d16bb8d6325ec6b105da7219d4e9ea9e5f6f4828..81cc67520651f8fa3d6b43459a8061693bee9e09 100644 |
| --- a/net/socket/ssl_session_cache_openssl.cc |
| +++ b/net/socket/ssl_session_cache_openssl.cc |
| @@ -236,6 +236,14 @@ class SSLSessionCacheOpenSSLImpl { |
| return SSL_set_session(ssl, session) == 1; |
| } |
| + bool SSLSessionIsInCache(const std::string& cache_key) { |
| + base::AutoLock locked(lock_); |
| + KeyIndex::const_iterator it = key_index_.find(cache_key); |
| + if (it == key_index_.end()) |
| + return false; |
| + return true; |
| + } |
| + |
| void MarkSSLSessionAsGood(SSL* ssl) { |
| SSL_SESSION* session = SSL_get_session(ssl); |
| if (!session) |
| @@ -469,7 +477,7 @@ class SSLSessionCacheOpenSSLImpl { |
| // method to get the index which can later be used with SSL_CTX_get_ex_data() |
| // or SSL_CTX_set_ex_data(). |
| - base::Lock lock_; // Protects access to containers below. |
| + mutable base::Lock lock_; // Protects access to containers below. |
|
wtc
2014/06/19 19:38:11
In general we should avoid the 'mutable' keyword.
mshelley1
2014/06/24 17:03:59
Done.
|
| MRUSessionList ordering_; |
| KeyIndex key_index_; |
| @@ -499,6 +507,11 @@ bool SSLSessionCacheOpenSSL::SetSSLSessionWithKey( |
| return impl_->SetSSLSessionWithKey(ssl, cache_key); |
| } |
| +bool SSLSessionCacheOpenSSL::SSLSessionIsInCache( |
| + const std::string& cache_key) const { |
| + return impl_->SSLSessionIsInCache(cache_key); |
| +} |
| + |
| void SSLSessionCacheOpenSSL::MarkSSLSessionAsGood(SSL* ssl) { |
| return impl_->MarkSSLSessionAsGood(ssl); |
| } |