Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: net/base/ssl_client_auth_cache.cc

Issue 132004: Add a simple cache of certificates for SSL client authentication.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Upload before checkin Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/ssl_client_auth_cache.h ('k') | net/base/ssl_client_auth_cache_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « net/base/ssl_client_auth_cache.h ('k') | net/base/ssl_client_auth_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698