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

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: Added DCHECK 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
« no previous file with comments | « components/autofill/core/browser/BUILD.gn ('k') | components/autofill/core/browser/autofill_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5457f3dc8859fa0e2c8291eebaeb391d40d528b8..1d36be4f55c9ac7c00d2a7b86746f443fca8a576 100644
--- a/components/autofill/core/browser/autofill_data_model.cc
+++ b/components/autofill/core/browser/autofill_data_model.cc
@@ -7,6 +7,7 @@
#include <math.h>
#include "components/autofill/core/browser/autofill_type.h"
+#include "components/autofill/core/common/autofill_clock.h"
#include "url/gurl.h"
namespace autofill {
@@ -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,
« no previous file with comments | « components/autofill/core/browser/BUILD.gn ('k') | components/autofill/core/browser/autofill_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698