diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-21 15:55:25 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-21 15:55:25 +0000 |
commit | b61ff0446b396bc9ed0ba537e25d0faf4283f963 (patch) | |
tree | 85f6f58c6553f9b27673432dbc3fbf65d717af61 /net/ftp | |
parent | 2949e90da94359207aad945a4c596e5ee975873b (diff) | |
download | chromium_src-b61ff0446b396bc9ed0ba537e25d0faf4283f963.zip chromium_src-b61ff0446b396bc9ed0ba537e25d0faf4283f963.tar.gz chromium_src-b61ff0446b396bc9ed0ba537e25d0faf4283f963.tar.bz2 |
Followup after http://codereview.chromium.org/165167, fixing the nits in FtpAuthCache.
TEST=Covered by net_unittests.
BUG=none
Review URL: http://codereview.chromium.org/174184
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23961 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/ftp')
-rw-r--r-- | net/ftp/ftp_auth_cache.cc | 8 | ||||
-rw-r--r-- | net/ftp/ftp_auth_cache.h | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/net/ftp/ftp_auth_cache.cc b/net/ftp/ftp_auth_cache.cc index def516d..c29146a 100644 --- a/net/ftp/ftp_auth_cache.cc +++ b/net/ftp/ftp_auth_cache.cc @@ -13,7 +13,7 @@ namespace net { const size_t FtpAuthCache::kMaxEntries = 10; AuthData* FtpAuthCache::Lookup(const GURL& origin) { - Entry* entry = LookupByOrigin(origin); + Entry* entry = LookupEntry(origin); return (entry ? entry->auth_data : NULL); } @@ -21,7 +21,7 @@ void FtpAuthCache::Add(const GURL& origin, AuthData* auth_data) { DCHECK(origin.SchemeIs("ftp")); DCHECK_EQ(origin.GetOrigin(), origin); - Entry* entry = LookupByOrigin(origin); + Entry* entry = LookupEntry(origin); if (entry) { entry->auth_data = auth_data; } else { @@ -37,13 +37,13 @@ void FtpAuthCache::Remove(const GURL& origin) { for (EntryList::iterator it = entries_.begin(); it != entries_.end(); ++it) { if (it->origin == origin) { entries_.erase(it); - DCHECK(!LookupByOrigin(origin)); + DCHECK(!LookupEntry(origin)); return; } } } -FtpAuthCache::Entry* FtpAuthCache::LookupByOrigin(const GURL& origin) { +FtpAuthCache::Entry* FtpAuthCache::LookupEntry(const GURL& origin) { for (EntryList::iterator it = entries_.begin(); it != entries_.end(); ++it) { if (it->origin == origin) return &(*it); diff --git a/net/ftp/ftp_auth_cache.h b/net/ftp/ftp_auth_cache.h index c63828d..1a5b088 100644 --- a/net/ftp/ftp_auth_cache.h +++ b/net/ftp/ftp_auth_cache.h @@ -7,8 +7,8 @@ #include <list> -#include "net/base/auth.h" #include "googleurl/src/gurl.h" +#include "net/base/auth.h" namespace net { @@ -22,12 +22,12 @@ namespace net { // GURL("ftp://myserver/PATH") -- WRONG, paths not allowed class FtpAuthCache { public: - FtpAuthCache() {} - ~FtpAuthCache() {} - // Maximum number of entries we allow in the cache. static const size_t kMaxEntries; + FtpAuthCache() {} + ~FtpAuthCache() {} + // Check if we have authentication data for ftp server at |origin|. // Returns the address of corresponding AuthData object (if found) or NULL // (if not found). @@ -53,7 +53,7 @@ class FtpAuthCache { typedef std::list<Entry> EntryList; // Return Entry corresponding to given |origin| or NULL if not found. - Entry* LookupByOrigin(const GURL& origin); + Entry* LookupEntry(const GURL& origin); // Internal representation of cache, an STL list. This makes lookups O(n), // but we expect n to be very low. |