Bug 1432429 Layout Assertions 7/14 draft
authorAndrea Marchesini <amarchesini@mozilla.com>
Fri, 15 Jun 2018 19:10:32 -0700
changeset 826368 f1ae2971ce0a0d7a180fb8560cc4d6a103a94b62
parent 826367 6dba227d2f926b575f16258bfa82d76100414566
child 826369 16705fe987bc10e810b9b01bc2838f58f14e09ce
push id118310
push userbmo:tom@mozilla.com
push dateFri, 03 Aug 2018 18:22:17 +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.
    *