Bug 865964. Remove dead WrapCallbackInterface code. r=smaug
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 26 Apr 2013 13:41:21 -0400
changeset 141043 03423d078b99d36ff59905500c3c6034e87e89e8
parent 141042 5884664a5961889243d07e579ff22625e57344a9
child 141044 d85886f848015fad80f12723a992213d1f153e31
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs865964
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 865964. Remove dead WrapCallbackInterface code. r=smaug
dom/bindings/BindingUtils.cpp
dom/bindings/BindingUtils.h
dom/bindings/Codegen.py
--- 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"