зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1635577 - add wakelog log. r=spohl,karlt
Differential Revision: https://phabricator.services.mozilla.com/D73949
This commit is contained in:
Родитель
b8809d1e54
Коммит
635e073f6f
|
@ -83,6 +83,8 @@ class MacWakeLockListener final : public nsIDOMMozWakeLockListener {
|
|||
shouldKeepDisplayOn ? kIOPMAssertionTypeNoDisplaySleep : kIOPMAssertionTypeNoIdleSleep;
|
||||
IOPMAssertionID& assertionId =
|
||||
shouldKeepDisplayOn ? mAssertionNoDisplaySleepID : mAssertionNoIdleSleepID;
|
||||
WAKE_LOCK_LOG("topic=%s, shouldKeepDisplayOn=%d", NS_ConvertUTF16toUTF8(aTopic).get(),
|
||||
shouldKeepDisplayOn);
|
||||
|
||||
// Note the wake lock code ensures that we're not sent duplicate
|
||||
// "locked-foreground" notifications when multiple wake locks are held.
|
||||
|
|
|
@ -42,6 +42,10 @@ NS_IMPL_ISUPPORTS(WakeLockListener, nsIDOMMozWakeLockListener)
|
|||
|
||||
StaticRefPtr<WakeLockListener> WakeLockListener::sSingleton;
|
||||
|
||||
# define WAKE_LOCK_LOG(...) \
|
||||
MOZ_LOG(gLinuxWakeLockLog, mozilla::LogLevel::Debug, (__VA_ARGS__))
|
||||
static mozilla::LazyLogModule gLinuxWakeLockLog("LinuxWakeLock");
|
||||
|
||||
enum DesktopEnvironment {
|
||||
FreeDesktop,
|
||||
GNOME,
|
||||
|
@ -484,6 +488,8 @@ nsresult WakeLockListener::Callback(const nsAString& topic,
|
|||
|
||||
// Treat "locked-background" the same as "unlocked" on desktop linux.
|
||||
bool shouldLock = state.EqualsLiteral("locked-foreground");
|
||||
WAKE_LOCK_LOG("topic=%s, shouldLock=%d", NS_ConvertUTF16toUTF8(topic).get(),
|
||||
shouldLock);
|
||||
|
||||
return shouldLock ? topicLock->InhibitScreensaver()
|
||||
: topicLock->UninhibitScreensaver();
|
||||
|
|
Загрузка…
Ссылка в новой задаче