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

Unified Diff: content/gpu/gpu_watchdog_thread.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
« no previous file with comments | « content/child/power_monitor_broadcast_source_unittest.cc ('k') | media/audio/mac/audio_manager_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/gpu/gpu_watchdog_thread.cc
diff --git a/content/gpu/gpu_watchdog_thread.cc b/content/gpu/gpu_watchdog_thread.cc
index 5f8f6197f6db178e34f1b162dfd6e0d32eaf0fc9..940d07e72ac43ae0cb6f36e1b160ab48c6bd7f24 100644
--- a/content/gpu/gpu_watchdog_thread.cc
+++ b/content/gpu/gpu_watchdog_thread.cc
@@ -114,7 +114,9 @@
CloseHandle(watched_thread_handle_);
#endif
- base::PowerMonitor::RemoveObserver(this);
+ base::PowerMonitor* power_monitor = base::PowerMonitor::Get();
+ if (power_monitor)
+ power_monitor->RemoveObserver(this);
#if defined(OS_CHROMEOS)
if (tty_file_)
@@ -264,7 +266,9 @@
}
void GpuWatchdogThread::OnAddPowerObserver() {
- DCHECK(base::PowerMonitor::AddObserver(this));
+ base::PowerMonitor* power_monitor = base::PowerMonitor::Get();
+ DCHECK(power_monitor);
+ power_monitor->AddObserver(this);
}
void GpuWatchdogThread::OnSuspend() {
« no previous file with comments | « content/child/power_monitor_broadcast_source_unittest.cc ('k') | media/audio/mac/audio_manager_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698