Index: net/base/ssl_client_auth_cache.cc |
=================================================================== |
--- net/base/ssl_client_auth_cache.cc (revision 18325) |
+++ net/base/ssl_client_auth_cache.cc (working copy) |
@@ -1,34 +1,25 @@ |
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "net/ftp/ftp_auth_cache.h" |
+#include "net/base/ssl_client_auth_cache.h" |
-#include "base/string_util.h" |
-#include "googleurl/src/gurl.h" |
- |
namespace net { |
-AuthData* FtpAuthCache::Lookup(const GURL& origin) { |
- AuthCacheMap::iterator iter = cache_.find(MakeKey(origin)); |
+X509Certificate* SSLClientAuthCache::Lookup(const std::string& server) { |
+ AuthCacheMap::iterator iter = cache_.find(server); |
return (iter == cache_.end()) ? NULL : iter->second; |
} |
-void FtpAuthCache::Add(const GURL& origin, AuthData* value) { |
- cache_[MakeKey(origin)] = value; |
+void SSLClientAuthCache::Add(const std::string& server, |
+ X509Certificate* value) { |
+ cache_[server] = value; |
- // TODO(eroman): enforce a maximum number of entries. |
+ // TODO(wtc): enforce a maximum number of entries. |
} |
-void FtpAuthCache::Remove(const GURL& origin) { |
- cache_.erase(MakeKey(origin)); |
+void SSLClientAuthCache::Remove(const std::string& server) { |
+ cache_.erase(server); |
} |
-// static |
-FtpAuthCache::AuthCacheKey FtpAuthCache::MakeKey(const GURL& origin) { |
- DCHECK(origin.SchemeIs("ftp")); |
- DCHECK(origin.GetOrigin() == origin); |
- return origin.spec(); |
-} |
- |
} // namespace net |