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

Unified Diff: content/gpu/gpu_watchdog_thread.cc

Issue 179923006: Attempting to resolve a race condition with PowerMonitor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win64 fixes Created 6 years, 9 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 940d07e72ac43ae0cb6f36e1b160ab48c6bd7f24..5f8f6197f6db178e34f1b162dfd6e0d32eaf0fc9 100644
--- a/content/gpu/gpu_watchdog_thread.cc
+++ b/content/gpu/gpu_watchdog_thread.cc
@@ -114,9 +114,7 @@ GpuWatchdogThread::~GpuWatchdogThread() {
CloseHandle(watched_thread_handle_);
#endif
- base::PowerMonitor* power_monitor = base::PowerMonitor::Get();
- if (power_monitor)
- power_monitor->RemoveObserver(this);
+ base::PowerMonitor::RemoveObserver(this);
#if defined(OS_CHROMEOS)
if (tty_file_)
@@ -266,9 +264,7 @@ void GpuWatchdogThread::AddPowerObserver() {
}
void GpuWatchdogThread::OnAddPowerObserver() {
- base::PowerMonitor* power_monitor = base::PowerMonitor::Get();
- DCHECK(power_monitor);
- power_monitor->AddObserver(this);
+ DCHECK(base::PowerMonitor::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