Bug 1309109 part 4 - Add get_ref method for RefPtr to get reference of raw pointer. r?froydnj draft
authorXidorn Quan <me@upsuper.org>
Fri, 14 Oct 2016 00:18:49 +1100
changeset 424785 5d659883c7c46768c67e26b2a5c947cb760f3aab
parent 424784 7a0d7abd8217da585534e85c678ce77aa5032697
child 424786 9da269a5e5ee13d4b8210ecc151a4091043d820b
push id32247
push userxquan@mozilla.com
push dateThu, 13 Oct 2016 13:47:06 +0000
reviewersfroydnj
bugs1309109
milestone52.0a1
Bug 1309109 part 4 - Add get_ref method for RefPtr to get reference of raw pointer. r?froydnj MozReview-Commit-ID: JLLDE5d0qVN
mfbt/RefPtr.h
--- a/mfbt/RefPtr.h
+++ b/mfbt/RefPtr.h
@@ -346,16 +346,22 @@ public:
   const RefPtr<T>*
   get_address() const
   // This is not intended to be used by clients.  See |address_of|
   // below.
   {
     return this;
   }
 
+  T* const&
+  get_ref() const
+  {
+    return mRawPtr;
+  }
+
 public:
   T&
   operator*() const
   {
     MOZ_ASSERT(mRawPtr != 0,
                "You can't dereference a NULL RefPtr with operator*().");
     return *get();
   }