mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 668558 - remove JSSecurityCallbacks::subsumePrincipals (r=mrbkap)
--HG-- extra : rebase_source : 6cb1ce1b8f2505ca98235e7ad44138ac5f42737a
This commit is contained in:
parent
c0b6a33107
commit
4842917cc6
@ -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