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

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: Fixed clang Created 8 years, 9 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..47f5e3f7bbc801de9ecd9b76e2fee81976ad5496 100644
--- a/chrome/browser/webdata/autofill_entry.h
+++ b/chrome/browser/webdata/autofill_entry.h
@@ -46,14 +46,19 @@ class AutofillEntry {
bool timestamps_culled() const { return timestamps_culled_; }
+ // Checks if last of the timestamps are older than |time|.
+ bool LastAccessOlder(base::Time time) const;
+
+ // The period after which Autofill entries should expire in days.
+ static const int64 kExpirationPeriodInDays = 60;
+
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
- // than kMaxAutofillTimeStamps then false is returned. Otherwise true is
- // returned. Note: source and result should be DIFFERENT vectors.
+ // Culls the list of timestamps to 2 - the first and last used. This is a
Ilya Sherman 2012/03/15 21:00:41 nit: Perhaps "first and last used" -> "oldest and
GeorgeY 2012/03/17 00:36:16 Done.
+ // precursor to getting rid of the timestamps db altogether.
Ilya Sherman 2012/03/15 21:00:41 If you plan to remove the timestamps db in a separ
GeorgeY 2012/03/17 00:36:16 Done.
static bool CullTimeStamps(const std::vector<base::Time>& source,
std::vector<base::Time>* result);
@@ -62,6 +67,4 @@ class AutofillEntry {
bool timestamps_culled_;
};
-// TODO(lipalani): Move this inside the class defintion.
-const unsigned int kMaxAutofillTimeStamps = 50;
#endif // CHROME_BROWSER_WEBDATA_AUTOFILL_ENTRY_H__

Powered by Google App Engine
This is Rietveld 408576698