Bug 1508627: Remove dangerous assertion from nsCOMPtr r=froydnj

Move constructors and assignment operators are expected to be safe and
infallible. In debug mode, nsCOMPtr's move functions called a test function
that modified the pointee's refcount -- a potentially thread unsafe operation
that also opened the door to assertion failures if the pointee implemented
some access checks in AddRef() or Release(). This commit removes this function
call in those two functions.

Differential Revision: https://phabricator.services.mozilla.com/D12422

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Yaron Tausky 2018-11-21 14:50:58 +00:00
Родитель 79b7d9fe91
Коммит 103bf1caae
1 изменённых файлов: 0 добавлений и 2 удалений

Просмотреть файл

@ -554,7 +554,6 @@ public:
assert_validity();
aSmartPtr.mRawPtr = nullptr;
NSCAP_LOG_ASSIGNMENT(this, mRawPtr);
NSCAP_ASSERT_NO_QUERY_NEEDED();
}
template <class U>
@ -733,7 +732,6 @@ public:
nsCOMPtr<T>& operator=(nsCOMPtr<T>&& aRhs)
{
assign_assuming_AddRef(aRhs.forget().take());
NSCAP_ASSERT_NO_QUERY_NEEDED();
return *this;
}