Backed out 3 changesets (bug 1299118) for ES lint failures
authorshindli <shindli@mozilla.com>
Thu, 11 Oct 2018 20:47:58 +0300
changeset 489029 6a40850883ffce1683a1c29f81314acaad331b9b
parent 489028 f8b19c4105d2e0e78a5a2ffd8843c93c12af5c79
child 489030 76efab1fc917e6efa5cb5c1335b530735be0d44f
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
bugs1299118
milestone64.0a1
backs out14451eb9a2b8ca1549e4fe1f6ae877fde2cf9f20
e5adc30bdf7f3d5c10b7160836c477c4abf0f17d
8f7bb583fbb516aac8016b285a622b3c69d619ad
Backed out 3 changesets (bug 1299118) for ES lint failures Backed out changeset 14451eb9a2b8 (bug 1299118) Backed out changeset e5adc30bdf7f (bug 1299118) Backed out changeset 8f7bb583fbb5 (bug 1299118)
dom/base/nsDOMNavigationTiming.cpp
dom/base/nsDOMNavigationTiming.h
dom/performance/PerformanceTiming.h
dom/webidl/PerformanceTiming.webidl
modules/libpref/init/all.js
taskcluster/ci/test/raptor.yml
testing/profiles/raptor/user.js
testing/raptor/raptor/manifest.py
testing/raptor/raptor/tests/raptor-tp6.ini
testing/raptor/webext/raptor/measure.js
testing/raptor/webext/raptor/runner.js
tools/profiler/core/ProfilerMarkerPayload.cpp
tools/profiler/public/ProfilerMarkerPayload.h
xpcom/threads/LazyIdleThread.cpp
xpcom/threads/nsIThread.idl
xpcom/threads/nsThread.cpp
xpcom/threads/nsThread.h
--- a/dom/base/nsDOMNavigationTiming.cpp
+++ b/dom/base/nsDOMNavigationTiming.cpp
@@ -14,17 +14,16 @@
 #include "nsIDocShellTreeItem.h"
 #include "nsIScriptSecurityManager.h"
 #include "prtime.h"
 #include "nsIURI.h"
 #include "nsPrintfCString.h"
 #include "mozilla/dom/PerformanceNavigation.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/Telemetry.h"
-#include "ProfilerMarkerPayload.h"
 
 using namespace mozilla;
 
 nsDOMNavigationTiming::nsDOMNavigationTiming(nsDocShell* aDocShell)
 {
   Clear();
 
   mDocShell = aDocShell;
@@ -249,123 +248,16 @@ nsDOMNavigationTiming::NotifyDOMContentL
   PROFILER_TRACING("Navigation", "DOMContentLoaded", TRACING_INTERVAL_END);
 
   if (IsTopLevelContentDocumentInContentProcess()) {
     Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_DOM_CONTENT_LOADED_END_MS,
                                    mNavigationStart);
   }
 }
 
-// static
-void
-nsDOMNavigationTiming::TTITimeoutCallback(nsITimer* aTimer, void *aClosure)
-{
-  nsDOMNavigationTiming* self = static_cast<nsDOMNavigationTiming*>(aClosure);
-  self->TTITimeout(aTimer);
-}
-
-// Return the max of aT1 and aT2, or the lower of the two if there's more
-// than Nms (the window size) between them.  In other words, the window
-// starts at the lower of aT1 and aT2, and we only want to respect
-// timestamps within the window (and pick the max of those).
-//
-// This approach handles the edge case of a late wakeup: where there was
-// more than Nms after one (of aT1 or aT2) without the other, but the other
-// happened after Nms and before we woke up.  For example, if aT1 was 10
-// seconds after aT2, but we woke up late (after aT1) we don't want to
-// return aT1 if the window is 5 seconds.
-static const TimeStamp&
-MaxWithinWindowBeginningAtMin(const TimeStamp& aT1, const TimeStamp& aT2,
-                              const TimeDuration& aWindowSize)
-{
-  if (aT2.IsNull()) {
-    return aT1;
-  } else if (aT1.IsNull()) {
-    return aT2;
-  }
-  if (aT1 > aT2) {
-    if ((aT1 - aT2) > aWindowSize) {
-      return aT2;
-    }
-    return aT1;
-  }
-  if ((aT2 - aT1) > aWindowSize) {
-    return aT1;
-  }
-  return aT2;
-}
-
-#define TTI_WINDOW_SIZE_MS (5 * 1000)
-
-void
-nsDOMNavigationTiming::TTITimeout(nsITimer* aTimer)
-{
-  // Check TTI: see if it's been 5 seconds since the last Long Task
-  TimeStamp now = TimeStamp::Now();
-  MOZ_RELEASE_ASSERT(!mNonBlankPaint.IsNull(), "TTI timeout with no non-blank-paint?");
-
-  nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
-  TimeStamp lastLongTaskEnded;
-  mainThread->GetLastLongNonIdleTaskEnd(&lastLongTaskEnded);
-  if (!lastLongTaskEnded.IsNull()) {
-    TimeDuration delta = now - lastLongTaskEnded;
-    if (delta.ToMilliseconds() < TTI_WINDOW_SIZE_MS) {
-      // Less than 5 seconds since the last long task.  Schedule another check
-      aTimer->InitWithNamedFuncCallback(TTITimeoutCallback, this, TTI_WINDOW_SIZE_MS,
-                                        nsITimer::TYPE_ONE_SHOT_LOW_PRIORITY,
-                                         "nsDOMNavigationTiming::TTITimeout");
-      return;
-    }
-  }
-  // To correctly implement TTI/TTFI as proposed, we'd need to use
-  // FirstContentfulPaint (FCP, which we have not yet implemented) instead
-  // of FirstNonBlankPaing (FNBP) to start at, and not fire it until there
-  // are no more than 2 network loads.  By the proposed definition, without
-  // that we're closer to TimeToFirstInteractive.
-
-  // XXX check number of network loads, and if > 2 mark to check if loads
-  // decreases to 2 (or record that point and let the normal timer here
-  // handle it)
-
-  // TTI has occurred!  TTI is either FCP (if there are no longtasks and no
-  // DCLEnd in the window that starts at FCP), or at the end of the last
-  // Long Task or DOMContentLoadedEnd (whichever is later).
-
-  if (mTTFI.IsNull()) {
-    mTTI = MaxWithinWindowBeginningAtMin(lastLongTaskEnded, mDOMContentLoadedEventEnd,
-                                         TimeDuration::FromMilliseconds(TTI_WINDOW_SIZE_MS));
-    if (mTTFI.IsNull()) {
-      mTTFI = mNonBlankPaint;
-    }
-  }
-  // XXX Implement TTI via check number of network loads, and if > 2 mark
-  // to check if loads decreases to 2 (or record that point and let the
-  // normal timer here handle it)
-
-  mTTITimer = nullptr;
-
-#ifdef MOZ_GECKO_PROFILER
-  if (profiler_is_active()) {
-    TimeDuration elapsed = mTTFI - mNavigationStart;
-    TimeDuration elapsedLongTask = lastLongTaskEnded.IsNull() ? 0 : lastLongTaskEnded - mNavigationStart;
-    nsAutoCString spec;
-    if (mLoadedURI) {
-      mLoadedURI->GetSpec(spec);
-    }
-    nsPrintfCString marker("TTFI after %dms (LongTask after %dms) for URL %s",
-                           int(elapsed.ToMilliseconds()),
-                           int(elapsedLongTask.ToMilliseconds()),spec.get());
-
-    profiler_add_marker(
-      "TTI", MakeUnique<UserTimingMarkerPayload>(NS_ConvertASCIItoUTF16(marker), mTTFI));
-  }
-#endif
-  return;
-}
-
 void
 nsDOMNavigationTiming::NotifyNonBlankPaintForRootContentDocument()
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!mNavigationStart.IsNull());
 
   if (!mNonBlankPaint.IsNull()) {
     return;
@@ -382,25 +274,16 @@ nsDOMNavigationTiming::NotifyNonBlankPai
     }
     nsPrintfCString marker("Non-blank paint after %dms for URL %s, %s",
                            int(elapsed.ToMilliseconds()), spec.get(),
                            mDocShellHasBeenActiveSinceNavigationStart ? "foreground tab" : "this tab was inactive some of the time between navigation start and first non-blank paint");
     profiler_add_marker(marker.get());
   }
 #endif
 
-  if (!mTTITimer) {
-    mTTITimer = NS_NewTimer();
-  }
-
-  // TTI is first checked 5 seconds after the FCP (non-blank-paint is very close to FCP).
-  mTTITimer->InitWithNamedFuncCallback(TTITimeoutCallback, this, TTI_WINDOW_SIZE_MS,
-                                       nsITimer::TYPE_ONE_SHOT_LOW_PRIORITY,
-                                       "nsDOMNavigationTiming::TTITimeout");
-
   if (mDocShellHasBeenActiveSinceNavigationStart) {
     if (net::nsHttp::IsBeforeLastActiveTabLoadOptimization(mNavigationStart)) {
       Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_NON_BLANK_PAINT_NETOPT_MS,
                                      mNavigationStart,
                                      mNonBlankPaint);
     } else {
       Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_NON_BLANK_PAINT_NO_NETOPT_MS,
                                      mNavigationStart,
--- a/dom/base/nsDOMNavigationTiming.h
+++ b/dom/base/nsDOMNavigationTiming.h
@@ -7,17 +7,16 @@
 #ifndef nsDOMNavigationTiming_h___
 #define nsDOMNavigationTiming_h___
 
 #include "nsCOMPtr.h"
 #include "nsCOMArray.h"
 #include "mozilla/WeakPtr.h"
 #include "mozilla/RelativeTimeline.h"
 #include "mozilla/TimeStamp.h"
-#include "nsITimer.h"
 
 class nsDocShell;
 class nsIURI;
 
 typedef unsigned long long DOMTimeMilliSec;
 typedef double DOMHighResTimeStamp;
 
 class nsDOMNavigationTiming final
@@ -92,20 +91,16 @@ public:
   DOMTimeMilliSec GetLoadEventEnd() const
   {
     return TimeStampToDOM(mLoadEventEnd);
   }
   DOMTimeMilliSec GetTimeToNonBlankPaint() const
   {
     return TimeStampToDOM(mNonBlankPaint);
   }
-  DOMTimeMilliSec GetTimeToTTFI() const
-  {
-    return TimeStampToDOM(mTTFI);
-  }
   DOMTimeMilliSec GetTimeToDOMContentFlushed() const
   {
     return TimeStampToDOM(mDOMContentFlushed);
   }
 
   DOMHighResTimeStamp GetUnloadEventStartHighRes()
   {
     mozilla::TimeStamp stamp = GetUnloadEventStartTimeStamp();
@@ -164,20 +159,16 @@ public:
   // Document changes state to 'loading' before connecting to timing
   void SetDOMLoadingTimeStamp(nsIURI* aURI, mozilla::TimeStamp aValue);
   void NotifyDOMLoading(nsIURI* aURI);
   void NotifyDOMInteractive(nsIURI* aURI);
   void NotifyDOMComplete(nsIURI* aURI);
   void NotifyDOMContentLoadedStart(nsIURI* aURI);
   void NotifyDOMContentLoadedEnd(nsIURI* aURI);
 
-  static void TTITimeoutCallback(nsITimer* aTimer, void *aClosure);
-  void TTITimeout(nsITimer* aTimer);
-
-  void NotifyLongTask(mozilla::TimeStamp aWhen);
   void NotifyNonBlankPaintForRootContentDocument();
   void NotifyDOMContentFlushedForRootContentDocument();
   void NotifyDocShellStateChanged(DocShellState aDocShellState);
 
   DOMTimeMilliSec TimeStampToDOM(mozilla::TimeStamp aStamp) const;
 
   inline DOMHighResTimeStamp TimeStampToDOMHighRes(mozilla::TimeStamp aStamp) const
   {
@@ -198,17 +189,16 @@ private:
   mozilla::TimeStamp GetUnloadEventEndTimeStamp() const;
 
   bool IsTopLevelContentDocumentInContentProcess() const;
 
   mozilla::WeakPtr<nsDocShell> mDocShell;
 
   nsCOMPtr<nsIURI> mUnloadedURI;
   nsCOMPtr<nsIURI> mLoadedURI;
-  nsCOMPtr<nsITimer> mTTITimer;
 
   Type mNavigationType;
   DOMHighResTimeStamp mNavigationStartHighRes;
   mozilla::TimeStamp mNavigationStart;
   mozilla::TimeStamp mNonBlankPaint;
   mozilla::TimeStamp mDOMContentFlushed;
 
   mozilla::TimeStamp mBeforeUnloadStart;
@@ -218,14 +208,12 @@ private:
   mozilla::TimeStamp mLoadEventEnd;
 
   mozilla::TimeStamp mDOMLoading;
   mozilla::TimeStamp mDOMInteractive;
   mozilla::TimeStamp mDOMContentLoadedEventStart;
   mozilla::TimeStamp mDOMContentLoadedEventEnd;
   mozilla::TimeStamp mDOMComplete;
 
-  mozilla::TimeStamp mTTFI;
-
   bool mDocShellHasBeenActiveSinceNavigationStart : 1;
 };
 
 #endif /* nsDOMNavigationTiming_h___ */
--- a/dom/performance/PerformanceTiming.h
+++ b/dom/performance/PerformanceTiming.h
@@ -449,30 +449,16 @@ public:
     if (mPerformance->IsSystemPrincipal()) {
       return GetDOMTiming()->GetTimeToDOMContentFlushed();
     }
     return nsRFPService::ReduceTimePrecisionAsMSecs(
       GetDOMTiming()->GetTimeToDOMContentFlushed(),
       mPerformance->GetRandomTimelineSeed());
   }
 
-  DOMTimeMilliSec TimeToFirstInteractive() const
-  {
-    if (!nsContentUtils::IsPerformanceTimingEnabled() ||
-        nsContentUtils::ShouldResistFingerprinting()) {
-      return 0;
-    }
-    if (mPerformance->IsSystemPrincipal()) {
-      return GetDOMTiming()->GetTimeToTTFI();
-    }
-    return nsRFPService::ReduceTimePrecisionAsMSecs(
-      GetDOMTiming()->GetTimeToTTFI(),
-      mPerformance->GetRandomTimelineSeed());
-  }
-
   PerformanceTimingData* Data() const
   {
     return mTimingData.get();
   }
 
 private:
   ~PerformanceTiming();
 
--- a/dom/webidl/PerformanceTiming.webidl
+++ b/dom/webidl/PerformanceTiming.webidl
@@ -40,16 +40,10 @@ interface PerformanceTiming {
   readonly attribute unsigned long long timeToNonBlankPaint;
 
   // This is a Mozilla proprietary extension and not part of the
   // performance/navigation timing specification. It marks the
   // completion of the first presentation flush after DOMContentLoaded.
   [Pref="dom.performance.time_to_dom_content_flushed.enabled"]
   readonly attribute unsigned long long timeToDOMContentFlushed;
 
-  // This is a Chrome proprietary extension and not part of the
-  // performance/navigation timing specification.
-  // Returns 0 if a time-to-interactive measurement has not happened.
-  [Pref="dom.performance.time_to_first_interactive.enabled"]
-  readonly attribute unsigned long long timeToFirstInteractive;
-
   [Default] object toJSON();
 };
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -177,19 +177,16 @@ pref("dom.performance.enable_scheduler_t
 pref("dom.permissions.revoke.enable", false);
 
 // Enable exposing timeToNonBlankPaint
 pref("dom.performance.time_to_non_blank_paint.enabled", false);
 
 // Enable exposing timeToDOMContentFlushed
 pref("dom.performance.time_to_dom_content_flushed.enabled", false);
 
-// Enable exposing timeToFirstInteractive
-pref("dom.performance.time_to_first_interactive.enabled", false);
-
 // Enable requestIdleCallback API
 pref("dom.requestIdleCallback.enabled", true);
 
 // Enable Pointer Lock API
 // This is added for accessibility purpose. When user has no way to exit
 // pointer lock (e.g. no keyboard available), they can use this pref to
 // disable the Pointer Lock API altogether.
 pref("dom.pointer-lock.enabled", true);
--- a/taskcluster/ci/test/raptor.yml
+++ b/taskcluster/ci/test/raptor.yml
@@ -32,17 +32,17 @@ job-defaults:
                 default:
                     - raptor/linux_config.py
 
 raptor-tp6-firefox:
     description: "Raptor tp6 on Firefox"
     try-name: raptor-tp6-firefox
     treeherder-symbol: Rap(tp6)
     run-on-projects: ['try', 'mozilla-central']
-    max-run-time: 1800
+    max-run-time: 1200
     mozharness:
         extra-options:
             - --test=raptor-tp6
 
 raptor-tp6-chrome:
     description: "Raptor tp6 on Chrome"
     try-name: raptor-tp6-chrome
     treeherder-symbol: Rap-C(tp6)
--- a/testing/profiles/raptor/user.js
+++ b/testing/profiles/raptor/user.js
@@ -1,8 +1,7 @@
 // Preferences file used by the raptor harness
 /* globals user_pref */
 user_pref("dom.performance.time_to_non_blank_paint.enabled", true);
 user_pref("dom.performance.time_to_dom_content_flushed.enabled", true);
-user_pref("dom.performance.time_to_first_interactive.enabled", true);
 
 // required for geckoview logging
 user_pref("geckoview.console.enabled", true);
--- a/testing/raptor/raptor/manifest.py
+++ b/testing/raptor/raptor/manifest.py
@@ -79,18 +79,16 @@ def write_test_settings_json(test_detail
         if "dcf" in test_details['measure']:
             test_settings['raptor-options']['measure']['dcf'] = True
         if "fnbpaint" in test_details['measure']:
             test_settings['raptor-options']['measure']['fnbpaint'] = True
         if "fcp" in test_details['measure']:
             test_settings['raptor-options']['measure']['fcp'] = True
         if "hero" in test_details['measure']:
             test_settings['raptor-options']['measure']['hero'] = test_details['hero'].split()
-        if "ttfi" in test_details['measure']:
-            test_settings['raptor-options']['measure']['ttfi'] = True
     if test_details.get("page_timeout", None) is not None:
         test_settings['raptor-options']['page_timeout'] = int(test_details['page_timeout'])
     test_settings['raptor-options']['unit'] = test_details.get("unit", "ms")
     if test_details.get("lower_is_better", "true") == "false":
         test_settings['raptor-options']['lower_is_better'] = False
     else:
         test_settings['raptor-options']['lower_is_better'] = True
 
--- a/testing/raptor/raptor/tests/raptor-tp6.ini
+++ b/testing/raptor/raptor/tests/raptor-tp6.ini
@@ -9,42 +9,39 @@ type =  pageload
 playback = mitmproxy
 playback_binary_manifest = mitmproxy-rel-bin-{platform}.manifest
 python3_win_manifest = python3{x64}.manifest
 playback_pageset_manifest = mitmproxy-recordings-raptor-tp6.manifest
 page_cycles = 25
 unit = ms
 lower_is_better = true
 alert_threshold = 2.0
-# TTI/TTFI can take a while on some pages, and requires at least 5 seconds
-# beyond typical pageload time
-page_timeout = 30000
 
 [raptor-tp6-amazon-firefox]
 apps = firefox
 test_url = https://www.amazon.com/s/url=search-alias%3Daps&field-keywords=laptop
 playback_recordings = amazon.mp
-measure = fnbpaint, hero, dcf, ttfi
+measure = fnbpaint, hero, dcf
 hero = hero1
 
 [raptor-tp6-facebook-firefox]
 apps = firefox
 test_url = https://www.facebook.com
 playback_recordings = facebook.mp
-measure = fnbpaint, hero, dcf, ttfi
+measure = fnbpaint, hero, dcf
 hero = hero1
 
 [raptor-tp6-google-firefox]
 apps = firefox
 # note: use the full url as the first part (without '&cad=h') redirects
 # to the url + '&cad=h'; that redirection causes measure.js content
 # to be loaded into that page also; resulting in 2 fnbpaint values etc.
 test_url = https://www.google.com/search?hl=en&q=barack+obama&cad=h
 playback_recordings = google-search.mp
-measure = fnbpaint, hero, dcf, ttfi
+measure = fnbpaint, hero, dcf
 hero = hero1
 
 [raptor-tp6-youtube-firefox]
 apps = firefox
 test_url = https://www.youtube.com
 playback_recordings = youtube.mp
 measure = fnbpaint, hero, dcf
 hero = hero1
--- a/testing/raptor/webext/raptor/measure.js
+++ b/testing/raptor/webext/raptor/measure.js
@@ -18,22 +18,16 @@ var heroesToCapture = [];
 var getFNBPaint = false;
 
 // measure firefox domContentFlushed
 // note: this browser pref must be enabled:
 // dom.performance.time_to_dom_content_flushed.enabled = True
 // default only; this is set via control server settings json
 var getDCF = false;
 
-// measure firefox TTFI
-// note: this browser pref must be enabled:
-// dom.performance.time_to_first_interactive.enabled = True
-// default only; this is set via control server settings json
-var getTTFI = false;
-
 // measure google's first-contentful-paint
 // default only; this is set via control server settings json
 var getFCP = false;
 
 // performance.timing measurement used as 'starttime'
 var startMeasure = "fetchStart";
 
 function contentHandler() {
@@ -88,24 +82,16 @@ function setup(settings) {
   if (settings.measure.hero !== undefined) {
     if (settings.measure.hero.length !== 0) {
       getHero = true;
       heroesToCapture = settings.measure.hero;
       console.log("hero elements to measure: " + heroesToCapture);
       measureHero();
     }
   }
-
-  if (settings.measure.ttfi !== undefined) {
-    getTTFI = settings.measure.ttfi;
-    if (getTTFI) {
-      console.log("will be measuring ttfi");
-      measureTTFI();
-    }
-  }
 }
 
 function measureHero() {
   var obs = null;
 
   var heroElementsFound = window.document.querySelectorAll("[elementtiming]");
   console.log("found " + heroElementsFound.length + " hero elements in the page");
 
@@ -188,47 +174,16 @@ function measureDCF() {
       console.log("\dcf is not yet available (0), retry number " + gRetryCounter + "...\n");
       window.setTimeout(measureDCF, 100);
     } else {
       console.log("\nunable to get a value for dcf after " + gRetryCounter + " retries\n");
     }
   }
 }
 
-function measureTTFI() {
-  var x = window.performance.timing.timeToFirstInteractive;
-
-  if (typeof(x) == "undefined") {
-    console.log("ERROR: timeToFirstInteractive is undefined; ensure the pref is enabled");
-    return;
-  }
-  if (x > 0) {
-    console.log("got timeToFirstInteractive: " + x);
-    gRetryCounter = 0;
-    var startTime = perfData.timing.fetchStart;
-    sendResult("ttfi", x - startTime);
-  } else {
-    gRetryCounter += 1;
-    // NOTE: currently the gecko implementation doesn't look at network
-    // requests, so this is closer to TimeToFirstInteractive than
-    // TimeToInteractive.  Also, we use FNBP instead of FCP as the start
-    // point.  TTFI/TTI requires running at least 5 seconds past last
-    // "busy" point, give 25 seconds here (overall the harness times out at
-    // 30 seconds).  Some pages will never get 5 seconds without a busy
-    // period!
-    if (gRetryCounter <= 25*(1000/200)) {
-      console.log("\TTFI is not yet available (0), retry number " + gRetryCounter + "...\n");
-      window.setTimeout(measureTTFI, 200);
-    } else {
-      // unable to get a value for TTFI - filter out later
-      sendResult("ttfi", 0);
-    }
-  }
-}
-
 function measureFirstContentfulPaint() {
   // see https://developer.mozilla.org/en-US/docs/Web/API/PerformancePaintTiming
   var resultType = "fcp";
   var result = 0;
 
   let performanceEntries = perfData.getEntriesByType("paint");
 
   if (performanceEntries.length >= 2) {
--- a/testing/raptor/webext/raptor/runner.js
+++ b/testing/raptor/webext/raptor/runner.js
@@ -32,24 +32,22 @@ var testType;
 var pageCycles = 0;
 var pageCycle = 0;
 var testURL;
 var testTabID = 0;
 var getHero = false;
 var getFNBPaint = false;
 var getFCP = false;
 var getDCF = false;
-var getTTFI = false;
 var isHeroPending = false;
 var pendingHeroes = [];
 var settings = {};
 var isFNBPaintPending = false;
 var isFCPPending = false;
 var isDCFPending = false;
-var isTTFIPending = false;
 var isBenchmarkPending = false;
 var pageTimeout = 10000; // default pageload timeout
 
 var results = {"name": "",
                "page": "",
                "type": "",
                "lower_is_better": true,
                "alert_threshold": 2.0,
@@ -103,19 +101,16 @@ function getTestSettings() {
             if (settings.measure.fcp !== undefined) {
               getFCP = settings.measure.fcp;
             }
             if (settings.measure.hero !== undefined) {
               if (settings.measure.hero.length !== 0) {
                 getHero = true;
               }
             }
-            if (settings.measure.ttfi !== undefined) {
-              getTTFI = settings.measure.ttfi;
-            }
           } else {
             console.log("abort: 'measure' key not found in test settings");
             cleanUp();
           }
         }
 
         // write options to storage that our content script needs to know
         if (["firefox", "geckoview"].includes(browserName)) {
@@ -177,17 +172,17 @@ async function testTabUpdated(tab) {
   nextCycle();
 }
 
 function waitForResult() {
   console.log("awaiting results...");
   return new Promise(resolve => {
     function checkForResult() {
       if (testType == "pageload") {
-        if (!isHeroPending && !isFNBPaintPending && !isFCPPending && !isDCFPending && !isTTFIPending) {
+        if (!isHeroPending && !isFNBPaintPending && !isFCPPending && !isDCFPending) {
           cancelTimeoutAlarm("raptor-page-timeout");
           resolve();
         } else {
           setTimeout(checkForResult, 5);
         }
       } else if (testType == "benchmark") {
         if (!isBenchmarkPending) {
           cancelTimeoutAlarm("raptor-page-timeout");
@@ -222,18 +217,16 @@ function nextCycle() {
           pendingHeroes = Array.from(settings.measure.hero);
         }
         if (getFNBPaint)
           isFNBPaintPending = true;
         if (getFCP)
           isFCPPending = true;
         if (getDCF)
           isDCFPending = true;
-        if (getTTFI)
-          isTTFIPending = true;
       } else if (testType == "benchmark") {
         isBenchmarkPending = true;
       }
       // update the test page - browse to our test URL
       ext.tabs.update(testTabID, {url: testURL}, testTabUpdated);
     }, pageCycleDelay);
   } else {
     verifyResults();
@@ -300,19 +293,16 @@ function resultListener(request, sender,
           }
         }
       } else if (request.type == "fnbpaint") {
         results.measurements.fnbpaint.push(request.value);
         isFNBPaintPending = false;
       } else if (request.type == "dcf") {
         results.measurements.dcf.push(request.value);
         isDCFPending = false;
-      } else if (request.type == "ttfi") {
-        results.measurements.ttfi.push(request.value);
-        isTTFIPending = false;
       } else if (request.type == "fcp") {
         results.measurements.fcp.push(request.value);
         isFCPPending = false;
       }
     } else if (testType == "benchmark") {
       // benchmark results received (all results for that complete benchmark run)
       console.log("received results from benchmark");
       results.measurements[request.type].push(request.value);
--- a/tools/profiler/core/ProfilerMarkerPayload.cpp
+++ b/tools/profiler/core/ProfilerMarkerPayload.cpp
@@ -259,17 +259,8 @@ StyleMarkerPayload::StreamPayload(Splice
   StreamCommonProps("Styles", aWriter, aProcessStartTime, aUniqueStacks);
   aWriter.StringProperty("category", "Paint");
   aWriter.IntProperty("elementsTraversed", mStats.mElementsTraversed);
   aWriter.IntProperty("elementsStyled", mStats.mElementsStyled);
   aWriter.IntProperty("elementsMatched", mStats.mElementsMatched);
   aWriter.IntProperty("stylesShared", mStats.mStylesShared);
   aWriter.IntProperty("stylesReused", mStats.mStylesReused);
 }
-
-void
-LongTaskMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                                     const TimeStamp& aProcessStartTime,
-                                     UniqueStacks& aUniqueStacks)
-{
-  StreamCommonProps("MainThreadLongTask", aWriter, aProcessStartTime, aUniqueStacks);
-  aWriter.StringProperty("category", "LongTask");
-}
--- a/tools/profiler/public/ProfilerMarkerPayload.h
+++ b/tools/profiler/public/ProfilerMarkerPayload.h
@@ -342,21 +342,9 @@ public:
   }
 
   DECL_STREAM_PAYLOAD
 
 private:
   mozilla::ServoTraversalStatistics mStats;
 };
 
-class LongTaskMarkerPayload : public ProfilerMarkerPayload
-{
-public:
-  LongTaskMarkerPayload(const mozilla::TimeStamp& aStartTime,
-                        const mozilla::TimeStamp& aEndTime)
-    : ProfilerMarkerPayload(aStartTime, aEndTime)
-  {
-  }
-
-  DECL_STREAM_PAYLOAD
-};
-
 #endif // ProfilerMarkerPayload_h
--- a/xpcom/threads/LazyIdleThread.cpp
+++ b/xpcom/threads/LazyIdleThread.cpp
@@ -468,26 +468,16 @@ LazyIdleThread::GetCanInvokeJS(bool* aCa
 
 NS_IMETHODIMP
 LazyIdleThread::SetCanInvokeJS(bool aCanInvokeJS)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-LazyIdleThread::GetLastLongTaskEnd(TimeStamp* _retval) {
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-LazyIdleThread::GetLastLongNonIdleTaskEnd(TimeStamp* _retval) {
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
 LazyIdleThread::AsyncShutdown()
 {
   ASSERT_OWNING_THREAD();
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 LazyIdleThread::Shutdown()
--- a/xpcom/threads/nsIThread.idl
+++ b/xpcom/threads/nsIThread.idl
@@ -3,26 +3,22 @@
 /* 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/. */
 
 #include "nsISerialEventTarget.idl"
 
 %{C++
 #include "mozilla/AlreadyAddRefed.h"
-namespace mozilla {
-class TimeStamp;
-}
 %}
 
 [ptr] native PRThread(PRThread);
 
 native nsIEventTargetPtr(nsIEventTarget*);
 native nsISerialEventTargetPtr(nsISerialEventTarget*);
-native TimeStamp(mozilla::TimeStamp);
 
 /**
  * This interface provides a high-level abstraction for an operating system
  * thread.
  *
  * Threads have a built-in event queue, and a thread is an event target that
  * can receive nsIRunnable objects (events) to be processed on the thread.
  *
@@ -152,16 +148,9 @@ interface nsIThread : nsISerialEventTarg
    */
   [noscript,notxpcom] nsIEventTargetPtr EventTarget();
 
   /**
    * A fast C++ getter for the eventTarget. It asserts that the thread's event
    * target is an nsISerialEventTarget and then returns it.
    */
   [noscript,notxpcom] nsISerialEventTargetPtr SerialEventTarget();
-
-  /**
-   * This is set to the end of the last 50+ms event that was executed on
-   * this thread (for MainThread only).  Otherwise returns a null TimeStamp.
-   */
-  [noscript] readonly attribute TimeStamp lastLongTaskEnd;
-  [noscript] readonly attribute TimeStamp lastLongNonIdleTaskEnd;
 };
--- a/xpcom/threads/nsThread.cpp
+++ b/xpcom/threads/nsThread.cpp
@@ -39,19 +39,16 @@
 #include "mozilla/ChaosMode.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/Unused.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "nsThreadSyncDispatch.h"
 #include "nsServiceManagerUtils.h"
 #include "GeckoProfiler.h"
-#ifdef MOZ_GECKO_PROFILER
-#include "ProfilerMarkerPayload.h"
-#endif
 #include "InputEventStatistics.h"
 #include "ThreadEventTarget.h"
 #include "ThreadDelay.h"
 
 #ifdef XP_LINUX
 #ifdef __GLIBC__
 #include <gnu/libc-version.h>
 #endif
@@ -648,18 +645,16 @@ nsThread::nsThread(NotNull<SynchronizedE
   , mShutdownRequired(false)
   , mPriority(PRIORITY_NORMAL)
   , mIsMainThread(uint8_t(aMainThread))
   , mCanInvokeJS(false)
   , mCurrentEvent(nullptr)
   , mCurrentEventStart(TimeStamp::Now())
   , mCurrentPerformanceCounter(nullptr)
 {
-  mLastLongTaskEnd = mCurrentEventStart;
-  mLastLongNonIdleTaskEnd = mCurrentEventStart;
 }
 
 
 nsThread::nsThread()
   : mEvents(nullptr)
   , mEventTarget(nullptr)
   , mShutdownContext(nullptr)
   , mScriptObserver(nullptr)
@@ -670,18 +665,16 @@ nsThread::nsThread()
   , mShutdownRequired(false)
   , mPriority(PRIORITY_NORMAL)
   , mIsMainThread(NOT_MAIN_THREAD)
   , mCanInvokeJS(false)
   , mCurrentEvent(nullptr)
   , mCurrentEventStart(TimeStamp::Now())
   , mCurrentPerformanceCounter(nullptr)
 {
-  mLastLongTaskEnd = mCurrentEventStart;
-  mLastLongNonIdleTaskEnd = mCurrentEventStart;
   MOZ_ASSERT(!NS_IsMainThread());
 }
 
 nsThread::~nsThread()
 {
   NS_ASSERTION(mRequestedShutdownContexts.IsEmpty(),
                "shouldn't be waiting on other threads to shutdown");
 
@@ -818,28 +811,16 @@ nsThread::GetCanInvokeJS(bool* aResult)
 NS_IMETHODIMP
 nsThread::SetCanInvokeJS(bool aCanInvokeJS)
 {
   mCanInvokeJS = aCanInvokeJS;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsThread::GetLastLongTaskEnd(TimeStamp* _retval) {
-  *_retval = mLastLongTaskEnd;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsThread::GetLastLongNonIdleTaskEnd(TimeStamp* _retval) {
-  *_retval = mLastLongNonIdleTaskEnd;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsThread::AsyncShutdown()
 {
   LOG(("THRD(%p) async shutdown\n", this));
 
   // XXX If we make this warn, then we hit that warning at xpcom shutdown while
   //     shutting down a thread in a thread pool.  That happens b/c the thread
   //     in the thread pool is already shutdown by the thread manager.
   if (!mThread) {
@@ -1231,52 +1212,29 @@ nsThread::ProcessNextEvent(bool aMayWait
       }
 #endif
       Maybe<AutoTimeDurationHelper> timeDurationHelper;
       if (priority == EventPriority::Input) {
         timeDurationHelper.emplace();
       }
 
       // The event starts to run, storing the timestamp.
-      bool recursiveEvent = mNestedEventLoopDepth > mCurrentEventLoopDepth;
-      mCurrentEventLoopDepth = mNestedEventLoopDepth;
-      if (IsMainThread() && !recursiveEvent) {
-        mCurrentEventStart = mozilla::TimeStamp::Now();
-      }
+      bool recursiveEvent = false;
       RefPtr<mozilla::PerformanceCounter> currentPerformanceCounter;
       if (schedulerLoggingEnabled) {
+        recursiveEvent = mNestedEventLoopDepth > mCurrentEventLoopDepth;
         mCurrentEventStart = mozilla::TimeStamp::Now();
         mCurrentEvent = event;
+        mCurrentEventLoopDepth = mNestedEventLoopDepth;
         mCurrentPerformanceCounter = GetPerformanceCounter(event);
         currentPerformanceCounter = mCurrentPerformanceCounter;
       }
 
       event->Run();
 
-      mozilla::TimeDuration duration;
-      // Remember the last 50ms+ task on mainthread for Long Task.
-      if (IsMainThread() && !recursiveEvent) {
-        TimeStamp now = TimeStamp::Now();
-        duration = now - mCurrentEventStart;
-        if (duration.ToMilliseconds() > LONGTASK_BUSY_WINDOW_MS) {
-          // Idle events (gc...) don't *really* count here
-          if (priority != EventPriority::Idle) {
-            mLastLongNonIdleTaskEnd = now;
-          }
-          mLastLongTaskEnd = now;
-#ifdef MOZ_GECKO_PROFILER
-          if (profiler_is_active()) {
-              profiler_add_marker(
-                (priority != EventPriority::Idle) ? "LongTask" : "LongIdleTask",
-                MakeUnique<LongTaskMarkerPayload>(mCurrentEventStart, now));
-          }
-#endif
-        }
-      }
-
       // End of execution, we can send the duration for the group
       if (schedulerLoggingEnabled) {
        if (recursiveEvent) {
           // If we're in a recursive call, reset the timer,
           // so the parent gets its remaining execution time right.
           mCurrentEventStart = mozilla::TimeStamp::Now();
           mCurrentPerformanceCounter = currentPerformanceCounter;
         } else {
--- a/xpcom/threads/nsThread.h
+++ b/xpcom/threads/nsThread.h
@@ -30,19 +30,16 @@ namespace mozilla {
 class CycleCollectedJSContext;
 class ThreadEventTarget;
 }
 
 using mozilla::NotNull;
 
 class nsThreadEnumerator;
 
-// See https://www.w3.org/TR/longtasks
-#define LONGTASK_BUSY_WINDOW_MS 50
-
 // A native thread
 class nsThread
   : public nsIThreadInternal
   , public nsISupportsPriority
   , private mozilla::LinkedListElement<nsThread>
 {
   friend mozilla::LinkedList<nsThread>;
   friend mozilla::LinkedListElement<nsThread>;
@@ -150,19 +147,16 @@ public:
   size_t ShallowSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
   size_t SizeOfEventQueues(mozilla::MallocSizeOf aMallocSizeOf) const;
 
   static nsThreadEnumerator Enumerate();
 
   static uint32_t MaxActiveThreads();
 
-  const mozilla::TimeStamp& LastLongTaskEnd() { return mLastLongTaskEnd; }
-  const mozilla::TimeStamp& LastLongNonIdleTaskEnd() { return mLastLongNonIdleTaskEnd; }
-
 private:
   void DoMainThreadSpecificProcessing(bool aReallyWait);
 
 protected:
   friend class nsThreadShutdownEvent;
 
   friend class nsThreadEnumerator;
 
@@ -214,19 +208,16 @@ protected:
   PRThread* mThread;
   void*     mStackBase = nullptr;
   uint32_t  mStackSize;
   uint32_t  mThreadId;
 
   uint32_t  mNestedEventLoopDepth;
   uint32_t  mCurrentEventLoopDepth;
 
-  mozilla::TimeStamp mLastLongTaskEnd;
-  mozilla::TimeStamp mLastLongNonIdleTaskEnd;
-
   mozilla::Atomic<bool> mShutdownRequired;
 
   int8_t   mPriority;
 
   uint8_t  mIsMainThread;
 
   bool IsMainThread() const
   {