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

Unified Diff: net/http/http_auth_cache.h

Issue 2097043002: Clear HTTP auth data on clearing browsing data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace FRIEND_TEST_ALL_PREFIXES with set_creation_time_for_testing Created 4 years, 4 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 | « chrome/browser/browsing_data/browsing_data_remover_unittest.cc ('k') | net/http/http_auth_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_cache.h
diff --git a/net/http/http_auth_cache.h b/net/http/http_auth_cache.h
index 9190e42c50899951eac307e3afa674cdb7175878..e620cb08ac49ff0e86bd4d68022d3fd4f3cdfbb0 100644
--- a/net/http/http_auth_cache.h
+++ b/net/http/http_auth_cache.h
@@ -27,9 +27,9 @@ namespace net {
// - the last auth handler used (contains realm and authentication scheme)
// - the list of paths which used this realm
// Entries can be looked up by either (origin, realm, scheme) or (origin, path).
-class NET_EXPORT_PRIVATE HttpAuthCache {
+class NET_EXPORT HttpAuthCache {
public:
- class NET_EXPORT_PRIVATE Entry {
+ class NET_EXPORT Entry {
public:
Entry(const Entry& other);
~Entry();
@@ -60,6 +60,10 @@ class NET_EXPORT_PRIVATE HttpAuthCache {
void UpdateStaleChallenge(const std::string& auth_challenge);
+ void set_creation_time_for_testing(base::TimeTicks creation_time) {
+ creation_time_ = creation_time;
+ }
+
private:
friend class HttpAuthCache;
FRIEND_TEST_ALL_PREFIXES(HttpAuthCacheTest, AddPath);
@@ -162,8 +166,8 @@ class NET_EXPORT_PRIVATE HttpAuthCache {
HttpAuth::Scheme scheme,
const AuthCredentials& credentials);
- // Clears the cache.
- void Clear();
+ // Clears cache entries created within |duration| of base::TimeTicks::Now().
+ void ClearEntriesAddedWithin(base::TimeDelta duration);
// Updates a stale digest entry on server |origin| for realm |realm| and
// scheme |scheme|. The cached auth challenge is replaced with
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover_unittest.cc ('k') | net/http/http_auth_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698