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

Unified Diff: components/autofill/core/browser/autofill_data_model.cc

Issue 2639403002: [Autofill] Remove direct use of base::Time::Now() in Autofill (Closed)
Patch Set: Rebase Created 3 years, 11 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: components/autofill/core/browser/autofill_data_model.cc
diff --git a/components/autofill/core/browser/autofill_data_model.cc b/components/autofill/core/browser/autofill_data_model.cc
index 4f42566bcb5964f855b2b3e4f66f16dc5b4277f3..23422355abcf25c03a62992ee7e706b27b908e46 100644
--- a/components/autofill/core/browser/autofill_data_model.cc
+++ b/components/autofill/core/browser/autofill_data_model.cc
@@ -6,6 +6,7 @@
#include <math.h>
+#include "components/autofill/core/browser/autofill_clock.h"
#include "components/autofill/core/browser/autofill_type.h"
#include "url/gurl.h"
@@ -16,8 +17,8 @@ AutofillDataModel::AutofillDataModel(const std::string& guid,
: guid_(guid),
origin_(origin),
use_count_(1),
- use_date_(base::Time::Now()),
- modification_date_(base::Time::Now()) {}
+ use_date_(AutofillClock::Now()),
+ modification_date_(AutofillClock::Now()) {}
AutofillDataModel::~AutofillDataModel() {}
bool AutofillDataModel::IsVerified() const {
@@ -27,7 +28,7 @@ bool AutofillDataModel::IsVerified() const {
// TODO(crbug.com/629507): Add support for injected mock clock for testing.
void AutofillDataModel::RecordUse() {
++use_count_;
- use_date_ = base::Time::Now();
+ use_date_ = AutofillClock::Now();
}
bool AutofillDataModel::CompareFrecency(const AutofillDataModel* other,

Powered by Google App Engine
This is Rietveld 408576698