Bug 1489317: Part 1 - Add forward declaration for mscom::AgileReference to RefPtr; r=froydnj a=pascalc
authorAaron Klotz <aklotz@mozilla.com>
Wed, 12 Sep 2018 18:55:30 +0000
changeset 492477 8344af6b480d2033894f903a1d644b66350a54c4
parent 492476 98ecb26cc87fef0efa20fa04ef4edd389c6c5fb4
child 492478 d9b447bdf5e9dbc923bc6ce6058d655be9229ab9
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj, pascalc
bugs1489317
milestone63.0
Bug 1489317: Part 1 - Add forward declaration for mscom::AgileReference to RefPtr; r=froydnj a=pascalc I'd like to add a constructor and operator= to RefPtr for mscom::AgileReference. This patch is simply the forward declarations to allow for that. Differential Revision: https://phabricator.services.mozilla.com/D5317
mfbt/RefPtr.h
--- a/mfbt/RefPtr.h
+++ b/mfbt/RefPtr.h
@@ -17,16 +17,21 @@
 
 class nsQueryReferent;
 class nsCOMPtr_helper;
 class nsISupports;
 
 namespace mozilla {
 template<class T> class OwningNonNull;
 template<class T> class StaticRefPtr;
+#if defined(XP_WIN)
+namespace mscom {
+class AgileReference;
+} // namespace mscom
+#endif // defined(XP_WIN)
 
 // Traditionally, RefPtr supports automatic refcounting of any pointer type
 // with AddRef() and Release() methods that follow the traditional semantics.
 //
 // This traits class can be specialized to operate on other pointer types. For
 // example, we specialize this trait for opaque FFI types that represent
 // refcounted objects in Rust.
 //
@@ -147,16 +152,19 @@ public:
   MOZ_IMPLICIT RefPtr(RefPtr<I>&& aSmartPtr)
     : mRawPtr(aSmartPtr.forget().take())
     // construct from |Move(RefPtr<SomeSubclassOfT>)|.
   {
   }
 
   MOZ_IMPLICIT RefPtr(const nsQueryReferent& aHelper);
   MOZ_IMPLICIT RefPtr(const nsCOMPtr_helper& aHelper);
+#if defined(XP_WIN)
+  MOZ_IMPLICIT RefPtr(const mozilla::mscom::AgileReference& aAgileRef);
+#endif // defined(XP_WIN)
 
   // Defined in OwningNonNull.h
   template<class U>
   MOZ_IMPLICIT RefPtr(const mozilla::OwningNonNull<U>& aOther);
 
   // Defined in StaticPtr.h
   template<class U>
   MOZ_IMPLICIT RefPtr(const mozilla::StaticRefPtr<U>& aOther);
@@ -210,16 +218,19 @@ public:
   // assign from |otherRefPtr.forget()|
   {
     assign_assuming_AddRef(aRhs.take());
     return *this;
   }
 
   RefPtr<T>& operator=(const nsQueryReferent& aQueryReferent);
   RefPtr<T>& operator=(const nsCOMPtr_helper& aHelper);
+#if defined(XP_WIN)
+  RefPtr<T>& operator=(const mozilla::mscom::AgileReference& aAgileRef);
+#endif // defined(XP_WIN)
 
   RefPtr<T>&
   operator=(RefPtr<T> && aRefPtr)
   {
     assign_assuming_AddRef(aRefPtr.mRawPtr);
     aRefPtr.mRawPtr = nullptr;
     return *this;
   }