From 671827e93872d5797768a4a5d3c38b964bb19477 Mon Sep 17 00:00:00 2001 From: "rvargas@google.com" Date: Mon, 11 Jun 2012 21:10:27 +0000 Subject: Revert 138011 - 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=base_unittests TBR=brettw Review URL: https://chromiumcodereview.appspot.com/10546101 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141497 0039d316-1c4b-4281-b951-d872f2087c98 --- base/system_monitor/system_monitor.h | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'base/system_monitor/system_monitor.h') diff --git a/base/system_monitor/system_monitor.h b/base/system_monitor/system_monitor.h index 7bff799..d960fa2 100644 --- a/base/system_monitor/system_monitor.h +++ b/base/system_monitor/system_monitor.h @@ -6,14 +6,11 @@ #define BASE_SYSTEM_MONITOR_SYSTEM_MONITOR_H_ #pragma once -#include #include -#include #include #include "base/base_export.h" #include "base/basictypes.h" -#include "base/threading/thread_checker.h" #include "base/tuple.h" #include "build/build_config.h" @@ -51,13 +48,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; // (Media device id, Media device name, Media device path) typedef Tuple3 MediaDeviceInfo; @@ -162,22 +152,6 @@ class BASE_EXPORT SystemMonitor { // Returns information for attached media devices. std::vector GetAttachedMediaDevices() const; - // 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: typedef std::map MediaDeviceMap; @@ -211,11 +185,6 @@ class BASE_EXPORT SystemMonitor { bool battery_in_use_; bool suspended_; -#if defined(OS_WIN) - std::map > handles_; - base::ThreadChecker thread_checker_; -#endif - #if defined(ENABLE_BATTERY_MONITORING) base::OneShotTimer delayed_battery_check_; #endif -- cgit v1.1