| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/base/ssl_client_auth_cache.h" | 5 #include "net/base/ssl_client_auth_cache.h" |
| 6 | 6 |
| 7 namespace net { | 7 namespace net { |
| 8 | 8 |
| 9 SSLClientAuthCache::SSLClientAuthCache() {} |
| 10 |
| 11 SSLClientAuthCache::~SSLClientAuthCache() {} |
| 12 |
| 9 X509Certificate* SSLClientAuthCache::Lookup(const std::string& server) { | 13 X509Certificate* SSLClientAuthCache::Lookup(const std::string& server) { |
| 10 AuthCacheMap::iterator iter = cache_.find(server); | 14 AuthCacheMap::iterator iter = cache_.find(server); |
| 11 return (iter == cache_.end()) ? NULL : iter->second; | 15 return (iter == cache_.end()) ? NULL : iter->second; |
| 12 } | 16 } |
| 13 | 17 |
| 14 void SSLClientAuthCache::Add(const std::string& server, | 18 void SSLClientAuthCache::Add(const std::string& server, |
| 15 X509Certificate* value) { | 19 X509Certificate* value) { |
| 16 cache_[server] = value; | 20 cache_[server] = value; |
| 17 | 21 |
| 18 // TODO(wtc): enforce a maximum number of entries. | 22 // TODO(wtc): enforce a maximum number of entries. |
| 19 } | 23 } |
| 20 | 24 |
| 21 void SSLClientAuthCache::Remove(const std::string& server) { | 25 void SSLClientAuthCache::Remove(const std::string& server) { |
| 22 cache_.erase(server); | 26 cache_.erase(server); |
| 23 } | 27 } |
| 24 | 28 |
| 25 } // namespace net | 29 } // namespace net |
| OLD | NEW |