bug 1249738 - make sWakeLockObservers a function static r=dhylands

This commit is contained in:
Trevor Saunders 2016-02-19 11:37:34 -05:00
parent fcc029f7be
commit 6a081240f6

View File

@ -336,7 +336,13 @@ protected:
}
};
static WakeLockObserversManager sWakeLockObservers;
static WakeLockObserversManager&
WakeLockObservers()
{
static WakeLockObserversManager sWakeLockObservers;
AssertMainThread();
return sWakeLockObservers;
}
class ScreenConfigurationObserversManager : public CachingObserversManager<ScreenConfiguration>
{
@ -663,14 +669,14 @@ void
RegisterWakeLockObserver(WakeLockObserver* aObserver)
{
AssertMainThread();
sWakeLockObservers.AddObserver(aObserver);
WakeLockObservers().AddObserver(aObserver);
}
void
UnregisterWakeLockObserver(WakeLockObserver* aObserver)
{
AssertMainThread();
sWakeLockObservers.RemoveObserver(aObserver);
WakeLockObservers().RemoveObserver(aObserver);
}
void
@ -701,7 +707,7 @@ void
NotifyWakeLockChange(const WakeLockInformation& aInfo)
{
AssertMainThread();
sWakeLockObservers.BroadcastInformation(aInfo);
WakeLockObservers().BroadcastInformation(aInfo);
}
void