mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
bug 1249738 - make sNetworkObservers a function static r=dhylands
This commit is contained in:
parent
34ed828351
commit
e7220223eb
18
hal/Hal.cpp
18
hal/Hal.cpp
@ -316,7 +316,13 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
static NetworkObserversManager sNetworkObservers;
|
||||
static NetworkObserversManager&
|
||||
NetworkObservers()
|
||||
{
|
||||
static NetworkObserversManager sNetworkObservers;
|
||||
AssertMainThread();
|
||||
return sNetworkObservers;
|
||||
}
|
||||
|
||||
class WakeLockObserversManager : public ObserversManager<WakeLockInformation>
|
||||
{
|
||||
@ -602,28 +608,28 @@ void
|
||||
RegisterNetworkObserver(NetworkObserver* aObserver)
|
||||
{
|
||||
AssertMainThread();
|
||||
sNetworkObservers.AddObserver(aObserver);
|
||||
NetworkObservers().AddObserver(aObserver);
|
||||
}
|
||||
|
||||
void
|
||||
UnregisterNetworkObserver(NetworkObserver* aObserver)
|
||||
{
|
||||
AssertMainThread();
|
||||
sNetworkObservers.RemoveObserver(aObserver);
|
||||
NetworkObservers().RemoveObserver(aObserver);
|
||||
}
|
||||
|
||||
void
|
||||
GetCurrentNetworkInformation(NetworkInformation* aInfo)
|
||||
{
|
||||
AssertMainThread();
|
||||
*aInfo = sNetworkObservers.GetCurrentInformation();
|
||||
*aInfo = NetworkObservers().GetCurrentInformation();
|
||||
}
|
||||
|
||||
void
|
||||
NotifyNetworkChange(const NetworkInformation& aInfo)
|
||||
{
|
||||
sNetworkObservers.CacheInformation(aInfo);
|
||||
sNetworkObservers.BroadcastCachedInformation();
|
||||
NetworkObservers().CacheInformation(aInfo);
|
||||
NetworkObservers().BroadcastCachedInformation();
|
||||
}
|
||||
|
||||
void Reboot()
|
||||
|
Loading…
Reference in New Issue
Block a user