Bug 865964. Remove dead WrapCallbackInterface code. r=smaug
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -1254,29 +1254,16 @@ HasPropertyOnPrototype(JSContext* cx, JS
}
MOZ_ASSERT(js::IsProxy(proxy) && js::GetProxyHandler(proxy) == handler);
bool found;
// We ignore an error from GetPropertyOnPrototype.
return !GetPropertyOnPrototype(cx, proxy, id, &found, NULL) || found;
}
-bool
-WrapCallbackInterface(JSContext *cx, JSObject *scope, nsISupports* callback,
- JS::Value* vp)
-{
- nsCOMPtr<nsIXPConnectWrappedJS> wrappedJS = do_QueryInterface(callback);
- MOZ_ASSERT(wrappedJS, "How can we not have an XPCWrappedJS here?");
- JSObject* obj;
- DebugOnly<nsresult> rv = wrappedJS->GetJSObject(&obj);
- MOZ_ASSERT(NS_SUCCEEDED(rv) && obj, "What are we wrapping?");
- *vp = JS::ObjectValue(*obj);
- return JS_WrapValue(cx, vp);
-}
-
JSObject*
GetXrayExpandoChain(JSObject* obj)
{
js::Class* clasp = js::GetObjectClass(obj);
JS::Value v;
if (IsDOMClass(clasp) || IsDOMIfaceAndProtoClass(clasp)) {
v = js::GetReservedSlot(obj, DOM_XRAY_EXPANDO_SLOT);
} else if (js::IsObjectProxyClass(clasp) || js::IsFunctionProxyClass(clasp)) {
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -997,36 +997,16 @@ WrapObject<JSObject>(JSContext* cx, JSOb
inline bool
WrapObject(JSContext* cx, JSObject* scope, JSObject& p, JS::Value* vp)
{
vp->setObject(p);
return true;
}
-bool
-WrapCallbackInterface(JSContext *cx, JSObject *scope, nsISupports* callback,
- JS::Value* vp);
-
-static inline bool
-WrapCallbackInterface(JSContext *cx, JSObject *scope, nsISupports& callback,
- JS::Value* vp)
-{
- return WrapCallbackInterface(cx, scope, &callback, vp);
-}
-
-// Helper for smart pointers (nsAutoPtr/nsRefPtr/nsCOMPtr).
-template <template <typename> class SmartPtr, class T>
-inline bool
-WrapCallbackInterface(JSContext* cx, JSObject* scope, const SmartPtr<T>& value,
- JS::Value* vp)
-{
- return WrapCallbackInterface(cx, scope, value.get(), vp);
-}
-
// Given an object "p" that inherits from nsISupports, wrap it and return the
// result. Null is returned on wrapping failure. This is somewhat similar to
// WrapObject() above, but does NOT allow Xrays around the result, since we
// don't want those for our parent object.
template<typename T>
static inline JSObject*
WrapNativeISupportsParent(JSContext* cx, JSObject* scope, T* p,
nsWrapperCache* cache)
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -3617,20 +3617,17 @@ if (!returnArray) {
descriptor = descriptorProvider.getDescriptor(type.unroll().inner.identifier.name)
if type.nullable():
wrappingCode = ("if (!%s) {\n" % (result) +
CGIndenter(CGGeneric(setValue("JSVAL_NULL"))).define() + "\n" +
"}\n")
else:
wrappingCode = ""
- if descriptor.interface.isCallback():
- wrap = "WrapCallbackInterface(cx, ${obj}, %s, ${jsvalPtr})" % result
- failed = None
- elif not descriptor.interface.isExternal() and not descriptor.skipGen:
+ if not descriptor.interface.isExternal() and not descriptor.skipGen:
if descriptor.wrapperCache:
assert descriptor.nativeOwnership != 'owned'
wrapMethod = "WrapNewBindingObject"
else:
if not isCreator:
raise MethodNotCreatorError(descriptor.interface.identifier.name)
if descriptor.nativeOwnership == 'owned':
wrapMethod = "WrapNewBindingNonWrapperCachedOwnedObject"