From 23b6d162d15a43c2d3af84c2721ff0119a382812 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Mon, 7 Apr 2014 22:42:19 -0700 Subject: [PATCH] Back out a28cd2a8b397 (bug 992105) for Windows build bustage --- widget/windows/nsAppShell.cpp | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/widget/windows/nsAppShell.cpp b/widget/windows/nsAppShell.cpp index 373acfe9f917..422850512bdd 100644 --- a/widget/windows/nsAppShell.cpp +++ b/widget/windows/nsAppShell.cpp @@ -18,7 +18,6 @@ #include "nsIDOMWakeLockListener.h" #include "nsIPowerManagerService.h" #include "mozilla/StaticPtr.h" -#include "nsTHashtable.h" #include "GeckoProfiler.h" using namespace mozilla; @@ -33,33 +32,15 @@ public: private: NS_IMETHOD Callback(const nsAString& aTopic, const nsAString& aState) { - bool isLocked = mLockedTopics.Contains(aTopic); - bool shouldLock = aState.Equals(NS_LITERAL_STRING("locked-foreground")); - if (isLocked == shouldLock) { - return NS_OK; - } - if (shouldLock) { - if (!mLockedTopics.Count()) { - // This is the first topic to request the screen saver be disabled. - // Prevent screen saver. - SetThreadExecutionState(ES_DISPLAY_REQUIRED|ES_CONTINUOUS); - } - mLockedTopics.PutEntry(aTopic); + if (aState.Equals(NS_LITERAL_STRING("locked-foreground"))) { + // Prevent screen saver. + SetThreadExecutionState(ES_DISPLAY_REQUIRED|ES_CONTINUOUS); } else { - mLockedTopics.RemoveEntry(aTopic); - if (!mLockedTopics.Count()) { - // No other outstanding topics have requested screen saver be disabled. - // Re-enable screen saver. - SetThreadExecutionState(ES_CONTINUOUS); - } + // Re-enable screen saver. + SetThreadExecutionState(ES_CONTINUOUS); } return NS_OK; } - - // Keep track of all the topics that have requested a wake lock. When the - // number of topics in the hashtable reaches zero, we can uninhibit the - // screensaver again. - nsTHashtable mLockedTopics; }; NS_IMPL_ISUPPORTS1(WinWakeLockListener, nsIDOMMozWakeLockListener)