Bug 1183301 - GetAllowedAudioChannels should not throw an exception if nsIFrameElement is not ready. r=baku
authorAlastor Wu <alwu@mozilla.com>
Thu, 16 Jul 2015 10:19:55 +0800
changeset 253533 c1bae5ba297f4ce1f70e7b2be5dcf5655edc32d1
parent 253532 f33885b678061820d2b87607ec1a00a7536a82a4
child 253534 6df67b9d7bdf7f778a44e9cdf5ef220c65ee9832
push id29068
push userkwierso@gmail.com
push dateSat, 18 Jul 2015 01:07:16 +0000
treeherdermozilla-central@d317a93e5161 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1183301
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 1183301 - GetAllowedAudioChannels should not throw an exception if nsIFrameElement is not ready. r=baku
dom/html/nsBrowserElement.cpp
--- a/dom/html/nsBrowserElement.cpp
+++ b/dom/html/nsBrowserElement.cpp
@@ -498,18 +498,17 @@ nsBrowserElement::GetAllowedAudioChannel
                  nsTArray<nsRefPtr<BrowserElementAudioChannel>>& aAudioChannels,
                  ErrorResult& aRv)
 {
   aAudioChannels.Clear();
 
   // If empty, it means that this is the first call of this method.
   if (mBrowserElementAudioChannels.IsEmpty()) {
     nsCOMPtr<nsIFrameLoader> frameLoader = GetFrameLoader();
-    if (!frameLoader) {
-      aRv.Throw(NS_ERROR_FAILURE);
+    if (NS_WARN_IF(!frameLoader)) {
       return;
     }
 
     bool isBrowserOrApp;
     aRv = frameLoader->GetOwnerIsBrowserOrAppFrame(&isBrowserOrApp);
     if (NS_WARN_IF(aRv.Failed())) {
       return;
     }