Bug 1837226 part 2: Upgrade some assertions to be release assertions in SwipeTracker.cpp. r=hiro

This patch just strengthens some invariants to be validated in release builds
as well.

Depends on D180239

Differential Revision: https://phabricator.services.mozilla.com/D180240
This commit is contained in:
Daniel Holbert 2023-06-07 22:02:29 +00:00
parent 6261b69841
commit f82eb9e9ec

View File

@ -62,8 +62,8 @@ SwipeTracker::SwipeTracker(nsIWidget& aWidget,
void SwipeTracker::Destroy() { UnregisterFromRefreshDriver(); }
SwipeTracker::~SwipeTracker() {
MOZ_ASSERT(!mRegisteredWithRefreshDriver,
"Destroy needs to be called before deallocating");
MOZ_RELEASE_ASSERT(!mRegisteredWithRefreshDriver,
"Destroy needs to be called before deallocating");
}
double SwipeTracker::SwipeSuccessTargetValue() const {
@ -177,7 +177,8 @@ void SwipeTracker::StartAnimating(double aStartValue, double aTargetValue) {
// Add ourselves as a refresh driver observer. The refresh driver
// will call WillRefresh for each animation frame until we
// unregister ourselves.
MOZ_ASSERT(!mRegisteredWithRefreshDriver);
MOZ_RELEASE_ASSERT(!mRegisteredWithRefreshDriver,
"We only want a single refresh driver registration");
if (mRefreshDriver) {
mRefreshDriver->AddRefreshObserver(this, FlushType::Style,
"Swipe animation");