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

Unified Diff: components/autofill/core/browser/payments/full_card_request.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
Index: components/autofill/core/browser/payments/full_card_request.cc
diff --git a/components/autofill/core/browser/payments/full_card_request.cc b/components/autofill/core/browser/payments/full_card_request.cc
index f2f63805e588f8e190a5cfd61e5972dc491ecc03..f4b09807c6f2b506441d7dfe6a347e6c69ddeadc 100644
--- a/components/autofill/core/browser/payments/full_card_request.cc
+++ b/components/autofill/core/browser/payments/full_card_request.cc
@@ -12,6 +12,7 @@
#include "components/autofill/core/browser/autofill_metrics.h"
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/personal_data_manager.h"
+#include "components/autofill/core/common/autofill_clock.h"
namespace autofill {
namespace payments {
@@ -50,7 +51,7 @@ void FullCardRequest::GetFullCard(const CreditCard& card,
request_->card = card;
should_unmask_card_ = card.record_type() == CreditCard::MASKED_SERVER_CARD ||
(card.record_type() == CreditCard::FULL_SERVER_CARD &&
- card.ShouldUpdateExpiration(base::Time::Now()));
+ card.ShouldUpdateExpiration(AutofillClock::Now()));
if (should_unmask_card_)
payments_client_->Prepare();
@@ -91,7 +92,7 @@ void FullCardRequest::OnUnmaskResponse(const UnmaskResponse& response) {
request_->user_response = response;
if (!request_->risk_data.empty()) {
- real_pan_request_timestamp_ = base::Time::Now();
+ real_pan_request_timestamp_ = AutofillClock::Now();
payments_client_->UnmaskCard(*request_);
}
}
@@ -106,7 +107,7 @@ void FullCardRequest::OnUnmaskPromptClosed() {
void FullCardRequest::OnDidGetUnmaskRiskData(const std::string& risk_data) {
request_->risk_data = risk_data;
if (!request_->user_response.cvc.empty()) {
- real_pan_request_timestamp_ = base::Time::Now();
+ real_pan_request_timestamp_ = AutofillClock::Now();
payments_client_->UnmaskCard(*request_);
}
}
@@ -114,7 +115,7 @@ void FullCardRequest::OnDidGetUnmaskRiskData(const std::string& risk_data) {
void FullCardRequest::OnDidGetRealPan(AutofillClient::PaymentsRpcResult result,
const std::string& real_pan) {
AutofillMetrics::LogRealPanDuration(
- base::Time::Now() - real_pan_request_timestamp_, result);
+ AutofillClock::Now() - real_pan_request_timestamp_, result);
switch (result) {
// Wait for user retry.
« no previous file with comments | « components/autofill/core/browser/credit_card_field.cc ('k') | components/autofill/core/browser/personal_data_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698