Bug 1460685 - Remove security.allow_chrome_frames_inside_content case from nsDocument;r=Gijs draft
authorBrian Grinstead <bgrinstead@mozilla.com>
Fri, 11 May 2018 16:25:58 -0700
changeset 794393 99f285fc9a534c8e53dd274056c064819ce0e8c3
parent 793238 76aad17f5b50a1b969eec8cbb5aa9875555640bc
child 794394 1a9c54c9807eaed2645d0ea03b5064ed7472d7a4
push id109681
push userbgrinstead@mozilla.com
push dateFri, 11 May 2018 23:26:16 +0000
reviewersGijs
bugs1460685
milestone62.0a1
Bug 1460685 - Remove security.allow_chrome_frames_inside_content case from nsDocument;r=Gijs This pref will be removed in the following changeset. MozReview-Commit-ID: E9TvPyxAgrf
dom/base/nsDocument.cpp
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -278,20 +278,16 @@ using namespace mozilla;
 using namespace mozilla::dom;
 
 typedef nsTArray<Link*> LinkArray;
 
 static LazyLogModule gDocumentLeakPRLog("DocumentLeak");
 static LazyLogModule gCspPRLog("CSP");
 static LazyLogModule gUserInteractionPRLog("UserInteraction");
 
-static const char kChromeInContentPref[] = "security.allow_chrome_frames_inside_content";
-static bool sChromeInContentAllowed = false;
-static bool sChromeInContentPrefCached = false;
-
 static nsresult
 GetHttpChannelHelper(nsIChannel* aChannel, nsIHttpChannel** aHttpChannel)
 {
   nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aChannel);
   if (httpChannel) {
     httpChannel.forget(aHttpChannel);
     return NS_OK;
   }
@@ -2391,23 +2387,17 @@ nsIDocument::MaybeDowngradePrincipal(nsI
   if (basePrin->Is<ExpandedPrincipal>()) {
     MOZ_DIAGNOSTIC_ASSERT(false, "Should never try to create a document with "
                                  "an expanded principal");
 
     auto* expanded = basePrin->As<ExpandedPrincipal>();
     return do_AddRef(expanded->WhiteList().LastElement());
   }
 
-  if (!sChromeInContentPrefCached) {
-    sChromeInContentPrefCached = true;
-    Preferences::AddBoolVarCache(&sChromeInContentAllowed,
-                                 kChromeInContentPref, false);
-  }
-  if (!sChromeInContentAllowed &&
-      nsContentUtils::IsSystemPrincipal(aPrincipal)) {
+  if (nsContentUtils::IsSystemPrincipal(aPrincipal)) {
     // We basically want the parent document here, but because this is very
     // early in the load, GetParentDocument() returns null, so we use the
     // docshell hierarchy to get this information instead.
     if (mDocumentContainer) {
       nsCOMPtr<nsIDocShellTreeItem> parentDocShellItem;
       mDocumentContainer->GetParent(getter_AddRefs(parentDocShellItem));
       nsCOMPtr<nsIDocShell> parentDocShell = do_QueryInterface(parentDocShellItem);
       if (parentDocShell) {