bug 1249738 - make sWakeLockObservers a function static r=dhylands
This commit is contained in:
12
hal/Hal.cpp
12
hal/Hal.cpp
@@ -336,7 +336,13 @@ protected:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static WakeLockObserversManager&
|
||||||
|
WakeLockObservers()
|
||||||
|
{
|
||||||
static WakeLockObserversManager sWakeLockObservers;
|
static WakeLockObserversManager sWakeLockObservers;
|
||||||
|
AssertMainThread();
|
||||||
|
return sWakeLockObservers;
|
||||||
|
}
|
||||||
|
|
||||||
class ScreenConfigurationObserversManager : public CachingObserversManager<ScreenConfiguration>
|
class ScreenConfigurationObserversManager : public CachingObserversManager<ScreenConfiguration>
|
||||||
{
|
{
|
||||||
@@ -663,14 +669,14 @@ void
|
|||||||
RegisterWakeLockObserver(WakeLockObserver* aObserver)
|
RegisterWakeLockObserver(WakeLockObserver* aObserver)
|
||||||
{
|
{
|
||||||
AssertMainThread();
|
AssertMainThread();
|
||||||
sWakeLockObservers.AddObserver(aObserver);
|
WakeLockObservers().AddObserver(aObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
UnregisterWakeLockObserver(WakeLockObserver* aObserver)
|
UnregisterWakeLockObserver(WakeLockObserver* aObserver)
|
||||||
{
|
{
|
||||||
AssertMainThread();
|
AssertMainThread();
|
||||||
sWakeLockObservers.RemoveObserver(aObserver);
|
WakeLockObservers().RemoveObserver(aObserver);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -701,7 +707,7 @@ void
|
|||||||
NotifyWakeLockChange(const WakeLockInformation& aInfo)
|
NotifyWakeLockChange(const WakeLockInformation& aInfo)
|
||||||
{
|
{
|
||||||
AssertMainThread();
|
AssertMainThread();
|
||||||
sWakeLockObservers.BroadcastInformation(aInfo);
|
WakeLockObservers().BroadcastInformation(aInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user