diff options
author | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-09 08:58:51 +0000 |
---|---|---|
committer | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-09 08:58:51 +0000 |
commit | c5324208455858b3393a3e1887366f858c588a2d (patch) | |
tree | f6bc89be1a437d7aa1c6fbd5c0dc98ad2b3ff5b4 /base/time_unittest_win.cc | |
parent | 08de3cde4d95e9c962aee2386d7297d561404513 (diff) | |
download | chromium_src-c5324208455858b3393a3e1887366f858c588a2d.zip chromium_src-c5324208455858b3393a3e1887366f858c588a2d.tar.gz chromium_src-c5324208455858b3393a3e1887366f858c588a2d.tar.bz2 |
Reapply r1633 (which was reverted by r1635), with some additional modifications. Consolidate all timer resolution code to time.h, and always depend on TimeTicks::Now for 1ms resolution.
Review URL: http://codereview.chromium.org/1806
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1893 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/time_unittest_win.cc')
-rw-r--r-- | base/time_unittest_win.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/base/time_unittest_win.cc b/base/time_unittest_win.cc index 5b29db2..87cf698 100644 --- a/base/time_unittest_win.cc +++ b/base/time_unittest_win.cc @@ -12,27 +12,26 @@ namespace { class MockTimeTicks : public TimeTicks { public: - static int Ticker() { + static DWORD Ticker() { return static_cast<int>(InterlockedIncrement(&ticker_)); } static void InstallTicker() { - old_tick_function_ = tick_function_; - tick_function_ = reinterpret_cast<TickFunction>(&Ticker); + old_tick_function_ = SetMockTickFunction(&Ticker); ticker_ = -5; } static void UninstallTicker() { - tick_function_ = old_tick_function_; + SetMockTickFunction(old_tick_function_); } private: static volatile LONG ticker_; - static TickFunction old_tick_function_; + static TickFunctionType old_tick_function_; }; volatile LONG MockTimeTicks::ticker_; -MockTimeTicks::TickFunction MockTimeTicks::old_tick_function_; +MockTimeTicks::TickFunctionType MockTimeTicks::old_tick_function_; HANDLE g_rollover_test_start; |