Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1397)

Unified Diff: base/timer/hi_res_timer_manager_win.cc

Issue 226263008: Revert of Attempting to resolve a race condition with PowerMonitor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/timer/hi_res_timer_manager_win.cc
diff --git a/base/timer/hi_res_timer_manager_win.cc b/base/timer/hi_res_timer_manager_win.cc
index 98b41d700926c76cf6849c21d3add8adc299b1e8..692f72b4e594481897bf022e256d51bb65b1f1b9 100644
--- a/base/timer/hi_res_timer_manager_win.cc
+++ b/base/timer/hi_res_timer_manager_win.cc
@@ -11,12 +11,14 @@
HighResolutionTimerManager::HighResolutionTimerManager()
: hi_res_clock_available_(false) {
- base::PowerMonitor::AddObserver(this);
- UseHiResClock(!base::PowerMonitor::IsOnBatteryPower());
+ base::PowerMonitor* power_monitor = base::PowerMonitor::Get();
+ DCHECK(power_monitor != NULL);
+ power_monitor->AddObserver(this);
+ UseHiResClock(!power_monitor->IsOnBatteryPower());
}
HighResolutionTimerManager::~HighResolutionTimerManager() {
- base::PowerMonitor::RemoveObserver(this);
+ base::PowerMonitor::Get()->RemoveObserver(this);
UseHiResClock(false);
}
« no previous file with comments | « base/timer/hi_res_timer_manager_unittest.cc ('k') | chrome/browser/extensions/event_router_forwarder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698