Bug 944130 - test_speakermanager.html: ASSERTION: background state is only maintained on outer windows. r=amarchesini
authorRandy Lin <rlin@mozilla.com>
Sun, 01 Dec 2013 13:23:00 +0800
changeset 173134 5e6f5a0ef9cdb952564d1ff5f610b42da6af6bb2
parent 173133 806ed2a530f9d8269124b46050a0dcfb47447b9d
child 173135 3c57c72b4b6155a332a1036d1390869b13fb832d
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersamarchesini
bugs944130
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 944130 - test_speakermanager.html: ASSERTION: background state is only maintained on outer windows. r=amarchesini
dom/speakermanager/SpeakerManager.cpp
--- a/dom/speakermanager/SpeakerManager.cpp
+++ b/dom/speakermanager/SpeakerManager.cpp
@@ -105,20 +105,22 @@ SpeakerManager::DispatchSimpleEvent(cons
     NS_ERROR("Failed to dispatch the event!!!");
     return;
   }
 }
 
 void
 SpeakerManager::Init(nsPIDOMWindow* aWindow)
 {
-  BindToOwner(aWindow->IsOuterWindow() ?
-    aWindow->GetCurrentInnerWindow() : aWindow);
+  BindToOwner(aWindow);
 
-  mVisible = !GetOwner()->IsBackground();
+  nsCOMPtr<nsIDocShell> docshell = do_GetInterface(GetOwner());
+  NS_ENSURE_TRUE_VOID(docshell);
+  docshell->GetIsActive(&mVisible);
+
   nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(GetOwner());
   NS_ENSURE_TRUE_VOID(target);
 
   target->AddSystemEventListener(NS_LITERAL_STRING("visibilitychange"),
                                  this,
                                  /* useCapture = */ true,
                                  /* wantsUntrusted = */ false);
 }