diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-24 20:16:03 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-24 20:16:03 +0000 |
commit | fe0f58fddabd7829d62d1174feaba725ab69e922 (patch) | |
tree | c842db924390f3af2bc469a007f7323894432f8d /app/system_monitor.cc | |
parent | b45d80311bc50f2d6251f2fd38feaa53f5c25276 (diff) | |
download | chromium_src-fe0f58fddabd7829d62d1174feaba725ab69e922.zip chromium_src-fe0f58fddabd7829d62d1174feaba725ab69e922.tar.gz chromium_src-fe0f58fddabd7829d62d1174feaba725ab69e922.tar.bz2 |
Monitor sleep/wake on Mac. Should fix some networking issues arising after sleep.
BUG=29669
TEST=turn logging up; see logging about power being suspended/resumed when Mac sleeps/awakes
Review URL: http://codereview.chromium.org/5310005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67301 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/system_monitor.cc')
-rw-r--r-- | app/system_monitor.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/app/system_monitor.cc b/app/system_monitor.cc index 428ab6c..a30dac1 100644 --- a/app/system_monitor.cc +++ b/app/system_monitor.cc @@ -29,9 +29,15 @@ SystemMonitor::SystemMonitor() base::TimeDelta::FromMilliseconds(kDelayedBatteryCheckMs), this, &SystemMonitor::BatteryCheck); #endif // defined(ENABLE_BATTERY_MONITORING) +#if defined(OS_MACOSX) + PlatformInit(); +#endif } SystemMonitor::~SystemMonitor() { +#if defined(OS_MACOSX) + PlatformDestroy(); +#endif DCHECK_EQ(this, g_system_monitor); g_system_monitor = NULL; } @@ -78,18 +84,18 @@ void SystemMonitor::RemoveObserver(PowerObserver* obs) { } void SystemMonitor::NotifyPowerStateChange() { - VLOG(1) << L"PowerStateChange: " << (BatteryPower() ? L"On" : L"Off") - << L" battery"; + VLOG(1) << "PowerStateChange: " << (BatteryPower() ? "On" : "Off") + << " battery"; observer_list_->Notify(&PowerObserver::OnPowerStateChange, BatteryPower()); } void SystemMonitor::NotifySuspend() { - VLOG(1) << L"Power Suspending"; + VLOG(1) << "Power Suspending"; observer_list_->Notify(&PowerObserver::OnSuspend); } void SystemMonitor::NotifyResume() { - VLOG(1) << L"Power Resuming"; + VLOG(1) << "Power Resuming"; observer_list_->Notify(&PowerObserver::OnResume); } |