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

Side by Side Diff: components/autofill/core/common/autofill_clock.cc

Issue 2639403002: [Autofill] Remove direct use of base::Time::Now() in Autofill (Closed)
Patch Set: Addressed comments 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/autofill/core/common/autofill_clock.h"
6
Mathieu 2017/01/25 22:32:14 #include <utility>
sebsg 2017/01/30 20:27:26 Done.
7 #include "base/time/clock.h"
8 #include "base/time/default_clock.h"
9
10 namespace autofill {
11
12 namespace {
13
14 static base::LazyInstance<AutofillClock> g_autofill_clock =
15 LAZY_INSTANCE_INITIALIZER;
16
17 } // namespace
18
19 // static
20 base::Time AutofillClock::Now() {
21 return g_autofill_clock.Get().clock_->Now();
22 }
23
24 AutofillClock::AutofillClock() {
25 clock_.reset(new base::DefaultClock());
26 }
27
28 AutofillClock::~AutofillClock() {}
29
30 // static
31 void AutofillClock::SetClockForTests(std::unique_ptr<base::Clock> clock) {
32 g_autofill_clock.Get().clock_ = std::move(clock);
33 }
34
35 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698