summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-13 18:15:03 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-13 18:15:03 +0000
commit4c2ab43245031b082289bd209f9ff4f3912ebccb (patch)
treea3fb39e79cb2121f547d4f088275450d46a1230d /base
parentab295637537b23093388b1dc0b8395e7f4c2088d (diff)
downloadchromium_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
Diffstat (limited to 'base')
-rw-r--r--base/system_monitor.cc9
-rw-r--r--base/system_monitor.h11
2 files changed, 12 insertions, 8 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;