зеркало из https://github.com/mozilla/gecko-dev.git
bug 1249738 - make sNetworkObservers a function static r=dhylands
This commit is contained in:
Родитель
34ed828351
Коммит
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()
|
||||
|
|
Загрузка…
Ссылка в новой задаче