Bug 1392352 - Part 1 - Interpose all objects;
We used to attempt interposition only for DOM instances and wrapped natives,
but now that tests are the only thing still using interposition this removes
the optimization.
This is needed so that `gBrowser` can continue to be interposed as a plain JS
object, until addon interposition is removed entirely (in
Bug 1412456).
MozReview-Commit-ID: LSAmAg9Lqd5
--- a/js/xpconnect/wrappers/AddonWrapper.cpp
+++ b/js/xpconnect/wrappers/AddonWrapper.cpp
@@ -37,28 +37,18 @@ ReportASCIIErrorWithId(JSContext* cx, co
return;
JS_ReportErrorUTF8(cx, msg, bytes.ptr());
}
bool
InterposeProperty(JSContext* cx, HandleObject target, const nsIID* iid, HandleId id,
MutableHandle<PropertyDescriptor> descriptor)
{
- // We only want to do interpostion on DOM instances and
- // wrapped natives.
RootedObject unwrapped(cx, UncheckedUnwrap(target));
- const js::Class* clasp = js::GetObjectClass(unwrapped);
bool isCPOW = jsipc::IsWrappedCPOW(unwrapped);
- if (!mozilla::dom::IsDOMClass(clasp) &&
- !IS_WN_CLASS(clasp) &&
- !IS_PROTO_CLASS(clasp) &&
- clasp != &OuterWindowProxyClass &&
- !isCPOW) {
- return true;
- }
XPCWrappedNativeScope* scope = ObjectScope(CurrentGlobalOrNull(cx));
MOZ_ASSERT(scope->HasInterposition());
nsCOMPtr<nsIAddonInterposition> interp = scope->GetInterposition();
InterpositionWhitelist* wl = XPCWrappedNativeScope::GetInterpositionWhitelist(interp);
// We do InterposeProperty only if the id is on the whitelist of the interpostion
// or if the target is a CPOW.