Bug 1340747 - Try to initialize the remote browser when getting the frameloader's loadContext, r=ehsan
authorMichael Layzell <michael@thelayzells.com>
Fri, 24 Feb 2017 16:59:53 -0500
changeset 489619 a932a0a9cffe540eb552d662ad5dd033bdfd43e5
parent 489618 32dce6ccde94a8c11a4de082e330656f1277b60f
child 489620 87cfe603d44d3f82e5af3eefaf5944fd128e591a
push id46871
push userbmo:sledru@mozilla.com
push dateSat, 25 Feb 2017 12:16:21 +0000
reviewersehsan
bugs1340747
milestone54.0a1
Bug 1340747 - Try to initialize the remote browser when getting the frameloader's loadContext, r=ehsan MozReview-Commit-ID: GhCNwG0uMGb
dom/base/nsFrameLoader.cpp
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -3480,17 +3480,18 @@ nsFrameLoader::GetTabParent(nsITabParent
   tp.forget(aTabParent);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsFrameLoader::GetLoadContext(nsILoadContext** aLoadContext)
 {
   nsCOMPtr<nsILoadContext> loadContext;
-  if (mRemoteBrowser) {
+  if (IsRemoteFrame() &&
+      (mRemoteBrowser || TryRemoteBrowser())) {
     loadContext = mRemoteBrowser->GetLoadContext();
   } else {
     nsCOMPtr<nsIDocShell> docShell;
     GetDocShell(getter_AddRefs(docShell));
     loadContext = do_GetInterface(docShell);
   }
   loadContext.forget(aLoadContext);
   return NS_OK;