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

Unified Diff: chrome/browser/webdata/autofill_entry.h

Issue 9585020: Cull autofill entries older than 60 days. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix spelling Created 8 years, 10 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: chrome/browser/webdata/autofill_entry.h
diff --git a/chrome/browser/webdata/autofill_entry.h b/chrome/browser/webdata/autofill_entry.h
index 8aae993ffd4b31747f5efc661195aca03581e7ff..f64abafe0b523e362071c4ba9e277d000ecbf462 100644
--- a/chrome/browser/webdata/autofill_entry.h
+++ b/chrome/browser/webdata/autofill_entry.h
@@ -46,9 +46,21 @@ class AutofillEntry {
bool timestamps_culled() const { return timestamps_culled_; }
+ // Checks if any of the timestamps are older than |time|.
+ bool HasTimestampsOlder(base::Time time) const;
+
+ // Culls the |timestamps_| by expiring all prior to |expire_before|. Returns
+ // true if culling occured (and sets |timestamps_culled_|). Warning:
+ // |timestamps_| could become empty after this call.
+ bool CullExpiredTimeStamps(base::Time expire_before);
+
+ // The period after which Autofill entries should expire in days.
+ static const int64 kExpirationPeriodInDays = 60;
Ilya Sherman 2012/03/06 08:48:35 nit: This should be defined wherever it is used, r
GeorgeY 2012/03/09 20:14:24 It is used in two completely different places, thi
+
private:
FRIEND_TEST_ALL_PREFIXES(AutofillEntryTest, NoCulling);
FRIEND_TEST_ALL_PREFIXES(AutofillEntryTest, Culling);
+ FRIEND_TEST_ALL_PREFIXES(AutofillEntryTest, CullByTime);
// Culls the list of timestamps to |kMaxAutofillTimeStamps| latest timestamps.
// Result is stored in |result|. If the original vtor's size is less

Powered by Google App Engine
This is Rietveld 408576698