bug 1249738 - make sNetworkObservers a function static r=dhylands

This commit is contained in:
Trevor Saunders 2016-02-19 11:28:00 -05:00
Родитель 34ed828351
Коммит e7220223eb
1 изменённых файлов: 12 добавлений и 6 удалений

Просмотреть файл

@ -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()