Bug 668558 - remove JSSecurityCallbacks::subsumePrincipals (r=mrbkap)

--HG--
extra : rebase_source : 6cb1ce1b8f2505ca98235e7ad44138ac5f42737a
This commit is contained in:
Luke Wagner 2012-08-23 09:45:24 -07:00
parent 591e88416d
commit ceb8da37c6
5 changed files with 1 additions and 21 deletions

View File

@ -3048,7 +3048,6 @@ nsresult nsScriptSecurityManager::Init()
static const JSSecurityCallbacks securityCallbacks = {
CheckObjectAccess,
nsJSPrincipals::Subsume,
ObjectPrincipalFinder,
ContentSecurityPolicyPermitsJSAction
};

View File

@ -15,7 +15,6 @@ ObjectPrincipalsFinder(JSObject *)
}
static const JSSecurityCallbacks seccb = {
NULL,
NULL,
ObjectPrincipalsFinder,
NULL

View File

@ -1997,9 +1997,6 @@ typedef JSBool
typedef void
(* JSDestroyPrincipalsOp)(JSPrincipals *principals);
typedef JSBool
(* JSSubsumePrincipalsOp)(JSPrincipals *principals1, JSPrincipals *principals2);
/*
* Return a weak reference to the principals associated with obj, possibly via
* the immutable parent chain leading from obj to a top-level container (e.g.,
@ -4911,7 +4908,6 @@ JS_DropPrincipals(JSRuntime *rt, JSPrincipals *principals);
struct JSSecurityCallbacks {
JSCheckAccessOp checkObjectAccess;
JSSubsumePrincipalsOp subsumePrincipals;
JSObjectPrincipalsFinder findObjectPrincipals;
JSCSPEvalChecker contentSecurityPolicyAllows;
};

View File

@ -661,25 +661,12 @@ obj_watch_handler(JSContext *cx, JSObject *obj_, jsid id_, jsval old,
RootedObject obj(cx, obj_);
RootedId id(cx, id_);
JSObject *callable = (JSObject *) closure;
if (JSSubsumePrincipalsOp subsume = cx->runtime->securityCallbacks->subsumePrincipals) {
if (JSPrincipals *watcher = callable->principals(cx)) {
if (JSObject *scopeChain = cx->stack.currentScriptedScopeChain()) {
if (JSPrincipals *subject = scopeChain->principals(cx)) {
if (!subsume(watcher, subject)) {
/* Silently don't call the watch handler. */
return true;
}
}
}
}
}
/* Avoid recursion on (obj, id) already being watched on cx. */
AutoResolving resolving(cx, obj, id, AutoResolving::WATCH);
if (resolving.alreadyStarted())
return true;
JSObject *callable = (JSObject *)closure;
Value argv[] = { IdToValue(id), old, *nvp };
return Invoke(cx, ObjectValue(*obj), ObjectOrNullValue(callable), ArrayLength(argv), argv, nvp);
}

View File

@ -4891,7 +4891,6 @@ CheckObjectAccess(JSContext *cx, HandleObject obj, HandleId id, JSAccessMode mod
JSSecurityCallbacks securityCallbacks = {
CheckObjectAccess,
NULL,
NULL,
NULL
};