| Index: chrome/browser/webdata/autofill_entry.cc
|
| diff --git a/chrome/browser/webdata/autofill_entry.cc b/chrome/browser/webdata/autofill_entry.cc
|
| index fe874a58cd8c4da8be15155a99f5e15ed43ace29..0235334fe7ebc32796ac6bff7faa1b776bc8685a 100644
|
| --- a/chrome/browser/webdata/autofill_entry.cc
|
| +++ b/chrome/browser/webdata/autofill_entry.cc
|
| @@ -1,12 +1,12 @@
|
| // Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
| +#include "chrome/browser/webdata/autofill_entry.h"
|
|
|
| #include <algorithm>
|
| #include <set>
|
|
|
| #include "base/logging.h"
|
| -#include "chrome/browser/webdata/autofill_entry.h"
|
| #include "base/utf_string_conversions.h"
|
|
|
| AutofillKey::AutofillKey() {}
|
| @@ -72,6 +72,31 @@ bool AutofillEntry::operator<(const AutofillEntry& entry) const {
|
| return key_ < entry.key();
|
| }
|
|
|
| +bool AutofillEntry::HasTimestampsOlder(base::Time time) const {
|
| + for (size_t i = 0; i < timestamps_.size(); ++i) {
|
| + if (timestamps_[i] < time)
|
| + return true;
|
| + }
|
| + return false;
|
| +}
|
| +
|
| +bool AutofillEntry::CullExpiredTimeStamps(base::Time expire_before) {
|
| + std::vector<base::Time> new_timestamps;
|
| + new_timestamps.reserve(timestamps_.size());
|
| +
|
| + for (size_t i = 0; i < timestamps_.size(); ++i) {
|
| + if (timestamps_[i] >= expire_before)
|
| + new_timestamps.push_back(timestamps_[i]);
|
| + }
|
| +
|
| + if (timestamps_.size() == new_timestamps.size())
|
| + return false;
|
| +
|
| + timestamps_.swap(new_timestamps);
|
| + timestamps_culled_ = true;
|
| + return true;
|
| +}
|
| +
|
| // Culls the list of timestamps to the most recent |kMaxAutofillTimeStamps|.
|
| // If sync is enabled, at every browser restart, sync will do a match up of all
|
| // autofill items on the server with all items on the web db. When webdb loads
|
|
|