diff options
author | charliea <charliea@google.com> | 2015-01-26 09:35:41 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-26 17:36:51 +0000 |
commit | 3be83970173f29ff3fec067fe64ff9910ce53c73 (patch) | |
tree | fc4b06ee8ee1f66001eb379412d35d234711bf93 /base/time | |
parent | 4bf260f81b3909da9099e5bcac948cbc0ca5e295 (diff) | |
download | chromium_src-3be83970173f29ff3fec067fe64ff9910ce53c73.zip chromium_src-3be83970173f29ff3fec067fe64ff9910ce53c73.tar.gz chromium_src-3be83970173f29ff3fec067fe64ff9910ce53c73.tar.bz2 |
Replaces instances of the deprecated TimeTicks::HighResNow() with TimeTicks::Now().
BUG=
Review URL: https://codereview.chromium.org/864943002
Cr-Commit-Position: refs/heads/master@{#313084}
Diffstat (limited to 'base/time')
-rw-r--r-- | base/time/tick_clock.h | 4 | ||||
-rw-r--r-- | base/time/time.h | 9 | ||||
-rw-r--r-- | base/time/time_mac.cc | 2 | ||||
-rw-r--r-- | base/time/time_posix.cc | 4 | ||||
-rw-r--r-- | base/time/time_unittest.cc | 10 | ||||
-rw-r--r-- | base/time/time_win_unittest.cc | 12 |
6 files changed, 16 insertions, 25 deletions
diff --git a/base/time/tick_clock.h b/base/time/tick_clock.h index 3e53d83..2b8691f 100644 --- a/base/time/tick_clock.h +++ b/base/time/tick_clock.h @@ -17,8 +17,8 @@ namespace base { // See DefaultTickClock (base/time/default_tick_clock.h) for the default // implementation that simply uses TimeTicks::Now(). // -// (Other implementations that use TimeTicks::HighResNow() or -// TimeTicks::NowFromSystemTime() should be added as needed.) +// (Other implementations that use TimeTicks::NowFromSystemTime() should +// be added as needed.) // // See SimpleTestTickClock (base/test/simple_test_tick_clock.h) for a // simple test implementation. diff --git a/base/time/time.h b/base/time/time.h index 915eac8..eb86693 100644 --- a/base/time/time.h +++ b/base/time/time.h @@ -603,21 +603,12 @@ class BASE_EXPORT TimeTicks { // microsecond. static TimeTicks Now(); - // DEPRECATED - // TODO(miu): Remove this function, and all callpoints should call Now(). - static TimeTicks HighResNow() { return TimeTicks::Now(); } - // Returns true if the high resolution clock is working on this system and // Now() will return high resolution values. Note that, on systems where the // high resolution clock works but is deemed inefficient, the low resolution // clock will be used instead. static bool IsHighResolution(); - // DEPRECATED - // TODO(miu): Remove this function, and all callpoints should call - // IsHighResolution(). - static bool IsHighResNowFastAndReliable() { return IsHighResolution(); } - // Returns true if ThreadNow() is supported on this system. static bool IsThreadNowSupported() { #if (defined(_POSIX_THREAD_CPUTIME) && (_POSIX_THREAD_CPUTIME >= 0)) || \ diff --git a/base/time/time_mac.cc b/base/time/time_mac.cc index 3944d06..e263d07 100644 --- a/base/time/time_mac.cc +++ b/base/time/time_mac.cc @@ -230,7 +230,7 @@ TimeTicks TimeTicks::ThreadNow() { // static TimeTicks TimeTicks::NowFromSystemTraceTime() { - return HighResNow(); + return Now(); } } // namespace base diff --git a/base/time/time_posix.cc b/base/time/time_posix.cc index 34b2f5a..8b207eb 100644 --- a/base/time/time_posix.cc +++ b/base/time/time_posix.cc @@ -338,7 +338,7 @@ TimeTicks TimeTicks::NowFromSystemTraceTime() { struct timespec ts; if (clock_gettime(kClockSystemTrace, &ts) != 0) { // NB: fall-back for a chrome os build running on linux - return HighResNow(); + return Now(); } absolute_micro = @@ -352,7 +352,7 @@ TimeTicks TimeTicks::NowFromSystemTraceTime() { // static TimeTicks TimeTicks::NowFromSystemTraceTime() { - return HighResNow(); + return Now(); } #endif // defined(OS_CHROMEOS) diff --git a/base/time/time_unittest.cc b/base/time/time_unittest.cc index 07b1e6b..27f71b4 100644 --- a/base/time/time_unittest.cc +++ b/base/time/time_unittest.cc @@ -643,8 +643,8 @@ TEST(TimeTicks, Deltas) { } static void HighResClockTest(TimeTicks (*GetTicks)()) { - // HighResNow doesn't work on some systems. Since the product still works - // even if it doesn't work, it makes this entire test questionable. + // IsHighResolution() is false on some systems. Since the product still works + // even if it's false, it makes this entire test questionable. if (!TimeTicks::IsHighResolution()) return; @@ -679,8 +679,8 @@ static void HighResClockTest(TimeTicks (*GetTicks)()) { EXPECT_TRUE(success); } -TEST(TimeTicks, HighResNow) { - HighResClockTest(&TimeTicks::HighResNow); +TEST(TimeTicks, HighRes) { + HighResClockTest(&TimeTicks::Now); } // Fails frequently on Android http://crbug.com/352633 with: @@ -711,7 +711,7 @@ TEST(TimeTicks, MAYBE_ThreadNow) { } TEST(TimeTicks, NowFromSystemTraceTime) { - // Re-use HighResNow test for now since clock properties are identical. + // Re-use HighRes test for now since clock properties are identical. HighResClockTest(&TimeTicks::NowFromSystemTraceTime); } diff --git a/base/time/time_win_unittest.cc b/base/time/time_win_unittest.cc index 71cd29e..82be8c5 100644 --- a/base/time/time_win_unittest.cc +++ b/base/time/time_win_unittest.cc @@ -116,8 +116,8 @@ TEST(TimeTicks, WinRollover) { } TEST(TimeTicks, SubMillisecondTimers) { - // HighResNow doesn't work on some systems. Since the product still works - // even if it doesn't work, it makes this entire test questionable. + // IsHighResolution() is false on some systems. Since the product still works + // even if it's false, it makes this entire test questionable. if (!TimeTicks::IsHighResolution()) return; @@ -126,11 +126,11 @@ TEST(TimeTicks, SubMillisecondTimers) { // Run kRetries attempts to see a sub-millisecond timer. for (int index = 0; index < kRetries; index++) { - TimeTicks last_time = TimeTicks::HighResNow(); + TimeTicks last_time = TimeTicks::Now(); TimeDelta delta; // Spin until the clock has detected a change. do { - delta = TimeTicks::HighResNow() - last_time; + delta = TimeTicks::Now() - last_time; } while (delta.InMicroseconds() == 0); if (delta.InMicroseconds() < 1000) { saw_submillisecond_timer = true; @@ -193,10 +193,10 @@ TEST(TimeTicks, TimerPerformance) { int test_case = 0; while (cases[test_case].func) { - TimeTicks start = TimeTicks::HighResNow(); + TimeTicks start = TimeTicks::Now(); for (int index = 0; index < kLoops; index++) cases[test_case].func(); - TimeTicks stop = TimeTicks::HighResNow(); + TimeTicks stop = TimeTicks::Now(); // Turning off the check for acceptible delays. Without this check, // the test really doesn't do much other than measure. But the // measurements are still useful for testing timers on various platforms. |