Bug 1084504 - fix Mixed Content Blocking for redirects in e10s. r=mrbkap
authorTanvi Vyas <tanvi@mozilla.com>
Thu, 19 Feb 2015 17:01:04 -0800
changeset 229939 f835c33057fd491c2d88430102938bf48d27b1c9
parent 229938 2144c24dfa0169e3c3e44e22a2f13d6f9e92323b
child 229940 e3ecf5768337ab6b9d0d23d92de10fb1d0e2ba3c
push id55845
push usertvyas@mozilla.com
push dateFri, 20 Feb 2015 01:01:34 +0000
treeherdermozilla-inbound@e3ecf5768337 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs1084504
milestone38.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 1084504 - fix Mixed Content Blocking for redirects in e10s. r=mrbkap
dom/security/nsMixedContentBlocker.cpp
--- a/dom/security/nsMixedContentBlocker.cpp
+++ b/dom/security/nsMixedContentBlocker.cpp
@@ -14,16 +14,17 @@
 #include "nsIWebProgressListener.h"
 #include "nsContentUtils.h"
 #include "nsNetUtil.h"
 #include "nsIRequest.h"
 #include "nsIDocument.h"
 #include "nsIContentViewer.h"
 #include "nsIChannel.h"
 #include "nsIHttpChannel.h"
+#include "nsIParentChannel.h"
 #include "mozilla/Preferences.h"
 #include "nsIScriptObjectPrincipal.h"
 #include "nsISecureBrowserUI.h"
 #include "nsIDocumentLoader.h"
 #include "nsIWebNavigation.h"
 #include "nsLoadGroup.h"
 #include "nsIScriptError.h"
 #include "nsIURI.h"
@@ -209,16 +210,26 @@ nsMixedContentBlocker::AsyncOnChannelRed
 {
   nsAsyncRedirectAutoCallback autoCallback(aCallback);
 
   if (!aOldChannel) {
     NS_ERROR("No channel when evaluating mixed content!");
     return NS_ERROR_FAILURE;
   }
 
+  // If we are in the parent process in e10s, we don't have access to the
+  // document node, and hence ShouldLoad will fail when we try to get
+  // the docShell.  If that's the case, ignore mixed content checks
+  // on redirects in the parent.  Let the child check for mixed content.
+  nsCOMPtr<nsIParentChannel> is_ipc_channel;
+  NS_QueryNotificationCallbacks(aNewChannel, is_ipc_channel);
+  if (is_ipc_channel) {
+    return NS_OK;
+  }
+
   nsresult rv;
   nsCOMPtr<nsIURI> oldUri;
   rv = aOldChannel->GetURI(getter_AddRefs(oldUri));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIURI> newUri;
   rv = aNewChannel->GetURI(getter_AddRefs(newUri));
   NS_ENSURE_SUCCESS(rv, rv);