summaryrefslogtreecommitdiffstats
path: root/net/http/http_auth_cache.h
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-11 03:08:43 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-11 03:08:43 +0000
commit542944a740ffd4ab7a89f392baa3f06fe88af258 (patch)
tree3fd16166a6dd3196535e221b02a16a9436621354 /net/http/http_auth_cache.h
parent105ea1f613a33fdaf2e93fcb7984ed6be756cad7 (diff)
downloadchromium_src-542944a740ffd4ab7a89f392baa3f06fe88af258.zip
chromium_src-542944a740ffd4ab7a89f392baa3f06fe88af258.tar.gz
chromium_src-542944a740ffd4ab7a89f392baa3f06fe88af258.tar.bz2
Add unittests for eviction of http auth cache entries.
Review URL: http://codereview.chromium.org/9734 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5161 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_auth_cache.h')
-rw-r--r--net/http/http_auth_cache.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/http/http_auth_cache.h b/net/http/http_auth_cache.h
index ab43f9b..62c09e9 100644
--- a/net/http/http_auth_cache.h
+++ b/net/http/http_auth_cache.h
@@ -74,6 +74,13 @@ class HttpAuthCache {
const std::wstring& username,
const std::wstring& password);
+ // Prevent unbounded memory growth. These are safeguards for abuse; it is
+ // not expected that the limits will be reached in ordinary usage.
+ // This also defines the worst-case lookup times (which grow linearly
+ // with number of elements in the cache).
+ enum { kMaxNumPathsPerRealmEntry = 10 };
+ enum { kMaxNumRealmEntries = 10 };
+
private:
typedef std::list<Entry> EntryList;
EntryList entries_;