Bug 1489317: Part 1 - Add forward delcaration for mscom::AgileReference to RefPtr; r=froydnj
☠☠ backed out by 151b11e40af6 ☠ ☠
authorAaron Klotz <aklotz@mozilla.com>
Mon, 10 Sep 2018 22:58:16 +0000
changeset 494036 fddf77dc2f9d02172eaed2e04289b22df4168864
parent 494035 c73d63442c8daccada03c850df06bc52e631545d
child 494037 d5d432fd2433c75b5b7bef6c8fd652d54e42b9cd
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1489317
milestone64.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 1489317: Part 1 - Add forward delcaration for mscom::AgileReference to RefPtr; r=froydnj 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;
   }