Bug 1489317: Part 1 - Add forward delcaration for mscom::AgileReference to RefPtr; r=froydnj
☠☠ backed out by 91136930be64 ☠ ☠
authorAaron Klotz <aklotz@mozilla.com>
Mon, 10 Sep 2018 22:58:16 +0000
changeset 494020 2787fb454f40584ad146c61fd9b375c419efe803
parent 494019 60fe9150ede60e0a07c5aa0bb0149f67bc70d3b7
child 494021 62b404e59c325af23d9133a5e18cc7cc477cafdd
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;
   }