Bug 1432429 Layout Assertions 7/14 draft
authorAndrea Marchesini <amarchesini@mozilla.com>
Fri, 15 Jun 2018 19:10:32 -0700
changeset 815066 20f67e9ae967b6c14ca7f08d4ac389a86fcc793f
parent 815065 d96bcba101c37dfcf171d2cd84653be165003025
child 815067 fb3fefc0fb5308cbd888452dfeff6decb873bc22
push id115424
push userbmo:tom@mozilla.com
push dateFri, 06 Jul 2018 17:03:34 +0000
bugs1432429
milestone62.0a1
Bug 1432429 Layout Assertions 7/14 MozReview-Commit-ID: bWStsijVfm
layout/base/nsRefreshDriver.cpp
mozglue/misc/TimeStamp.h
--- 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.
    *