diff options
author | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-18 23:42:54 +0000 |
---|---|---|
committer | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-18 23:42:54 +0000 |
commit | 581db2b3642608e603900d99f10ab479f6dab2da (patch) | |
tree | 7a62c23ca0328ae4eebb4f13a11cf7c6c1a3c9d3 /base/system_monitor/system_monitor.h | |
parent | 7b38c4e9f68673251cbc257962940d7cb4cb979d (diff) | |
download | chromium_src-581db2b3642608e603900d99f10ab479f6dab2da.zip chromium_src-581db2b3642608e603900d99f10ab479f6dab2da.tar.gz chromium_src-581db2b3642608e603900d99f10ab479f6dab2da.tar.bz2 |
Revert 137960 - Base: Add power requirements to the System monitor.
The only thing we need in the short term is CPU_REQUIRED,
and that part is implemented for all platforms (as far as it
makes sense). The other options are implemented for Windows,
but given that currently there's no user, I expect the
implementation for other platforms to be written when there's
an actual need for it.
BUG=126591
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10406012
TBR=rvargas@google.com
Review URL: https://chromiumcodereview.appspot.com/10414012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137976 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/system_monitor/system_monitor.h')
-rw-r--r-- | base/system_monitor/system_monitor.h | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/base/system_monitor/system_monitor.h b/base/system_monitor/system_monitor.h index e0decc9..3f73b15 100644 --- a/base/system_monitor/system_monitor.h +++ b/base/system_monitor/system_monitor.h @@ -6,13 +6,10 @@ #define BASE_SYSTEM_MONITOR_SYSTEM_MONITOR_H_ #pragma once -#include <map> #include <string> -#include <utility> #include "base/base_export.h" #include "base/basictypes.h" -#include "base/threading/thread_checker.h" #include "build/build_config.h" // Windows HiRes timers drain the battery faster so we need to know the battery @@ -49,13 +46,6 @@ class BASE_EXPORT SystemMonitor { RESUME_EVENT // The system is being resumed. }; - enum PowerRequirement { - DISPLAY_REQUIRED, // The display should not be shut down. - SYSTEM_REQUIRED, // The system should not be suspended. - CPU_REQUIRED, // The process should not be suspended. - TEST_REQUIRED // This is used by unit tests. - }; - typedef unsigned int DeviceIdType; // Create SystemMonitor. Only one SystemMonitor instance per application @@ -155,22 +145,6 @@ class BASE_EXPORT SystemMonitor { const FilePath& path); void ProcessMediaDeviceDetached(const DeviceIdType& id); - // Enters or leaves a period of time with a given |requirement|. If the - // operation has multiple requirements, make sure to use a unique |reason| for - // each one. Reusing the same |reason| is OK as far as the |requirement| is - // the same in every call, and each BeginPowerRequirement call is paired with - // a call to EndPowerRequirement. |reason| is expected to be an ASCII string. - // Must be called from the thread that created the SystemMonitor. - // Warning: Please remember that sleep deprivation is not a good thing; use - // with caution. - void BeginPowerRequirement(PowerRequirement requirement, - const std::string& reason); - void EndPowerRequirement(PowerRequirement requirement, - const std::string& reason); - - // Returns the number of outsanding power requirement requests. - size_t GetPowerRequirementsCountForTest() const; - private: #if defined(OS_MACOSX) void PlatformInit(); @@ -202,11 +176,6 @@ class BASE_EXPORT SystemMonitor { bool battery_in_use_; bool suspended_; -#if defined(OS_WIN) - std::map<std::string, std::pair<HANDLE, int> > handles_; - base::ThreadChecker thread_checker_; -#endif - #if defined(ENABLE_BATTERY_MONITORING) base::OneShotTimer<SystemMonitor> delayed_battery_check_; #endif |