| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SSL_SSL_CLIENT_AUTH_CACHE_H_ | 5 #ifndef NET_SSL_SSL_CLIENT_AUTH_CACHE_H_ |
| 6 #define NET_SSL_SSL_CLIENT_AUTH_CACHE_H_ | 6 #define NET_SSL_SSL_CLIENT_AUTH_CACHE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // overwritten. A NULL |client_cert| indicates a preference that no client | 46 // overwritten. A NULL |client_cert| indicates a preference that no client |
| 47 // certificate should be sent to |server|. | 47 // certificate should be sent to |server|. |
| 48 void Add(const HostPortPair& server, | 48 void Add(const HostPortPair& server, |
| 49 X509Certificate* client_cert, | 49 X509Certificate* client_cert, |
| 50 SSLPrivateKey* private_key); | 50 SSLPrivateKey* private_key); |
| 51 | 51 |
| 52 // Remove the client certificate for |server| from the cache, if one exists. | 52 // Remove the client certificate for |server| from the cache, if one exists. |
| 53 void Remove(const HostPortPair& server); | 53 void Remove(const HostPortPair& server); |
| 54 | 54 |
| 55 // CertDatabase::Observer methods: | 55 // CertDatabase::Observer methods: |
| 56 void OnCertAdded(const X509Certificate* cert) override; | 56 void OnCertDBChanged(const X509Certificate* cert) override; |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 typedef HostPortPair AuthCacheKey; | 59 typedef HostPortPair AuthCacheKey; |
| 60 typedef std::pair<scoped_refptr<X509Certificate>, | 60 typedef std::pair<scoped_refptr<X509Certificate>, |
| 61 scoped_refptr<SSLPrivateKey>> AuthCacheValue; | 61 scoped_refptr<SSLPrivateKey>> AuthCacheValue; |
| 62 typedef std::map<AuthCacheKey, AuthCacheValue> AuthCacheMap; | 62 typedef std::map<AuthCacheKey, AuthCacheValue> AuthCacheMap; |
| 63 | 63 |
| 64 // internal representation of cache, an STL map. | 64 // internal representation of cache, an STL map. |
| 65 AuthCacheMap cache_; | 65 AuthCacheMap cache_; |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 } // namespace net | 68 } // namespace net |
| 69 | 69 |
| 70 #endif // NET_SSL_SSL_CLIENT_AUTH_CACHE_H_ | 70 #endif // NET_SSL_SSL_CLIENT_AUTH_CACHE_H_ |
| OLD | NEW |