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

Unified Diff: components/history/core/browser/expire_history_backend.h

Issue 2903573002: [Thumbnails DB] Add functionality to clear unused on-demand favicons. (Closed)
Patch Set: Peter's comments #4 Created 3 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
Index: components/history/core/browser/expire_history_backend.h
diff --git a/components/history/core/browser/expire_history_backend.h b/components/history/core/browser/expire_history_backend.h
index ebffc5b62e4e14ee9b45b271c18c0a4f1333b326..e2fb4f848b2cb1cbd0c390d8abe36dc68ef89041 100644
--- a/components/history/core/browser/expire_history_backend.h
+++ b/components/history/core/browser/expire_history_backend.h
@@ -20,6 +20,7 @@ class GURL;
class TestingProfile;
namespace base {
+struct Feature;
class SequencedTaskRunner;
}
@@ -42,6 +43,11 @@ class ExpiringVisitsReader {
typedef std::vector<const ExpiringVisitsReader*> ExpiringVisitsReaders;
+namespace internal {
+// Feature that enables clearing old on-demand favicons.
+extern const base::Feature kClearOldOnDemandFavicons;
+} // namespace internal
+
// Helper component to HistoryBackend that manages expiration and deleting of
// history.
//
@@ -102,6 +108,10 @@ class ExpireHistoryBackend {
FRIEND_TEST_ALL_PREFIXES(ExpireHistoryTest, ExpireSomeOldHistory);
FRIEND_TEST_ALL_PREFIXES(ExpireHistoryTest, ExpiringVisitsReader);
FRIEND_TEST_ALL_PREFIXES(ExpireHistoryTest, ExpireSomeOldHistoryWithSource);
+ FRIEND_TEST_ALL_PREFIXES(ExpireHistoryTest,
+ ClearOldOnDemandFaviconsDoesNotDeleteStarred);
+ FRIEND_TEST_ALL_PREFIXES(ExpireHistoryTest,
+ ClearOldOnDemandFaviconsDoesDeleteUnstarred);
friend class ::TestingProfile;
struct DeleteEffects {
@@ -206,6 +216,9 @@ class ExpireHistoryBackend {
// future.
void DoExpireIteration();
+ // Clears all old on-demand favicons from thumbnail database.
+ void ClearOldOnDemandFavicons(base::Time expiration_threshold);
+
// Tries to expire the oldest |max_visits| visits from history that are older
// than |time_threshold|. The return value indicates if we think there might
// be more history to expire with the current time threshold (it does not

Powered by Google App Engine
This is Rietveld 408576698