diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-13 18:15:03 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-13 18:15:03 +0000 |
commit | 4c2ab43245031b082289bd209f9ff4f3912ebccb (patch) | |
tree | a3fb39e79cb2121f547d4f088275450d46a1230d | |
parent | ab295637537b23093388b1dc0b8395e7f4c2088d (diff) | |
download | chromium_src-4c2ab43245031b082289bd209f9ff4f3912ebccb.zip chromium_src-4c2ab43245031b082289bd209f9ff4f3912ebccb.tar.gz chromium_src-4c2ab43245031b082289bd209f9ff4f3912ebccb.tar.bz2 |
Simple cleanup.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/164424
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23327 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/system_monitor.cc | 9 | ||||
-rw-r--r-- | base/system_monitor.h | 11 | ||||
-rw-r--r-- | chrome/browser/safe_browsing/safe_browsing_service.h | 2 |
3 files changed, 13 insertions, 9 deletions
diff --git a/base/system_monitor.cc b/base/system_monitor.cc index dd5aa60..cf946a7 100644 --- a/base/system_monitor.cc +++ b/base/system_monitor.cc @@ -5,6 +5,7 @@ #include "base/system_monitor.h" #include "base/logging.h" #include "base/message_loop.h" +#include "base/singleton.h" namespace base { @@ -72,6 +73,14 @@ void SystemMonitor::NotifyResume() { observer_list_->Notify(&PowerObserver::OnResume, this); } +// static +SystemMonitor* SystemMonitor::Get() { + // Uses the LeakySingletonTrait because cleanup is optional. + return + Singleton<SystemMonitor, LeakySingletonTraits<SystemMonitor> >::get(); +} + +// static void SystemMonitor::Start() { #if defined(ENABLE_BATTERY_MONITORING) DCHECK(MessageLoop::current()); // Can't call start too early. diff --git a/base/system_monitor.h b/base/system_monitor.h index 7eee09d..aeec42b 100644 --- a/base/system_monitor.h +++ b/base/system_monitor.h @@ -16,7 +16,6 @@ #endif // !OS_WIN #include "base/observer_list_threadsafe.h" -#include "base/singleton.h" #if defined(ENABLE_BATTERY_MONITORING) #include "base/timer.h" #endif // defined(ENABLE_BATTERY_MONITORING) @@ -28,12 +27,8 @@ namespace base { // TODO(mbelshe): Add support beyond just power management. class SystemMonitor { public: - // Access to the Singleton - static SystemMonitor* Get() { - // Uses the LeakySingletonTrait because cleanup is optional. - return - Singleton<SystemMonitor, LeakySingletonTraits<SystemMonitor> >::get(); - } + // Retrieves the Singleton. + static SystemMonitor* Get(); // Start the System Monitor within a process. This method // is provided so that the battery check can be deferred. @@ -67,7 +62,7 @@ class SystemMonitor { // lengthy operations are needed, the observer should take care to invoke // the operation on an appropriate thread. class PowerObserver { - public: + public: // Notification of a change in power status of the computer, such // as from switching between battery and A/C power. virtual void OnPowerStateChange(SystemMonitor*) = 0; diff --git a/chrome/browser/safe_browsing/safe_browsing_service.h b/chrome/browser/safe_browsing/safe_browsing_service.h index ccfe1f3..cc5651f 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.h +++ b/chrome/browser/safe_browsing/safe_browsing_service.h @@ -169,7 +169,7 @@ class SafeBrowsingService // PowerObserver notifications // We defer SafeBrowsing work for a short duration when the computer comes // out of a suspend state to avoid thrashing the disk. - void OnPowerStateChange(base::SystemMonitor*) {}; + void OnPowerStateChange(base::SystemMonitor*) {} void OnSuspend(base::SystemMonitor*); void OnResume(base::SystemMonitor*); |