Bug 1309109 part 4 - Add get_ref method for RefPtr to get reference of raw pointer. r?froydnj
MozReview-Commit-ID: JLLDE5d0qVN
--- 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();
}