diff --git a/ipc/glue/Shmem.h b/ipc/glue/Shmem.h index 10553a05f4c5..1b5b9d8e6cd5 100644 --- a/ipc/glue/Shmem.h +++ b/ipc/glue/Shmem.h @@ -265,7 +265,7 @@ private: void AssertInvariants() const; #endif - SharedMemory* MOZ_WEAK_REF mSegment; + SharedMemory* MOZ_NON_OWNING_REF mSegment; void* mData; size_t mSize; id_t mId; diff --git a/mfbt/Attributes.h b/mfbt/Attributes.h index f504d62ed35b..3ac9c1f0d4c7 100644 --- a/mfbt/Attributes.h +++ b/mfbt/Attributes.h @@ -512,11 +512,11 @@ * conversions. * MOZ_NO_ARITHMETIC_EXPR_IN_ARGUMENT: Applies to functions. Makes it a compile * time error to pass arithmetic expressions on variables to the function. - * MOZ_STRONG_REF: Applies to declarations of pointer types. This attribute + * MOZ_OWNING_REF: Applies to declarations of pointer types. This attribute * tells the compiler that the raw pointer is a strong reference, and that * property is somehow enforced by the code. This can make the compiler * ignore these pointers when validating the usage of pointers otherwise. - * MOZ_WEAK_REF: Applies to declarations of pointer types. This attribute + * MOZ_NON_OWNING_REF: Applies to declarations of pointer types. This attribute * tells the compiler that the raw pointer is a weak reference, and that * property is somehow enforced by the code. This can make the compiler * ignore these pointers when validating the usage of pointers otherwise. @@ -535,8 +535,8 @@ # endif # define MOZ_IMPLICIT __attribute__((annotate("moz_implicit"))) # define MOZ_NO_ARITHMETIC_EXPR_IN_ARGUMENT __attribute__((annotate("moz_no_arith_expr_in_arg"))) -# define MOZ_STRONG_REF __attribute__((annotate("moz_strong_ref"))) -# define MOZ_WEAK_REF __attribute__((annotate("moz_weak_ref"))) +# define MOZ_OWNING_REF __attribute__((annotate("moz_strong_ref"))) +# define MOZ_NON_OWNING_REF __attribute__((annotate("moz_weak_ref"))) /* * It turns out that clang doesn't like void func() __attribute__ {} without a * warning, so use pragmas to disable the warning. This code won't work on GCC @@ -556,8 +556,8 @@ # define MOZ_IMPLICIT /* nothing */ # define MOZ_NO_ARITHMETIC_EXPR_IN_ARGUMENT /* nothing */ # define MOZ_HEAP_ALLOCATOR /* nothing */ -# define MOZ_STRONG_REF /* nothing */ -# define MOZ_WEAK_REF /* nothing */ +# define MOZ_OWNING_REF /* nothing */ +# define MOZ_NON_OWNING_REF /* nothing */ #endif /* MOZ_CLANG_PLUGIN */ /* diff --git a/mfbt/RefPtr.h b/mfbt/RefPtr.h index 82b4f798522e..d330edada8b0 100644 --- a/mfbt/RefPtr.h +++ b/mfbt/RefPtr.h @@ -285,7 +285,7 @@ private: mPtr = aVal; } - T* MOZ_STRONG_REF mPtr; + T* MOZ_OWNING_REF mPtr; static MOZ_ALWAYS_INLINE T* ref(T* aVal) { @@ -336,7 +336,7 @@ public: private: TemporaryRef(T* aVal, const DontRef&) : mPtr(aVal) {} - mutable T* MOZ_STRONG_REF mPtr; + mutable T* MOZ_OWNING_REF mPtr; TemporaryRef() MOZ_DELETE; void operator=(const TemporaryRef&) MOZ_DELETE; diff --git a/mfbt/WeakPtr.h b/mfbt/WeakPtr.h index 5149075e57a1..3f26a5011201 100644 --- a/mfbt/WeakPtr.h +++ b/mfbt/WeakPtr.h @@ -123,7 +123,7 @@ private: void detach() { mPtr = nullptr; } - T* MOZ_WEAK_REF mPtr; + T* MOZ_NON_OWNING_REF mPtr; }; } // namespace detail diff --git a/xpcom/base/AlreadyAddRefed.h b/xpcom/base/AlreadyAddRefed.h index 9fe7f69f8f62..7af840615b8c 100644 --- a/xpcom/base/AlreadyAddRefed.h +++ b/xpcom/base/AlreadyAddRefed.h @@ -137,7 +137,7 @@ struct already_AddRefed } private: - T* MOZ_STRONG_REF mRawPtr; + T* MOZ_OWNING_REF mRawPtr; }; #endif // AlreadyAddRefed_h diff --git a/xpcom/base/StaticPtr.h b/xpcom/base/StaticPtr.h index 906c8d4e99b5..f01590d0e3e4 100644 --- a/xpcom/base/StaticPtr.h +++ b/xpcom/base/StaticPtr.h @@ -141,7 +141,7 @@ private: } } - T* MOZ_STRONG_REF mRawPtr; + T* MOZ_OWNING_REF mRawPtr; }; namespace StaticPtr_internal { diff --git a/xpcom/base/nsAutoPtr.h b/xpcom/base/nsAutoPtr.h index 9f864ce8505d..a5bd06dadb96 100644 --- a/xpcom/base/nsAutoPtr.h +++ b/xpcom/base/nsAutoPtr.h @@ -60,11 +60,11 @@ private: } private: - T* MOZ_WEAK_REF mPtr; + T* MOZ_NON_OWNING_REF mPtr; }; private: - T* MOZ_STRONG_REF mRawPtr; + T* MOZ_OWNING_REF mRawPtr; public: typedef T element_type; @@ -431,7 +431,7 @@ private: } private: - T* MOZ_STRONG_REF mRawPtr; + T* MOZ_OWNING_REF mRawPtr; public: typedef T element_type; @@ -778,7 +778,7 @@ public: return status; } private: - T* MOZ_WEAK_REF mRawPtr; + T* MOZ_NON_OWNING_REF mRawPtr; }; template @@ -801,7 +801,7 @@ public: return status; } private: - T* MOZ_WEAK_REF mRawPtr; + T* MOZ_NON_OWNING_REF mRawPtr; nsresult* mErrorPtr; }; diff --git a/xpcom/base/nsRefPtr.h b/xpcom/base/nsRefPtr.h index 4582e402f7ff..fb085a8c4466 100644 --- a/xpcom/base/nsRefPtr.h +++ b/xpcom/base/nsRefPtr.h @@ -48,7 +48,7 @@ private: } private: - T* MOZ_STRONG_REF mRawPtr; + T* MOZ_OWNING_REF mRawPtr; public: typedef T element_type; diff --git a/xpcom/build/nsXREAppData.h b/xpcom/build/nsXREAppData.h index 8df8fb11ccf2..4c9c6351ca80 100644 --- a/xpcom/build/nsXREAppData.h +++ b/xpcom/build/nsXREAppData.h @@ -31,7 +31,7 @@ struct nsXREAppData * The directory of the application to be run. May be null if the * xulrunner and the app are installed into the same directory. */ - nsIFile* MOZ_WEAK_REF directory; + nsIFile* MOZ_NON_OWNING_REF directory; /** * The name of the application vendor. This must be ASCII, and is normally @@ -93,7 +93,7 @@ struct nsXREAppData * The location of the XRE. XRE_main may not be able to figure this out * programatically. */ - nsIFile* MOZ_WEAK_REF xreDirectory; + nsIFile* MOZ_NON_OWNING_REF xreDirectory; /** * The minimum/maximum compatible XRE version. diff --git a/xpcom/glue/nsCOMPtr.h b/xpcom/glue/nsCOMPtr.h index ba67fe6fff36..ed483323f41c 100644 --- a/xpcom/glue/nsCOMPtr.h +++ b/xpcom/glue/nsCOMPtr.h @@ -167,7 +167,7 @@ public: nsresult NS_FASTCALL operator()(const nsIID& aIID, void**) const; private: - nsISupports* MOZ_STRONG_REF mRawPtr; + nsISupports* MOZ_OWNING_REF mRawPtr; }; class nsQueryInterfaceWithError @@ -182,7 +182,7 @@ public: nsresult NS_FASTCALL operator()(const nsIID& aIID, void**) const; private: - nsISupports* MOZ_STRONG_REF mRawPtr; + nsISupports* MOZ_OWNING_REF mRawPtr; nsresult* mErrorPtr; }; @@ -319,7 +319,7 @@ public: begin_assignment(); protected: - NS_MAY_ALIAS_PTR(nsISupports) MOZ_STRONG_REF mRawPtr; + NS_MAY_ALIAS_PTR(nsISupports) MOZ_OWNING_REF mRawPtr; void assign_assuming_AddRef(nsISupports* aNewPtr) { @@ -378,7 +378,7 @@ private: } private: - T* MOZ_STRONG_REF mRawPtr; + T* MOZ_OWNING_REF mRawPtr; #endif public: diff --git a/xpcom/glue/nsComponentManagerUtils.h b/xpcom/glue/nsComponentManagerUtils.h index 6c1725611ec6..4de522eb1bf7 100644 --- a/xpcom/glue/nsComponentManagerUtils.h +++ b/xpcom/glue/nsComponentManagerUtils.h @@ -41,7 +41,7 @@ public: private: const nsCID& mCID; - nsISupports* MOZ_WEAK_REF mOuter; + nsISupports* MOZ_NON_OWNING_REF mOuter; nsresult* mErrorPtr; }; @@ -60,7 +60,7 @@ public: private: const char* mContractID; - nsISupports* MOZ_WEAK_REF mOuter; + nsISupports* MOZ_NON_OWNING_REF mOuter; nsresult* mErrorPtr; }; @@ -78,8 +78,8 @@ public: virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const; private: - nsIFactory* MOZ_WEAK_REF mFactory; - nsISupports* MOZ_WEAK_REF mOuter; + nsIFactory* MOZ_NON_OWNING_REF mFactory; + nsISupports* MOZ_NON_OWNING_REF mOuter; nsresult* mErrorPtr; }; diff --git a/xpcom/glue/nsHashKeys.h b/xpcom/glue/nsHashKeys.h index 1e1dca662141..410066f098db 100644 --- a/xpcom/glue/nsHashKeys.h +++ b/xpcom/glue/nsHashKeys.h @@ -385,7 +385,7 @@ public: enum { ALLOW_MEMMOVE = true }; protected: - T* MOZ_WEAK_REF mKey; + T* MOZ_NON_OWNING_REF mKey; }; /** diff --git a/xpcom/glue/nsIInterfaceRequestorUtils.h b/xpcom/glue/nsIInterfaceRequestorUtils.h index 33bd2c7e528b..4551a4fa1c00 100644 --- a/xpcom/glue/nsIInterfaceRequestorUtils.h +++ b/xpcom/glue/nsIInterfaceRequestorUtils.h @@ -34,7 +34,7 @@ public: virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const; private: - nsISupports* MOZ_WEAK_REF mSource; + nsISupports* MOZ_NON_OWNING_REF mSource; nsresult* mErrorPtr; }; diff --git a/xpcom/glue/nsProxyRelease.cpp b/xpcom/glue/nsProxyRelease.cpp index bcbdb35b5843..091751dce82d 100644 --- a/xpcom/glue/nsProxyRelease.cpp +++ b/xpcom/glue/nsProxyRelease.cpp @@ -20,7 +20,7 @@ public: } private: - nsISupports* MOZ_STRONG_REF mDoomed; + nsISupports* MOZ_OWNING_REF mDoomed; }; nsresult diff --git a/xpcom/glue/nsThreadUtils.h b/xpcom/glue/nsThreadUtils.h index 22cb37aefe27..f900d9ad72f4 100644 --- a/xpcom/glue/nsThreadUtils.h +++ b/xpcom/glue/nsThreadUtils.h @@ -297,7 +297,7 @@ struct nsRunnableMethodReceiver template struct nsRunnableMethodReceiver { - ClassType* MOZ_WEAK_REF mObj; + ClassType* MOZ_NON_OWNING_REF mObj; explicit nsRunnableMethodReceiver(ClassType* aObj) : mObj(aObj) {} void Revoke() { mObj = nullptr; } }; diff --git a/xpcom/glue/nsWeakReference.cpp b/xpcom/glue/nsWeakReference.cpp index 06874005211e..beb157f4ac05 100644 --- a/xpcom/glue/nsWeakReference.cpp +++ b/xpcom/glue/nsWeakReference.cpp @@ -45,7 +45,7 @@ private: mReferent = 0; } - nsSupportsWeakReference* MOZ_WEAK_REF mReferent; + nsSupportsWeakReference* MOZ_NON_OWNING_REF mReferent; }; nsresult diff --git a/xpcom/glue/nsWeakReference.h b/xpcom/glue/nsWeakReference.h index 93e5b9a86f5c..8631e0dee135 100644 --- a/xpcom/glue/nsWeakReference.h +++ b/xpcom/glue/nsWeakReference.h @@ -31,7 +31,7 @@ private: // Called (only) by an |nsWeakReference| from _its_ dtor. void NoticeProxyDestruction() { mProxy = 0; } - nsWeakReference* MOZ_WEAK_REF mProxy; + nsWeakReference* MOZ_NON_OWNING_REF mProxy; protected: