Issue #1391 - Remove the DOM battery API

This commit is contained in:
Moonchild 2020-07-28 15:46:41 +00:00 committed by Roy Tam
commit b33e80b186
30 changed files with 0 additions and 1833 deletions

View file

@ -264,30 +264,6 @@ private:
bool mHasValidCache;
};
class BatteryObserversManager : public CachingObserversManager<BatteryInformation>
{
protected:
void EnableNotifications() {
PROXY_IF_SANDBOXED(EnableBatteryNotifications());
}
void DisableNotifications() {
PROXY_IF_SANDBOXED(DisableBatteryNotifications());
}
void GetCurrentInformationInternal(BatteryInformation* aInfo) {
PROXY_IF_SANDBOXED(GetCurrentBatteryInformation(aInfo));
}
};
static BatteryObserversManager&
BatteryObservers()
{
static BatteryObserversManager sBatteryObservers;
AssertMainThread();
return sBatteryObservers;
}
class NetworkObserversManager : public CachingObserversManager<NetworkInformation>
{
protected:
@ -356,35 +332,6 @@ ScreenConfigurationObservers()
return sScreenConfigurationObservers;
}
void
RegisterBatteryObserver(BatteryObserver* aObserver)
{
AssertMainThread();
BatteryObservers().AddObserver(aObserver);
}
void
UnregisterBatteryObserver(BatteryObserver* aObserver)
{
AssertMainThread();
BatteryObservers().RemoveObserver(aObserver);
}
void
GetCurrentBatteryInformation(BatteryInformation* aInfo)
{
AssertMainThread();
*aInfo = BatteryObservers().GetCurrentInformation();
}
void
NotifyBatteryChange(const BatteryInformation& aInfo)
{
AssertMainThread();
BatteryObservers().CacheInformation(aInfo);
BatteryObservers().BroadcastCachedInformation();
}
bool GetScreenEnabled()
{
AssertMainThread();