mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 668558 - remove JSSecurityCallbacks::subsumePrincipals (r=mrbkap)
--HG-- extra : rebase_source : 6cb1ce1b8f2505ca98235e7ad44138ac5f42737a
This commit is contained in:
parent
591e88416d
commit
ceb8da37c6
@ -3048,7 +3048,6 @@ nsresult nsScriptSecurityManager::Init()
|
||||
|
||||
static const JSSecurityCallbacks securityCallbacks = {
|
||||
CheckObjectAccess,
|
||||
nsJSPrincipals::Subsume,
|
||||
ObjectPrincipalFinder,
|
||||
ContentSecurityPolicyPermitsJSAction
|
||||
};
|
||||
|
@ -15,7 +15,6 @@ ObjectPrincipalsFinder(JSObject *)
|
||||
}
|
||||
|
||||
static const JSSecurityCallbacks seccb = {
|
||||
NULL,
|
||||
NULL,
|
||||
ObjectPrincipalsFinder,
|
||||
NULL
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -4891,7 +4891,6 @@ CheckObjectAccess(JSContext *cx, HandleObject obj, HandleId id, JSAccessMode mod
|
||||
JSSecurityCallbacks securityCallbacks = {
|
||||
CheckObjectAccess,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user