Bug 1184292 - Remove some Wakelock warning messages when unlocking. r=smaug
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 26 Aug 2015 09:21:00 -0400
changeset 288070 fea87cbeaa6b64510dff835549ed906fe405d558
parent 288069 01e811dbd44d28240f3c1bae9decca4f96a1292c
child 288071 7ee77248182d4d43ebc1a899ad32041beb8a59a2
child 288096 e8ae9c511b505ee733128d3fb227aa92b9ddabb8
child 288102 03dc725619b856a268fd096c1ec2a73341d06024
child 288149 935bd05b494b38c39451ae5f1c661939129f743e
child 288151 2d44a0951c70ebecb6bf8a2c77664fe071ae3c1f
child 288152 2ff8d5b31a1606ff20f17c583765cceb673f6755
child 288187 13cd9ed4b792b79ab7b18d3b008482c6078382d7
child 288314 3110eabd53b6832a3e892cecbb33264059fde30f
child 288435 43efb02089316fc63cd22fb3e136afa1b8f94729
child 326839 bb78c7bdb3b66e629000bf8fd097941fb3571222
push id4792
push useryura.zenevich@gmail.com
push dateWed, 26 Aug 2015 20:00:52 +0000
reviewerssmaug
bugs1184292
milestone43.0a1
Bug 1184292 - Remove some Wakelock warning messages when unlocking. r=smaug CLOSED TREE
dom/base/nsGlobalWindow.cpp
dom/html/HTMLMediaElement.cpp
dom/html/HTMLVideoElement.cpp
dom/media/omx/AudioOffloadPlayer.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -6613,17 +6613,16 @@ nsGlobalWindow::FinishFullscreenChange(b
 
     ErrorResult rv;
     mWakeLock = pmService->NewWakeLock(NS_LITERAL_STRING("DOM_Fullscreen"),
                                        this, rv);
     NS_WARN_IF_FALSE(!rv.Failed(), "Failed to lock the wakelock");
   } else if (mWakeLock && !mFullScreen) {
     ErrorResult rv;
     mWakeLock->Unlock(rv);
-    NS_WARN_IF_FALSE(!rv.Failed(), "Failed to unlock the wakelock.");
     mWakeLock = nullptr;
   }
 }
 
 bool
 nsGlobalWindow::FullScreen() const
 {
   MOZ_ASSERT(IsOuterWindow());
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -2329,17 +2329,16 @@ HTMLMediaElement::WakeLockCreate()
 }
 
 void
 HTMLMediaElement::WakeLockRelease()
 {
   if (mWakeLock) {
     ErrorResult rv;
     mWakeLock->Unlock(rv);
-    NS_WARN_IF_FALSE(!rv.Failed(), "Failed to unlock the wakelock.");
     mWakeLock = nullptr;
   }
 }
 
 bool HTMLMediaElement::ParseAttribute(int32_t aNamespaceID,
                                       nsIAtom* aAttribute,
                                       const nsAString& aValue,
                                       nsAttrValue& aResult)
--- a/dom/html/HTMLVideoElement.cpp
+++ b/dom/html/HTMLVideoElement.cpp
@@ -248,17 +248,16 @@ HTMLVideoElement::WakeLockRelease()
 void
 HTMLVideoElement::UpdateScreenWakeLock()
 {
   bool hidden = OwnerDoc()->Hidden();
 
   if (mScreenWakeLock && (mPaused || hidden)) {
     ErrorResult rv;
     mScreenWakeLock->Unlock(rv);
-    NS_WARN_IF_FALSE(!rv.Failed(), "Failed to unlock the wakelock.");
     mScreenWakeLock = nullptr;
     return;
   }
 
   if (!mScreenWakeLock && !mPaused && !hidden && HasVideo()) {
     nsRefPtr<power::PowerManagerService> pmService =
       power::PowerManagerService::GetInstance();
     NS_ENSURE_TRUE_VOID(pmService);
--- a/dom/media/omx/AudioOffloadPlayer.cpp
+++ b/dom/media/omx/AudioOffloadPlayer.cpp
@@ -740,14 +740,13 @@ void AudioOffloadPlayer::WakeLockCreate(
 
 void AudioOffloadPlayer::WakeLockRelease()
 {
   MOZ_ASSERT(NS_IsMainThread());
   AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("%s", __FUNCTION__));
   if (mWakeLock) {
     ErrorResult rv;
     mWakeLock->Unlock(rv);
-    NS_WARN_IF_FALSE(!rv.Failed(), "Failed to unlock the wakelock.");
     mWakeLock = nullptr;
   }
 }
 
 } // namespace mozilla