Backed out changeset cb01170872de (bug 1494765) for bustages on nsCOMPtr.h. CLOSED TREE
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Tue, 02 Oct 2018 00:37:46 +0300
changeset 487435 825f10de78392d7f9578b7950b498cfc280ddcf5
parent 487434 cb01170872de75622282968dbc8bccaab391be0d
child 487436 a2e5b2b30bfa6f6912f4af2df950284950e3fb16
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
bugs1494765
milestone64.0a1
backs outcb01170872de75622282968dbc8bccaab391be0d
Backed out changeset cb01170872de (bug 1494765) for bustages on nsCOMPtr.h. CLOSED TREE
xpcom/base/nsCOMPtr.h
--- a/xpcom/base/nsCOMPtr.h
+++ b/xpcom/base/nsCOMPtr.h
@@ -464,51 +464,25 @@ public:
   {
     assert_validity();
     if (mRawPtr) {
       NSCAP_ADDREF(this, mRawPtr);
     }
     NSCAP_LOG_ASSIGNMENT(this, aSmartPtr.mRawPtr);
   }
 
-  template <class U>
-  MOZ_IMPLICIT nsCOMPtr(const nsCOMPtr<U>& aSmartPtr)
-    : NSCAP_CTOR_BASE(aSmartPtr.get())
-  {
-    // Make sure that U actually inherits from T
-    static_assert(mozilla::IsBaseOf<T, U>::value,
-                  "U should be a subclass of T");
-    assert_validity();
-    if (mRawPtr) {
-      NSCAP_ADDREF(this, mRawPtr);
-    }
-    NSCAP_LOG_ASSIGNMENT(this, aSmartPtr.get());
-  }
-
   nsCOMPtr(nsCOMPtr<T>&& aSmartPtr)
     : NSCAP_CTOR_BASE(aSmartPtr.mRawPtr)
   {
     assert_validity();
     aSmartPtr.mRawPtr = nullptr;
     NSCAP_LOG_ASSIGNMENT(this, mRawPtr);
     NSCAP_ASSERT_NO_QUERY_NEEDED();
   }
 
-  template <class U>
-  nsCOMPtr(nsCOMPtr<U>&& aSmartPtr)
-    : NSCAP_CTOR_BASE(aSmartPtr.forget().template downcast<T>().take())
-  {
-    // Make sure that U actually inherits from T
-    static_assert(mozilla::IsBaseOf<T, U>::value,
-                  "U should be a subclass of T");
-    assert_validity();
-    NSCAP_LOG_ASSIGNMENT(this, mRawPtr);
-    NSCAP_ASSERT_NO_QUERY_NEEDED();
-  }
-
   MOZ_IMPLICIT nsCOMPtr(T* aRawPtr)
     : NSCAP_CTOR_BASE(aRawPtr)
   {
     assert_validity();
     if (mRawPtr) {
       NSCAP_ADDREF(this, mRawPtr);
     }
     NSCAP_LOG_ASSIGNMENT(this, aRawPtr);
@@ -640,44 +614,23 @@ public:
   // Assignment operators
 
   nsCOMPtr<T>& operator=(const nsCOMPtr<T>& aRhs)
   {
     assign_with_AddRef(aRhs.mRawPtr);
     return *this;
   }
 
-  template<class U>
-  nsCOMPtr<T>& operator=(const nsCOMPtr<U>& aRhs)
-  {
-    // Make sure that U actually inherits from T
-    static_assert(mozilla::IsBaseOf<T, U>::value,
-                  "U should be a subclass of T");
-    assign_with_AddRef(static_cast<T*>(aRhs.get()));
-    return *this;
-  }
-
   nsCOMPtr<T>& operator=(nsCOMPtr<T>&& aRhs)
   {
     assign_assuming_AddRef(aRhs.forget().take());
     NSCAP_ASSERT_NO_QUERY_NEEDED();
     return *this;
   }
 
-  template<class U>
-  nsCOMPtr<T>& operator=(nsCOMPtr<U>&& aRhs)
-  {
-    // Make sure that U actually inherits from T
-    static_assert(mozilla::IsBaseOf<T, U>::value,
-                  "U should be a subclass of T");
-    assign_assuming_AddRef(aRhs.forget().template downcast<T>().take());
-    NSCAP_ASSERT_NO_QUERY_NEEDED();
-    return *this;
-  }
-
   nsCOMPtr<T>& operator=(T* aRhs)
   {
     assign_with_AddRef(aRhs);
     NSCAP_ASSERT_NO_QUERY_NEEDED();
     return *this;
   }
 
   nsCOMPtr<T>& operator=(decltype(nullptr))