Chromium Code Reviews| Index: components/autofill/core/common/autofill_clock.h |
| diff --git a/components/autofill/core/common/autofill_clock.h b/components/autofill/core/common/autofill_clock.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2bb3cf408030d104fa1bb50a89de1eaed5f53093 |
| --- /dev/null |
| +++ b/components/autofill/core/common/autofill_clock.h |
| @@ -0,0 +1,40 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLOCK_H_ |
|
Mathieu
2017/01/25 22:32:14
fix
sebsg
2017/01/30 20:27:26
Done.
|
| +#define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLOCK_H_ |
| + |
| +#include <memory> |
| + |
| +#include "base/gtest_prod_util.h" |
|
Mathieu
2017/01/25 22:32:14
need?
sebsg
2017/01/30 20:27:26
Done.
|
| +#include "base/lazy_instance.h" |
|
Mathieu
2017/01/25 22:32:14
move to cc?
sebsg
2017/01/30 20:27:26
Done.
|
| +#include "base/macros.h" |
| + |
| +namespace base { |
| +class Clock; |
| +class Time; |
| +} // namespace base |
| + |
| +namespace autofill { |
| + |
| +class AutofillClock { |
|
Mathieu
2017/01/25 22:32:14
Please add at least a class comment
sebsg
2017/01/30 20:27:26
Done.
|
| + public: |
| + static base::Time Now(); |
| + |
| + AutofillClock(); |
|
Mathieu
2017/01/25 22:32:14
nit: I think I would put ctor and dtor before the
sebsg
2017/01/30 20:27:26
Done.
|
| + ~AutofillClock(); |
| + |
| + private: |
| + friend class PersonalDataManagerTest; |
| + |
| + static void SetClockForTests(std::unique_ptr<base::Clock> clock); |
| + |
| + std::unique_ptr<base::Clock> clock_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AutofillClock); |
| +}; |
| + |
| +} // namespace autofill |
| + |
| +#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLOCK_H_ |