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

Side by Side Diff: components/autofill/core/browser/autofill_clock.h

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 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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLOCK_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLOCK_H_
7
Mathieu 2017/01/25 19:57:24 include <memory>
sebsg 2017/01/25 21:35:27 Done.
8 #include "base/gtest_prod_util.h"
9 #include "base/lazy_instance.h"
10 #include "base/macros.h"
11 #include "base/memory/ptr_util.h"
Mathieu 2017/01/25 19:57:24 need?
sebsg 2017/01/25 21:35:27 Not anymore!
12
13 namespace base {
14 class Clock;
15 class Time;
16 } // namespace base
17
18 namespace autofill {
19
20 class AutofillClock {
21 public:
22 static base::Time Now();
23
24 AutofillClock();
25 ~AutofillClock();
26 AutofillClock(AutofillClock const&) = delete;
Mathieu 2017/01/25 19:57:24 is that DISALLOW_COPY_AND_ASSIGN?
sebsg 2017/01/25 21:35:27 Done.
27 void operator=(AutofillClock const&) = delete;
28
29 private:
30 FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
Mathieu 2017/01/25 19:57:24 worried this will get cluttered... friend class
sebsg 2017/01/25 21:35:27 It was much easier that I thought, thanks for the
31 AddCreditCard_BasicInformation);
32 FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
33 AddProfile_BasicInformation);
34 FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, ApplyProfileUseDatesFix);
35 FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, DontDuplicateServerProfile);
36 FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, MergeProfile_UsageStats);
37 FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, RecordUseOf);
38 FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
39 UpdateServerCreditCardUsageStats);
40 static void SetClockForTests(base::Clock* clock);
41
42 std::unique_ptr<base::Clock> clock_;
43 };
44
45 } // namespace autofill
46
47 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLOCK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698