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

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: if (!RemoveFormElementForID(pair_id)) 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..8ba8908dbd72e492806b196eafa1477878d011a2 100644
--- a/chrome/browser/webdata/autofill_entry.h
+++ b/chrome/browser/webdata/autofill_entry.h
@@ -46,14 +46,21 @@ 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.
+ // See http://crbug.com/118696.
+ // |source| is expected to be sorted from oldest to newest.
static bool CullTimeStamps(const std::vector<base::Time>& source,
std::vector<base::Time>* result);
@@ -62,6 +69,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