Backed out changeset 5d9fb147f723 (bug 979481)

This commit is contained in:
Carsten "Tomcat" Book 2014-03-10 12:31:35 +01:00
parent c5cb46f60a
commit 6fff26dc1e

View File

@ -79,17 +79,17 @@ XPCJSContextStack::Push(JSContext *cx)
if ((e.cx == cx) && ssm) {
// DOM JSContexts don't store their default compartment object on
// the cx, so in those cases we need to fetch it via the scx
// instead. And in some cases (i.e. the SafeJSContext), we have no
// default compartment object at all.
// instead.
RootedObject defaultScope(cx, GetDefaultScopeFromJSContext(cx));
if (defaultScope) {
nsIPrincipal *currentPrincipal =
GetCompartmentPrincipal(js::GetContextCompartment(cx));
nsIPrincipal *defaultPrincipal = GetObjectPrincipal(defaultScope);
if (currentPrincipal->Equals(defaultPrincipal)) {
mStack.AppendElement(cx);
return true;
}
nsIPrincipal *currentPrincipal =
GetCompartmentPrincipal(js::GetContextCompartment(cx));
nsIPrincipal *defaultPrincipal = GetObjectPrincipal(defaultScope);
bool equal = false;
currentPrincipal->Equals(defaultPrincipal, &equal);
if (equal) {
mStack.AppendElement(cx);
return true;
}
}