diff --git a/js/xpconnect/src/xpcpublic.h b/js/xpconnect/src/xpcpublic.h index d233f50ce245..9d7017736f38 100644 --- a/js/xpconnect/src/xpcpublic.h +++ b/js/xpconnect/src/xpcpublic.h @@ -141,23 +141,6 @@ IsXrayWrapper(JSObject* obj); JSObject* XrayAwareCalleeGlobal(JSObject* fun); -// A version of XrayAwareCalleeGlobal that can be used from a binding -// specialized getter. We need this function because in a specialized getter we -// don't have a callee JSFunction, so can't use xpc::XrayAwareCalleeGlobal. -// Instead we do something a bit hacky using our current compartment and "this" -// value. Note that for the Xray case thisObj will NOT be in the compartment of -// "cx". -// -// As expected, the outparam "global" need not be same-compartment with either -// thisObj or cx, though it _will_ be same-compartment with one of them. -// -// This function can fail; the return value indicates success or failure. -bool -XrayAwareCalleeGlobalForSpecializedGetters(JSContext* cx, - JS::Handle thisObj, - JS::MutableHandle global); - - void TraceXPCGlobal(JSTracer* trc, JSObject* obj); diff --git a/js/xpconnect/wrappers/XrayWrapper.cpp b/js/xpconnect/wrappers/XrayWrapper.cpp index 0215f6c94a22..2fc5e54b708a 100644 --- a/js/xpconnect/wrappers/XrayWrapper.cpp +++ b/js/xpconnect/wrappers/XrayWrapper.cpp @@ -145,39 +145,6 @@ XrayAwareCalleeGlobal(JSObject* fun) return js::GetGlobalForObjectCrossCompartment(xrayTarget); } -bool -XrayAwareCalleeGlobalForSpecializedGetters(JSContext* cx, - JS::Handle thisObj, - JS::MutableHandle global) -{ - JS::Rooted wrappedObj(cx, thisObj); - if (!JS_WrapObject(cx, &wrappedObj)) { - return false; - } - - if (xpc::WrapperFactory::IsXrayWrapper(wrappedObj)) { - // Our current compartment would generaly get xrays to thisObj. That - // means we're presumably doing a call over Xrays, an the compartment of - // the callee is presumably that of thisObj. This isn't _necessarily_ - // true (e.g. chrome code could be using a chrome-side getter and doing - // .call() with a content-side this value), but people shouldn't do - // that! - // - // If someoen does do something weird here, the only impact is that we - // will create the rejected promise that a promise-returning getter - // creates around any exceptions it throws in the "wrong" compartment. - // In particular, we might create it in the content compartment even - // though we should really have created it in the chrome compartment - // (for the case when a chrome getter is invoked with a content object - // instead of just invoking the xrayed getter). - global.set(js::GetGlobalForObjectCrossCompartment(thisObj)); - return true; - } - - global.set(JS::CurrentGlobalOrNull(cx)); - return true; -} - JSObject* XrayTraits::getExpandoChain(HandleObject obj) { @@ -1363,12 +1330,6 @@ XrayTraits::getExpandoClass(JSContext* cx, HandleObject target) const static const size_t JSSLOT_XRAY_HOLDER = 0; -static JSObject* -GetHolder(JSObject* obj) -{ - return &js::GetProxyReservedSlot(obj, JSSLOT_XRAY_HOLDER).toObject(); -} - /* static */ JSObject* XrayTraits::getHolder(JSObject* wrapper) { @@ -1707,17 +1668,6 @@ DOMXrayTraits::getExpandoClass(JSContext* cx, HandleObject target) const namespace XrayUtils { -JSObject* -GetNativePropertiesObject(JSContext* cx, JSObject* wrapper) -{ - MOZ_ASSERT(js::IsWrapper(wrapper) && WrapperFactory::IsXrayWrapper(wrapper), - "bad object passed in"); - - JSObject* holder = GetHolder(wrapper); - MOZ_ASSERT(holder, "uninitialized wrapper being used?"); - return holder; -} - bool HasNativeProperty(JSContext* cx, HandleObject wrapper, HandleId id, bool* hasProp) { diff --git a/js/xpconnect/wrappers/XrayWrapper.h b/js/xpconnect/wrappers/XrayWrapper.h index 0ab5a0d99958..a1aab99e8446 100644 --- a/js/xpconnect/wrappers/XrayWrapper.h +++ b/js/xpconnect/wrappers/XrayWrapper.h @@ -37,9 +37,6 @@ namespace XrayUtils { bool IsTransparent(JSContext* cx, JS::HandleObject wrapper, JS::HandleId id); -JSObject* -GetNativePropertiesObject(JSContext* cx, JSObject* wrapper); - bool HasNativeProperty(JSContext* cx, JS::HandleObject wrapper, JS::HandleId id, bool* hasProp); @@ -465,8 +462,6 @@ extern template class SecurityXrayDOM; extern template class PermissiveXrayJS; extern template class PermissiveXrayOpaque; -class AutoSetWrapperNotShadowing; - /* * Slots for Xray expando objects. See comments in XrayWrapper.cpp for details * of how these get used; we mostly want the value of JSSLOT_EXPANDO_COUNT here.