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 174108 5e6f5a0ef9cdb952564d1ff5f610b42da6af6bb2
parent 174107 806ed2a530f9d8269124b46050a0dcfb47447b9d
child 174109 3c57c72b4b6155a332a1036d1390869b13fb832d
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [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);
 }