#ifndef BASE_POWER_MONITOR_POWER_MONITOR_SOURCE_H_
#define BASE_POWER_MONITOR_POWER_MONITOR_SOURCE_H_
#include "base/base_export.h"
#include "base/power_monitor/power_observer.h"
#include "base/synchronization/lock.h"
#include "build/build_config.h"
namespace base {
class BASE_EXPORT PowerMonitorSource {
public:
PowerMonitorSource();
PowerMonitorSource(const PowerMonitorSource&) = delete;
PowerMonitorSource& operator=(const PowerMonitorSource&) = delete;
virtual ~PowerMonitorSource();
enum PowerEvent {
POWER_STATE_EVENT,
SUSPEND_EVENT,
RESUME_EVENT
};
virtual PowerThermalObserver::DeviceThermalState GetCurrentThermalState()
const;
virtual int GetInitialSpeedLimit() const;
virtual void SetCurrentThermalState(
PowerThermalObserver::DeviceThermalState state);
virtual PowerStateObserver::BatteryPowerStatus GetBatteryPowerStatus()
const = 0;
static const char* DeviceThermalStateToString(
PowerThermalObserver::DeviceThermalState state);
protected:
friend class PowerMonitorTest;
friend void ProcessPowerEventHelper(PowerEvent);
friend void ProcessThermalEventHelper(
PowerThermalObserver::DeviceThermalState);
static void ProcessPowerEvent(PowerEvent event_id);
static void ProcessThermalEvent(
PowerThermalObserver::DeviceThermalState new_thermal_state);
static void ProcessSpeedLimitEvent(int speed_limit);
};
}
#endif