Revert of Several Tick counter improvements. (patchset #8 id:140001 of https://codereview.webrtc.org/1415923010/ )

Reason for revert:
Potentially breaks a threading test under DrMemory.  Rolling back while I investigate.

Original issue's description:
> Several Tick counter improvements.
>
> Move logic into cc file
> Simplify interval calculation
> Remove unused QUERY_PERFORMANCE_COUNTER windows implementation
> Remove double divide on each ::Now() invocation on mac
>
> Move TickTime and TickInterval funcitons to cc file in prep for refactoring.
>
> BUG=
> R=mflodman@webrtc.org, pbos@webrtc.org
>
> Committed: https://crrev.com/4c27e4b62da2047063d88eedfeec3e939fea7843
> Cr-Commit-Position: refs/heads/master@{#10661}

TBR=pbos@webrtc.org,mflodman@webrtc.org,noahric@chromium.org,thaloun@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.webrtc.org/1450203002

Cr-Commit-Position: refs/heads/master@{#10663}
This commit is contained in:
thaloun
2015-11-16 16:28:49 -08:00
committed by Commit bot
parent fa6228e221
commit c91d173870
3 changed files with 143 additions and 98 deletions

View File

@ -251,9 +251,8 @@ TEST(ProcessThreadImpl, WakeUp) {
rtc::scoped_ptr<EventWrapper> called(EventWrapper::Create());
MockModule module;
int64_t start_time;
int64_t called_time;
int64_t start_time = 0;
int64_t called_time = 0;
// Ask for a callback after 1000ms.
// TimeUntilNextProcess will be called twice.
// The first time we use it to get the thread into a waiting state.
@ -282,6 +281,8 @@ TEST(ProcessThreadImpl, WakeUp) {
EXPECT_CALL(module, ProcessThreadAttached(nullptr)).Times(1);
thread.Stop();
ASSERT_GT(start_time, 0);
ASSERT_GT(called_time, 0);
EXPECT_GE(called_time, start_time);
uint32_t diff = called_time - start_time;
// We should have been called back much quicker than 1sec.