Bug 723808 followup: fix shared builds by avoiding use of nsContentUtils::IsSystemPrincipal, r=bz,a=Standard8 for landing in a Thunderbird specific relbranch COMM19228_2012030612_RELBRANCH THUNDERBIRD_3_1_20_BUILD1 THUNDERBIRD_3_1_20_RELEASE
authorGavin Sharp <gavin@gavinsharp.com>
Tue, 06 Mar 2012 11:19:40 -0800
branchCOMM19228_2012030612_RELBRANCH
changeset 35282 85a0f57dd1575587269610518433e954e227642d
parent 35278 b2576dbcd6147b7f671b9f96f61ade0cbb72b855
child 35283 33a4b0ac2e13a5d37bbb76b2cd6d912dae8f5abd
push id2034
push userbugzilla@standard8.plus.com
push dateTue, 06 Mar 2012 20:44:27 +0000
reviewersbz, Standard8
bugs723808
milestone1.9.2.28
Bug 723808 followup: fix shared builds by avoiding use of nsContentUtils::IsSystemPrincipal, r=bz,a=Standard8 for landing in a Thunderbird specific relbranch
docshell/base/nsDocShell.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -8125,20 +8125,27 @@ nsDocShell::GetInheritedPrincipal(PRBool
     }
 
     //-- Get the document's principal
     if (document) {
         nsIPrincipal *docPrincipal = document->NodePrincipal();
 
         // Don't allow loads in typeContent docShells to inherit the system
         // principal from existing documents.
-        if (inheritedFromCurrent &&
-            mItemType == typeContent &&
-            nsContentUtils::IsSystemPrincipal(docPrincipal)) {
-            return nsnull;
+        if (inheritedFromCurrent && mItemType == typeContent) {
+            PRBool isSystem;
+            nsresult rv;
+            nsCOMPtr<nsIScriptSecurityManager> secMan =
+                do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);
+            NS_ENSURE_SUCCESS(rv, nsnull);
+            rv = secMan->IsSystemPrincipal(docPrincipal, &isSystem);
+            NS_ENSURE_SUCCESS(rv, nsnull);
+
+            if (isSystem)
+                return nsnull;
         }
 
         return docPrincipal;
     }
 
     return nsnull;
 }