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

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: Addressed the comments 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..922760cb28fbede0f2edc5bdcd0bfefb9ede035d 100644
--- a/chrome/browser/webdata/autofill_entry.h
+++ b/chrome/browser/webdata/autofill_entry.h
@@ -46,22 +46,29 @@ class AutofillEntry {
bool timestamps_culled() const { return timestamps_culled_; }
+ // Checks if last of the timestamps are older than ExpirationTime().
+ bool IsExpired() const;
+
+ // The entries last accessed before this time should expire.
+ static base::Time ExpirationTime();
+
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 oldest and most recent. This is a
+ // precursor to getting rid of the timestamps db altogether. (Issue #118696)
Ilya Sherman 2012/03/19 21:12:51 nit: Please include a link to the issue, i.e. http
GeorgeY 2012/03/20 20:47:58 Done.
+ // |source| is expected to be sorted from oldest to newest.
static bool CullTimeStamps(const std::vector<base::Time>& source,
std::vector<base::Time>* result);
AutofillKey key_;
std::vector<base::Time> timestamps_;
bool timestamps_culled_;
+
+ // The period after which Autofill entries should expire in days.
+ static const int64 kExpirationPeriodInDays = 60;
Ilya Sherman 2012/03/19 21:12:51 nit: Let's tuck this into the implementation file
GeorgeY 2012/03/20 20:47:58 Done.
};
-// 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