зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug 717009 (Inline ListBase<LC>::instanceIsListObject and ListBase<LC>::getListObject). r=bz.
--HG-- extra : rebase_source : 661d5fc98c76506ab6abccd057a0ce1e8cf6b0f8
This commit is contained in:
Родитель
4f1d6f1a15
Коммит
56a33403d0
|
@ -306,19 +306,27 @@ ListBase<LC>::setProtoShape(JSObject *obj, js::Shape *shape)
|
|||
js::SetProxyExtra(obj, JSPROXYSLOT_PROTOSHAPE, PrivateValue(shape));
|
||||
}
|
||||
|
||||
static JSBool
|
||||
UnwrapSecurityWrapper(JSContext *cx, JSObject *obj, JSObject *callee, JSObject **unwrapped)
|
||||
{
|
||||
JS_ASSERT(XPCWrapper::IsSecurityWrapper(obj));
|
||||
|
||||
if (callee && JS_GetGlobalForObject(cx, obj) == JS_GetGlobalForObject(cx, callee)) {
|
||||
*unwrapped = js::UnwrapObject(obj);
|
||||
} else {
|
||||
*unwrapped = XPCWrapper::Unwrap(cx, obj);
|
||||
if (!*unwrapped)
|
||||
return Throw(cx, NS_ERROR_XPC_SECURITY_MANAGER_VETO);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class LC>
|
||||
bool
|
||||
ListBase<LC>::instanceIsListObject(JSContext *cx, JSObject *obj, JSObject *callee)
|
||||
{
|
||||
if (XPCWrapper::IsSecurityWrapper(obj)) {
|
||||
if (callee && JS_GetGlobalForObject(cx, obj) == JS_GetGlobalForObject(cx, callee)) {
|
||||
obj = js::UnwrapObject(obj);
|
||||
} else {
|
||||
obj = XPCWrapper::Unwrap(cx, obj);
|
||||
if (!obj)
|
||||
return Throw(cx, NS_ERROR_XPC_SECURITY_MANAGER_VETO);
|
||||
}
|
||||
}
|
||||
if (XPCWrapper::IsSecurityWrapper(obj) && !UnwrapSecurityWrapper(cx, obj, callee, &obj))
|
||||
return false;
|
||||
|
||||
if (!objIsList(obj)) {
|
||||
// FIXME: Throw a proper DOM exception.
|
||||
|
|
|
@ -246,12 +246,12 @@ public:
|
|||
static bool objIsList(JSObject *obj) {
|
||||
return js::IsProxy(obj) && proxyHandlerIsList(js::GetProxyHandler(obj));
|
||||
}
|
||||
static bool instanceIsListObject(JSContext *cx, JSObject *obj, JSObject *callee);
|
||||
static inline bool instanceIsListObject(JSContext *cx, JSObject *obj, JSObject *callee);
|
||||
virtual bool isInstanceOf(JSObject *prototype)
|
||||
{
|
||||
return js::GetObjectClass(prototype) == &sInterfaceClass;
|
||||
}
|
||||
static ListType *getListObject(JSObject *obj);
|
||||
static inline ListType *getListObject(JSObject *obj);
|
||||
|
||||
static JSObject *getPrototype(JSContext *cx, XPCWrappedNativeScope *scope);
|
||||
static inline bool protoIsClean(JSContext *cx, JSObject *proto, bool *isClean);
|
||||
|
|
Загрузка…
Ссылка в новой задаче