bug 1072150, backout the release assertion which changed the ancient requirements of nsContentUtils::IsCallerChrome(), a=backout
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Sun, 27 Sep 2015 00:52:26 +0300
changeset 264406 6256ec9113c115141aab089c45ee69438884b680
parent 264405 6457f01e4bcb818060f89c3b80ae0596e1583345
child 264434 6b022a1c49b64fece41a83890561faf6b2615baa
push id29441
push useropettay@mozilla.com
push dateSat, 26 Sep 2015 23:01:55 +0000
treeherdermozilla-central@6256ec9113c1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1072150
milestone44.0a1
first release with
nightly linux32
6256ec9113c1 / 44.0a1 / 20150927030300 / files
nightly linux64
6256ec9113c1 / 44.0a1 / 20150927030300 / files
nightly mac
6256ec9113c1 / 44.0a1 / 20150927030300 / files
nightly win32
6256ec9113c1 / 44.0a1 / 20150927030300 / files
nightly win64
6256ec9113c1 / 44.0a1 / 20150927030300 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1072150, backout the release assertion which changed the ancient requirements of nsContentUtils::IsCallerChrome(), a=backout
dom/base/nsContentUtils.cpp
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -2705,17 +2705,17 @@ nsContentUtils::GenerateStateKey(nsICont
 // static
 nsIPrincipal*
 nsContentUtils::SubjectPrincipal()
 {
   MOZ_ASSERT(IsInitialized());
   MOZ_ASSERT(NS_IsMainThread());
   JSContext* cx = GetCurrentJSContext();
   if (!cx) {
-    MOZ_CRASH("Accessing the Subject Principal without an AutoJSAPI on the stack is forbidden");
+    return GetSystemPrincipal();
   }
 
   JSCompartment *compartment = js::GetContextCompartment(cx);
 
   // When an AutoJSAPI is instantiated, we are in a null compartment until the
   // first JSAutoCompartment, which is kind of a purgatory as far as permissions
   // go. It would be nice to just hard-abort if somebody does a security check
   // in this purgatory zone, but that would be too fragile, since it could be