summaryrefslogtreecommitdiffstats
path: root/hal/sandbox
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-07-28 15:46:41 +0000
committerMoonchild <moonchild@palemoon.org>2020-07-28 15:47:07 +0000
commit08fb2f306856948ecc71974dd98c0a6d78df25aa (patch)
treedd008594a9e130c8f2f916de398915cd7e54ad90 /hal/sandbox
parent15ed0691f6fe6e558c7e733af9fca0586c4d554b (diff)
downloadUXP-08fb2f306856948ecc71974dd98c0a6d78df25aa.tar
UXP-08fb2f306856948ecc71974dd98c0a6d78df25aa.tar.gz
UXP-08fb2f306856948ecc71974dd98c0a6d78df25aa.tar.lz
UXP-08fb2f306856948ecc71974dd98c0a6d78df25aa.tar.xz
UXP-08fb2f306856948ecc71974dd98c0a6d78df25aa.zip
Issue #1391 - Remove the DOM battery API
Diffstat (limited to 'hal/sandbox')
-rw-r--r--hal/sandbox/PHal.ipdl12
-rw-r--r--hal/sandbox/SandboxHal.cpp51
2 files changed, 0 insertions, 63 deletions
diff --git a/hal/sandbox/PHal.ipdl b/hal/sandbox/PHal.ipdl
index 1af550aff..8701e1219 100644
--- a/hal/sandbox/PHal.ipdl
+++ b/hal/sandbox/PHal.ipdl
@@ -20,12 +20,6 @@ using PRTime from "prtime.h";
namespace mozilla {
namespace hal {
-struct BatteryInformation {
- double level;
- bool charging;
- double remainingTime;
-};
-
struct SensorData {
SensorType sensor;
PRTime timestamp;
@@ -69,7 +63,6 @@ nested(upto inside_cpow) sync protocol PHal {
manager PContent;
child:
- async NotifyBatteryChange(BatteryInformation aBatteryInfo);
async NotifyNetworkChange(NetworkInformation aNetworkInfo);
async NotifyWakeLockChange(WakeLockInformation aWakeLockInfo);
async NotifyScreenConfigurationChange(ScreenConfiguration aScreenOrientation);
@@ -80,11 +73,6 @@ parent:
async Vibrate(uint32_t[] pattern, uint64_t[] id, PBrowser browser);
async CancelVibrate(uint64_t[] id, PBrowser browser);
- async EnableBatteryNotifications();
- async DisableBatteryNotifications();
- sync GetCurrentBatteryInformation()
- returns (BatteryInformation aBatteryInfo);
-
async EnableNetworkNotifications();
async DisableNetworkNotifications();
sync GetCurrentNetworkInformation()
diff --git a/hal/sandbox/SandboxHal.cpp b/hal/sandbox/SandboxHal.cpp
index aeaeb724e..579f3b472 100644
--- a/hal/sandbox/SandboxHal.cpp
+++ b/hal/sandbox/SandboxHal.cpp
@@ -13,7 +13,6 @@
#include "mozilla/hal_sandbox/PHalParent.h"
#include "mozilla/dom/TabParent.h"
#include "mozilla/dom/TabChild.h"
-#include "mozilla/dom/battery/Types.h"
#include "mozilla/dom/network/Types.h"
#include "mozilla/dom/ScreenOrientation.h"
#include "mozilla/EnumeratedRange.h"
@@ -70,24 +69,6 @@ CancelVibrate(const WindowIdentifier &id)
}
void
-EnableBatteryNotifications()
-{
- Hal()->SendEnableBatteryNotifications();
-}
-
-void
-DisableBatteryNotifications()
-{
- Hal()->SendDisableBatteryNotifications();
-}
-
-void
-GetCurrentBatteryInformation(BatteryInformation* aBatteryInfo)
-{
- Hal()->SendGetCurrentBatteryInformation(aBatteryInfo);
-}
-
-void
EnableNetworkNotifications()
{
Hal()->SendEnableNetworkNotifications();
@@ -376,7 +357,6 @@ bool SystemServiceIsRunning(const char* aSvcName)
}
class HalParent : public PHalParent
- , public BatteryObserver
, public NetworkObserver
, public ISensorObserver
, public WakeLockObserver
@@ -390,7 +370,6 @@ public:
{
// NB: you *must* unconditionally unregister your observer here,
// if it *may* be registered below.
- hal::UnregisterBatteryObserver(this);
hal::UnregisterNetworkObserver(this);
hal::UnregisterScreenConfigurationObserver(this);
for (auto sensor : MakeEnumeratedRange(NUM_SENSOR_TYPE)) {
@@ -432,30 +411,6 @@ public:
}
virtual bool
- RecvEnableBatteryNotifications() override {
- // We give all content battery-status permission.
- hal::RegisterBatteryObserver(this);
- return true;
- }
-
- virtual bool
- RecvDisableBatteryNotifications() override {
- hal::UnregisterBatteryObserver(this);
- return true;
- }
-
- virtual bool
- RecvGetCurrentBatteryInformation(BatteryInformation* aBatteryInfo) override {
- // We give all content battery-status permission.
- hal::GetCurrentBatteryInformation(aBatteryInfo);
- return true;
- }
-
- void Notify(const BatteryInformation& aBatteryInfo) override {
- Unused << SendNotifyBatteryChange(aBatteryInfo);
- }
-
- virtual bool
RecvEnableNetworkNotifications() override {
// We give all content access to this network-status information.
hal::RegisterNetworkObserver(this);
@@ -769,12 +724,6 @@ public:
}
virtual bool
- RecvNotifyBatteryChange(const BatteryInformation& aBatteryInfo) override {
- hal::NotifyBatteryChange(aBatteryInfo);
- return true;
- }
-
- virtual bool
RecvNotifySensorChange(const hal::SensorData &aSensorData) override;
virtual bool