|
@@ -2,7 +2,7 @@
|
|
# User Makoto Kato <m_kato@ga2.so-net.ne.jp>
|
|
# User Makoto Kato <m_kato@ga2.so-net.ne.jp>
|
|
# Date 1521683202 -32400
|
|
# Date 1521683202 -32400
|
|
# Node ID 6e032627821402c26a1cacf6043ba48c260b409c
|
|
# Node ID 6e032627821402c26a1cacf6043ba48c260b409c
|
|
-# Parent 3b4159eb83aadc9cd4dc23fd9283da12e4b9966a
|
|
|
|
|
|
+# Parent 3805db0d953fcac7cddebddb84992ef219fae425
|
|
Bug 1447873 - Remove Time API backend in hal. r=gsvelto
|
|
Bug 1447873 - Remove Time API backend in hal. r=gsvelto
|
|
|
|
|
|
Time API is already removed, so hal backend is unnecessary now.
|
|
Time API is already removed, so hal backend is unnecessary now.
|
|
@@ -12,18 +12,17 @@ MozReview-Commit-ID: 8R2VRYIX9Vs
|
|
diff --git a/hal/Hal.cpp b/hal/Hal.cpp
|
|
diff --git a/hal/Hal.cpp b/hal/Hal.cpp
|
|
--- a/hal/Hal.cpp
|
|
--- a/hal/Hal.cpp
|
|
+++ b/hal/Hal.cpp
|
|
+++ b/hal/Hal.cpp
|
|
-@@ -377,103 +377,16 @@ GetCurrentBatteryInformation(BatteryInfo
|
|
|
|
- void
|
|
|
|
- NotifyBatteryChange(const BatteryInformation& aInfo)
|
|
|
|
- {
|
|
|
|
|
|
+@@ -334,88 +334,16 @@ void GetCurrentBatteryInformation(Batter
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ void NotifyBatteryChange(const BatteryInformation& aInfo) {
|
|
AssertMainThread();
|
|
AssertMainThread();
|
|
BatteryObservers().CacheInformation(aInfo);
|
|
BatteryObservers().CacheInformation(aInfo);
|
|
BatteryObservers().BroadcastCachedInformation();
|
|
BatteryObservers().BroadcastCachedInformation();
|
|
}
|
|
}
|
|
|
|
|
|
--class SystemClockChangeObserversManager : public ObserversManager<int64_t>
|
|
|
|
--{
|
|
|
|
--protected:
|
|
|
|
|
|
+-class SystemClockChangeObserversManager : public ObserversManager<int64_t> {
|
|
|
|
+- protected:
|
|
- void EnableNotifications() override {
|
|
- void EnableNotifications() override {
|
|
- PROXY_IF_SANDBOXED(EnableSystemClockChangeNotifications());
|
|
- PROXY_IF_SANDBOXED(EnableSystemClockChangeNotifications());
|
|
- }
|
|
- }
|
|
@@ -33,37 +32,29 @@ diff --git a/hal/Hal.cpp b/hal/Hal.cpp
|
|
- }
|
|
- }
|
|
-};
|
|
-};
|
|
-
|
|
-
|
|
--static SystemClockChangeObserversManager&
|
|
|
|
--SystemClockChangeObservers()
|
|
|
|
--{
|
|
|
|
|
|
+-static SystemClockChangeObserversManager& SystemClockChangeObservers() {
|
|
- static SystemClockChangeObserversManager sSystemClockChangeObservers;
|
|
- static SystemClockChangeObserversManager sSystemClockChangeObservers;
|
|
- AssertMainThread();
|
|
- AssertMainThread();
|
|
- return sSystemClockChangeObservers;
|
|
- return sSystemClockChangeObservers;
|
|
-}
|
|
-}
|
|
-
|
|
-
|
|
--void
|
|
|
|
--RegisterSystemClockChangeObserver(SystemClockChangeObserver* aObserver)
|
|
|
|
--{
|
|
|
|
|
|
+-void RegisterSystemClockChangeObserver(SystemClockChangeObserver* aObserver) {
|
|
- AssertMainThread();
|
|
- AssertMainThread();
|
|
- SystemClockChangeObservers().AddObserver(aObserver);
|
|
- SystemClockChangeObservers().AddObserver(aObserver);
|
|
-}
|
|
-}
|
|
-
|
|
-
|
|
--void
|
|
|
|
--UnregisterSystemClockChangeObserver(SystemClockChangeObserver* aObserver)
|
|
|
|
--{
|
|
|
|
|
|
+-void UnregisterSystemClockChangeObserver(SystemClockChangeObserver* aObserver) {
|
|
- AssertMainThread();
|
|
- AssertMainThread();
|
|
- SystemClockChangeObservers().RemoveObserver(aObserver);
|
|
- SystemClockChangeObservers().RemoveObserver(aObserver);
|
|
-}
|
|
-}
|
|
-
|
|
-
|
|
--void
|
|
|
|
--NotifySystemClockChange(const int64_t& aClockDeltaMS)
|
|
|
|
--{
|
|
|
|
|
|
+-void NotifySystemClockChange(const int64_t& aClockDeltaMS) {
|
|
- SystemClockChangeObservers().BroadcastInformation(aClockDeltaMS);
|
|
- SystemClockChangeObservers().BroadcastInformation(aClockDeltaMS);
|
|
-}
|
|
-}
|
|
-
|
|
-
|
|
--class SystemTimezoneChangeObserversManager : public ObserversManager<SystemTimezoneChangeInformation>
|
|
|
|
--{
|
|
|
|
--protected:
|
|
|
|
|
|
+-class SystemTimezoneChangeObserversManager
|
|
|
|
+- : public ObserversManager<SystemTimezoneChangeInformation> {
|
|
|
|
+- protected:
|
|
- void EnableNotifications() override {
|
|
- void EnableNotifications() override {
|
|
- PROXY_IF_SANDBOXED(EnableSystemTimezoneChangeNotifications());
|
|
- PROXY_IF_SANDBOXED(EnableSystemTimezoneChangeNotifications());
|
|
- }
|
|
- }
|
|
@@ -73,53 +64,47 @@ diff --git a/hal/Hal.cpp b/hal/Hal.cpp
|
|
- }
|
|
- }
|
|
-};
|
|
-};
|
|
-
|
|
-
|
|
--static SystemTimezoneChangeObserversManager&
|
|
|
|
--SystemTimezoneChangeObservers()
|
|
|
|
--{
|
|
|
|
|
|
+-static SystemTimezoneChangeObserversManager& SystemTimezoneChangeObservers() {
|
|
- static SystemTimezoneChangeObserversManager sSystemTimezoneChangeObservers;
|
|
- static SystemTimezoneChangeObserversManager sSystemTimezoneChangeObservers;
|
|
- return sSystemTimezoneChangeObservers;
|
|
- return sSystemTimezoneChangeObservers;
|
|
-}
|
|
-}
|
|
-
|
|
-
|
|
--void
|
|
|
|
--RegisterSystemTimezoneChangeObserver(SystemTimezoneChangeObserver* aObserver)
|
|
|
|
--{
|
|
|
|
|
|
+-void RegisterSystemTimezoneChangeObserver(
|
|
|
|
+- SystemTimezoneChangeObserver* aObserver) {
|
|
- AssertMainThread();
|
|
- AssertMainThread();
|
|
- SystemTimezoneChangeObservers().AddObserver(aObserver);
|
|
- SystemTimezoneChangeObservers().AddObserver(aObserver);
|
|
-}
|
|
-}
|
|
-
|
|
-
|
|
--void
|
|
|
|
--UnregisterSystemTimezoneChangeObserver(SystemTimezoneChangeObserver* aObserver)
|
|
|
|
--{
|
|
|
|
|
|
+-void UnregisterSystemTimezoneChangeObserver(
|
|
|
|
+- SystemTimezoneChangeObserver* aObserver) {
|
|
- AssertMainThread();
|
|
- AssertMainThread();
|
|
- SystemTimezoneChangeObservers().RemoveObserver(aObserver);
|
|
- SystemTimezoneChangeObservers().RemoveObserver(aObserver);
|
|
-}
|
|
-}
|
|
-
|
|
-
|
|
--void
|
|
|
|
--NotifySystemTimezoneChange(const SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo)
|
|
|
|
--{
|
|
|
|
|
|
+-void NotifySystemTimezoneChange(
|
|
|
|
+- const SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo) {
|
|
- nsJSUtils::ResetTimeZone();
|
|
- nsJSUtils::ResetTimeZone();
|
|
-- SystemTimezoneChangeObservers().BroadcastInformation(aSystemTimezoneChangeInfo);
|
|
|
|
|
|
+- SystemTimezoneChangeObservers().BroadcastInformation(
|
|
|
|
+- aSystemTimezoneChangeInfo);
|
|
-}
|
|
-}
|
|
-
|
|
-
|
|
--void
|
|
|
|
--AdjustSystemClock(int64_t aDeltaMilliseconds)
|
|
|
|
--{
|
|
|
|
|
|
+-void AdjustSystemClock(int64_t aDeltaMilliseconds) {
|
|
- AssertMainThread();
|
|
- AssertMainThread();
|
|
- PROXY_IF_SANDBOXED(AdjustSystemClock(aDeltaMilliseconds));
|
|
- PROXY_IF_SANDBOXED(AdjustSystemClock(aDeltaMilliseconds));
|
|
-}
|
|
-}
|
|
-
|
|
-
|
|
- void
|
|
|
|
- EnableSensorNotifications(SensorType aSensor) {
|
|
|
|
|
|
+ void EnableSensorNotifications(SensorType aSensor) {
|
|
AssertMainThread();
|
|
AssertMainThread();
|
|
PROXY_IF_SANDBOXED(EnableSensorNotifications(aSensor));
|
|
PROXY_IF_SANDBOXED(EnableSensorNotifications(aSensor));
|
|
}
|
|
}
|
|
|
|
|
|
- void
|
|
|
|
- DisableSensorNotifications(SensorType aSensor) {
|
|
|
|
|
|
+ void DisableSensorNotifications(SensorType aSensor) {
|
|
|
|
+ AssertMainThread();
|
|
|
|
+ PROXY_IF_SANDBOXED(DisableSensorNotifications(aSensor));
|
|
diff --git a/hal/Hal.h b/hal/Hal.h
|
|
diff --git a/hal/Hal.h b/hal/Hal.h
|
|
--- a/hal/Hal.h
|
|
--- a/hal/Hal.h
|
|
+++ b/hal/Hal.h
|
|
+++ b/hal/Hal.h
|
|
-@@ -38,19 +38,16 @@ class nsPIDOMWindowInner;
|
|
|
|
|
|
+@@ -37,19 +37,16 @@ class nsPIDOMWindowInner;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
namespace mozilla {
|
|
namespace mozilla {
|
|
@@ -131,7 +116,7 @@ diff --git a/hal/Hal.h b/hal/Hal.h
|
|
-typedef Observer<int64_t> SystemClockChangeObserver;
|
|
-typedef Observer<int64_t> SystemClockChangeObserver;
|
|
-typedef Observer<SystemTimezoneChangeInformation> SystemTimezoneChangeObserver;
|
|
-typedef Observer<SystemTimezoneChangeInformation> SystemTimezoneChangeObserver;
|
|
-
|
|
-
|
|
- } // namespace hal
|
|
|
|
|
|
+ } // namespace hal
|
|
|
|
|
|
namespace MOZ_HAL_NAMESPACE {
|
|
namespace MOZ_HAL_NAMESPACE {
|
|
|
|
|
|
@@ -139,7 +124,7 @@ diff --git a/hal/Hal.h b/hal/Hal.h
|
|
* Turn the default vibrator device on/off per the pattern specified
|
|
* Turn the default vibrator device on/off per the pattern specified
|
|
* by |pattern|. Each element in the pattern is the number of
|
|
* by |pattern|. Each element in the pattern is the number of
|
|
* milliseconds to turn the vibrator on or off. The first element in
|
|
* milliseconds to turn the vibrator on or off. The first element in
|
|
-@@ -166,63 +163,16 @@ void GetCurrentNetworkInformation(hal::N
|
|
|
|
|
|
+@@ -163,63 +160,16 @@ void GetCurrentNetworkInformation(hal::N
|
|
|
|
|
|
/**
|
|
/**
|
|
* Notify of a change in the network state.
|
|
* Notify of a change in the network state.
|
|
@@ -158,14 +143,14 @@ diff --git a/hal/Hal.h b/hal/Hal.h
|
|
- * @param aObserver The observer that should be added.
|
|
- * @param aObserver The observer that should be added.
|
|
- */
|
|
- */
|
|
-void RegisterSystemClockChangeObserver(
|
|
-void RegisterSystemClockChangeObserver(
|
|
-- hal::SystemClockChangeObserver* aObserver);
|
|
|
|
|
|
+- hal::SystemClockChangeObserver* aObserver);
|
|
-
|
|
-
|
|
-/**
|
|
-/**
|
|
- * Unregister the observer for system clock changed.
|
|
- * Unregister the observer for system clock changed.
|
|
- * @param aObserver The observer that should be removed.
|
|
- * @param aObserver The observer that should be removed.
|
|
- */
|
|
- */
|
|
-void UnregisterSystemClockChangeObserver(
|
|
-void UnregisterSystemClockChangeObserver(
|
|
-- hal::SystemClockChangeObserver* aObserver);
|
|
|
|
|
|
+- hal::SystemClockChangeObserver* aObserver);
|
|
-
|
|
-
|
|
-/**
|
|
-/**
|
|
- * Notify of a change in the system clock.
|
|
- * Notify of a change in the system clock.
|
|
@@ -178,21 +163,21 @@ diff --git a/hal/Hal.h b/hal/Hal.h
|
|
- * @param aObserver The observer that should be added.
|
|
- * @param aObserver The observer that should be added.
|
|
- */
|
|
- */
|
|
-void RegisterSystemTimezoneChangeObserver(
|
|
-void RegisterSystemTimezoneChangeObserver(
|
|
-- hal::SystemTimezoneChangeObserver* aObserver);
|
|
|
|
|
|
+- hal::SystemTimezoneChangeObserver* aObserver);
|
|
-
|
|
-
|
|
-/**
|
|
-/**
|
|
- * Unregister the observer for system timezone changed.
|
|
- * Unregister the observer for system timezone changed.
|
|
- * @param aObserver The observer that should be removed.
|
|
- * @param aObserver The observer that should be removed.
|
|
- */
|
|
- */
|
|
-void UnregisterSystemTimezoneChangeObserver(
|
|
-void UnregisterSystemTimezoneChangeObserver(
|
|
-- hal::SystemTimezoneChangeObserver* aObserver);
|
|
|
|
|
|
+- hal::SystemTimezoneChangeObserver* aObserver);
|
|
-
|
|
-
|
|
-/**
|
|
-/**
|
|
- * Notify of a change in the system timezone.
|
|
- * Notify of a change in the system timezone.
|
|
- * @param aSystemTimezoneChangeInfo
|
|
- * @param aSystemTimezoneChangeInfo
|
|
- */
|
|
- */
|
|
-void NotifySystemTimezoneChange(
|
|
-void NotifySystemTimezoneChange(
|
|
-- const hal::SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo);
|
|
|
|
|
|
+- const hal::SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo);
|
|
-
|
|
-
|
|
-/**
|
|
-/**
|
|
* Enable wake lock notifications from the backend.
|
|
* Enable wake lock notifications from the backend.
|
|
@@ -239,15 +224,15 @@ diff --git a/hal/HalInternal.h b/hal/HalInternal.h
|
|
* messages to hal_sandbox.
|
|
* messages to hal_sandbox.
|
|
*/
|
|
*/
|
|
bool HalChildDestroyed();
|
|
bool HalChildDestroyed();
|
|
- } // namespace MOZ_HAL_NAMESPACE
|
|
|
|
- } // namespace mozilla
|
|
|
|
|
|
+ } // namespace MOZ_HAL_NAMESPACE
|
|
|
|
+ } // namespace mozilla
|
|
|
|
|
|
#endif // mozilla_HalInternal_h
|
|
#endif // mozilla_HalInternal_h
|
|
diff --git a/hal/fallback/FallbackTime.cpp b/hal/fallback/FallbackTime.cpp
|
|
diff --git a/hal/fallback/FallbackTime.cpp b/hal/fallback/FallbackTime.cpp
|
|
deleted file mode 100644
|
|
deleted file mode 100644
|
|
--- a/hal/fallback/FallbackTime.cpp
|
|
--- a/hal/fallback/FallbackTime.cpp
|
|
+++ /dev/null
|
|
+++ /dev/null
|
|
-@@ -1,38 +0,0 @@
|
|
|
|
|
|
+@@ -1,24 +0,0 @@
|
|
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
- * vim: sw=2 ts=8 et :
|
|
- * vim: sw=2 ts=8 et :
|
|
- */
|
|
- */
|
|
@@ -260,42 +245,28 @@ deleted file mode 100644
|
|
-namespace mozilla {
|
|
-namespace mozilla {
|
|
-namespace hal_impl {
|
|
-namespace hal_impl {
|
|
-
|
|
-
|
|
--void
|
|
|
|
--AdjustSystemClock(int64_t aDeltaMilliseconds)
|
|
|
|
--{}
|
|
|
|
|
|
+-void AdjustSystemClock(int64_t aDeltaMilliseconds) {}
|
|
-
|
|
-
|
|
--void
|
|
|
|
--EnableSystemClockChangeNotifications()
|
|
|
|
--{
|
|
|
|
--}
|
|
|
|
|
|
+-void EnableSystemClockChangeNotifications() {}
|
|
-
|
|
-
|
|
--void
|
|
|
|
--DisableSystemClockChangeNotifications()
|
|
|
|
--{
|
|
|
|
--}
|
|
|
|
|
|
+-void DisableSystemClockChangeNotifications() {}
|
|
-
|
|
-
|
|
--void
|
|
|
|
--EnableSystemTimezoneChangeNotifications()
|
|
|
|
--{
|
|
|
|
--}
|
|
|
|
|
|
+-void EnableSystemTimezoneChangeNotifications() {}
|
|
-
|
|
-
|
|
--void
|
|
|
|
--DisableSystemTimezoneChangeNotifications()
|
|
|
|
--{
|
|
|
|
--}
|
|
|
|
|
|
+-void DisableSystemTimezoneChangeNotifications() {}
|
|
-
|
|
-
|
|
--} // namespace hal_impl
|
|
|
|
--} // namespace mozilla
|
|
|
|
|
|
+-} // namespace hal_impl
|
|
|
|
+-} // namespace mozilla
|
|
diff --git a/hal/moz.build b/hal/moz.build
|
|
diff --git a/hal/moz.build b/hal/moz.build
|
|
--- a/hal/moz.build
|
|
--- a/hal/moz.build
|
|
+++ b/hal/moz.build
|
|
+++ b/hal/moz.build
|
|
-@@ -94,17 +94,16 @@ else:
|
|
|
|
- 'fallback/FallbackSensor.cpp',
|
|
|
|
|
|
+@@ -95,17 +95,16 @@ else:
|
|
'fallback/FallbackVibration.cpp',
|
|
'fallback/FallbackVibration.cpp',
|
|
]
|
|
]
|
|
|
|
|
|
- # Fallbacks for backends implemented on Gonk only.
|
|
|
|
|
|
+ # Fallbacks for backends no longer implemented.
|
|
UNIFIED_SOURCES += [
|
|
UNIFIED_SOURCES += [
|
|
|
|
+ 'fallback/FallbackDiskSpaceWatcher.cpp',
|
|
'fallback/FallbackProcessPriority.cpp',
|
|
'fallback/FallbackProcessPriority.cpp',
|
|
'fallback/FallbackThreadPriority.cpp',
|
|
'fallback/FallbackThreadPriority.cpp',
|
|
- 'fallback/FallbackTime.cpp',
|
|
- 'fallback/FallbackTime.cpp',
|
|
@@ -372,90 +343,79 @@ diff --git a/hal/sandbox/PHal.ipdl b/hal/sandbox/PHal.ipdl
|
|
diff --git a/hal/sandbox/SandboxHal.cpp b/hal/sandbox/SandboxHal.cpp
|
|
diff --git a/hal/sandbox/SandboxHal.cpp b/hal/sandbox/SandboxHal.cpp
|
|
--- a/hal/sandbox/SandboxHal.cpp
|
|
--- a/hal/sandbox/SandboxHal.cpp
|
|
+++ b/hal/sandbox/SandboxHal.cpp
|
|
+++ b/hal/sandbox/SandboxHal.cpp
|
|
-@@ -132,46 +132,16 @@ LockScreenOrientation(const dom::ScreenO
|
|
|
|
-
|
|
|
|
- void
|
|
|
|
- UnlockScreenOrientation()
|
|
|
|
- {
|
|
|
|
- Hal()->SendUnlockScreenOrientation();
|
|
|
|
|
|
+@@ -91,36 +91,16 @@ void GetCurrentScreenConfiguration(Scree
|
|
|
|
+ bool LockScreenOrientation(const dom::ScreenOrientationInternal& aOrientation) {
|
|
|
|
+ bool allowed;
|
|
|
|
+ Hal()->SendLockScreenOrientation(aOrientation, &allowed);
|
|
|
|
+ return allowed;
|
|
}
|
|
}
|
|
|
|
|
|
- void
|
|
|
|
--AdjustSystemClock(int64_t aDeltaMilliseconds)
|
|
|
|
--{
|
|
|
|
|
|
+ void UnlockScreenOrientation() { Hal()->SendUnlockScreenOrientation(); }
|
|
|
|
+
|
|
|
|
+-void AdjustSystemClock(int64_t aDeltaMilliseconds) {
|
|
- Hal()->SendAdjustSystemClock(aDeltaMilliseconds);
|
|
- Hal()->SendAdjustSystemClock(aDeltaMilliseconds);
|
|
-}
|
|
-}
|
|
-
|
|
-
|
|
--void
|
|
|
|
--EnableSystemClockChangeNotifications()
|
|
|
|
--{
|
|
|
|
|
|
+-void EnableSystemClockChangeNotifications() {
|
|
- Hal()->SendEnableSystemClockChangeNotifications();
|
|
- Hal()->SendEnableSystemClockChangeNotifications();
|
|
-}
|
|
-}
|
|
-
|
|
-
|
|
--void
|
|
|
|
--DisableSystemClockChangeNotifications()
|
|
|
|
--{
|
|
|
|
|
|
+-void DisableSystemClockChangeNotifications() {
|
|
- Hal()->SendDisableSystemClockChangeNotifications();
|
|
- Hal()->SendDisableSystemClockChangeNotifications();
|
|
-}
|
|
-}
|
|
-
|
|
-
|
|
--void
|
|
|
|
--EnableSystemTimezoneChangeNotifications()
|
|
|
|
--{
|
|
|
|
|
|
+-void EnableSystemTimezoneChangeNotifications() {
|
|
- Hal()->SendEnableSystemTimezoneChangeNotifications();
|
|
- Hal()->SendEnableSystemTimezoneChangeNotifications();
|
|
-}
|
|
-}
|
|
-
|
|
-
|
|
--void
|
|
|
|
--DisableSystemTimezoneChangeNotifications()
|
|
|
|
--{
|
|
|
|
|
|
+-void DisableSystemTimezoneChangeNotifications() {
|
|
- Hal()->SendDisableSystemTimezoneChangeNotifications();
|
|
- Hal()->SendDisableSystemTimezoneChangeNotifications();
|
|
-}
|
|
-}
|
|
-
|
|
-
|
|
--void
|
|
|
|
- EnableSensorNotifications(SensorType aSensor) {
|
|
|
|
|
|
+ void EnableSensorNotifications(SensorType aSensor) {
|
|
Hal()->SendEnableSensorNotifications(aSensor);
|
|
Hal()->SendEnableSensorNotifications(aSensor);
|
|
}
|
|
}
|
|
|
|
|
|
- void
|
|
|
|
- DisableSensorNotifications(SensorType aSensor) {
|
|
|
|
|
|
+ void DisableSensorNotifications(SensorType aSensor) {
|
|
Hal()->SendDisableSensorNotifications(aSensor);
|
|
Hal()->SendDisableSensorNotifications(aSensor);
|
|
}
|
|
}
|
|
-@@ -251,35 +221,31 @@ SetThreadPriority(PlatformThreadId aThre
|
|
|
|
|
|
+
|
|
|
|
+@@ -182,32 +162,28 @@ void StopDiskSpaceWatcher() {
|
|
|
|
+ MOZ_CRASH("StopDiskSpaceWatcher() can't be called from sandboxed contexts.");
|
|
}
|
|
}
|
|
|
|
|
|
- class HalParent : public PHalParent
|
|
|
|
- , public BatteryObserver
|
|
|
|
- , public NetworkObserver
|
|
|
|
- , public ISensorObserver
|
|
|
|
- , public WakeLockObserver
|
|
|
|
- , public ScreenConfigurationObserver
|
|
|
|
-- , public SystemClockChangeObserver
|
|
|
|
-- , public SystemTimezoneChangeObserver
|
|
|
|
- {
|
|
|
|
- public:
|
|
|
|
- virtual void
|
|
|
|
- ActorDestroy(ActorDestroyReason aWhy) override
|
|
|
|
- {
|
|
|
|
|
|
+ class HalParent : public PHalParent,
|
|
|
|
+ public BatteryObserver,
|
|
|
|
+ public NetworkObserver,
|
|
|
|
+ public ISensorObserver,
|
|
|
|
+ public WakeLockObserver,
|
|
|
|
+- public ScreenConfigurationObserver,
|
|
|
|
+- public SystemClockChangeObserver,
|
|
|
|
+- public SystemTimezoneChangeObserver {
|
|
|
|
++ public ScreenConfigurationObserver {
|
|
|
|
+ public:
|
|
|
|
+ virtual void ActorDestroy(ActorDestroyReason aWhy) override {
|
|
// NB: you *must* unconditionally unregister your observer here,
|
|
// NB: you *must* unconditionally unregister your observer here,
|
|
// if it *may* be registered below.
|
|
// if it *may* be registered below.
|
|
hal::UnregisterBatteryObserver(this);
|
|
hal::UnregisterBatteryObserver(this);
|
|
hal::UnregisterNetworkObserver(this);
|
|
hal::UnregisterNetworkObserver(this);
|
|
hal::UnregisterScreenConfigurationObserver(this);
|
|
hal::UnregisterScreenConfigurationObserver(this);
|
|
- for (int32_t sensor = SENSOR_UNKNOWN + 1;
|
|
|
|
- sensor < NUM_SENSOR_TYPE; ++sensor) {
|
|
|
|
- hal::UnregisterSensorObserver(SensorType(sensor), this);
|
|
|
|
|
|
+ for (auto sensor : MakeEnumeratedRange(NUM_SENSOR_TYPE)) {
|
|
|
|
+ hal::UnregisterSensorObserver(sensor, this);
|
|
}
|
|
}
|
|
hal::UnregisterWakeLockObserver(this);
|
|
hal::UnregisterWakeLockObserver(this);
|
|
- hal::UnregisterSystemClockChangeObserver(this);
|
|
- hal::UnregisterSystemClockChangeObserver(this);
|
|
- hal::UnregisterSystemTimezoneChangeObserver(this);
|
|
- hal::UnregisterSystemTimezoneChangeObserver(this);
|
|
}
|
|
}
|
|
|
|
|
|
- virtual mozilla::ipc::IPCResult
|
|
|
|
- RecvVibrate(InfallibleTArray<unsigned int>&& pattern,
|
|
|
|
- InfallibleTArray<uint64_t>&& id,
|
|
|
|
- PBrowserParent *browserParent) override
|
|
|
|
- {
|
|
|
|
|
|
+ virtual mozilla::ipc::IPCResult RecvVibrate(
|
|
|
|
+ InfallibleTArray<unsigned int>&& pattern, InfallibleTArray<uint64_t>&& id,
|
|
|
|
+ PBrowserParent* browserParent) override {
|
|
// We give all content vibration permission.
|
|
// We give all content vibration permission.
|
|
-@@ -386,51 +352,16 @@ public:
|
|
|
|
|
|
+ // TabParent *tabParent = TabParent::GetFrom(browserParent);
|
|
|
|
+ /* xxxkhuey wtf
|
|
|
|
+@@ -303,46 +279,16 @@ class HalParent : public PHalParent,
|
|
|
|
+ hal::UnlockScreenOrientation();
|
|
return IPC_OK();
|
|
return IPC_OK();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -463,103 +423,96 @@ diff --git a/hal/sandbox/SandboxHal.cpp b/hal/sandbox/SandboxHal.cpp
|
|
Unused << SendNotifyScreenConfigurationChange(aScreenConfiguration);
|
|
Unused << SendNotifyScreenConfigurationChange(aScreenConfiguration);
|
|
}
|
|
}
|
|
|
|
|
|
- virtual mozilla::ipc::IPCResult
|
|
|
|
-- RecvAdjustSystemClock(const int64_t &aDeltaMilliseconds) override
|
|
|
|
-- {
|
|
|
|
|
|
+- virtual mozilla::ipc::IPCResult RecvAdjustSystemClock(
|
|
|
|
+- const int64_t& aDeltaMilliseconds) override {
|
|
- hal::AdjustSystemClock(aDeltaMilliseconds);
|
|
- hal::AdjustSystemClock(aDeltaMilliseconds);
|
|
- return IPC_OK();
|
|
- return IPC_OK();
|
|
- }
|
|
- }
|
|
-
|
|
-
|
|
-- virtual mozilla::ipc::IPCResult
|
|
|
|
-- RecvEnableSystemClockChangeNotifications() override
|
|
|
|
-- {
|
|
|
|
|
|
+- virtual mozilla::ipc::IPCResult RecvEnableSystemClockChangeNotifications()
|
|
|
|
+- override {
|
|
- hal::RegisterSystemClockChangeObserver(this);
|
|
- hal::RegisterSystemClockChangeObserver(this);
|
|
- return IPC_OK();
|
|
- return IPC_OK();
|
|
- }
|
|
- }
|
|
-
|
|
-
|
|
-- virtual mozilla::ipc::IPCResult
|
|
|
|
-- RecvDisableSystemClockChangeNotifications() override
|
|
|
|
-- {
|
|
|
|
|
|
+- virtual mozilla::ipc::IPCResult RecvDisableSystemClockChangeNotifications()
|
|
|
|
+- override {
|
|
- hal::UnregisterSystemClockChangeObserver(this);
|
|
- hal::UnregisterSystemClockChangeObserver(this);
|
|
- return IPC_OK();
|
|
- return IPC_OK();
|
|
- }
|
|
- }
|
|
-
|
|
-
|
|
-- virtual mozilla::ipc::IPCResult
|
|
|
|
-- RecvEnableSystemTimezoneChangeNotifications() override
|
|
|
|
-- {
|
|
|
|
|
|
+- virtual mozilla::ipc::IPCResult RecvEnableSystemTimezoneChangeNotifications()
|
|
|
|
+- override {
|
|
- hal::RegisterSystemTimezoneChangeObserver(this);
|
|
- hal::RegisterSystemTimezoneChangeObserver(this);
|
|
- return IPC_OK();
|
|
- return IPC_OK();
|
|
- }
|
|
- }
|
|
-
|
|
-
|
|
-- virtual mozilla::ipc::IPCResult
|
|
|
|
-- RecvDisableSystemTimezoneChangeNotifications() override
|
|
|
|
-- {
|
|
|
|
|
|
+- virtual mozilla::ipc::IPCResult RecvDisableSystemTimezoneChangeNotifications()
|
|
|
|
+- override {
|
|
- hal::UnregisterSystemTimezoneChangeObserver(this);
|
|
- hal::UnregisterSystemTimezoneChangeObserver(this);
|
|
- return IPC_OK();
|
|
- return IPC_OK();
|
|
- }
|
|
- }
|
|
-
|
|
-
|
|
-- virtual mozilla::ipc::IPCResult
|
|
|
|
- RecvEnableSensorNotifications(const SensorType &aSensor) override {
|
|
|
|
|
|
+ virtual mozilla::ipc::IPCResult RecvEnableSensorNotifications(
|
|
|
|
+ const SensorType& aSensor) override {
|
|
// We currently allow any content to register device-sensor
|
|
// We currently allow any content to register device-sensor
|
|
// listeners.
|
|
// listeners.
|
|
hal::RegisterSensorObserver(aSensor, this);
|
|
hal::RegisterSensorObserver(aSensor, this);
|
|
return IPC_OK();
|
|
return IPC_OK();
|
|
}
|
|
}
|
|
|
|
|
|
- virtual mozilla::ipc::IPCResult
|
|
|
|
-@@ -477,26 +408,16 @@ public:
|
|
|
|
|
|
+@@ -382,25 +328,16 @@ class HalParent : public PHalParent,
|
|
|
|
+ const nsString& aTopic, WakeLockInformation* aWakeLockInfo) override {
|
|
hal::GetWakeLockInfo(aTopic, aWakeLockInfo);
|
|
hal::GetWakeLockInfo(aTopic, aWakeLockInfo);
|
|
return IPC_OK();
|
|
return IPC_OK();
|
|
}
|
|
}
|
|
|
|
|
|
- void Notify(const WakeLockInformation& aWakeLockInfo) override
|
|
|
|
- {
|
|
|
|
|
|
+ void Notify(const WakeLockInformation& aWakeLockInfo) override {
|
|
Unused << SendNotifyWakeLockChange(aWakeLockInfo);
|
|
Unused << SendNotifyWakeLockChange(aWakeLockInfo);
|
|
}
|
|
}
|
|
-
|
|
-
|
|
-- void Notify(const int64_t& aClockDeltaMS) override
|
|
|
|
-- {
|
|
|
|
|
|
+- void Notify(const int64_t& aClockDeltaMS) override {
|
|
- Unused << SendNotifySystemClockChange(aClockDeltaMS);
|
|
- Unused << SendNotifySystemClockChange(aClockDeltaMS);
|
|
- }
|
|
- }
|
|
-
|
|
-
|
|
-- void Notify(const SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo) override
|
|
|
|
-- {
|
|
|
|
|
|
+- void Notify(const SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo)
|
|
|
|
+- override {
|
|
- Unused << SendNotifySystemTimezoneChange(aSystemTimezoneChangeInfo);
|
|
- Unused << SendNotifySystemTimezoneChange(aSystemTimezoneChangeInfo);
|
|
- }
|
|
- }
|
|
};
|
|
};
|
|
|
|
|
|
class HalChild : public PHalChild {
|
|
class HalChild : public PHalChild {
|
|
- public:
|
|
|
|
- virtual void
|
|
|
|
- ActorDestroy(ActorDestroyReason aWhy) override
|
|
|
|
- {
|
|
|
|
|
|
+ public:
|
|
|
|
+ virtual void ActorDestroy(ActorDestroyReason aWhy) override {
|
|
sHalChildDestroyed = true;
|
|
sHalChildDestroyed = true;
|
|
-@@ -523,29 +444,16 @@ public:
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+@@ -425,29 +362,16 @@ class HalChild : public PHalChild {
|
|
return IPC_OK();
|
|
return IPC_OK();
|
|
}
|
|
}
|
|
|
|
|
|
- virtual mozilla::ipc::IPCResult
|
|
|
|
- RecvNotifyScreenConfigurationChange(const ScreenConfiguration& aScreenConfiguration) override {
|
|
|
|
|
|
+ virtual mozilla::ipc::IPCResult RecvNotifyScreenConfigurationChange(
|
|
|
|
+ const ScreenConfiguration& aScreenConfiguration) override {
|
|
hal::NotifyScreenConfigurationChange(aScreenConfiguration);
|
|
hal::NotifyScreenConfigurationChange(aScreenConfiguration);
|
|
return IPC_OK();
|
|
return IPC_OK();
|
|
}
|
|
}
|
|
-
|
|
-
|
|
-- virtual mozilla::ipc::IPCResult
|
|
|
|
-- RecvNotifySystemClockChange(const int64_t& aClockDeltaMS) override {
|
|
|
|
|
|
+- virtual mozilla::ipc::IPCResult RecvNotifySystemClockChange(
|
|
|
|
+- const int64_t& aClockDeltaMS) override {
|
|
- hal::NotifySystemClockChange(aClockDeltaMS);
|
|
- hal::NotifySystemClockChange(aClockDeltaMS);
|
|
- return IPC_OK();
|
|
- return IPC_OK();
|
|
- }
|
|
- }
|
|
-
|
|
-
|
|
-- virtual mozilla::ipc::IPCResult
|
|
|
|
-- RecvNotifySystemTimezoneChange(
|
|
|
|
-- const SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo) override {
|
|
|
|
|
|
+- virtual mozilla::ipc::IPCResult RecvNotifySystemTimezoneChange(
|
|
|
|
+- const SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo)
|
|
|
|
+- override {
|
|
- hal::NotifySystemTimezoneChange(aSystemTimezoneChangeInfo);
|
|
- hal::NotifySystemTimezoneChange(aSystemTimezoneChangeInfo);
|
|
- return IPC_OK();
|
|
- return IPC_OK();
|
|
- }
|
|
- }
|
|
};
|
|
};
|
|
|
|
|
|
- mozilla::ipc::IPCResult
|
|
|
|
- HalChild::RecvNotifySensorChange(const hal::SensorData &aSensorData) {
|
|
|
|
|
|
+ mozilla::ipc::IPCResult HalChild::RecvNotifySensorChange(
|
|
|
|
+ const hal::SensorData& aSensorData) {
|
|
hal::NotifySensorChange(aSensorData);
|
|
hal::NotifySensorChange(aSensorData);
|
|
|
|
|
|
return IPC_OK();
|
|
return IPC_OK();
|