Backed out changeset eeb7c0aec59c (bug 1605130) for build bustage at build/src/obj-firefox/dist/include/mozilla/OwningNonNull. on a CLOSED TREE

This commit is contained in:
Coroiu Cristina 2019-12-19 19:44:29 +02:00
parent 0e01c0c207
commit 13eac3a3c9

View File

@ -68,6 +68,21 @@ class MOZ_IS_SMARTPTR_TO_REFCOUNTED OwningNonNull {
// Don't allow assigning nullptr, it makes no sense
void operator=(decltype(nullptr)) = delete;
already_AddRefed<T> forget() {
#ifdef DEBUG
mInited = false;
#endif
return mPtr.forget();
}
template <class U>
void forget(U** aOther) {
#ifdef DEBUG
mInited = false;
#endif
mPtr.forget(aOther);
}
T& ref() const {
MOZ_ASSERT(mInited);
MOZ_ASSERT(mPtr, "OwningNonNull<T> was set to null");
@ -97,17 +112,6 @@ class MOZ_IS_SMARTPTR_TO_REFCOUNTED OwningNonNull {
return mPtr;
}
private:
already_AddRefed<T> forget() {
#ifdef DEBUG
mInited = false;
#endif
return mPtr.forget();
}
// Allow ImplCycleCollectionUnlink to call forget().
friend void ImplCycleCollectionUnlink(OwningNonNull<T>& aField);
protected:
template <typename U>
void init(U&& aValue) {