diff options
author | miu <miu@chromium.org> | 2015-01-05 18:13:48 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-06 02:14:46 +0000 |
commit | c824fbcdb67598143b773bb6a78e109d50071030 (patch) | |
tree | e60bf3d1733fa03a784c11cb22fbeb4ece1e0694 /base | |
parent | 7fa649a9d55e020ddcb612cfb505103b00e3b713 (diff) | |
download | chromium_src-c824fbcdb67598143b773bb6a78e109d50071030.zip chromium_src-c824fbcdb67598143b773bb6a78e109d50071030.tar.gz chromium_src-c824fbcdb67598143b773bb6a78e109d50071030.tar.bz2 |
Clean-up: Remove base::TimeTicks::UnprotectedNow().
This method was added in r222396:
https://chromiumcodereview.appspot.com/23147002
However, with the current implementation of base::TimeTicks::Now(),
this logic appears to be bogus. The comment in TrackedTime::Now()
thinks this method provides a lock-free execution of the timeGetTime()
function, but that is only the case on older systems without an
efficient QPC implementation. Furthermore, for those older systems, the
overhead in processing for the "rollover-protected" timestamp is
negligible (~20ns, according to benchmarking; compare this to the
1.0 ms to 15.6 ms precision of the clock).
Review URL: https://codereview.chromium.org/829113002
Cr-Commit-Position: refs/heads/master@{#310039}
Diffstat (limited to 'base')
-rw-r--r-- | base/profiler/tracked_time.cc | 8 | ||||
-rw-r--r-- | base/time/time.h | 3 | ||||
-rw-r--r-- | base/time/time_win.cc | 8 |
3 files changed, 0 insertions, 19 deletions
diff --git a/base/profiler/tracked_time.cc b/base/profiler/tracked_time.cc index 0121038..e5da68f 100644 --- a/base/profiler/tracked_time.cc +++ b/base/profiler/tracked_time.cc @@ -51,15 +51,7 @@ TrackedTime::TrackedTime(const base::TimeTicks& time) // static TrackedTime TrackedTime::Now() { -#if defined(OS_WIN) - // Use lock-free accessor to 32 bit time. - // Note that TimeTicks::Now() is built on this, so we have "compatible" - // times when we down-convert a TimeTicks sample. - return TrackedTime(base::TimeTicks::UnprotectedNow()); -#else - // Posix has nice cheap 64 bit times, so we just down-convert it. return TrackedTime(base::TimeTicks::Now()); -#endif // OS_WIN } Duration TrackedTime::operator-(const TrackedTime& other) const { diff --git a/base/time/time.h b/base/time/time.h index 9cb007e..d61a351 100644 --- a/base/time/time.h +++ b/base/time/time.h @@ -634,9 +634,6 @@ class BASE_EXPORT TimeTicks { // Returns true if the high resolution clock is working on this system. // This is only for testing. static bool IsHighResClockWorking(); - - // Returns a time value that is NOT rollover protected. - static TimeTicks UnprotectedNow(); #endif // Returns true if this object has not been initialized. diff --git a/base/time/time_win.cc b/base/time/time_win.cc index 0061180..9b4f17d 100644 --- a/base/time/time_win.cc +++ b/base/time/time_win.cc @@ -540,14 +540,6 @@ bool TimeTicks::IsHighResClockWorking() { return GetHighResNowSingleton()->IsUsingHighResClock(); } -TimeTicks TimeTicks::UnprotectedNow() { - if (now_function == HighResNowWrapper) { - return Now(); - } else { - return TimeTicks() + TimeDelta::FromMilliseconds(timeGetTime()); - } -} - // TimeDelta ------------------------------------------------------------------ // static |