Bug 1177399 - patch 3 - AudioChannelAgent should not be initialized without a valid top-window, CLOSED TREE
authorAndrea Marchesini <amarchesini@mozilla.com>
Fri, 17 Jul 2015 18:29:44 +0100
changeset 253520 37a7604e5e1e3b3ebb0de6c98f5b7e9ec6c0a75c
parent 253519 9a5dd877fb8ee9acbd9635d592b446d9b67b9bd7
child 253521 5b4a4d8e5a801ba292c589d0d47c4b30971b8448
push id29067
push userkwierso@gmail.com
push dateSat, 18 Jul 2015 00:57:04 +0000
treeherdermozilla-central@e2f2eb9ecca0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1177399
milestone42.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 1177399 - patch 3 - AudioChannelAgent should not be initialized without a valid top-window, CLOSED TREE
dom/audiochannel/AudioChannelAgent.cpp
--- a/dom/audiochannel/AudioChannelAgent.cpp
+++ b/dom/audiochannel/AudioChannelAgent.cpp
@@ -100,24 +100,20 @@ AudioChannelAgent::InitInternal(nsIDOMWi
       aChannelType > AUDIO_AGENT_CHANNEL_PUBLICNOTIFICATION ||
       aChannelType < AUDIO_AGENT_CHANNEL_NORMAL) {
     return NS_ERROR_FAILURE;
   }
 
   if (aWindow) {
     nsCOMPtr<nsIDOMWindow> topWindow;
     aWindow->GetScriptableTop(getter_AddRefs(topWindow));
-    MOZ_ASSERT(topWindow);
-
     mWindow = do_QueryInterface(topWindow);
-    if (!mWindow) {
-      return NS_ERROR_FAILURE;
+    if (mWindow) {
+      mWindow = mWindow->GetOuterWindow();
     }
-
-    mWindow = mWindow->GetOuterWindow();
   }
 
   mAudioChannelType = aChannelType;
 
   if (aUseWeakRef) {
     mWeakCallback = do_GetWeakReference(aCallback);
   } else {
     mCallback = aCallback;