diff options
author | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-09 09:05:38 +0000 |
---|---|---|
committer | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-09 09:05:38 +0000 |
commit | cccd51abcce7ceb09a46278283698461273f08c3 (patch) | |
tree | 9fb85aef6fc0714d6f1871d2b796ab868c8a19d3 | |
parent | c5324208455858b3393a3e1887366f858c588a2d (diff) | |
download | chromium_src-cccd51abcce7ceb09a46278283698461273f08c3.zip chromium_src-cccd51abcce7ceb09a46278283698461273f08c3.tar.gz chromium_src-cccd51abcce7ceb09a46278283698461273f08c3.tar.bz2 |
Revert the timeBeginPeriod changes in event_recorder. It's doing it's own timeGetTime calls, so let it manage all of those APIs on it's own. Remove an unneeded include in message_loop.cc.
Review URL: http://codereview.chromium.org/1842
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1894 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/event_recorder.cc | 10 | ||||
-rw-r--r-- | base/message_loop.cc | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/base/event_recorder.cc b/base/event_recorder.cc index ddc7617..23c092f 100644 --- a/base/event_recorder.cc +++ b/base/event_recorder.cc @@ -53,6 +53,9 @@ bool EventRecorder::StartRecording(std::wstring& filename) { return false; } + // Set the faster clock, if possible. + ::timeBeginPeriod(1); + // Set the recording hook. JOURNALRECORD can only be used as a global hook. journal_hook_ = ::SetWindowsHookEx(WH_JOURNALRECORD, StaticRecordWndProc, GetModuleHandle(NULL), 0); @@ -76,6 +79,8 @@ void EventRecorder::StopRecording() { return; } + ::timeEndPeriod(1); + DCHECK(file_ != NULL); fclose(file_); file_ = NULL; @@ -104,6 +109,9 @@ bool EventRecorder::StartPlayback(std::wstring& filename) { return false; } + // Set the faster clock, if possible. + ::timeBeginPeriod(1); + // Playback time is tricky. When playing back, we read a series of events, // each with timeouts. Simply subtracting the delta between two timers will // lead to fast playback (about 2x speed). The API has two events, one @@ -142,6 +150,8 @@ void EventRecorder::StopPlayback() { fclose(file_); file_ = NULL; + ::timeEndPeriod(1); + journal_hook_ = NULL; is_playing_ = false; } diff --git a/base/message_loop.cc b/base/message_loop.cc index ee33aa1..ee4a344 100644 --- a/base/message_loop.cc +++ b/base/message_loop.cc @@ -6,10 +6,6 @@ #include <algorithm> -#if defined(OS_WIN) -#include <mmsystem.h> -#endif - #include "base/compiler_specific.h" #include "base/logging.h" #include "base/message_pump_default.h" |