Index: base/power_monitor/power_monitor_source.cc |
diff --git a/base/power_monitor/power_monitor_source.cc b/base/power_monitor/power_monitor_source.cc |
index 33f3d23d9a295244fc08160b84c2a61aaa01c08f..6868cb19e338e17b7d5c960b606b8f22845893da 100644 |
--- a/base/power_monitor/power_monitor_source.cc |
+++ b/base/power_monitor/power_monitor_source.cc |
@@ -22,11 +22,11 @@ |
} |
void PowerMonitorSource::ProcessPowerEvent(PowerEvent event_id) { |
- AutoLock lock(*PowerMonitor::GetLock()); |
- if (!PowerMonitor::IsInitializedLocked()) |
+ PowerMonitor* monitor = PowerMonitor::Get(); |
+ if (!monitor) |
return; |
- PowerMonitorSource* source = PowerMonitor::GetSource(); |
+ PowerMonitorSource* source = monitor->Source(); |
// Suppress duplicate notifications. Some platforms may |
// send multiple notifications of the same event. |
@@ -45,19 +45,19 @@ |
} |
if (changed) |
- PowerMonitor::NotifyPowerStateChange(new_on_battery_power); |
+ monitor->NotifyPowerStateChange(new_on_battery_power); |
} |
break; |
case RESUME_EVENT: |
if (source->suspended_) { |
source->suspended_ = false; |
- PowerMonitor::NotifyResume(); |
+ monitor->NotifyResume(); |
} |
break; |
case SUSPEND_EVENT: |
if (!source->suspended_) { |
source->suspended_ = true; |
- PowerMonitor::NotifySuspend(); |
+ monitor->NotifySuspend(); |
} |
break; |
} |