Bug 1437064 - Remove tracking timeouts list from TimeoutManager. r=chutten,Ehsan
authorAndreas Farre <farre@mozilla.com>
Fri, 12 Oct 2018 18:01:19 +0000
changeset 499664 4a230b07f0cbf48e87dcb4265ea2d00893bb1b62
parent 499663 db130923a2cdfd7872dcf4e745293ae62220ae3d
child 499665 224715760a637bc37c14794839468a954f1f2695
child 499686 5f44f57c4ae734a8c9ac490c4e520c703365beae
child 499728 1f2c8a6231564cbc7db6d7e9e21433007f508804
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschutten, Ehsan
bugs1437064
milestone64.0a1
first release with
nightly linux32
4a230b07f0cb / 64.0a1 / 20181015100128 / files
nightly linux64
4a230b07f0cb / 64.0a1 / 20181015100128 / files
nightly mac
4a230b07f0cb / 64.0a1 / 20181015100128 / files
nightly win32
4a230b07f0cb / 64.0a1 / 20181015100128 / files
nightly win64
4a230b07f0cb / 64.0a1 / 20181015100128 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1437064 - Remove tracking timeouts list from TimeoutManager. r=chutten,Ehsan Differential Revision: https://phabricator.services.mozilla.com/D7878
dom/base/OrderedTimeoutIterator.h
dom/base/Timeout.cpp
dom/base/Timeout.h
dom/base/TimeoutBudgetManager.cpp
dom/base/TimeoutBudgetManager.h
dom/base/TimeoutManager.cpp
dom/base/TimeoutManager.h
dom/base/nsDOMWindowUtils.cpp
dom/base/test/file_timer_flood.html
dom/base/test/test_timer_flood.html
dom/interfaces/base/nsIDOMWindowUtils.idl
toolkit/components/telemetry/Histograms.json
toolkit/components/url-classifier/tests/mochitest/chrome.ini
toolkit/components/url-classifier/tests/mochitest/classifierFrame.html
toolkit/components/url-classifier/tests/mochitest/mochitest.ini
toolkit/components/url-classifier/tests/mochitest/tracker.js
deleted file mode 100644
--- a/dom/base/OrderedTimeoutIterator.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_OrderedTimeoutIterator_h__
-#define mozilla_dom_OrderedTimeoutIterator_h__
-
-#include "mozilla/RefPtr.h"
-#include "mozilla/dom/Timeout.h"
-#include "mozilla/dom/TimeoutManager.h"
-
-namespace mozilla {
-namespace dom {
-
-// This class implements and iterator which iterates the normal and tracking
-// timeouts lists simultaneously in the mWhen order.
-class MOZ_STACK_CLASS OrderedTimeoutIterator final {
-public:
-  typedef TimeoutManager::Timeouts Timeouts;
-  typedef Timeouts::TimeoutList    TimeoutList;
-
-  OrderedTimeoutIterator(Timeouts& aNormalTimeouts,
-                         Timeouts& aTrackingTimeouts)
-    : mNormalTimeouts(aNormalTimeouts.mTimeoutList),
-      mTrackingTimeouts(aTrackingTimeouts.mTimeoutList),
-      mNormalIter(mNormalTimeouts.getFirst()),
-      mTrackingIter(mTrackingTimeouts.getFirst()),
-      mKind(Kind::None),
-      mUpdateIteratorCalled(true)
-  {
-  }
-
-  // Return the current timeout and move to the next one.
-  // Unless this is the first time calling Next(), you must call
-  // UpdateIterator() before calling this method.
-  Timeout* Next()
-  {
-    MOZ_ASSERT(mUpdateIteratorCalled);
-    MOZ_ASSERT_IF(mNormalIter, mNormalIter->isInList());
-    MOZ_ASSERT_IF(mTrackingIter, mTrackingIter->isInList());
-
-    mUpdateIteratorCalled = false;
-    mKind = Kind::None;
-    Timeout* timeout = nullptr;
-    if (!mNormalIter) {
-      if (!mTrackingIter) {
-        // We have reached the end of both lists.  Bail out!
-        return nullptr;
-      } else {
-        // We have reached the end of the normal timeout list, select the next
-        // tracking timeout.
-        timeout = mTrackingIter;
-        mKind = Kind::Tracking;
-      }
-    } else if (!mTrackingIter) {
-      // We have reached the end of the tracking timeout list, select the next
-      // normal timeout.
-      timeout = mNormalIter;
-      mKind = Kind::Normal;
-    } else {
-      // If we have a normal and a tracking timer, return the one with the
-      // smaller mWhen (and prefer the timeout with a lower ID in case they are
-      // equal.) Otherwise, return whichever iterator has an item left,
-      // preferring a non-tracking timeout again.  Note that in practice, even
-      // if a web page calls setTimeout() twice in a row, it should get
-      // different mWhen values, so in practice we shouldn't fall back to
-      // comparing timeout IDs.
-      if (mNormalIter && mTrackingIter &&
-          (mTrackingIter->When() < mNormalIter->When() ||
-           (mTrackingIter->When() == mNormalIter->When() &&
-            mTrackingIter->mTimeoutId < mNormalIter->mTimeoutId))) {
-        timeout = mTrackingIter;
-        mKind = Kind::Tracking;
-      } else if (mNormalIter) {
-        timeout = mNormalIter;
-        mKind = Kind::Normal;
-      } else if (mTrackingIter) {
-        timeout = mTrackingIter;
-        mKind = Kind::Tracking;
-      }
-    }
-    if (!timeout) {
-      // We didn't find any suitable iterator.  This can happen for example
-      // when getNext() in UpdateIterator() returns nullptr and then Next()
-      // gets called.  Bail out!
-      return nullptr;
-    }
-
-    MOZ_ASSERT(mKind != Kind::None);
-
-    // Record the current timeout we just found.
-    mCurrent = timeout;
-    MOZ_ASSERT(mCurrent);
-
-    return mCurrent;
-  }
-
-  // Prepare the iterator for the next call to Next().
-  // This method can be called as many times as needed.  Calling this more than
-  // once is helpful in cases where we expect the timeouts list has been
-  // modified before we got a chance to call Next().
-  void UpdateIterator()
-  {
-    MOZ_ASSERT(mKind != Kind::None);
-    // Update the winning iterator to point to the next element.  Also check to
-    // see if the other iterator is still valid, otherwise reset it to the
-    // beginning of the list.  This is needed in case a timeout handler removes
-    // the timeout pointed to from one of our iterators.
-    if (mKind == Kind::Normal) {
-      mNormalIter = mCurrent->getNext();
-      if (mTrackingIter && !mTrackingIter->isInList()) {
-        mTrackingIter = mTrackingTimeouts.getFirst();
-      }
-    } else {
-      mTrackingIter = mCurrent->getNext();
-      if (mNormalIter && !mNormalIter->isInList()) {
-        mNormalIter = mNormalTimeouts.getFirst();
-      }
-    }
-
-    mUpdateIteratorCalled = true;
-  }
-
-  // This function resets the iterator to a defunct state.  It should only be
-  // used when we want to forcefully sever all of the strong references this
-  // class holds.
-  void Clear()
-  {
-    // Release all strong references.
-    mNormalIter = nullptr;
-    mTrackingIter = nullptr;
-    mCurrent = nullptr;
-    mKind = Kind::None;
-    mUpdateIteratorCalled = true;
-  }
-
-  // Returns true if the previous call to Next() picked a normal timeout.
-  // Cannot be called before Next() has been called.  Note that the result of
-  // this method is only affected by Next() and not UpdateIterator(), so calling
-  // UpdateIterator() before calling this is allowed.
-  bool PickedNormalIter() const
-  {
-    MOZ_ASSERT(mKind != Kind::None);
-    return mKind == Kind::Normal;
-  }
-
-  // Returns true if the previous call to Next() picked a tracking timeout.
-  // Cannot be called before Next() has been called.  Note that the result of
-  // this method is only affected by Next() and not UpdateIterator(), so calling
-  // UpdateIterator() before calling this is allowed.
-  bool PickedTrackingIter() const
-  {
-    MOZ_ASSERT(mKind != Kind::None);
-    return mKind == Kind::Tracking;
-  }
-
-private:
-  TimeoutList& mNormalTimeouts;          // The list of normal timeouts.
-  TimeoutList& mTrackingTimeouts;        // The list of tracking timeouts.
-  RefPtr<Timeout> mNormalIter;           // The iterator over the normal timeout list.
-  RefPtr<Timeout> mTrackingIter;         // The iterator over the tracking timeout list.
-  RefPtr<Timeout> mCurrent;              // The current timeout that Next() just found.
-  enum class Kind { Normal, Tracking, None };
-  Kind mKind;                            // The kind of iterator picked the last time.
-  DebugOnly<bool> mUpdateIteratorCalled; // Whether we have called UpdateIterator() before calling Next().
-};
-
-}
-}
-
-#endif
--- a/dom/base/Timeout.cpp
+++ b/dom/base/Timeout.cpp
@@ -14,18 +14,17 @@ namespace dom {
 Timeout::Timeout()
   : mTimeoutId(0),
     mFiringId(TimeoutManager::InvalidFiringId),
     mPopupState(openAllowed),
     mReason(Reason::eTimeoutOrInterval),
     mNestingLevel(0),
     mCleared(false),
     mRunning(false),
-    mIsInterval(false),
-    mIsTracking(false)
+    mIsInterval(false)
 {
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(Timeout)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Timeout)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mWindow)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mScriptHandler)
--- a/dom/base/Timeout.h
+++ b/dom/base/Timeout.h
@@ -99,17 +99,14 @@ public:
   // True if the timeout was cleared
   bool mCleared;
 
   // True if this is one of the timeouts that are currently running
   bool mRunning;
 
   // True if this is a repeating/interval timer
   bool mIsInterval;
-
-  // True if this is a timeout coming from a tracking script
-  bool mIsTracking;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_timeout_h
--- a/dom/base/TimeoutBudgetManager.cpp
+++ b/dom/base/TimeoutBudgetManager.cpp
@@ -6,19 +6,16 @@
 
 #include "TimeoutBudgetManager.h"
 
 #include "mozilla/dom/Timeout.h"
 
 namespace mozilla {
 namespace dom {
 
-// Time between sampling timeout execution time.
-const uint32_t kTelemetryPeriodMS = 1000;
-
 /* static */ TimeoutBudgetManager&
 TimeoutBudgetManager::Get()
 {
   static TimeoutBudgetManager gTimeoutBudgetManager;
   return gTimeoutBudgetManager;
 }
 
 void
@@ -30,68 +27,21 @@ TimeoutBudgetManager::StartRecording(con
 void
 TimeoutBudgetManager::StopRecording()
 {
   mStart = TimeStamp();
 }
 
 TimeDuration
 TimeoutBudgetManager::RecordExecution(const TimeStamp& aNow,
-                                      const Timeout* aTimeout,
-                                      bool aIsBackground)
+                                      const Timeout* aTimeout)
 {
   if (!mStart) {
     // If we've started a sync operation mStart might be null, in
     // which case we should not record this piece of execution.
     return TimeDuration();
   }
 
-  TimeDuration duration = aNow - mStart;
-
-  if (aIsBackground) {
-    if (aTimeout->mIsTracking) {
-      mTelemetryData.mBackgroundTracking += duration;
-    } else {
-      mTelemetryData.mBackgroundNonTracking += duration;
-    }
-  } else {
-    if (aTimeout->mIsTracking) {
-      mTelemetryData.mForegroundTracking += duration;
-    } else {
-      mTelemetryData.mForegroundNonTracking += duration;
-    }
-  }
-
-  return duration;
-}
-
-void
-TimeoutBudgetManager::Accumulate(Telemetry::HistogramID aId,
-                                 const TimeDuration& aSample)
-{
-  uint32_t sample = std::round(aSample.ToMilliseconds());
-  if (sample) {
-    Telemetry::Accumulate(aId, sample);
-  }
-}
-
-void
-TimeoutBudgetManager::MaybeCollectTelemetry(const TimeStamp& aNow)
-{
-  if ((aNow - mLastCollection).ToMilliseconds() < kTelemetryPeriodMS) {
-    return;
-  }
-
-  Accumulate(Telemetry::TIMEOUT_EXECUTION_FG_TRACKING_MS,
-             mTelemetryData.mForegroundTracking);
-  Accumulate(Telemetry::TIMEOUT_EXECUTION_FG_MS,
-             mTelemetryData.mForegroundNonTracking);
-  Accumulate(Telemetry::TIMEOUT_EXECUTION_BG_TRACKING_MS,
-             mTelemetryData.mBackgroundTracking);
-  Accumulate(Telemetry::TIMEOUT_EXECUTION_BG_MS,
-             mTelemetryData.mBackgroundNonTracking);
-
-  mTelemetryData = TelemetryData();
-  mLastCollection = aNow;
+  return aNow - mStart;
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/base/TimeoutBudgetManager.h
+++ b/dom/base/TimeoutBudgetManager.h
@@ -2,47 +2,33 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_timeoutbudgetmanager_h
 #define mozilla_dom_timeoutbudgetmanager_h
 
-#include "mozilla/Telemetry.h"
 #include "mozilla/TimeStamp.h"
 
 namespace mozilla {
 namespace dom {
 
 class Timeout;
 
 class TimeoutBudgetManager
 {
 public:
   static TimeoutBudgetManager& Get();
   void StartRecording(const TimeStamp& aNow);
   void StopRecording();
   TimeDuration RecordExecution(const TimeStamp& aNow,
-                               const Timeout* aTimeout,
-                               bool aIsBackground);
-  void MaybeCollectTelemetry(const TimeStamp& aNow);
+                               const Timeout* aTimeout);
 private:
-  TimeoutBudgetManager() : mLastCollection(TimeStamp::Now()) {}
-  struct TelemetryData
-  {
-    TimeDuration mForegroundTracking;
-    TimeDuration mForegroundNonTracking;
-    TimeDuration mBackgroundTracking;
-    TimeDuration mBackgroundNonTracking;
-  };
+  TimeoutBudgetManager() = default;
 
-  void Accumulate(Telemetry::HistogramID aId, const TimeDuration& aSample);
-
-  TelemetryData mTelemetryData;
   TimeStamp mStart;
-  TimeStamp mLastCollection;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_timeoutbudgetmanager_h
--- a/dom/base/TimeoutManager.cpp
+++ b/dom/base/TimeoutManager.cpp
@@ -13,17 +13,16 @@
 #include "mozilla/Telemetry.h"
 #include "mozilla/ThrottledEventQueue.h"
 #include "mozilla/TimeStamp.h"
 #include "nsIDocShell.h"
 #include "nsINamed.h"
 #include "nsITimeoutHandler.h"
 #include "mozilla/dom/DocGroup.h"
 #include "mozilla/dom/TabGroup.h"
-#include "OrderedTimeoutIterator.h"
 #include "TimeoutExecutor.h"
 #include "TimeoutBudgetManager.h"
 #include "mozilla/net/WebSocketEventService.h"
 #include "mozilla/MediaManager.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
@@ -288,21 +287,16 @@ TimeoutManager::CalculateDelay(Timeout* 
   MOZ_DIAGNOSTIC_ASSERT(aTimeout);
   TimeDuration result = aTimeout->mInterval;
 
   if (aTimeout->mNestingLevel >= DOM_CLAMP_TIMEOUT_NESTING_LEVEL) {
     result = TimeDuration::Max(
       result, TimeDuration::FromMilliseconds(gMinClampTimeoutValue));
   }
 
-  if (aTimeout->mIsTracking && mThrottleTrackingTimeouts) {
-    result = TimeDuration::Max(
-      result, TimeDuration::FromMilliseconds(gMinTrackingTimeoutValue));
-  }
-
   return result;
 }
 
 PerformanceCounter*
 TimeoutManager::GetPerformanceCounter()
 {
   if (!StaticPrefs::dom_performance_enable_scheduler_timing()) {
     return nullptr;
@@ -327,19 +321,17 @@ TimeoutManager::RecordExecution(Timeout*
   }
 
   TimeoutBudgetManager& budgetManager = TimeoutBudgetManager::Get();
   TimeStamp now = TimeStamp::Now();
 
   if (aRunningTimeout) {
     // If we're running a timeout callback, record any execution until
     // now.
-    TimeDuration duration = budgetManager.RecordExecution(
-      now, aRunningTimeout, mWindow.IsBackgroundInternal());
-    budgetManager.MaybeCollectTelemetry(now);
+    TimeDuration duration = budgetManager.RecordExecution(now, aRunningTimeout);
 
     UpdateBudget(now, duration);
 
     // This is an ad-hoc way to use the counters for the timers
     // that should be removed at somepoint. See Bug 1482834
     PerformanceCounter* counter = GetPerformanceCounter();
     if (counter) {
       counter->IncrementExecutionDuration(duration.ToMicroseconds());
@@ -391,23 +383,16 @@ TimeoutManager::UpdateBudget(const TimeS
     // timeouts being executed, even though budget throttling isn't
     // active at the moment.
     mExecutionBudget = GetMaxBudget(isBackground);
   }
 
   mLastBudgetUpdate = aNow;
 }
 
-#define TRACKING_SEPARATE_TIMEOUT_BUCKETING_STRATEGY 0 // Consider all timeouts coming from tracking scripts as tracking
-// These strategies are useful for testing.
-#define ALL_NORMAL_TIMEOUT_BUCKETING_STRATEGY        1 // Consider all timeouts as normal
-#define ALTERNATE_TIMEOUT_BUCKETING_STRATEGY         2 // Put every other timeout in the list of tracking timeouts
-#define RANDOM_TIMEOUT_BUCKETING_STRATEGY            3 // Put timeouts into either the normal or tracking timeouts list randomly
-static int32_t gTimeoutBucketingStrategy = 0;
-
 #define DEFAULT_TIMEOUT_THROTTLING_DELAY           -1  // Only positive integers cause us to introduce a delay for
                                                        // timeout throttling.
 
 // The longest interval (as PRIntervalTime) we permit, or that our
 // timer code can handle, really. See DELAY_INTERVAL_LIMIT in
 // nsTimerImpl.h for details.
 #define DOM_MAX_TIMEOUT_VALUE    DELAY_INTERVAL_LIMIT
 
@@ -425,18 +410,17 @@ uint32_t gMaxConsecutiveCallbacksMillise
 #define DEFAULT_DISABLE_OPEN_CLICK_DELAY 0
 int32_t gDisableOpenClickDelay;
 
 } // anonymous namespace
 
 TimeoutManager::TimeoutManager(nsGlobalWindowInner& aWindow)
   : mWindow(aWindow),
     mExecutor(new TimeoutExecutor(this)),
-    mNormalTimeouts(*this),
-    mTrackingTimeouts(*this),
+    mTimeouts(*this),
     mTimeoutIdCounter(1),
     mNextFiringId(InvalidFiringId + 1),
     mRunningTimeout(nullptr),
     mIdleCallbackTimeoutCounter(1),
     mLastBudgetUpdate(TimeStamp::Now()),
     mExecutionBudget(GetMaxBudget(mWindow.IsBackgroundInternal())),
     mThrottleTimeouts(false),
     mThrottleTrackingTimeouts(false),
@@ -469,19 +453,16 @@ TimeoutManager::Initialize()
                               "dom.min_background_timeout_value",
                               DEFAULT_MIN_BACKGROUND_TIMEOUT_VALUE);
   Preferences::AddIntVarCache(&gMinTrackingTimeoutValue,
                               "dom.min_tracking_timeout_value",
                               DEFAULT_MIN_TRACKING_TIMEOUT_VALUE);
   Preferences::AddIntVarCache(&gMinTrackingBackgroundTimeoutValue,
                               "dom.min_tracking_background_timeout_value",
                               DEFAULT_MIN_TRACKING_BACKGROUND_TIMEOUT_VALUE);
-  Preferences::AddIntVarCache(&gTimeoutBucketingStrategy,
-                              "dom.timeout_bucketing_strategy",
-                              TRACKING_SEPARATE_TIMEOUT_BUCKETING_STRATEGY);
   Preferences::AddIntVarCache(&gTimeoutThrottlingDelay,
                               "dom.timeout.throttling_delay",
                               DEFAULT_TIMEOUT_THROTTLING_DELAY);
 
   Preferences::AddBoolVarCache(&gAnnotateTrackingChannels,
                                "privacy.trackingprotection.annotate_channels",
                                false);
 
@@ -558,53 +539,16 @@ TimeoutManager::SetTimeout(nsITimeoutHan
   timeout->mIsInterval = aIsInterval;
   timeout->mInterval = TimeDuration::FromMilliseconds(interval);
   timeout->mScriptHandler = aHandler;
   timeout->mReason = aReason;
 
   // No popups from timeouts by default
   timeout->mPopupState = openAbused;
 
-  switch (gTimeoutBucketingStrategy) {
-  default:
-  case TRACKING_SEPARATE_TIMEOUT_BUCKETING_STRATEGY: {
-    const char* filename = nullptr;
-    uint32_t dummyLine = 0, dummyColumn = 0;
-    aHandler->GetLocation(&filename, &dummyLine, &dummyColumn);
-    timeout->mIsTracking = doc->IsScriptTracking(nsDependentCString(filename));
-
-    MOZ_LOG(gLog, LogLevel::Debug,
-            ("Classified timeout %p set from %s as %stracking\n",
-             timeout.get(), filename, timeout->mIsTracking ? "" : "non-"));
-    break;
-  }
-  case ALL_NORMAL_TIMEOUT_BUCKETING_STRATEGY:
-    // timeout->mIsTracking is already false!
-    MOZ_DIAGNOSTIC_ASSERT(!timeout->mIsTracking);
-
-    MOZ_LOG(gLog, LogLevel::Debug,
-            ("Classified timeout %p unconditionally as normal\n",
-             timeout.get()));
-    break;
-  case ALTERNATE_TIMEOUT_BUCKETING_STRATEGY:
-    timeout->mIsTracking = (mTimeoutIdCounter % 2) == 0;
-
-    MOZ_LOG(gLog, LogLevel::Debug,
-            ("Classified timeout %p as %stracking (alternating mode)\n",
-             timeout.get(), timeout->mIsTracking ? "" : "non-"));
-    break;
-  case RANDOM_TIMEOUT_BUCKETING_STRATEGY:
-    timeout->mIsTracking = (rand() % 2) == 0;
-
-    MOZ_LOG(gLog, LogLevel::Debug,
-            ("Classified timeout %p as %stracking (random mode)\n",
-             timeout.get(), timeout->mIsTracking ? "" : "non-"));
-    break;
-  }
-
   timeout->mNestingLevel = sNestingLevel < DOM_CLAMP_TIMEOUT_NESTING_LEVEL
                          ? sNestingLevel + 1 : sNestingLevel;
 
   // Now clamp the actual interval we will use for the timer based on
   TimeDuration realInterval = CalculateDelay(timeout);
   TimeStamp now = TimeStamp::Now();
   timeout->SetWhenOrTimeRemaining(now, realInterval);
 
@@ -628,59 +572,53 @@ TimeoutManager::SetTimeout(nsITimeoutHan
     // in some cases.
     if (interval <= gDisableOpenClickDelay) {
       timeout->mPopupState = nsContentUtils::GetPopupControlState();
     }
   }
 
   Timeouts::SortBy sort(mWindow.IsFrozen() ? Timeouts::SortBy::TimeRemaining
                                            : Timeouts::SortBy::TimeWhen);
-  if (timeout->mIsTracking) {
-    mTrackingTimeouts.Insert(timeout, sort);
-  } else {
-    mNormalTimeouts.Insert(timeout, sort);
-  }
+  mTimeouts.Insert(timeout, sort);
 
   timeout->mTimeoutId = GetTimeoutId(aReason);
   *aReturn = timeout->mTimeoutId;
 
   MOZ_LOG(gLog,
           LogLevel::Debug,
           ("Set%s(TimeoutManager=%p, timeout=%p, delay=%i, "
            "minimum=%f, throttling=%s, state=%s(%s), realInterval=%f) "
-           "returned %stracking timeout ID %u, budget=%d\n",
+           "returned timeout ID %u, budget=%d\n",
            aIsInterval ? "Interval" : "Timeout",
            this, timeout.get(), interval,
            (CalculateDelay(timeout) - timeout->mInterval).ToMilliseconds(),
            mThrottleTimeouts
              ? "yes"
              : (mThrottleTimeoutsTimer ? "pending" : "no"),
            IsActive() ? "active" : "inactive",
            mWindow.IsBackgroundInternal() ? "background" : "foreground",
            realInterval.ToMilliseconds(),
-           timeout->mIsTracking ? "" : "non-",
            timeout->mTimeoutId,
            int(mExecutionBudget.ToMilliseconds())));
 
   return NS_OK;
 }
 
 void
 TimeoutManager::ClearTimeout(int32_t aTimerId, Timeout::Reason aReason)
 {
   uint32_t timerId = (uint32_t)aTimerId;
 
   bool firstTimeout = true;
   bool deferredDeletion = false;
 
-  ForEachUnorderedTimeoutAbortable([&](Timeout* aTimeout) {
+  mTimeouts.ForEachAbortable([&](Timeout* aTimeout) {
     MOZ_LOG(gLog, LogLevel::Debug,
-            ("Clear%s(TimeoutManager=%p, timeout=%p, aTimerId=%u, ID=%u, tracking=%d)\n", aTimeout->mIsInterval ? "Interval" : "Timeout",
-             this, aTimeout, timerId, aTimeout->mTimeoutId,
-             int(aTimeout->mIsTracking)));
+            ("Clear%s(TimeoutManager=%p, timeout=%p, aTimerId=%u, ID=%u)\n", aTimeout->mIsInterval ? "Interval" : "Timeout",
+             this, aTimeout, timerId, aTimeout->mTimeoutId));
 
     if (aTimeout->mTimeoutId == timerId && aTimeout->mReason == aReason) {
       if (aTimeout->mRunning) {
         /* We're running from inside the aTimeout. Mark this
            aTimeout for deferred deletion by the code in
            RunTimeout() */
         aTimeout->mIsInterval = false;
         deferredDeletion = true;
@@ -707,18 +645,17 @@ TimeoutManager::ClearTimeout(int32_t aTi
   //    Timeouts.
   if (!firstTimeout || deferredDeletion || mWindow.IsSuspended()) {
     return;
   }
 
   // Stop the executor and restart it at the next soonest deadline.
   mExecutor->Cancel();
 
-  OrderedTimeoutIterator iter(mNormalTimeouts, mTrackingTimeouts);
-  Timeout* nextTimeout = iter.Next();
+  Timeout* nextTimeout = mTimeouts.GetFirst();
   if (nextTimeout) {
     MOZ_ALWAYS_SUCCEEDS(MaybeSchedule(nextTimeout->When()));
   }
 }
 
 void
 TimeoutManager::RunTimeout(const TimeStamp& aNow, const TimeStamp& aTargetDeadline)
 {
@@ -782,49 +719,40 @@ TimeoutManager::RunTimeout(const TimeSta
   uint32_t numTimersToRun = 0;
 
   // The timeout list is kept in deadline order. Discover the latest timeout
   // whose deadline has expired. On some platforms, native timeout events fire
   // "early", but we handled that above by setting deadline to aTargetDeadline
   // if the timer fired early.  So we can stop walking if we get to timeouts
   // whose When() is greater than deadline, since once that happens we know
   // nothing past that point is expired.
-  {
-    // Use a nested scope in order to make sure the strong references held by
-    // the iterator are freed after the loop.
-    OrderedTimeoutIterator expiredIter(mNormalTimeouts, mTrackingTimeouts);
-
-    while (true) {
-      Timeout* timeout = expiredIter.Next();
-      if (!timeout || totalTimeLimit.IsZero() || timeout->When() > deadline) {
-        if (timeout) {
-          nextDeadline = timeout->When();
-        }
-        break;
-      }
+  for (Timeout* timeout = mTimeouts.GetFirst();
+       timeout != nullptr;
+       timeout = timeout->getNext()) {
+    if (totalTimeLimit.IsZero() || timeout->When() > deadline) {
+      nextDeadline = timeout->When();
+      break;
+    }
 
-      if (IsInvalidFiringId(timeout->mFiringId)) {
-        // Mark any timeouts that are on the list to be fired with the
-        // firing depth so that we can reentrantly run timeouts
-        timeout->mFiringId = firingId;
+    if (IsInvalidFiringId(timeout->mFiringId)) {
+      // Mark any timeouts that are on the list to be fired with the
+      // firing depth so that we can reentrantly run timeouts
+      timeout->mFiringId = firingId;
 
-        numTimersToRun += 1;
+      numTimersToRun += 1;
 
-        // Run only a limited number of timers based on the configured maximum.
-        if (numTimersToRun % kNumTimersPerInitialElapsedCheck == 0) {
-          now = TimeStamp::Now();
-          TimeDuration elapsed(now - start);
-          if (elapsed >= initialTimeLimit) {
-            nextDeadline = timeout->When();
-            break;
-          }
+      // Run only a limited number of timers based on the configured maximum.
+      if (numTimersToRun % kNumTimersPerInitialElapsedCheck == 0) {
+        now = TimeStamp::Now();
+        TimeDuration elapsed(now - start);
+        if (elapsed >= initialTimeLimit) {
+          nextDeadline = timeout->When();
+          break;
         }
       }
-
-      expiredIter.UpdateIterator();
     }
   }
 
   now = TimeStamp::Now();
 
   // Wherever we stopped in the timer list, schedule the executor to
   // run for the next unexpired deadline.  Note, this *must* be done
   // before we start executing any content script handlers.  If one
@@ -848,27 +776,28 @@ TimeoutManager::RunTimeout(const TimeSta
   // Now we need to search the normal and tracking timer list at the same
   // time to run the timers in the scheduled order.
 
   // We stop iterating each list when we go past the last expired timeout from
   // that list that we have observed above.  That timeout will either be the
   // next item after the last timeout we looked at or nullptr if we have
   // exhausted the entire list while looking for the last expired timeout.
   {
-    // Use a nested scope in order to make sure the strong references held by
-    // the iterator are freed after the loop.
-    OrderedTimeoutIterator runIter(mNormalTimeouts, mTrackingTimeouts);
-    while (true) {
-      RefPtr<Timeout> timeout = runIter.Next();
-      if (!timeout) {
-        // We have run out of timeouts!
-        break;
-      }
-      runIter.UpdateIterator();
+    // Use a nested scope in order to make sure the strong references held while
+    // iterating are freed after the loop.
 
+    // The next timeout to run. This is used to advance the loop, but
+    // we cannot set it until we've run the current timeout, since
+    // running the current timeout might remove the immediate next
+    // timeout.
+    RefPtr<Timeout> next;
+
+    for (RefPtr<Timeout> timeout = mTimeouts.GetFirst();
+         timeout != nullptr;
+         timeout = next) {
       // We should only execute callbacks for the set of expired Timeout
       // objects we computed above.
       if (timeout->mFiringId != firingId) {
         // If the FiringId does not match, but is still valid, then this is
         // a TImeout for another RunTimeout() on the call stack.  Just
         // skip it.
         if (IsValidFiringId(timeout->mFiringId)) {
           continue;
@@ -902,25 +831,28 @@ TimeoutManager::RunTimeout(const TimeSta
         // so just remove it.
         timeout->remove();
         continue;
       }
 
       // This timeout is good to run
       bool timeout_was_cleared = mWindow.RunTimeoutHandler(timeout, scx);
 
-      MOZ_LOG(gLog, LogLevel::Debug,
-              ("Run%s(TimeoutManager=%p, timeout=%p, tracking=%d) returned %d\n", timeout->mIsInterval ? "Interval" : "Timeout",
-               this, timeout.get(),
-               int(timeout->mIsTracking),
-               !!timeout_was_cleared));
+      MOZ_LOG(
+        gLog,
+        LogLevel::Debug,
+        ("Run%s(TimeoutManager=%p, timeout=%p) returned %d\n",
+         timeout->mIsInterval ? "Interval" : "Timeout",
+         this,
+         timeout.get(),
+         !!timeout_was_cleared));
 
       if (timeout_was_cleared) {
-        // Make sure the iterator isn't holding any Timeout objects alive.
-        runIter.Clear();
+        // Make sure we're not holding any Timeout objects alive.
+        next = nullptr;
 
         // Since ClearAllTimeouts() was called the lists should be empty.
         MOZ_DIAGNOSTIC_ASSERT(!HasTimeouts());
 
         return;
       }
 
       // If we need to reschedule a setInterval() the delay should be
@@ -931,54 +863,47 @@ TimeoutManager::RunTimeout(const TimeSta
       now = TimeStamp::Now();
 
       // If we have a regular interval timer, we re-schedule the
       // timeout, accounting for clock drift.
       bool needsReinsertion = RescheduleTimeout(timeout, lastCallbackTime, now);
 
       // Running a timeout can cause another timeout to be deleted, so
       // we need to reset the pointer to the following timeout.
-      runIter.UpdateIterator();
+      next = timeout->getNext();
 
       timeout->remove();
 
       if (needsReinsertion) {
         // Insert interval timeout onto the corresponding list sorted in
         // deadline order. AddRefs timeout.
-        if (runIter.PickedTrackingIter()) {
-          mTrackingTimeouts.Insert(timeout,
-                                   mWindow.IsFrozen() ? Timeouts::SortBy::TimeRemaining
-                                                      : Timeouts::SortBy::TimeWhen);
-        } else {
-          mNormalTimeouts.Insert(timeout,
-                                 mWindow.IsFrozen() ? Timeouts::SortBy::TimeRemaining
-                                                    : Timeouts::SortBy::TimeWhen);
-        }
+        mTimeouts.Insert(timeout,
+                         mWindow.IsFrozen() ? Timeouts::SortBy::TimeRemaining
+                                            : Timeouts::SortBy::TimeWhen);
       }
 
       // Check to see if we have run out of time to execute timeout handlers.
       // If we've exceeded our time budget then terminate the loop immediately.
       TimeDuration elapsed = now - start;
       if (elapsed >= totalTimeLimit) {
         // We ran out of time.  Make sure to schedule the executor to
         // run immediately for the next timer, if it exists.  Its possible,
         // however, that the last timeout handler suspended the window.  If
         // that happened then we must skip this step.
         if (!mWindow.IsSuspended()) {
-          RefPtr<Timeout> timeout = runIter.Next();
-          if (timeout) {
+          if (next) {
             // If we ran out of execution budget we need to force a
             // reschedule. By cancelling the executor we will not run
             // immediately, but instead reschedule to the minimum
             // scheduling delay.
             if (mExecutionBudget < TimeDuration()) {
               mExecutor->Cancel();
             }
 
-            MOZ_ALWAYS_SUCCEEDS(MaybeSchedule(timeout->When(), now));
+            MOZ_ALWAYS_SUCCEEDS(MaybeSchedule(next->When(), now));
           }
         }
         break;
       }
     }
   }
 }
 
@@ -1051,18 +976,17 @@ TimeoutManager::ClearAllTimeouts()
     }
 
     // Set timeout->mCleared to true to indicate that the timeout was
     // cleared and taken out of the list of timeouts
     aTimeout->mCleared = true;
   });
 
   // Clear out our list
-  mNormalTimeouts.Clear();
-  mTrackingTimeouts.Clear();
+  mTimeouts.Clear();
 }
 
 void
 TimeoutManager::Timeouts::Insert(Timeout* aTimeout, SortBy aSortBy)
 {
 
   // Start at mLastTimeout and go backwards.  Stop if we see a Timeout with a
   // valid FiringId since those timers are currently being processed by
@@ -1144,18 +1068,17 @@ TimeoutManager::Resume()
 
   // When Suspend() has been called after IsDocumentLoaded(), but the
   // throttle tracking timer never managed to fire, start the timer
   // again.
   if (mWindow.AsInner()->IsDocumentLoaded() && !mThrottleTimeouts) {
     MaybeStartThrottleTimeout();
   }
 
-  OrderedTimeoutIterator iter(mNormalTimeouts, mTrackingTimeouts);
-  Timeout* nextTimeout = iter.Next();
+  Timeout* nextTimeout = mTimeouts.GetFirst();
   if (nextTimeout) {
     MOZ_ALWAYS_SUCCEEDS(MaybeSchedule(nextTimeout->When()));
   }
 }
 
 void
 TimeoutManager::Freeze()
 {
@@ -1197,33 +1120,24 @@ TimeoutManager::UpdateBackgroundState()
 {
   mExecutionBudget = GetMaxBudget(mWindow.IsBackgroundInternal());
 
   // When the window moves to the background or foreground we should
   // reschedule the TimeoutExecutor in case the MinSchedulingDelay()
   // changed.  Only do this if the window is not suspended and we
   // actually have a timeout.
   if (!mWindow.IsSuspended()) {
-    OrderedTimeoutIterator iter(mNormalTimeouts, mTrackingTimeouts);
-    Timeout* nextTimeout = iter.Next();
+    Timeout* nextTimeout = mTimeouts.GetFirst();
     if (nextTimeout) {
       mExecutor->Cancel();
       MOZ_ALWAYS_SUCCEEDS(MaybeSchedule(nextTimeout->When()));
     }
   }
 }
 
-bool
-TimeoutManager::IsTimeoutTracking(uint32_t aTimeoutId)
-{
-  return mTrackingTimeouts.ForEachAbortable([&](Timeout* aTimeout) {
-      return aTimeout->mTimeoutId == aTimeoutId;
-    });
-}
-
 namespace {
 
 class ThrottleTimeoutsCallback final : public nsITimerCallback
                                      , public nsINamed
 {
 public:
   explicit ThrottleTimeoutsCallback(nsGlobalWindowInner* aWindow)
     : mWindow(aWindow)
--- a/dom/base/TimeoutManager.h
+++ b/dom/base/TimeoutManager.h
@@ -16,17 +16,16 @@ class nsITimer;
 class nsGlobalWindowInner;
 
 namespace mozilla {
 
 class PerformanceCounter;
 
 namespace dom {
 
-class OrderedTimeoutIterator;
 class TimeoutExecutor;
 
 // This class manages the timeouts in a Window's setTimeout/setInterval pool.
 class TimeoutManager final
 {
 public:
   explicit TimeoutManager(nsGlobalWindowInner& aWindow);
   ~TimeoutManager();
@@ -35,18 +34,17 @@ public:
 
   bool IsRunningTimeout() const;
 
   static uint32_t GetNestingLevel() { return sNestingLevel; }
   static void SetNestingLevel(uint32_t aLevel) { sNestingLevel = aLevel; }
 
   bool HasTimeouts() const
   {
-    return !mNormalTimeouts.IsEmpty() ||
-           !mTrackingTimeouts.IsEmpty();
+    return !mTimeouts.IsEmpty();
   }
 
   nsresult SetTimeout(nsITimeoutHandler* aHandler,
                       int32_t interval, bool aIsInterval,
                       mozilla::dom::Timeout::Reason aReason,
                       int32_t* aReturn);
   void ClearTimeout(int32_t aTimerId,
                     mozilla::dom::Timeout::Reason aReason);
@@ -76,41 +74,26 @@ public:
 
   // This should be called by nsGlobalWindow when the window might have moved
   // to the background or foreground.
   void UpdateBackgroundState();
 
   // Initialize TimeoutManager before the first time it is accessed.
   static void Initialize();
 
-  // Exposed only for testing
-  bool IsTimeoutTracking(uint32_t aTimeoutId);
-
   // The document finished loading
   void OnDocumentLoaded();
   void StartThrottlingTimeouts();
 
   // Run some code for each Timeout in our list.  Note that this function
   // doesn't guarantee that Timeouts are iterated in any particular order.
   template <class Callable>
   void ForEachUnorderedTimeout(Callable c)
   {
-    mNormalTimeouts.ForEach(c);
-    mTrackingTimeouts.ForEach(c);
-  }
-
-  // Run some code for each Timeout in our list, but let the callback cancel the
-  // iteration by returning true.  Note that this function doesn't guarantee
-  // that Timeouts are iterated in any particular order.
-  template <class Callable>
-  void ForEachUnorderedTimeoutAbortable(Callable c)
-  {
-    if (!mNormalTimeouts.ForEachAbortable(c)) {
-      mTrackingTimeouts.ForEachAbortable(c);
-    }
+    mTimeouts.ForEach(c);
   }
 
   void BeginSyncOperation();
   void EndSyncOperation();
 
   nsIEventTarget*
   EventTarget();
 
@@ -199,43 +182,37 @@ private:
            timeout = timeout->getNext()) {
         if (c(timeout)) {
           return true;
         }
       }
       return false;
     }
 
-    friend class OrderedTimeoutIterator;
-
   private:
     // The TimeoutManager that owns this Timeouts structure.  This is
     // mainly used to call state inspecting methods like IsValidFiringId().
     const TimeoutManager&     mManager;
 
     typedef mozilla::LinkedList<RefPtr<Timeout>> TimeoutList;
 
     // mTimeoutList is generally sorted by mWhen, but new values are always
     // inserted after any Timeouts with a valid FiringId.
     TimeoutList               mTimeoutList;
   };
 
-  friend class OrderedTimeoutIterator;
-
   // Each nsGlobalWindowInner object has a TimeoutManager member.  This reference
   // points to that holder object.
   nsGlobalWindowInner&             mWindow;
   // The executor is specific to the nsGlobalWindow/TimeoutManager, but it
   // can live past the destruction of the window if its scheduled.  Therefore
   // it must be a separate ref-counted object.
   RefPtr<TimeoutExecutor>     mExecutor;
   // The list of timeouts coming from non-tracking scripts.
-  Timeouts                    mNormalTimeouts;
-  // The list of timeouts coming from scripts on the tracking protection list.
-  Timeouts                    mTrackingTimeouts;
+  Timeouts                    mTimeouts;
   uint32_t                    mTimeoutIdCounter;
   uint32_t                    mNextFiringId;
   AutoTArray<uint32_t, 2>     mFiringIdStack;
   mozilla::dom::Timeout*      mRunningTimeout;
 
    // The current idle request callback timeout handle
   uint32_t                    mIdleCallbackTimeoutCounter;
 
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -4245,31 +4245,16 @@ nsDOMWindowUtils::GetGpuProcessPid(int32
     *aPid = pm->GPUProcessPid();
   } else {
     *aPid = -1;
   }
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsDOMWindowUtils::IsTimeoutTracking(uint32_t aTimeoutId, bool* aResult)
-{
-  NS_ENSURE_ARG_POINTER(aResult);
-  *aResult = false;
-
-  nsCOMPtr<nsPIDOMWindowOuter> window = do_QueryReferent(mWindow);
-  NS_ENSURE_STATE(window);
-  nsCOMPtr<nsPIDOMWindowInner> innerWindow = window->GetCurrentInnerWindow();
-  NS_ENSURE_STATE(innerWindow);
-
-  *aResult = innerWindow->TimeoutManager().IsTimeoutTracking(aTimeoutId);
-  return NS_OK;
-}
-
 struct StateTableEntry
 {
   const char* mStateString;
   EventStates mState;
 };
 
 static constexpr StateTableEntry kManuallyManagedStates[] = {
   { "-moz-autofill", NS_EVENT_STATE_AUTOFILL },
@@ -4488,9 +4473,8 @@ nsDOMWindowUtils::IsCssPropertyRecordedI
 
   bool knownProp = false;
   *aRecorded =
     Servo_IsCssPropertyRecordedInUseCounter(doc->GetStyleUseCounters(),
                                             &aPropName,
                                             &knownProp);
   return knownProp ? NS_OK : NS_ERROR_FAILURE;
 }
-
--- a/dom/base/test/file_timer_flood.html
+++ b/dom/base/test/file_timer_flood.html
@@ -1,29 +1,19 @@
 <!DOCTYPE HTML>
 <html>
 <body>
 <script>
 let count = 0;
-let last_timer_set = 0;
-let last_timer_observed = 0;
-function cb(timer_observed) {
-  if (timer_observed > last_timer_observed) {
-    // In order to make the test more efficient, we don't use the SimpleTest
-    // ok() function to avoid generating one test assertion per one of these
-    // checks.  We only send a message to the parent which fails the test if
-    // we detect out of order firing of timeouts.
-    window.parent.postMessage('OUT_OF_ORDER', '*');
-  }
-  last_timer_observed = timer_observed;
+function cb() {
   count += 1;
   // Notify our parent that we are ready once the timer flood has
   // warmed up.
   if (count === 10000) {
     window.parent.postMessage('STARTED', '*');
   }
-  last_timer_set = setTimeout(cb.bind(last_timer_set), 0);
-  last_timer_set = setTimeout(cb.bind(last_timer_set), 0);
+  setTimeout(cb, 0);
+  setTimeout(cb, 0);
 }
 addEventListener('load', cb);
 </script>
 </body>
 </html>
--- a/dom/base/test/test_timer_flood.html
+++ b/dom/base/test/test_timer_flood.html
@@ -17,34 +17,25 @@ SimpleTest.waitForExplicitFinish();
 SimpleTest.requestLongerTimeout(5);
 
 function onLoad() {
   return new Promise(resolve => {
     addEventListener('load', resolve, { once: true });
   });
 }
 
-function setPrefs() {
-  // Put timeouts randomly in the tracking or normal buffer.  We do this in order to
-  // test to ensure that by default, this will not change the scheduling of timeouts.
-  return SpecialPowers.pushPrefEnv({"set": [["dom.timeout_bucketing_strategy", 3]]});
-}
-
 // Create a frame that executes a timer flood.  The frame signals
 // that is ready once the flood has had a chance to warm up.
 function withFloodFrame() {
-  return new Promise((resolve, reject) => {
+  return new Promise(resolve => {
     let frame = document.createElement('iframe');
     addEventListener('message', function onMsg(evt) {
       if (evt.data === 'STARTED') {
         removeEventListener('message', onMsg);
         resolve(frame);
-      } else if (evt.data == 'OUT_OF_ORDER') {
-        ok(false, "Out of order timeout observed");
-        reject();
       }
     });
     frame.src = 'file_timer_flood.html';
     document.body.appendChild(frame);
   });
 }
 
 // Test that we can load documents during a timer flood.
@@ -81,19 +72,17 @@ function testRequestAnimationFrame() {
       }
     };
     requestAnimationFrame(nextFrame);
   });
 }
 
 let floodFrame;
 
-onLoad()
-.then(setPrefs)
-.then(_ => {
+onLoad().then(_ => {
   // Start a timer flood in a frame.
   return withFloodFrame();
 }).then(frame => {
   floodFrame = frame;
 
   // Next we are going to start a bunch of asynchronous work that we
   // expect to complete in spite of the timer flood.  The type of work
   // is a bit arbitrary, but is chosen to reflect the kinds of things
@@ -117,15 +106,13 @@ onLoad()
 
   // Wait for all tests to finish.  If we do not handle the timer flood
   // well then this will likely time out.
   return Promise.all(tests);
 }).then(_ => {
   ok(true, 'completed tests without timing out');
   floodFrame.remove();
   SimpleTest.finish();
-}).catch(_ => {
-  SimpleTest.finish();
 });
 </script>
 </pre>
 </body>
 </html>
--- a/dom/interfaces/base/nsIDOMWindowUtils.idl
+++ b/dom/interfaces/base/nsIDOMWindowUtils.idl
@@ -1872,22 +1872,16 @@ interface nsIDOMWindowUtils : nsISupport
   void terminateGPUProcess();
 
   /**
     * Returns the GPU process pid, or -1 if there is no GPU process.
     */
   readonly attribute int32_t gpuProcessPid;
 
   /**
-   * Returns true if the given timeout ID is in the list of tracking
-   * timeouts.
-   */
-  boolean isTimeoutTracking(in unsigned long timeoutId);
-
-  /**
    * Adds an EventStates bit to the element.
    *
    * The state string must be one of the following:
    *   * (none yet; but for example "higlighted" for NS_EVENT_STATE_HIGHLIGHTED)
    *
    * The supported state strings are defined in kManuallyManagedStates
    * in nsDOMWindowUtils.cpp.
    */
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -13174,61 +13174,16 @@
     "expires_in_version": "70",
     "kind": "exponential",
     "low": 32,
     "high": 750,
     "n_buckets": 40,
     "keyed": true,
     "description": "Measures the number of milliseconds we spend waiting for sync message manager IPC messages to finish sending, keyed by message name. Note: only messages that wait for more than 500 microseconds are included in this probe."
   },
-  "TIMEOUT_EXECUTION_FG_MS":
-  {
-    "record_in_processes": ["main", "content"],
-    "alert_emails": ["farre@mozilla.com"],
-    "bug_numbers": [1355480],
-    "expires_in_version": "61",
-    "kind": "exponential",
-    "high": 1000,
-    "n_buckets": 20,
-    "description": "Time in ms used to execute callbacks from setTimeout/setInterval, when the script belongs to a tab in the foreground and the script is not on the tracking list. Multiple events are aggregated over a 1s interval."
-  },
-  "TIMEOUT_EXECUTION_FG_TRACKING_MS":
-  {
-    "record_in_processes": ["main", "content"],
-    "alert_emails": ["farre@mozilla.com"],
-    "bug_numbers": [1355480],
-    "expires_in_version": "61",
-    "kind": "exponential",
-    "high": 1000,
-    "n_buckets": 20,
-    "description": "Time in ms used to execute callbacks from setTimeout/setInterval, when the script belongs to a tab in the foreground and the script is on the tracking list. Multiple events are aggregated over a 1s interval."
-  },
-  "TIMEOUT_EXECUTION_BG_MS":
-  {
-    "record_in_processes": ["main", "content"],
-    "alert_emails": ["farre@mozilla.com"],
-    "bug_numbers": [1355480],
-    "expires_in_version": "61",
-    "kind": "exponential",
-    "high": 1000,
-    "n_buckets": 20,
-    "description": "Time in ms used to execute callbacks from setTimeout/setInterval, when the script belongs to a tab in the background and the script is not on the tracking list. Multiple events are aggregated over a 1s interval."
-  },
-  "TIMEOUT_EXECUTION_BG_TRACKING_MS":
-  {
-    "record_in_processes": ["main", "content"],
-    "alert_emails": ["farre@mozilla.com"],
-    "bug_numbers": [1355480],
-    "expires_in_version": "61",
-    "kind": "exponential",
-    "low": 1,
-    "high": 1000,
-    "n_buckets": 10,
-    "description": "Time in ms used to execute callbacks from setTimeout/setInterval, when the script belongs to a tab in the background and the script is on the tracking list. Multiple events are aggregated over a 1s interval."
-  },
   "TIME_TO_DOM_LOADING_MS": {
     "record_in_processes": ["content"],
     "alert_emails": ["hbambas@mozilla.com", "vgosu@mozilla.com", "jduell@mozilla.com"],
     "expires_in_version": "never",
     "releaseChannelCollection": "opt-out",
     "kind": "exponential",
     "high": 50000,
     "n_buckets": 100,
--- a/toolkit/components/url-classifier/tests/mochitest/chrome.ini
+++ b/toolkit/components/url-classifier/tests/mochitest/chrome.ini
@@ -37,17 +37,16 @@ support-files =
   !/toolkit/components/url-classifier/tests/mochitest/basic.vtt
   !/toolkit/components/url-classifier/tests/mochitest/basic.vtt^headers^
   !/toolkit/components/url-classifier/tests/mochitest/dnt.html
   !/toolkit/components/url-classifier/tests/mochitest/dnt.sjs
   !/toolkit/components/url-classifier/tests/mochitest/update.sjs
   !/toolkit/components/url-classifier/tests/mochitest/bad.css
   !/toolkit/components/url-classifier/tests/mochitest/bad.css^headers^
   !/toolkit/components/url-classifier/tests/mochitest/gethashFrame.html
-  !/toolkit/components/url-classifier/tests/mochitest/tracker.js
   !/toolkit/components/url-classifier/tests/mochitest/seek.webm
   !/toolkit/components/url-classifier/tests/mochitest/cache.sjs
 
 [test_lookup_system_principal.html]
 [test_classified_annotations.html]
 tags = trackingprotection
 skip-if = os == 'linux' && asan # Bug 1202548
 [test_allowlisted_annotations.html]
--- a/toolkit/components/url-classifier/tests/mochitest/classifierFrame.html
+++ b/toolkit/components/url-classifier/tests/mochitest/classifierFrame.html
@@ -27,39 +27,25 @@ function checkLoads() {
   // cache entries.
   if (window.parent.firstLoad) {
     window.parent.info("Reloading from cache...");
     window.parent.firstLoad = false;
     window.parent.loadTestFrame();
     return;
   }
 
-  let dwu = window.parent.SpecialPowers.getDOMWindowUtils(window);
-  let timer1 = window.setTimeout(function() {}, 0);
-  window.parent.ok(!dwu.isTimeoutTracking(timer1),
-                   "Timeout set from main script should not be considered as tracking");
-  /* global getTrackerTimeout */
-  let timer2 = getTrackerTimeout();
-  window.parent.ok(dwu.isTimeoutTracking(timer2),
-                   "Timeout set from included script should be considered as tracking");
-  window.clearTimeout(timer1);
-  window.clearTimeout(timer2);
-
   // End (parent) test.
   window.parent.SimpleTest.finish();
 }
 
 </script>
 
 <!-- Try loading from a malware javascript URI -->
 <script type="text/javascript" src="http://malware.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js"></script>
 
-<!-- Try loading from a tracker javascript URI -->
-<script type="text/javascript" src="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/tracker.js"></script>
-
 <!-- Try loading from an uwanted software css URI -->
 <link rel="stylesheet" type="text/css" href="http://unwanted.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.css"></link>
 
 <!-- Try loading a marked-as-malware css through an @import from a clean URI -->
 <link rel="stylesheet" type="text/css" href="import.css"></link>
 </head>
 
 <body onload="checkLoads()">
--- a/toolkit/components/url-classifier/tests/mochitest/mochitest.ini
+++ b/toolkit/components/url-classifier/tests/mochitest/mochitest.ini
@@ -25,17 +25,16 @@ support-files =
   basic.vtt^headers^
   dnt.html
   dnt.sjs
   update.sjs
   bad.css
   bad.css^headers^
   gethash.sjs
   gethashFrame.html
-  tracker.js
   seek.webm
   cache.sjs
 
 [test_classifier.html]
 skip-if = (os == 'linux' && debug) #Bug 1199778
 [test_classifier_match.html]
 [test_classifier_worker.html]
 [test_classify_ping.html]
deleted file mode 100644
--- a/toolkit/components/url-classifier/tests/mochitest/tracker.js
+++ /dev/null
@@ -1,3 +0,0 @@
-function getTrackerTimeout() {
-  return window.setTimeout(function() {}, 0);
-}