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

Unified Diff: net/http/http_auth_cache.cc

Issue 2097043002: Clear HTTP auth data on clearing browsing data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix review issues Created 4 years, 5 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
« net/http/http_auth_cache.h ('K') | « net/http/http_auth_cache.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_cache.cc
diff --git a/net/http/http_auth_cache.cc b/net/http/http_auth_cache.cc
index 7a3a4e0f6714cb9b927af8d6c17fad4d0e8c12ae..650bdddf6a7bd78903175b5eaa143c1d2b829e96 100644
--- a/net/http/http_auth_cache.cc
+++ b/net/http/http_auth_cache.cc
@@ -252,8 +252,11 @@ bool HttpAuthCache::Remove(const GURL& origin,
return false;
}
-void HttpAuthCache::Clear() {
- entries_.clear();
+void HttpAuthCache::Clear(base::TimeDelta duration) {
+ base::TimeTicks begin_time = base::TimeTicks::Now() - duration;
+ entries_.remove_if([begin_time](const Entry& entry) {
+ return entry.creation_time_ >= begin_time;
+ });
}
bool HttpAuthCache::UpdateStaleChallenge(const GURL& origin,
« net/http/http_auth_cache.h ('K') | « net/http/http_auth_cache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698