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..9c073bdf58e180e93c2083955b83b63c20174f29 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::ClearEntriesAddedWithin(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, |