Bug 1114979 - Annotate some strong and weak references in MFBT; r=froydnj
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 23 Dec 2014 17:26:28 -0500
changeset 247078 520a9a3c88ade5482b03719fe643d948cac40c56
parent 247077 4d8cd2c1ecc8634fed52d71eaf4ccc7e4a869971
child 247079 45798e9a16c252f3792b49f119c8e5177cc43f7d
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1114979
milestone37.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 1114979 - Annotate some strong and weak references in MFBT; r=froydnj
mfbt/RefPtr.h
mfbt/WeakPtr.h
--- a/mfbt/RefPtr.h
+++ b/mfbt/RefPtr.h
@@ -280,17 +280,17 @@ public:
 
 private:
   void assign(T* aVal)
   {
     unref(mPtr);
     mPtr = aVal;
   }
 
-  T* mPtr;
+  T* MOZ_STRONG_REF mPtr;
 
   static MOZ_ALWAYS_INLINE T* ref(T* aVal)
   {
     if (aVal) {
       aVal->AddRef();
     }
     return aVal;
   }
@@ -331,17 +331,17 @@ public:
     T* tmp = mPtr;
     mPtr = nullptr;
     return tmp;
   }
 
 private:
   TemporaryRef(T* aVal, const DontRef&) : mPtr(aVal) {}
 
-  mutable T* mPtr;
+  mutable T* MOZ_STRONG_REF mPtr;
 
   TemporaryRef() MOZ_DELETE;
   void operator=(const TemporaryRef&) MOZ_DELETE;
 };
 
 /**
  * OutParamRef is a wrapper that tracks a refcounted pointer passed as
  * an outparam argument to a function.  OutParamRef implements COM T**
--- a/mfbt/WeakPtr.h
+++ b/mfbt/WeakPtr.h
@@ -64,16 +64,17 @@
  * http://src.chromium.org/svn/trunk/src/base/memory/weak_ptr.h
  */
 
 #ifndef mozilla_WeakPtr_h
 #define mozilla_WeakPtr_h
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Assertions.h"
+#include "mozilla/Attributes.h"
 #include "mozilla/NullPtr.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/TypeTraits.h"
 
 #include <string.h>
 
 namespace mozilla {
 
@@ -117,17 +118,17 @@ public:
 #undef snprintf
 #endif
 
 private:
   friend class mozilla::SupportsWeakPtr<T>;
 
   void detach() { mPtr = nullptr; }
 
-  T* mPtr;
+  T* MOZ_WEAK_REF mPtr;
 };
 
 } // namespace detail
 
 template <typename T>
 class SupportsWeakPtr
 {
 protected: