Commit b51db0e8 authored by David Munro's avatar David Munro Committed by Commit Bot

Copy DefaultTickClock's usage note to TickClock

Per the note, you probably don't need to use TickClock or
DefaultTickClock anymore. Stick that note in both TickClock and
DefaultTickClockheaders instead of just DefaultTickClock.

Bug: None
Test: None
Change-Id: I7cdaa5b198ad06b230e2b0406c51f49f769b0794
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2547749
Commit-Queue: David Munro <davidmunro@google.com>
Auto-Submit: David Munro <davidmunro@google.com>
Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830072}
parent 3bdb21df
...@@ -13,9 +13,9 @@ namespace base { ...@@ -13,9 +13,9 @@ namespace base {
// DefaultTickClock is a TickClock implementation that uses TimeTicks::Now(). // DefaultTickClock is a TickClock implementation that uses TimeTicks::Now().
// This is typically used by components that expose a SetTickClockForTesting(). // This is typically used by components that expose a SetTickClockForTesting().
// Note: Overriding Time/TimeTicks altogether via // Note: Overriding Time/TimeTicks altogether via
// TaskEnvironment::TimeSource::MOCK_TIME is now the preferred of // TaskEnvironment::TimeSource::MOCK_TIME is now the preferred way of overriding
// overriding time in unit tests. As such, there shouldn't be many new use cases // time in unit tests. As such, there shouldn't be many new use cases for
// for TickClock/DefaultTickClock anymore. // TickClock/DefaultTickClock anymore.
class BASE_EXPORT DefaultTickClock : public TickClock { class BASE_EXPORT DefaultTickClock : public TickClock {
public: public:
~DefaultTickClock() override; ~DefaultTickClock() override;
......
...@@ -14,6 +14,11 @@ namespace base { ...@@ -14,6 +14,11 @@ namespace base {
// intended to be able to test the behavior of classes with respect to // intended to be able to test the behavior of classes with respect to
// non-decreasing time. // non-decreasing time.
// //
// Note: Overriding Time/TimeTicks altogether via
// TaskEnvironment::TimeSource::MOCK_TIME is now the preferred way of overriding
// time in unit tests. As such, there shouldn't be many new use cases for
// TickClock/DefaultTickClock anymore.
//
// See DefaultTickClock (base/time/default_tick_clock.h) for the default // See DefaultTickClock (base/time/default_tick_clock.h) for the default
// implementation that simply uses TimeTicks::Now(). // implementation that simply uses TimeTicks::Now().
// //
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment