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

Unified Diff: components/ntp_snippets/remote/ntp_snippets_service.h

Issue 2386103009: NTPSnippetsService: Garbage collect orphaned images at startup. (Closed)
Patch Set: patch restored Created 4 years, 2 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/ntp_snippets/remote/ntp_snippets_service.h
diff --git a/components/ntp_snippets/remote/ntp_snippets_service.h b/components/ntp_snippets/remote/ntp_snippets_service.h
index ad3ad2bdeb94f541985ab19249ef8b90005d2e68..dad3c3617a5cee00abc288d88a6fca5b986fe8ec 100644
--- a/components/ntp_snippets/remote/ntp_snippets_service.h
+++ b/components/ntp_snippets/remote/ntp_snippets_service.h
@@ -235,9 +235,11 @@ class NTPSnippetsService final : public ContentSuggestionsProvider,
// Removes expired dismissed snippets from the service and the database.
void ClearExpiredDismissedSnippets();
- // Removes images from the DB that do not have any corresponding snippet
- // (neither in the current set, nor in the archived set).
- void ClearOrphanedImages();
+ // Removes images from the DB that do not have any corresponding snippet in
+ // the provided set. Needs to iterate the whole snippet database -- so do it
+ // often enough to keep it small but not too often as it still iterates over
+ // the file system.
+ void ClearOrphanedImages(const NTPSnippet::PtrVector& snippets);
// Clears all stored snippets and updates the observer.
void NukeAllSnippets();

Powered by Google App Engine
This is Rietveld 408576698