OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "net/base/tls_client_login_cache.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 namespace net { |
| 10 |
| 11 TLSClientLoginCache::TLSClientLoginCache() {} |
| 12 |
| 13 TLSClientLoginCache::~TLSClientLoginCache() {} |
| 14 |
| 15 bool TLSClientLoginCache::Lookup( |
| 16 const std::string& server, |
| 17 scoped_refptr<AuthData>* tls_auth_data) { |
| 18 DCHECK(tls_auth_data); |
| 19 |
| 20 AuthCacheMap::iterator iter = cache_.find(server); |
| 21 if (iter == cache_.end()) |
| 22 return false; |
| 23 |
| 24 *tls_auth_data = iter->second; |
| 25 return true; |
| 26 } |
| 27 |
| 28 void TLSClientLoginCache::Add(const std::string& server, |
| 29 AuthData* tls_auth_data) { |
| 30 cache_[server] = tls_auth_data; |
| 31 |
| 32 // TODO(wtc): enforce a maximum number of entries. |
| 33 } |
| 34 |
| 35 void TLSClientLoginCache::Remove(const std::string& server) { |
| 36 cache_.erase(server); |
| 37 } |
| 38 |
| 39 } // namespace net |
OLD | NEW |