Bug 958643, part 1 - Remove the unused nsXPConnect::WrapNativeHolder. r=krizsa draft
authorAndrew McCreight <continuation@gmail.com>
Wed, 20 Sep 2017 10:12:35 -0700
changeset 667829 4837b2a49d64fff5cadab16dd7a0fb32a61184f7
parent 667694 020db2a299ca134919d9344496edda5c7f6c2328
child 667830 dacab11fa86757c4faea26f8324801b1f3f1e1cb
push id80866
push userbmo:continuation@gmail.com
push dateWed, 20 Sep 2017 20:39:49 +0000
reviewerskrizsa
bugs958643
milestone57.0a1
Bug 958643, part 1 - Remove the unused nsXPConnect::WrapNativeHolder. r=krizsa MozReview-Commit-ID: AOQYLS8FFrf
js/xpconnect/idl/nsIXPConnect.idl
js/xpconnect/src/nsXPConnect.cpp
--- a/js/xpconnect/idl/nsIXPConnect.idl
+++ b/js/xpconnect/idl/nsIXPConnect.idl
@@ -306,25 +306,16 @@ interface nsIXPConnect : nsISupports
     */
     JSObjectPtr
     wrapNative(in JSContextPtr aJSContext,
                in JSObjectPtr  aScope,
                in nsISupports  aCOMObj,
                in nsIIDRef     aIID);
 
     /**
-     * Same as wrapNative, but it returns the JSObject in an nsIXPConnectJSObjectHolder.
-     */
-    nsIXPConnectJSObjectHolder
-    wrapNativeHolder(in JSContextPtr aJSContext,
-                     in JSObjectPtr  aScope,
-                     in nsISupports  aCOMObj,
-                     in nsIIDRef     aIID);
-
-    /**
      * Same as wrapNative, but it returns the JSObject in aVal. C++ callers
      * must ensure that aVal is rooted.
      * aIID may be null, it means the same as passing in
      * &NS_GET_IID(nsISupports) but when passing in null certain shortcuts
      * can be taken because we know without comparing IIDs that the caller is
      * asking for an nsISupports wrapper.
      * If aAllowWrapper, then the returned value will be wrapped in the proper
      * type of security wrapper on top of the XPCWrappedNative (if needed).
--- a/js/xpconnect/src/nsXPConnect.cpp
+++ b/js/xpconnect/src/nsXPConnect.cpp
@@ -646,34 +646,16 @@ nsXPConnect::WrapNative(JSContext * aJSC
     if (!v.isObjectOrNull())
         return NS_ERROR_FAILURE;
 
     *aRetVal = v.toObjectOrNull();
     return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXPConnect::WrapNativeHolder(JSContext * aJSContext,
-                              JSObject * aScopeArg,
-                              nsISupports* aCOMObj,
-                              const nsIID & aIID,
-                              nsIXPConnectJSObjectHolder **aHolder)
-{
-    MOZ_ASSERT(aHolder, "bad param");
-    MOZ_ASSERT(aJSContext, "bad param");
-    MOZ_ASSERT(aScopeArg, "bad param");
-    MOZ_ASSERT(aCOMObj, "bad param");
-
-    RootedObject aScope(aJSContext, aScopeArg);
-    RootedValue v(aJSContext);
-    return NativeInterface2JSObject(aScope, aCOMObj, nullptr, &aIID,
-                                    true, &v, aHolder);
-}
-
-NS_IMETHODIMP
 nsXPConnect::WrapNativeToJSVal(JSContext* aJSContext,
                                JSObject* aScopeArg,
                                nsISupports* aCOMObj,
                                nsWrapperCache* aCache,
                                const nsIID* aIID,
                                bool aAllowWrapping,
                                MutableHandleValue aVal)
 {