Bug 671482 - Use the trusted principal to identify the system principal. r=luke.
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 15 Jul 2011 09:52:51 +1000
changeset 72854 2f993221e1906d1adf6a498b087e5a48ce8741e7
parent 72853 54af1e1bda1af69e25302bca1f67c504dc0e1491
child 72855 0d25dd1013375e6019f9fd6649dc069415bc8a58
push id20776
push usereakhgari@mozilla.com
push dateFri, 15 Jul 2011 12:13:35 +0000
treeherdermozilla-central@9349ae9094f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs671482
milestone8.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 671482 - Use the trusted principal to identify the system principal. r=luke.
js/src/jsgc.cpp
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -2873,17 +2873,18 @@ IterateCompartmentsArenasCells(JSContext
 namespace gc {
 
 JSCompartment *
 NewCompartment(JSContext *cx, JSPrincipals *principals)
 {
     JSRuntime *rt = cx->runtime;
     JSCompartment *compartment = cx->new_<JSCompartment>(rt);
     if (compartment && compartment->init()) {
-        compartment->isSystemCompartment = principals && !strcmp(principals->codebase, "[System Principal]");
+        // The trusted compartment is a system compartment.
+        compartment->isSystemCompartment = principals && rt->trustedPrincipals() == principals;
         if (principals) {
             compartment->principals = principals;
             JSPRINCIPALS_HOLD(cx, principals);
         }
 
         compartment->setGCLastBytes(8192, GC_NORMAL);
 
         /*