Bug 1432429 Layout Assertions 7/14
MozReview-Commit-ID: bWStsijVfm
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -659,17 +659,27 @@ private:
MonitorAutoLock lock(mRefreshTickLock);
aVsyncTimestamp = mRecentVsync;
mProcessedVsync = true;
} else {
mLastChildTick = TimeStamp::Now();
mLastProcessedTickInChildProcess = aVsyncTimestamp;
}
+
+#ifdef MOZ_FUZZYFOX
+ TimeStamp rightnow = TimeStamp::Now();
+ // fuzzyfox hackyness in the case of moving between canonical and
+ // noncanonical time
+ if (rightnow.UsedCanonicalNow() == aVsyncTimestamp.UsedCanonicalNow()) {
+ MOZ_ASSERT(aVsyncTimestamp <= rightnow);
+ }
+#else
MOZ_ASSERT(aVsyncTimestamp <= TimeStamp::Now());
+#endif
// We might have a problem that we call ~VsyncRefreshDriverTimer() before
// the scheduled TickRefreshDriver() runs. Check mVsyncRefreshDriverTimer
// before use.
if (mVsyncRefreshDriverTimer) {
mVsyncRefreshDriverTimer->RunRefreshDrivers(aVsyncTimestamp);
}
--- a/mozglue/misc/TimeStamp.h
+++ b/mozglue/misc/TimeStamp.h
@@ -452,16 +452,20 @@ public:
* Return true if this is not the "null" moment, may be used in tests, e.g.:
* |if (timestamp) { ... }|
*/
explicit operator bool() const
{
return mValue != 0;
}
+#ifdef MOZ_FUZZYFOX
+ bool UsedCanonicalNow() const { return mUsedCanonicalNow; }
+#endif
+
/**
* Return a timestamp reflecting the current elapsed system time. This
* is monotonically increasing (i.e., does not decrease) over the
* lifetime of this process' XPCOM session.
*
* Now() is trying to ensure the best possible precision on each platform,
* at least one millisecond.
*