forked from mirrors/gecko-dev
Bug 1447873 - Remove Time API backend in hal. r=gsvelto
Time API is already removed, so hal backend is unnecessary now. MozReview-Commit-ID: 8R2VRYIX9Vs --HG-- extra : rebase_source : 4e927dcf0f0d2a3ae802332fff438985b0be14f1
This commit is contained in:
parent
9ecc515945
commit
6b0532c81c
7 changed files with 0 additions and 303 deletions
87
hal/Hal.cpp
87
hal/Hal.cpp
|
|
@ -388,93 +388,6 @@ NotifyBatteryChange(const BatteryInformation& aInfo)
|
|||
BatteryObservers().BroadcastCachedInformation();
|
||||
}
|
||||
|
||||
class SystemClockChangeObserversManager : public ObserversManager<int64_t>
|
||||
{
|
||||
protected:
|
||||
void EnableNotifications() override {
|
||||
PROXY_IF_SANDBOXED(EnableSystemClockChangeNotifications());
|
||||
}
|
||||
|
||||
void DisableNotifications() override {
|
||||
PROXY_IF_SANDBOXED(DisableSystemClockChangeNotifications());
|
||||
}
|
||||
};
|
||||
|
||||
static SystemClockChangeObserversManager&
|
||||
SystemClockChangeObservers()
|
||||
{
|
||||
static SystemClockChangeObserversManager sSystemClockChangeObservers;
|
||||
AssertMainThread();
|
||||
return sSystemClockChangeObservers;
|
||||
}
|
||||
|
||||
void
|
||||
RegisterSystemClockChangeObserver(SystemClockChangeObserver* aObserver)
|
||||
{
|
||||
AssertMainThread();
|
||||
SystemClockChangeObservers().AddObserver(aObserver);
|
||||
}
|
||||
|
||||
void
|
||||
UnregisterSystemClockChangeObserver(SystemClockChangeObserver* aObserver)
|
||||
{
|
||||
AssertMainThread();
|
||||
SystemClockChangeObservers().RemoveObserver(aObserver);
|
||||
}
|
||||
|
||||
void
|
||||
NotifySystemClockChange(const int64_t& aClockDeltaMS)
|
||||
{
|
||||
SystemClockChangeObservers().BroadcastInformation(aClockDeltaMS);
|
||||
}
|
||||
|
||||
class SystemTimezoneChangeObserversManager : public ObserversManager<SystemTimezoneChangeInformation>
|
||||
{
|
||||
protected:
|
||||
void EnableNotifications() override {
|
||||
PROXY_IF_SANDBOXED(EnableSystemTimezoneChangeNotifications());
|
||||
}
|
||||
|
||||
void DisableNotifications() override {
|
||||
PROXY_IF_SANDBOXED(DisableSystemTimezoneChangeNotifications());
|
||||
}
|
||||
};
|
||||
|
||||
static SystemTimezoneChangeObserversManager&
|
||||
SystemTimezoneChangeObservers()
|
||||
{
|
||||
static SystemTimezoneChangeObserversManager sSystemTimezoneChangeObservers;
|
||||
return sSystemTimezoneChangeObservers;
|
||||
}
|
||||
|
||||
void
|
||||
RegisterSystemTimezoneChangeObserver(SystemTimezoneChangeObserver* aObserver)
|
||||
{
|
||||
AssertMainThread();
|
||||
SystemTimezoneChangeObservers().AddObserver(aObserver);
|
||||
}
|
||||
|
||||
void
|
||||
UnregisterSystemTimezoneChangeObserver(SystemTimezoneChangeObserver* aObserver)
|
||||
{
|
||||
AssertMainThread();
|
||||
SystemTimezoneChangeObservers().RemoveObserver(aObserver);
|
||||
}
|
||||
|
||||
void
|
||||
NotifySystemTimezoneChange(const SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo)
|
||||
{
|
||||
nsJSUtils::ResetTimeZone();
|
||||
SystemTimezoneChangeObservers().BroadcastInformation(aSystemTimezoneChangeInfo);
|
||||
}
|
||||
|
||||
void
|
||||
AdjustSystemClock(int64_t aDeltaMilliseconds)
|
||||
{
|
||||
AssertMainThread();
|
||||
PROXY_IF_SANDBOXED(AdjustSystemClock(aDeltaMilliseconds));
|
||||
}
|
||||
|
||||
void
|
||||
EnableSensorNotifications(SensorType aSensor) {
|
||||
AssertMainThread();
|
||||
|
|
|
|||
50
hal/Hal.h
50
hal/Hal.h
|
|
@ -43,9 +43,6 @@ namespace hal {
|
|||
|
||||
class WindowIdentifier;
|
||||
|
||||
typedef Observer<int64_t> SystemClockChangeObserver;
|
||||
typedef Observer<SystemTimezoneChangeInformation> SystemTimezoneChangeObserver;
|
||||
|
||||
} // namespace hal
|
||||
|
||||
namespace MOZ_HAL_NAMESPACE {
|
||||
|
|
@ -170,53 +167,6 @@ void GetCurrentNetworkInformation(hal::NetworkInformation* aNetworkInfo);
|
|||
*/
|
||||
void NotifyNetworkChange(const hal::NetworkInformation& aNetworkInfo);
|
||||
|
||||
/**
|
||||
* Adjusting system clock.
|
||||
* @param aDeltaMilliseconds The difference compared with current system clock.
|
||||
*/
|
||||
void AdjustSystemClock(int64_t aDeltaMilliseconds);
|
||||
|
||||
/**
|
||||
* Register observer for system clock changed notification.
|
||||
* @param aObserver The observer that should be added.
|
||||
*/
|
||||
void RegisterSystemClockChangeObserver(
|
||||
hal::SystemClockChangeObserver* aObserver);
|
||||
|
||||
/**
|
||||
* Unregister the observer for system clock changed.
|
||||
* @param aObserver The observer that should be removed.
|
||||
*/
|
||||
void UnregisterSystemClockChangeObserver(
|
||||
hal::SystemClockChangeObserver* aObserver);
|
||||
|
||||
/**
|
||||
* Notify of a change in the system clock.
|
||||
* @param aClockDeltaMS
|
||||
*/
|
||||
void NotifySystemClockChange(const int64_t& aClockDeltaMS);
|
||||
|
||||
/**
|
||||
* Register observer for system timezone changed notification.
|
||||
* @param aObserver The observer that should be added.
|
||||
*/
|
||||
void RegisterSystemTimezoneChangeObserver(
|
||||
hal::SystemTimezoneChangeObserver* aObserver);
|
||||
|
||||
/**
|
||||
* Unregister the observer for system timezone changed.
|
||||
* @param aObserver The observer that should be removed.
|
||||
*/
|
||||
void UnregisterSystemTimezoneChangeObserver(
|
||||
hal::SystemTimezoneChangeObserver* aObserver);
|
||||
|
||||
/**
|
||||
* Notify of a change in the system timezone.
|
||||
* @param aSystemTimezoneChangeInfo
|
||||
*/
|
||||
void NotifySystemTimezoneChange(
|
||||
const hal::SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo);
|
||||
|
||||
/**
|
||||
* Enable wake lock notifications from the backend.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -64,26 +64,6 @@ void EnableSwitchNotifications(hal::SwitchDevice aDevice);
|
|||
*/
|
||||
void DisableSwitchNotifications(hal::SwitchDevice aDevice);
|
||||
|
||||
/**
|
||||
* Enable system clock change notifications from the backend.
|
||||
*/
|
||||
void EnableSystemClockChangeNotifications();
|
||||
|
||||
/**
|
||||
* Disable system clock change notifications from the backend.
|
||||
*/
|
||||
void DisableSystemClockChangeNotifications();
|
||||
|
||||
/**
|
||||
* Enable system timezone change notifications from the backend.
|
||||
*/
|
||||
void EnableSystemTimezoneChangeNotifications();
|
||||
|
||||
/**
|
||||
* Disable system timezone change notifications from the backend.
|
||||
*/
|
||||
void DisableSystemTimezoneChangeNotifications();
|
||||
|
||||
/**
|
||||
* Has the child-side HAL IPC object been destroyed? If so, you shouldn't send
|
||||
* messages to hal_sandbox.
|
||||
|
|
|
|||
|
|
@ -1,38 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* vim: sw=2 ts=8 et :
|
||||
*/
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "Hal.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace hal_impl {
|
||||
|
||||
void
|
||||
AdjustSystemClock(int64_t aDeltaMilliseconds)
|
||||
{}
|
||||
|
||||
void
|
||||
EnableSystemClockChangeNotifications()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
DisableSystemClockChangeNotifications()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
EnableSystemTimezoneChangeNotifications()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
DisableSystemTimezoneChangeNotifications()
|
||||
{
|
||||
}
|
||||
|
||||
} // namespace hal_impl
|
||||
} // namespace mozilla
|
||||
|
|
@ -101,7 +101,6 @@ UNIFIED_SOURCES += [
|
|||
'fallback/FallbackProcessPriority.cpp',
|
||||
'fallback/FallbackSwitch.cpp',
|
||||
'fallback/FallbackThreadPriority.cpp',
|
||||
'fallback/FallbackTime.cpp',
|
||||
]
|
||||
|
||||
# Fallbacks for backends implemented on Android only.
|
||||
|
|
|
|||
|
|
@ -61,13 +61,6 @@ struct ScreenConfiguration {
|
|||
uint32_t pixelDepth;
|
||||
};
|
||||
|
||||
struct SystemTimezoneChangeInformation {
|
||||
// These timezone offsets are relative to UTC in minutes and
|
||||
// have already taken daylight saving time (DST) into account.
|
||||
int32_t oldTimezoneOffsetMinutes;
|
||||
int32_t newTimezoneOffsetMinutes;
|
||||
};
|
||||
|
||||
} // namespace hal
|
||||
|
||||
namespace hal_sandbox {
|
||||
|
|
@ -81,8 +74,6 @@ child:
|
|||
async NotifyWakeLockChange(WakeLockInformation aWakeLockInfo);
|
||||
async NotifyScreenConfigurationChange(ScreenConfiguration aScreenOrientation);
|
||||
async NotifySwitchChange(SwitchEvent aEvent);
|
||||
async NotifySystemClockChange(int64_t aClockDeltaMS);
|
||||
async NotifySystemTimezoneChange(SystemTimezoneChangeInformation aSystemTimezoneChangeInfo);
|
||||
|
||||
parent:
|
||||
async Vibrate(uint32_t[] pattern, uint64_t[] id, PBrowser browser);
|
||||
|
|
@ -98,12 +89,6 @@ parent:
|
|||
sync GetCurrentNetworkInformation()
|
||||
returns (NetworkInformation aNetworkInfo);
|
||||
|
||||
async AdjustSystemClock(int64_t aDeltaMilliseconds);
|
||||
async EnableSystemClockChangeNotifications();
|
||||
async DisableSystemClockChangeNotifications();
|
||||
async EnableSystemTimezoneChangeNotifications();
|
||||
async DisableSystemTimezoneChangeNotifications();
|
||||
|
||||
async ModifyWakeLock(nsString aTopic,
|
||||
WakeLockControl aLockAdjust,
|
||||
WakeLockControl aHiddenAdjust,
|
||||
|
|
|
|||
|
|
@ -136,36 +136,6 @@ UnlockScreenOrientation()
|
|||
Hal()->SendUnlockScreenOrientation();
|
||||
}
|
||||
|
||||
void
|
||||
AdjustSystemClock(int64_t aDeltaMilliseconds)
|
||||
{
|
||||
Hal()->SendAdjustSystemClock(aDeltaMilliseconds);
|
||||
}
|
||||
|
||||
void
|
||||
EnableSystemClockChangeNotifications()
|
||||
{
|
||||
Hal()->SendEnableSystemClockChangeNotifications();
|
||||
}
|
||||
|
||||
void
|
||||
DisableSystemClockChangeNotifications()
|
||||
{
|
||||
Hal()->SendDisableSystemClockChangeNotifications();
|
||||
}
|
||||
|
||||
void
|
||||
EnableSystemTimezoneChangeNotifications()
|
||||
{
|
||||
Hal()->SendEnableSystemTimezoneChangeNotifications();
|
||||
}
|
||||
|
||||
void
|
||||
DisableSystemTimezoneChangeNotifications()
|
||||
{
|
||||
Hal()->SendDisableSystemTimezoneChangeNotifications();
|
||||
}
|
||||
|
||||
void
|
||||
EnableSensorNotifications(SensorType aSensor) {
|
||||
Hal()->SendEnableSensorNotifications(aSensor);
|
||||
|
|
@ -278,8 +248,6 @@ class HalParent : public PHalParent
|
|||
, public WakeLockObserver
|
||||
, public ScreenConfigurationObserver
|
||||
, public SwitchObserver
|
||||
, public SystemClockChangeObserver
|
||||
, public SystemTimezoneChangeObserver
|
||||
{
|
||||
public:
|
||||
virtual void
|
||||
|
|
@ -295,8 +263,6 @@ public:
|
|||
hal::UnregisterSensorObserver(SensorType(sensor), this);
|
||||
}
|
||||
hal::UnregisterWakeLockObserver(this);
|
||||
hal::UnregisterSystemClockChangeObserver(this);
|
||||
hal::UnregisterSystemTimezoneChangeObserver(this);
|
||||
for (int32_t switchDevice = SWITCH_DEVICE_UNKNOWN + 1;
|
||||
switchDevice < NUM_SWITCH_DEVICE; ++switchDevice) {
|
||||
hal::UnregisterSwitchObserver(SwitchDevice(switchDevice), this);
|
||||
|
|
@ -416,41 +382,6 @@ public:
|
|||
Unused << SendNotifyScreenConfigurationChange(aScreenConfiguration);
|
||||
}
|
||||
|
||||
virtual mozilla::ipc::IPCResult
|
||||
RecvAdjustSystemClock(const int64_t &aDeltaMilliseconds) override
|
||||
{
|
||||
hal::AdjustSystemClock(aDeltaMilliseconds);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
virtual mozilla::ipc::IPCResult
|
||||
RecvEnableSystemClockChangeNotifications() override
|
||||
{
|
||||
hal::RegisterSystemClockChangeObserver(this);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
virtual mozilla::ipc::IPCResult
|
||||
RecvDisableSystemClockChangeNotifications() override
|
||||
{
|
||||
hal::UnregisterSystemClockChangeObserver(this);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
virtual mozilla::ipc::IPCResult
|
||||
RecvEnableSystemTimezoneChangeNotifications() override
|
||||
{
|
||||
hal::RegisterSystemTimezoneChangeObserver(this);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
virtual mozilla::ipc::IPCResult
|
||||
RecvDisableSystemTimezoneChangeNotifications() override
|
||||
{
|
||||
hal::UnregisterSystemTimezoneChangeObserver(this);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
virtual mozilla::ipc::IPCResult
|
||||
RecvEnableSensorNotifications(const SensorType &aSensor) override {
|
||||
// We currently allow any content to register device-sensor
|
||||
|
|
@ -528,16 +459,6 @@ public:
|
|||
{
|
||||
Unused << SendNotifySwitchChange(aSwitchEvent);
|
||||
}
|
||||
|
||||
void Notify(const int64_t& aClockDeltaMS) override
|
||||
{
|
||||
Unused << SendNotifySystemClockChange(aClockDeltaMS);
|
||||
}
|
||||
|
||||
void Notify(const SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo) override
|
||||
{
|
||||
Unused << SendNotifySystemTimezoneChange(aSystemTimezoneChangeInfo);
|
||||
}
|
||||
};
|
||||
|
||||
class HalChild : public PHalChild {
|
||||
|
|
@ -580,19 +501,6 @@ public:
|
|||
hal::NotifySwitchChange(aEvent);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
virtual mozilla::ipc::IPCResult
|
||||
RecvNotifySystemClockChange(const int64_t& aClockDeltaMS) override {
|
||||
hal::NotifySystemClockChange(aClockDeltaMS);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
virtual mozilla::ipc::IPCResult
|
||||
RecvNotifySystemTimezoneChange(
|
||||
const SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo) override {
|
||||
hal::NotifySystemTimezoneChange(aSystemTimezoneChangeInfo);
|
||||
return IPC_OK();
|
||||
}
|
||||
};
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
|
|
|
|||
Loading…
Reference in a new issue