summaryrefslogtreecommitdiffstats
path: root/app/hi_res_timer_manager.h
diff options
context:
space:
mode:
authormbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-20 08:52:32 +0000
committermbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-20 08:52:32 +0000
commit47245d6709f7f16a65cfb3df9aeb51fb32d5a4ea (patch)
tree36051d10c826994d095b116955f42dae2de16e52 /app/hi_res_timer_manager.h
parentc4fcdca3cfec4ca060d29d10cdc06dc83aed1bf2 (diff)
downloadchromium_src-47245d6709f7f16a65cfb3df9aeb51fb32d5a4ea.zip
chromium_src-47245d6709f7f16a65cfb3df9aeb51fb32d5a4ea.tar.gz
chromium_src-47245d6709f7f16a65cfb3df9aeb51fb32d5a4ea.tar.bz2
2nd try:
Fix regression where high resolution timers could be activated even under battery power. Add unit test to protect chromium from developers like me in the future. The fix is a one-liner in hi_res_timer_manager_win.cc. The rest of the code change is the mechanics to enable the unit test. BUG=59528 TEST=HiResTimerManagerTest.ToggleOnOff Review URL: http://codereview.chromium.org/3889004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63191 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/hi_res_timer_manager.h')
-rw-r--r--app/hi_res_timer_manager.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/hi_res_timer_manager.h b/app/hi_res_timer_manager.h
index 7eed795..fdc10b3 100644
--- a/app/hi_res_timer_manager.h
+++ b/app/hi_res_timer_manager.h
@@ -18,11 +18,14 @@ class HighResolutionTimerManager : public SystemMonitor::PowerObserver {
// SystemMonitor::PowerObserver:
void OnPowerStateChange(bool on_battery_power);
+ // Returns true if the hi resolution clock could be used right now.
+ bool hi_res_clock_available() const { return hi_res_clock_available_; }
+
private:
// Enable or disable the faster multimedia timer.
void UseHiResClock(bool use);
- bool hi_res_clock_used_;
+ bool hi_res_clock_available_;
DISALLOW_COPY_AND_ASSIGN(HighResolutionTimerManager);
};