summaryrefslogtreecommitdiffstats
path: root/app/hi_res_timer_manager_win.cc
diff options
context:
space:
mode:
authormbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-20 03:53:13 +0000
committermbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-20 03:53:13 +0000
commit32e9efbc0564ea718a7fb3b56d7ad934fefce70f (patch)
tree308e462dda8dc50008e9dfe26ae8b37c2705a2c7 /app/hi_res_timer_manager_win.cc
parent8f31f41edbe94651e1df889993be0704954942db (diff)
downloadchromium_src-32e9efbc0564ea718a7fb3b56d7ad934fefce70f.zip
chromium_src-32e9efbc0564ea718a7fb3b56d7ad934fefce70f.tar.gz
chromium_src-32e9efbc0564ea718a7fb3b56d7ad934fefce70f.tar.bz2
Revert 63176 - 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/3848002 TBR=mbelshe@chromium.org Review URL: http://codereview.chromium.org/3948001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63177 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/hi_res_timer_manager_win.cc')
-rw-r--r--app/hi_res_timer_manager_win.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/hi_res_timer_manager_win.cc b/app/hi_res_timer_manager_win.cc
index da25d70..6fbffca 100644
--- a/app/hi_res_timer_manager_win.cc
+++ b/app/hi_res_timer_manager_win.cc
@@ -7,7 +7,7 @@
#include "base/time.h"
HighResolutionTimerManager::HighResolutionTimerManager()
- : hi_res_clock_available_(false) {
+ : hi_res_clock_used_(false) {
SystemMonitor* system_monitor = SystemMonitor::Get();
system_monitor->AddObserver(this);
UseHiResClock(!system_monitor->BatteryPower());
@@ -23,8 +23,7 @@ void HighResolutionTimerManager::OnPowerStateChange(bool on_battery_power) {
}
void HighResolutionTimerManager::UseHiResClock(bool use) {
- if (use == hi_res_clock_available_)
+ if (use == hi_res_clock_used_)
return;
- hi_res_clock_available_ = use;
base::Time::EnableHighResolutionTimer(use);
}