mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 18:04:46 +00:00
Bug 1114880 follow-up: Rename MOZ_{STRONG,WEAK}_REF to MOZ_{OWNING,NON_OWNING}_REF
--HG-- extra : rebase_source : 51fff0785d112b5b87be3c6ff723c8986b37effe
This commit is contained in:
parent
883381c0be
commit
9297631e0b
@ -265,7 +265,7 @@ private:
|
|||||||
void AssertInvariants() const;
|
void AssertInvariants() const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SharedMemory* MOZ_WEAK_REF mSegment;
|
SharedMemory* MOZ_NON_OWNING_REF mSegment;
|
||||||
void* mData;
|
void* mData;
|
||||||
size_t mSize;
|
size_t mSize;
|
||||||
id_t mId;
|
id_t mId;
|
||||||
|
@ -512,11 +512,11 @@
|
|||||||
* conversions.
|
* conversions.
|
||||||
* MOZ_NO_ARITHMETIC_EXPR_IN_ARGUMENT: Applies to functions. Makes it a compile
|
* MOZ_NO_ARITHMETIC_EXPR_IN_ARGUMENT: Applies to functions. Makes it a compile
|
||||||
* time error to pass arithmetic expressions on variables to the function.
|
* 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
|
* 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
|
* property is somehow enforced by the code. This can make the compiler
|
||||||
* ignore these pointers when validating the usage of pointers otherwise.
|
* 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
|
* 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
|
* property is somehow enforced by the code. This can make the compiler
|
||||||
* ignore these pointers when validating the usage of pointers otherwise.
|
* ignore these pointers when validating the usage of pointers otherwise.
|
||||||
@ -535,8 +535,8 @@
|
|||||||
# endif
|
# endif
|
||||||
# define MOZ_IMPLICIT __attribute__((annotate("moz_implicit")))
|
# define MOZ_IMPLICIT __attribute__((annotate("moz_implicit")))
|
||||||
# define MOZ_NO_ARITHMETIC_EXPR_IN_ARGUMENT __attribute__((annotate("moz_no_arith_expr_in_arg")))
|
# 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_OWNING_REF __attribute__((annotate("moz_strong_ref")))
|
||||||
# define MOZ_WEAK_REF __attribute__((annotate("moz_weak_ref")))
|
# define MOZ_NON_OWNING_REF __attribute__((annotate("moz_weak_ref")))
|
||||||
/*
|
/*
|
||||||
* It turns out that clang doesn't like void func() __attribute__ {} without a
|
* 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
|
* 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_IMPLICIT /* nothing */
|
||||||
# define MOZ_NO_ARITHMETIC_EXPR_IN_ARGUMENT /* nothing */
|
# define MOZ_NO_ARITHMETIC_EXPR_IN_ARGUMENT /* nothing */
|
||||||
# define MOZ_HEAP_ALLOCATOR /* nothing */
|
# define MOZ_HEAP_ALLOCATOR /* nothing */
|
||||||
# define MOZ_STRONG_REF /* nothing */
|
# define MOZ_OWNING_REF /* nothing */
|
||||||
# define MOZ_WEAK_REF /* nothing */
|
# define MOZ_NON_OWNING_REF /* nothing */
|
||||||
#endif /* MOZ_CLANG_PLUGIN */
|
#endif /* MOZ_CLANG_PLUGIN */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -285,7 +285,7 @@ private:
|
|||||||
mPtr = aVal;
|
mPtr = aVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
T* MOZ_STRONG_REF mPtr;
|
T* MOZ_OWNING_REF mPtr;
|
||||||
|
|
||||||
static MOZ_ALWAYS_INLINE T* ref(T* aVal)
|
static MOZ_ALWAYS_INLINE T* ref(T* aVal)
|
||||||
{
|
{
|
||||||
@ -336,7 +336,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
TemporaryRef(T* aVal, const DontRef&) : mPtr(aVal) {}
|
TemporaryRef(T* aVal, const DontRef&) : mPtr(aVal) {}
|
||||||
|
|
||||||
mutable T* MOZ_STRONG_REF mPtr;
|
mutable T* MOZ_OWNING_REF mPtr;
|
||||||
|
|
||||||
TemporaryRef() MOZ_DELETE;
|
TemporaryRef() MOZ_DELETE;
|
||||||
void operator=(const TemporaryRef&) MOZ_DELETE;
|
void operator=(const TemporaryRef&) MOZ_DELETE;
|
||||||
|
@ -123,7 +123,7 @@ private:
|
|||||||
|
|
||||||
void detach() { mPtr = nullptr; }
|
void detach() { mPtr = nullptr; }
|
||||||
|
|
||||||
T* MOZ_WEAK_REF mPtr;
|
T* MOZ_NON_OWNING_REF mPtr;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
@ -137,7 +137,7 @@ struct already_AddRefed
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
T* MOZ_STRONG_REF mRawPtr;
|
T* MOZ_OWNING_REF mRawPtr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // AlreadyAddRefed_h
|
#endif // AlreadyAddRefed_h
|
||||||
|
@ -141,7 +141,7 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
T* MOZ_STRONG_REF mRawPtr;
|
T* MOZ_OWNING_REF mRawPtr;
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace StaticPtr_internal {
|
namespace StaticPtr_internal {
|
||||||
|
@ -60,11 +60,11 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
T* MOZ_WEAK_REF mPtr;
|
T* MOZ_NON_OWNING_REF mPtr;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
T* MOZ_STRONG_REF mRawPtr;
|
T* MOZ_OWNING_REF mRawPtr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef T element_type;
|
typedef T element_type;
|
||||||
@ -431,7 +431,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
T* MOZ_STRONG_REF mRawPtr;
|
T* MOZ_OWNING_REF mRawPtr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef T element_type;
|
typedef T element_type;
|
||||||
@ -778,7 +778,7 @@ public:
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
T* MOZ_WEAK_REF mRawPtr;
|
T* MOZ_NON_OWNING_REF mRawPtr;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
@ -801,7 +801,7 @@ public:
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
T* MOZ_WEAK_REF mRawPtr;
|
T* MOZ_NON_OWNING_REF mRawPtr;
|
||||||
nsresult* mErrorPtr;
|
nsresult* mErrorPtr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
T* MOZ_STRONG_REF mRawPtr;
|
T* MOZ_OWNING_REF mRawPtr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef T element_type;
|
typedef T element_type;
|
||||||
|
@ -31,7 +31,7 @@ struct nsXREAppData
|
|||||||
* The directory of the application to be run. May be null if the
|
* The directory of the application to be run. May be null if the
|
||||||
* xulrunner and the app are installed into the same directory.
|
* 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
|
* 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
|
* The location of the XRE. XRE_main may not be able to figure this out
|
||||||
* programatically.
|
* programatically.
|
||||||
*/
|
*/
|
||||||
nsIFile* MOZ_WEAK_REF xreDirectory;
|
nsIFile* MOZ_NON_OWNING_REF xreDirectory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The minimum/maximum compatible XRE version.
|
* The minimum/maximum compatible XRE version.
|
||||||
|
@ -167,7 +167,7 @@ public:
|
|||||||
nsresult NS_FASTCALL operator()(const nsIID& aIID, void**) const;
|
nsresult NS_FASTCALL operator()(const nsIID& aIID, void**) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsISupports* MOZ_STRONG_REF mRawPtr;
|
nsISupports* MOZ_OWNING_REF mRawPtr;
|
||||||
};
|
};
|
||||||
|
|
||||||
class nsQueryInterfaceWithError
|
class nsQueryInterfaceWithError
|
||||||
@ -182,7 +182,7 @@ public:
|
|||||||
nsresult NS_FASTCALL operator()(const nsIID& aIID, void**) const;
|
nsresult NS_FASTCALL operator()(const nsIID& aIID, void**) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsISupports* MOZ_STRONG_REF mRawPtr;
|
nsISupports* MOZ_OWNING_REF mRawPtr;
|
||||||
nsresult* mErrorPtr;
|
nsresult* mErrorPtr;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -319,7 +319,7 @@ public:
|
|||||||
begin_assignment();
|
begin_assignment();
|
||||||
|
|
||||||
protected:
|
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)
|
void assign_assuming_AddRef(nsISupports* aNewPtr)
|
||||||
{
|
{
|
||||||
@ -378,7 +378,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
T* MOZ_STRONG_REF mRawPtr;
|
T* MOZ_OWNING_REF mRawPtr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -41,7 +41,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
const nsCID& mCID;
|
const nsCID& mCID;
|
||||||
nsISupports* MOZ_WEAK_REF mOuter;
|
nsISupports* MOZ_NON_OWNING_REF mOuter;
|
||||||
nsresult* mErrorPtr;
|
nsresult* mErrorPtr;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
const char* mContractID;
|
const char* mContractID;
|
||||||
nsISupports* MOZ_WEAK_REF mOuter;
|
nsISupports* MOZ_NON_OWNING_REF mOuter;
|
||||||
nsresult* mErrorPtr;
|
nsresult* mErrorPtr;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -78,8 +78,8 @@ public:
|
|||||||
virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const;
|
virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsIFactory* MOZ_WEAK_REF mFactory;
|
nsIFactory* MOZ_NON_OWNING_REF mFactory;
|
||||||
nsISupports* MOZ_WEAK_REF mOuter;
|
nsISupports* MOZ_NON_OWNING_REF mOuter;
|
||||||
nsresult* mErrorPtr;
|
nsresult* mErrorPtr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -385,7 +385,7 @@ public:
|
|||||||
enum { ALLOW_MEMMOVE = true };
|
enum { ALLOW_MEMMOVE = true };
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
T* MOZ_WEAK_REF mKey;
|
T* MOZ_NON_OWNING_REF mKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const;
|
virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsISupports* MOZ_WEAK_REF mSource;
|
nsISupports* MOZ_NON_OWNING_REF mSource;
|
||||||
nsresult* mErrorPtr;
|
nsresult* mErrorPtr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsISupports* MOZ_STRONG_REF mDoomed;
|
nsISupports* MOZ_OWNING_REF mDoomed;
|
||||||
};
|
};
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
@ -297,7 +297,7 @@ struct nsRunnableMethodReceiver<ClassType, void, Owning>
|
|||||||
template<class ClassType>
|
template<class ClassType>
|
||||||
struct nsRunnableMethodReceiver<ClassType, void, false>
|
struct nsRunnableMethodReceiver<ClassType, void, false>
|
||||||
{
|
{
|
||||||
ClassType* MOZ_WEAK_REF mObj;
|
ClassType* MOZ_NON_OWNING_REF mObj;
|
||||||
explicit nsRunnableMethodReceiver(ClassType* aObj) : mObj(aObj) {}
|
explicit nsRunnableMethodReceiver(ClassType* aObj) : mObj(aObj) {}
|
||||||
void Revoke() { mObj = nullptr; }
|
void Revoke() { mObj = nullptr; }
|
||||||
};
|
};
|
||||||
|
@ -45,7 +45,7 @@ private:
|
|||||||
mReferent = 0;
|
mReferent = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsSupportsWeakReference* MOZ_WEAK_REF mReferent;
|
nsSupportsWeakReference* MOZ_NON_OWNING_REF mReferent;
|
||||||
};
|
};
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
@ -31,7 +31,7 @@ private:
|
|||||||
// Called (only) by an |nsWeakReference| from _its_ dtor.
|
// Called (only) by an |nsWeakReference| from _its_ dtor.
|
||||||
void NoticeProxyDestruction() { mProxy = 0; }
|
void NoticeProxyDestruction() { mProxy = 0; }
|
||||||
|
|
||||||
nsWeakReference* MOZ_WEAK_REF mProxy;
|
nsWeakReference* MOZ_NON_OWNING_REF mProxy;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user