Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown
authorAndrew McCreight <continuation@gmail.com>
Thu, 27 Feb 2020 17:39:15 +0000
changeset 515965 954d5a7490a36c05b8f07e0caaa782c7eb0a2ed5
parent 515964 49099d517f2d979204cac5b1fa803b3ba002202f
child 515966 af69c248de3f8bebe08214c3e8c0955fbd8f2770
push id108538
push useramccreight@mozilla.com
push dateThu, 27 Feb 2020 17:40:08 +0000
treeherderautoland@954d5a7490a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert, jandem, gbrown
bugs1609815
milestone75.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown Patch by bhackett and jlaster. Also reviewed by mccr8. Differential Revision: https://phabricator.services.mozilla.com/D60197
accessible/generic/Accessible.cpp
accessible/generic/Accessible.h
devtools/client/framework/test/browser_toolbox_options_disable_buttons.js
devtools/client/shared/test/test-actor.js
docshell/base/timeline/TimelineConsumers.cpp
docshell/base/timeline/TimelineConsumers.h
dom/base/TabGroup.cpp
dom/base/nsContentUtils.cpp
dom/base/nsFrameMessageManager.cpp
dom/base/nsJSEnvironment.cpp
dom/base/nsWrapperCache.cpp
dom/bindings/BindingUtils.cpp
dom/bindings/BindingUtils.h
dom/bindings/nsIScriptError.idl
dom/bindings/nsScriptError.cpp
dom/bindings/nsScriptError.h
dom/canvas/WebGLContext.cpp
dom/html/HTMLMediaElement.cpp
dom/html/input/InputType.h
dom/interfaces/base/nsIRemoteTab.idl
dom/ipc/BrowserChild.cpp
dom/ipc/BrowserHost.cpp
dom/ipc/BrowserParent.cpp
dom/ipc/BrowserParent.h
dom/ipc/ContentChild.cpp
dom/ipc/ContentParent.cpp
dom/ipc/ContentParent.h
dom/ipc/ContentProcess.cpp
dom/ipc/PContent.ipdl
dom/ipc/ProcessHangMonitor.cpp
dom/media/CubebUtils.cpp
dom/media/MediaFormatReader.cpp
dom/media/MediaManager.cpp
dom/media/webaudio/AudioContext.cpp
dom/plugins/base/nsPluginHost.cpp
dom/workers/RuntimeService.cpp
gfx/2d/RecordedEvent.h
gfx/layers/apz/src/APZCTreeManager.cpp
gfx/layers/client/ClientLayerManager.cpp
gfx/layers/ipc/CompositorBridgeParent.cpp
gfx/layers/ipc/CompositorManagerChild.cpp
gfx/layers/ipc/CompositorManagerParent.cpp
gfx/layers/ipc/CompositorVsyncScheduler.cpp
gfx/layers/ipc/LayerTransactionParent.cpp
gfx/layers/ipc/ShadowLayers.cpp
gfx/layers/ipc/ThreadSafeRefcountingWithMainThreadDestruction.h
gfx/thebes/gfxPlatform.cpp
gfx/thebes/gfxPlatform.h
hal/sandbox/SandboxHal.cpp
image/Decoder.h
image/IDecodingTask.h
image/SurfaceCache.cpp
ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc
ipc/glue/CrashReporterClient.h
ipc/glue/CrashReporterHost.cpp
ipc/glue/GeckoChildProcessHost.cpp
ipc/glue/MessageChannel.cpp
ipc/glue/MessageChannel.h
ipc/glue/ProtocolUtils.cpp
ipc/glue/ProtocolUtils.h
ipc/ipdl/sync-messages.ini
js/ductwork/debugger/IJSDebugger.idl
js/ductwork/debugger/JSDebugger.cpp
js/ipc/JavaScriptShared.cpp
js/public/CharacterEncoding.h
js/public/Principals.h
js/public/ProfilingStack.h
js/src/builtin/AtomicsObject.cpp
js/src/builtin/AtomicsObject.h
js/src/builtin/Promise.cpp
js/src/debugger/Debugger.cpp
js/src/doc/Debugger/Debugger.md
js/src/ds/MemoryProtectionExceptionHandler.cpp
js/src/frontend/BytecodeCompiler.cpp
js/src/frontend/BytecodeEmitter.h
js/src/gc/ArenaList.h
js/src/gc/AtomMarking.h
js/src/gc/GC.cpp
js/src/gc/GCParallelTask.h
js/src/gc/GCRuntime.h
js/src/gc/Marking.cpp
js/src/gc/Memory.cpp
js/src/gc/Nursery.cpp
js/src/gc/Scheduling.h
js/src/gc/Statistics.h
js/src/gc/Zone.h
js/src/jit/BaselineBailouts.cpp
js/src/jit/BaselineCodeGen.cpp
js/src/jit/BaselineCodeGen.h
js/src/jit/CacheIRCompiler.cpp
js/src/jit/CodeGenerator.cpp
js/src/jit/CompileInfo.h
js/src/jit/IonBuilder.cpp
js/src/jit/JitRealm.h
js/src/jit/JitScript.h
js/src/jit/MIR.h
js/src/jit/MIRGenerator.h
js/src/jit/ProcessExecutableMemory.cpp
js/src/jit/shared/CodeGenerator-shared.cpp
js/src/jsapi.h
js/src/jsexn.cpp
js/src/threading/Mutex.h
js/src/threading/ProtectedData.cpp
js/src/threading/ProtectedData.h
js/src/threading/posix/PosixThread.cpp
js/src/util/StructuredSpewer.cpp
js/src/util/StructuredSpewer.h
js/src/vm/ErrorObject-inl.h
js/src/vm/ErrorObject.cpp
js/src/vm/ErrorObject.h
js/src/vm/HelperThreads.cpp
js/src/vm/Interpreter.cpp
js/src/vm/JSContext.cpp
js/src/vm/JSContext.h
js/src/vm/JSScript.cpp
js/src/vm/JSScript.h
js/src/vm/NativeObject.cpp
js/src/vm/OffThreadScriptCompilation.cpp
js/src/vm/Probes-inl.h
js/src/vm/Runtime.cpp
js/src/vm/Runtime.h
js/src/vm/SharedStencil.h
js/src/vm/Stack.cpp
js/src/vm/StructuredClone.cpp
js/src/vm/Time.h
js/src/vm/TypeInference.cpp
js/src/wasm/WasmSignalHandlers.cpp
js/xpconnect/loader/mozJSComponentLoader.cpp
js/xpconnect/src/SandboxPrivate.h
js/xpconnect/src/XPCInlines.h
js/xpconnect/src/XPCJSContext.cpp
js/xpconnect/src/XPCWrappedNative.cpp
js/xpconnect/src/XPCWrappedNativeProto.cpp
js/xpconnect/src/nsXPConnect.cpp
js/xpconnect/src/xpcpublic.h
layout/base/PresShell.cpp
layout/ipc/VsyncChild.cpp
layout/style/ImageLoader.cpp
layout/style/Loader.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
memory/build/mozjemalloc.cpp
memory/replace/logalloc/replay/moz.build
memory/replace/phc/PHC.cpp
mfbt/Assertions.cpp
mfbt/Atomics.h
mfbt/ChaosMode.cpp
mfbt/ChaosMode.h
mfbt/RecordReplay.cpp
mfbt/RecordReplay.h
mfbt/RefCounted.h
mfbt/moz.build
mfbt/tests/TestAtomics.cpp
modules/libjar/nsJARChannel.cpp
modules/libpref/StaticPrefsBase.h
modules/libpref/init/all.js
mozglue/baseprofiler/core/PageInformation.h
mozglue/baseprofiler/core/ProfilerMarkerPayload.cpp
mozglue/baseprofiler/core/RegisteredThread.h
mozglue/baseprofiler/core/ThreadInfo.h
mozglue/baseprofiler/core/platform.cpp
mozglue/baseprofiler/public/BaseProfiler.h
mozglue/baseprofiler/public/BaseProfilerDetail.h
mozglue/baseprofiler/public/BaseProfilerMarkerPayload.h
mozglue/baseprofiler/public/BaseProfilingStack.h
mozglue/misc/AutoProfilerLabel.cpp
mozglue/misc/Mutex_posix.cpp
mozglue/misc/Mutex_windows.cpp
mozglue/misc/PlatformMutex.h
mozglue/tests/TestBaseProfiler.cpp
netwerk/base/nsFileStreams.h
netwerk/base/nsSocketTransportService2.h
netwerk/base/nsStreamTransportService.cpp
netwerk/ipc/NeckoCommon.h
netwerk/protocol/websocket/WebSocketEventService.cpp
testing/mochitest/mochitest_options.py
testing/mochitest/runtests.py
testing/mozharness/configs/unittests/mac_unittest.py
testing/mozharness/mozharness/mozilla/testing/per_test_base.py
toolkit/components/backgroundhangmonitor/BackgroundHangMonitor.cpp
toolkit/components/finalizationwitness/FinalizationWitnessService.cpp
toolkit/components/printingui/ipc/nsPrintingProxy.cpp
toolkit/components/telemetry/core/Stopwatch.cpp
toolkit/components/telemetry/core/Telemetry.cpp
toolkit/components/telemetry/core/TelemetryHistogram.cpp
toolkit/components/telemetry/core/TelemetryScalar.cpp
toolkit/components/telemetry/geckoview/streaming/GeckoViewStreamingTelemetry.cpp
toolkit/crashreporter/CrashAnnotations.yaml
toolkit/crashreporter/breakpad-client/mac/crash_generation/crash_generation_client.cc
toolkit/crashreporter/breakpad-client/mac/handler/exception_handler.cc
toolkit/crashreporter/nsExceptionHandler.cpp
toolkit/moz.build
toolkit/recordreplay/Assembler.cpp
toolkit/recordreplay/Assembler.h
toolkit/recordreplay/BufferStream.h
toolkit/recordreplay/CallFunction.h
toolkit/recordreplay/Callback.cpp
toolkit/recordreplay/Callback.h
toolkit/recordreplay/ChunkAllocator.h
toolkit/recordreplay/ExternalCall.cpp
toolkit/recordreplay/ExternalCall.h
toolkit/recordreplay/HashTable.cpp
toolkit/recordreplay/HashTable.h
toolkit/recordreplay/InfallibleVector.h
toolkit/recordreplay/Lock.cpp
toolkit/recordreplay/Lock.h
toolkit/recordreplay/Monitor.h
toolkit/recordreplay/ProcessRecordReplay.cpp
toolkit/recordreplay/ProcessRecordReplay.h
toolkit/recordreplay/ProcessRedirect.cpp
toolkit/recordreplay/ProcessRedirect.h
toolkit/recordreplay/ProcessRedirectDarwin.cpp
toolkit/recordreplay/ProcessRewind.cpp
toolkit/recordreplay/ProcessRewind.h
toolkit/recordreplay/Recording.cpp
toolkit/recordreplay/Recording.h
toolkit/recordreplay/SpinLock.h
toolkit/recordreplay/SplayTree.h
toolkit/recordreplay/Thread.cpp
toolkit/recordreplay/Thread.h
toolkit/recordreplay/ThreadSnapshot.cpp
toolkit/recordreplay/ThreadSnapshot.h
toolkit/recordreplay/ValueIndex.cpp
toolkit/recordreplay/ValueIndex.h
toolkit/recordreplay/ipc/Channel.cpp
toolkit/recordreplay/ipc/Channel.h
toolkit/recordreplay/ipc/ChildIPC.cpp
toolkit/recordreplay/ipc/ChildIPC.h
toolkit/recordreplay/ipc/ChildInternal.h
toolkit/recordreplay/ipc/ChildProcess.cpp
toolkit/recordreplay/ipc/DisabledIPC.cpp
toolkit/recordreplay/ipc/JSControl.cpp
toolkit/recordreplay/ipc/JSControl.h
toolkit/recordreplay/ipc/ParentForwarding.cpp
toolkit/recordreplay/ipc/ParentGraphics.cpp
toolkit/recordreplay/ipc/ParentIPC.cpp
toolkit/recordreplay/ipc/ParentIPC.h
toolkit/recordreplay/ipc/ParentInternal.h
toolkit/recordreplay/moz.build
toolkit/xre/nsAppRunner.cpp
toolkit/xre/nsEmbedFunctions.cpp
tools/profiler/core/ProfilerMarkerPayload.cpp
tools/profiler/core/RegisteredThread.h
tools/profiler/core/memory_hooks.cpp
tools/profiler/core/platform.cpp
tools/profiler/public/GeckoProfiler.h
tools/profiler/public/ProfilerMarkerPayload.h
tools/tryselect/test/test_mozharness_integration.py
widget/VsyncDispatcher.cpp
widget/nsBaseWidget.cpp
xpcom/base/CountingAllocatorBase.h
xpcom/base/CycleCollectedJSRuntime.cpp
xpcom/base/Logging.cpp
xpcom/base/Logging.h
xpcom/base/StaticMutex.h
xpcom/base/nsCycleCollector.cpp
xpcom/base/nsDebugImpl.cpp
xpcom/base/nsISupportsImpl.h
xpcom/base/nsTraceRefcnt.cpp
xpcom/ds/PLDHashTable.cpp
xpcom/ds/PLDHashTable.h
xpcom/ds/StaticAtoms.py
xpcom/ds/nsAtom.h
xpcom/ds/nsAtomTable.cpp
xpcom/ds/nsHashPropertyBag.h
xpcom/io/nsPipe3.cpp
xpcom/string/nsReadableUtils.cpp
xpcom/string/nsSubstring.cpp
xpcom/threads/AbstractThread.h
xpcom/threads/DataMutex.h
xpcom/threads/DeadlockDetector.h
xpcom/threads/IdlePeriodState.cpp
xpcom/threads/Monitor.h
xpcom/threads/Mutex.h
xpcom/threads/ReentrantMonitor.h
xpcom/threads/TimerThread.cpp
xpcom/threads/nsThreadManager.h
xpcom/threads/nsThreadUtils.h
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -111,25 +111,20 @@ Accessible::Accessible(nsIContent* aCont
       mContextFlags(0),
       mType(0),
       mGenericTypes(0),
       mReorderEventTarget(false),
       mShowEventTarget(false),
       mHideEventTarget(false) {
   mBits.groupInfo = nullptr;
   mInt.mIndexOfEmbeddedChild = -1;
-
-  // Assign an ID to this Accessible for use in UniqueID().
-  recordreplay::RegisterThing(this);
 }
 
 Accessible::~Accessible() {
   NS_ASSERTION(!mDoc, "LastRelease was never called!?!");
-
-  recordreplay::UnregisterThing(this);
 }
 
 ENameValueFlag Accessible::Name(nsString& aName) const {
   aName.Truncate();
 
   if (!HasOwnContent()) return eNameOK;
 
   ARIAName(aName);
--- a/accessible/generic/Accessible.h
+++ b/accessible/generic/Accessible.h
@@ -167,25 +167,17 @@ class Accessible : public nsISupports {
   /**
    * Return node type information of DOM node associated with the accessible.
    */
   bool IsContent() const { return GetNode() && GetNode()->IsContent(); }
 
   /**
    * Return the unique identifier of the accessible.
    */
-  void* UniqueID() {
-    // When recording or replaying, use an ID which will be consistent when
-    // recording/replaying (pointer values are not consistent), so that IPC
-    // messages from the parent process can be handled when replaying.
-    if (recordreplay::IsRecordingOrReplaying()) {
-      return reinterpret_cast<void*>(recordreplay::ThingIndex(this));
-    }
-    return static_cast<void*>(this);
-  }
+  void* UniqueID() { return static_cast<void*>(this); }
 
   /**
    * Return language associated with the accessible.
    */
   void Language(nsAString& aLocale);
 
   /**
    * Get the description of this accessible.
--- a/devtools/client/framework/test/browser_toolbox_options_disable_buttons.js
+++ b/devtools/client/framework/test/browser_toolbox_options_disable_buttons.js
@@ -120,17 +120,17 @@ async function testButtonStateOnClick() 
 async function testToggleToolboxButtons() {
   const checkNodes = [
     ...panelWin.document.querySelectorAll(
       "#enabled-toolbox-buttons-box input[type=checkbox]"
     ),
   ];
 
   // Filter out all the buttons which are not supported on the current target.
-  // (WebReplay, DevTools Fission Preferences etc...)
+  // (DevTools Fission Preferences etc...)
   const target = await TargetFactory.forTab(gBrowser.selectedTab);
   const toolbarButtons = toolbox.toolbarButtons.filter(tool =>
     tool.isTargetSupported(target)
   );
 
   const visibleToolbarButtons = toolbarButtons.filter(tool => tool.isVisible);
 
   const toolbarButtonNodes = [...doc.querySelectorAll(".command-button")];
--- a/devtools/client/shared/test/test-actor.js
+++ b/devtools/client/shared/test/test-actor.js
@@ -15,17 +15,16 @@ const {
   getWindowDimensions,
 } = require("devtools/shared/layout/utils");
 const defer = require("devtools/shared/defer");
 const {
   isAuthorStylesheet,
   getCSSStyleRules,
 } = require("devtools/shared/inspector/css-logic");
 const InspectorUtils = require("InspectorUtils");
-const Debugger = require("Debugger");
 
 // Set up a dummy environment so that EventUtils works. We need to be careful to
 // pass a window object into each EventUtils method we call rather than having
 // it rely on the |window| global.
 const EventUtils = {};
 EventUtils.window = {};
 EventUtils.parent = {};
 /* eslint-disable camelcase */
@@ -497,23 +496,16 @@ var TestActor = (exports.TestActor = pro
 
     return regions;
   },
 
   /**
    * Get the window which mouse events on node should be delivered to.
    */
   windowForMouseEvent: function(node) {
-    // When replaying, the node is a proxy for an element in the replaying
-    // process. Use the window which the server is running against, which is
-    // able to receive events. We can't use isReplaying here because this actor
-    // is loaded into its own sandbox.
-    if (Debugger.recordReplayProcessKind() == "Middleman") {
-      return this.targetActor.window;
-    }
     return node.ownerDocument.defaultView;
   },
 
   /**
    * Synthesize a mouse event on an element, after ensuring that it is visible
    * in the viewport. This handler doesn't send a message back. Consumers
    * should listen to specific events on the inspector/highlighter to know when
    * the event got synthesized.
--- a/docshell/base/timeline/TimelineConsumers.cpp
+++ b/docshell/base/timeline/TimelineConsumers.cpp
@@ -10,17 +10,17 @@
 #include "jsapi.h"
 #include "nsAppRunner.h"  // for XRE_IsContentProcess, XRE_IsParentProcess
 #include "nsDocShell.h"
 
 namespace mozilla {
 
 NS_IMPL_ISUPPORTS(TimelineConsumers, nsIObserver);
 
-StaticMutexNotRecorded TimelineConsumers::sMutex;
+StaticMutex TimelineConsumers::sMutex;
 
 // Manually manage this singleton's lifetime and destroy it before shutdown.
 // This avoids the leakchecker detecting false-positive memory leaks when
 // using automatic memory management (i.e. statically instantiating this
 // singleton inside the `Get` method), which would automatically destroy it on
 // application shutdown, but too late for the leakchecker. Sigh...
 StaticRefPtr<TimelineConsumers> TimelineConsumers::sInstance;
 
--- a/docshell/base/timeline/TimelineConsumers.h
+++ b/docshell/base/timeline/TimelineConsumers.h
@@ -117,14 +117,14 @@ class TimelineConsumers : public nsIObse
   static bool sInShutdown;
 
   // Counter for how many timelines are currently interested in markers,
   // and a list of the MarkersStorage interfaces representing them.
   unsigned long mActiveConsumers;
   LinkedList<MarkersStorage> mMarkersStores;
 
   // Protects this class's data structures.
-  static StaticMutexNotRecorded sMutex;
+  static StaticMutex sMutex;
 };
 
 }  // namespace mozilla
 
 #endif /* mozilla_TimelineConsumers_h_ */
--- a/dom/base/TabGroup.cpp
+++ b/dom/base/TabGroup.cpp
@@ -102,21 +102,16 @@ TabGroup* TabGroup::GetFromWindow(mozIDO
 
   return nullptr;
 }
 
 /* static */
 TabGroup* TabGroup::GetFromActor(BrowserChild* aBrowserChild) {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
 
-  // Middleman processes do not assign event targets to their tab children.
-  if (recordreplay::IsMiddleman()) {
-    return GetChromeTabGroup();
-  }
-
   nsCOMPtr<nsIEventTarget> target =
       aBrowserChild->Manager()->GetEventTargetFor(aBrowserChild);
   if (!target) {
     return nullptr;
   }
 
   // We have an event target. We assume the IPC code created it via
   // TabGroup::CreateEventTarget.
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -244,17 +244,16 @@
 #include "mozilla/dom/DocGroup.h"
 #include "mozilla/dom/TabGroup.h"
 #include "nsIWebNavigationInfo.h"
 #include "nsPluginHost.h"
 #include "nsIBrowser.h"
 #include "mozilla/HangAnnotations.h"
 #include "mozilla/Encoding.h"
 #include "nsXULElement.h"
-#include "mozilla/RecordReplay.h"
 #include "nsThreadManager.h"
 #include "nsIBidiKeyboard.h"
 #include "ReferrerInfo.h"
 #include "nsAboutProtocolUtils.h"
 
 #if defined(XP_WIN)
 // Undefine LoadImage to prevent naming conflict with Windows.
 #  undef LoadImage
@@ -9910,22 +9909,16 @@ uint64_t nsContentUtils::GenerateProcess
 
   MOZ_RELEASE_ASSERT(processId < (uint64_t(1) << kIdProcessBits));
   uint64_t processBits = processId & ((uint64_t(1) << kIdProcessBits) - 1);
 
   uint64_t id = aId;
   MOZ_RELEASE_ASSERT(id < (uint64_t(1) << kIdBits));
   uint64_t bits = id & ((uint64_t(1) << kIdBits) - 1);
 
-  // Set the high bit for middleman processes so it doesn't conflict with the
-  // content process's generated IDs.
-  if (recordreplay::IsMiddleman()) {
-    bits |= uint64_t(1) << (kIdBits - 1);
-  }
-
   return (processBits << kIdBits) | bits;
 }
 
 // Next process-local Tab ID.
 static uint64_t gNextTabId = 0;
 
 /* static */
 uint64_t nsContentUtils::GenerateTabId() {
--- a/dom/base/nsFrameMessageManager.cpp
+++ b/dom/base/nsFrameMessageManager.cpp
@@ -47,17 +47,16 @@
 #include "mozilla/dom/ProcessMessageManager.h"
 #include "mozilla/dom/SameProcessMessageQueue.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/dom/ToJSValue.h"
 #include "mozilla/dom/ipc/SharedMap.h"
 #include "mozilla/dom/ipc/StructuredCloneData.h"
 #include "mozilla/dom/DOMStringList.h"
 #include "mozilla/jsipc/CrossProcessObjectWrappers.h"
-#include "mozilla/recordreplay/ParentIPC.h"
 #include "nsPrintfCString.h"
 #include "nsXULAppAPI.h"
 #include "nsQueryObject.h"
 #include "xpcprivate.h"
 #include <algorithm>
 #include "chrome/common/ipc_channel.h"  // for IPC::Channel::kMaximumMessageSize
 
 #ifdef XP_WIN
@@ -589,45 +588,21 @@ class MMListenerRemover {
       }
     }
   }
 
   bool mWasHandlingMessage;
   RefPtr<nsFrameMessageManager> mMM;
 };
 
-// When recording or replaying, return whether a message should be received in
-// the middleman process instead of the recording/replaying process.
-static bool DirectMessageToMiddleman(const nsAString& aMessage) {
-  // Middleman processes run developer tools server code and need to receive
-  // debugger related messages. The session store flush message needs to be
-  // received in order to cleanly shutdown the process.
-  return (StringBeginsWith(aMessage, NS_LITERAL_STRING("debug:")) &&
-          recordreplay::parent::DebuggerRunsInMiddleman()) ||
-         aMessage.EqualsLiteral("SessionStore:flush");
-}
-
 void nsFrameMessageManager::ReceiveMessage(
     nsISupports* aTarget, nsFrameLoader* aTargetFrameLoader, bool aTargetClosed,
     const nsAString& aMessage, bool aIsSync, StructuredCloneData* aCloneData,
     mozilla::jsipc::CpowHolder* aCpows, nsIPrincipal* aPrincipal,
     nsTArray<StructuredCloneData>* aRetVal, ErrorResult& aError) {
-  // If we are recording or replaying, we will end up here in both the
-  // middleman process and the recording/replaying process. Ignore the message
-  // in one of the processes, so that it is only received in one place.
-  if (recordreplay::IsRecordingOrReplaying()) {
-    if (DirectMessageToMiddleman(aMessage)) {
-      return;
-    }
-  } else if (recordreplay::IsMiddleman()) {
-    if (!DirectMessageToMiddleman(aMessage)) {
-      return;
-    }
-  }
-
   MOZ_ASSERT(aTarget);
 
   nsAutoTObserverArray<nsMessageListenerInfo, 1>* listeners =
       mListeners.Get(aMessage);
   if (listeners) {
     MMListenerRemover lr(this);
 
     nsAutoTObserverArray<nsMessageListenerInfo, 1>::EndLimitedIterator iter(
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -525,18 +525,17 @@ class ScriptErrorEvent : public Runnable
                                         &status);
     }
 
     if (status != nsEventStatus_eConsumeNoDefault) {
       JS::Rooted<JSObject*> stack(rootingCx);
       JS::Rooted<JSObject*> stackGlobal(rootingCx);
       xpc::FindExceptionStackForConsoleReport(win, mError, mErrorStack, &stack,
                                               &stackGlobal);
-      mReport->LogToConsoleWithStack(stack, stackGlobal,
-                                     JS::ExceptionTimeWarpTarget(mError));
+      mReport->LogToConsoleWithStack(stack, stackGlobal);
     }
 
     return NS_OK;
   }
 
  private:
   nsCOMPtr<nsPIDOMWindowInner> mWindow;
   RefPtr<xpc::ErrorReport> mReport;
--- a/dom/base/nsWrapperCache.cpp
+++ b/dom/base/nsWrapperCache.cpp
@@ -33,21 +33,16 @@ void nsWrapperCache::HoldJSObjects(void*
 
 void nsWrapperCache::SetWrapperJSObject(JSObject* aWrapper) {
   mWrapper = aWrapper;
   UnsetWrapperFlags(kWrapperFlagsMask);
 
   if (aWrapper && !JS::ObjectIsTenured(aWrapper)) {
     CycleCollectedJSRuntime::Get()->NurseryWrapperAdded(this);
   }
-
-  // Never collect the wrapper object while recording or replaying, to avoid
-  // non-deterministic behaviors if the cache is emptied and then refilled at
-  // a different point when replaying.
-  recordreplay::HoldJSObject(aWrapper);
 }
 
 void nsWrapperCache::ReleaseWrapper(void* aScriptObjectHolder) {
   // If the behavior here changes in a substantive way, you may need
   // to update css::Rule::UnlinkDeclarationWrapper as well.
   if (PreservingWrapper()) {
     SetPreservingWrapper(false);
     cyclecollector::DropJSObjectsImpl(aScriptObjectHolder);
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -4047,23 +4047,16 @@ void DeprecationWarning(JSContext* aCx, 
   }
 
   DeprecationWarning(global, aOperation);
 }
 
 void DeprecationWarning(const GlobalObject& aGlobal,
                         Document::DeprecatedOperations aOperation) {
   if (NS_IsMainThread()) {
-    // After diverging from the recording, a replaying process is not able to
-    // report warnings and will be forced to rewind. Avoid reporting warnings
-    // in this case so that the debugger can access deprecated properties.
-    if (recordreplay::HasDivergedFromRecording()) {
-      return;
-    }
-
     nsCOMPtr<nsPIDOMWindowInner> window =
         do_QueryInterface(aGlobal.GetAsSupports());
     if (window && window->GetExtantDoc()) {
       window->GetExtantDoc()->WarnOnceAbout(aOperation);
 
       nsAutoString fileName;
       Nullable<uint32_t> lineNumber;
       Nullable<uint32_t> columnNumber;
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -2652,21 +2652,16 @@ class MOZ_STACK_CLASS BindingJSObjectCre
                                 JS::MemoryUse::DOMBinding);
       }
     }
   }
 
   void InitializationSucceeded() {
     T* pointer;
     mNative.forget(&pointer);
-
-    // Never collect binding objects while recording or replaying, to avoid
-    // non-deterministically releasing references during finalization.
-    recordreplay::HoldJSObject(mReflector);
-
     mReflector = nullptr;
   }
 
  private:
   struct OwnedNative {
     // Make sure the native objects inherit from NonRefcountedDOMObject so
     // that we log their ctor and dtor.
     static_assert(std::is_base_of<NonRefcountedDOMObject, T>::value,
--- a/dom/bindings/nsIScriptError.idl
+++ b/dom/bindings/nsIScriptError.idl
@@ -110,22 +110,16 @@ interface nsIScriptError : nsIConsoleMes
      * The name of a template string, as found in js.msg, associated with the
      * error message.
      */
     attribute AString errorMessageName;
 
     readonly attribute nsIArray notes;
 
     /**
-     * If we are recording or replaying, this value may identify the point
-     * where the error was generated, otherwise zero.
-     */
-    attribute unsigned long long timeWarpTarget;
-
-    /**
      * If the ScriptError is a CSS parser error, this value will contain the
      * CSS selectors of the CSS ruleset where the error occured.
      */
     attribute AString cssSelectors;
 
     void init(in AString message,
               in AString sourceName,
               in AString sourceLine,
--- a/dom/bindings/nsScriptError.cpp
+++ b/dom/bindings/nsScriptError.cpp
@@ -36,17 +36,16 @@ nsScriptErrorBase::nsScriptErrorBase()
       mLineNumber(0),
       mSourceLine(),
       mColumnNumber(0),
       mFlags(0),
       mCategory(),
       mOuterWindowID(0),
       mInnerWindowID(0),
       mTimeStamp(0),
-      mTimeWarpTarget(0),
       mInitializedOnMainThread(false),
       mIsFromPrivateWindow(false),
       mIsFromChromeContext(false) {}
 
 nsScriptErrorBase::~nsScriptErrorBase() = default;
 
 void nsScriptErrorBase::AddNote(nsIScriptErrorNote* note) {
   mNotes.AppendObject(note);
@@ -382,28 +381,16 @@ nsScriptErrorBase::GetIsFromPrivateWindo
     InitializeOnMainThread();
   }
 
   *aIsFromPrivateWindow = mIsFromPrivateWindow;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsScriptErrorBase::SetTimeWarpTarget(uint64_t aTarget) {
-  mTimeWarpTarget = aTarget;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsScriptErrorBase::GetTimeWarpTarget(uint64_t* aTarget) {
-  *aTarget = mTimeWarpTarget;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsScriptErrorBase::GetIsFromChromeContext(bool* aIsFromChromeContext) {
   NS_WARNING_ASSERTION(NS_IsMainThread() || mInitializedOnMainThread,
                        "This can't be safely determined off the main thread, "
                        "returning an inaccurate value!");
   if (!mInitializedOnMainThread && NS_IsMainThread()) {
     InitializeOnMainThread();
   }
   *aIsFromChromeContext = mIsFromChromeContext;
--- a/dom/bindings/nsScriptError.h
+++ b/dom/bindings/nsScriptError.h
@@ -78,17 +78,16 @@ class nsScriptErrorBase : public nsIScri
   nsString mSourceLine;
   uint32_t mColumnNumber;
   uint32_t mFlags;
   nsCString mCategory;
   // mOuterWindowID is set on the main thread from InitializeOnMainThread().
   uint64_t mOuterWindowID;
   uint64_t mInnerWindowID;
   int64_t mTimeStamp;
-  uint64_t mTimeWarpTarget;
   // mInitializedOnMainThread, mIsFromPrivateWindow and mIsFromChromeContext are
   // set on the main thread from InitializeOnMainThread().
   mozilla::Atomic<bool> mInitializedOnMainThread;
   bool mIsFromPrivateWindow;
   bool mIsFromChromeContext;
 };
 
 class nsScriptError final : public nsScriptErrorBase {
--- a/dom/canvas/WebGLContext.cpp
+++ b/dom/canvas/WebGLContext.cpp
@@ -316,27 +316,16 @@ bool WebGLContext::CreateAndInitGL(
     FailureReason reason;
     reason.info =
         "Can't use WebGL in headless mode (https://bugzil.la/1375585).";
     out_failReasons->push_back(reason);
     GenerateWarning("%s", reason.info.BeginReading());
     return false;
   }
 
-  // WebGL can't be used when recording/replaying.
-  if (recordreplay::IsRecordingOrReplaying()) {
-    FailureReason reason;
-    reason.info =
-        "Can't use WebGL when recording or replaying "
-        "(https://bugzil.la/1506467).";
-    out_failReasons->push_back(reason);
-    GenerateWarning("%s", reason.info.BeginReading());
-    return false;
-  }
-
   // WebGL2 is separately blocked:
   if (IsWebGL2() && !forceEnabled) {
     const nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo();
     const auto feature = nsIGfxInfo::FEATURE_WEBGL2;
 
     FailureReason reason;
     if (IsFeatureInBlacklist(gfxInfo, feature, &reason.key)) {
       reason.info =
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -1174,23 +1174,16 @@ NS_IMETHODIMP
 HTMLMediaElement::MediaLoadListener::OnStartRequest(nsIRequest* aRequest) {
   nsContentUtils::UnregisterShutdownObserver(this);
 
   if (!mElement) {
     // We've been notified by the shutdown observer, and are shutting down.
     return NS_BINDING_ABORTED;
   }
 
-  // Media element playback is not currently supported when recording or
-  // replaying. See bug 1304146.
-  if (recordreplay::IsRecordingOrReplaying()) {
-    mElement->ReportLoadError("Media elements not available when recording");
-    return NS_ERROR_NOT_AVAILABLE;
-  }
-
   // The element is only needed until we've had a chance to call
   // InitializeDecoderForChannel. So make sure mElement is cleared here.
   RefPtr<HTMLMediaElement> element;
   element.swap(mElement);
 
   AbstractThread::AutoEnter context(element->AbstractMainThread());
 
   if (mLoadID != element->GetCurrentLoadID()) {
--- a/dom/html/input/InputType.h
+++ b/dom/html/input/InputType.h
@@ -4,16 +4,17 @@
  * 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 InputType_h__
 #define InputType_h__
 
 #include <stdint.h>
 #include "mozilla/Decimal.h"
+#include "mozilla/Maybe.h"
 #include "mozilla/UniquePtr.h"
 #include "nsIConstraintValidation.h"
 #include "nsString.h"
 #include "nsError.h"
 
 // This must come outside of any namespace, or else it won't overload with the
 // double based version in nsMathUtils.h
 inline mozilla::Decimal NS_floorModulo(mozilla::Decimal x, mozilla::Decimal y) {
--- a/dom/interfaces/base/nsIRemoteTab.idl
+++ b/dom/interfaces/base/nsIRemoteTab.idl
@@ -90,22 +90,16 @@ interface nsIRemoteTab : nsISupports
 
   /**
    * Notify APZ to stop autoscrolling.
    * aScrollId and aPresShellId identify the scroll frame that is being
    * autoscrolled.
    */
   void stopApzAutoscroll(in nsViewID aScrollId, in uint32_t aPresShellId);
 
-  /**
-   * Save a recording of the associated content process' behavior to the
-   * specified filename. Returns whether the process is being recorded.
-   */
-  bool saveRecording(in AString aFileName);
-
   cenum NavigationType : 8 {
     NAVIGATE_BACK = 0,
     NAVIGATE_FORWARD = 1,
     NAVIGATE_INDEX = 2,
     NAVIGATE_URL = 3
   };
 
   /**
--- a/dom/ipc/BrowserChild.cpp
+++ b/dom/ipc/BrowserChild.cpp
@@ -81,17 +81,16 @@
 #include "mozilla/layers/DoubleTapToZoom.h"
 #include "mozilla/layers/IAPZCTreeManager.h"
 #include "mozilla/layers/ImageBridgeChild.h"
 #include "mozilla/layers/InputAPZContext.h"
 #include "mozilla/layers/LayerTransactionChild.h"
 #include "mozilla/layers/ShadowLayers.h"
 #include "mozilla/layers/WebRenderLayerManager.h"
 #include "mozilla/plugins/PPluginWidgetChild.h"
-#include "mozilla/recordreplay/ParentIPC.h"
 #include "nsBrowserStatusFilter.h"
 #include "nsColorPickerProxy.h"
 #include "nsCommandParams.h"
 #include "nsContentPermissionHelper.h"
 #include "nsContentUtils.h"
 #include "nsDeviceContext.h"
 #include "nsDocShell.h"
 #include "nsDocShellLoadState.h"
@@ -286,21 +285,17 @@ class BrowserChild::DelayedDeleteRunnabl
     if (!mReadyToDelete) {
       // This time run this runnable at input priority.
       mReadyToDelete = true;
       MOZ_ALWAYS_SUCCEEDS(NS_DispatchToCurrentThread(this));
       return NS_OK;
     }
 
     // Check in case ActorDestroy was called after RecvDestroy message.
-    // Middleman processes with their own recording child process avoid
-    // sending a delete message, so that the parent process does not
-    // receive two deletes for the same actor.
-    if (mBrowserChild->IPCOpen() &&
-        !recordreplay::parent::IsMiddlemanWithRecordingChild()) {
+    if (mBrowserChild->IPCOpen()) {
       Unused << PBrowserChild::Send__delete__(mBrowserChild);
     }
 
     mBrowserChild = nullptr;
     return NS_OK;
   }
 };
 
@@ -584,21 +579,16 @@ nsresult BrowserChild::Init(mozIDOMWindo
           static_cast<BrowserChild*>(browserChild.get())
               ->ContentReceivedInputBlock(aInputBlockId, aPreventDefault);
         }
       });
   mAPZEventState = new APZEventState(mPuppetWidget, std::move(callback));
 
   mIPCOpen = true;
 
-  // Recording/replaying processes use their own compositor.
-  if (recordreplay::IsRecordingOrReplaying()) {
-    mPuppetWidget->CreateCompositor();
-  }
-
 #if !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_THUNDERBIRD) && \
     !defined(MOZ_SUITE)
   mSessionStoreListener = new TabListener(docShell, nullptr);
   rv = mSessionStoreListener->Init();
   NS_ENSURE_SUCCESS(rv, rv);
 #endif
   return NS_OK;
 }
@@ -1180,23 +1170,16 @@ mozilla::ipc::IPCResult BrowserChild::Re
   if (!mIsTopLevel) {
     RecvScrollbarPreferenceChanged(aOwnerInfo.scrollbarPreference());
   }
 
   if (!res) {
     return IPC_FAIL_NO_REASON(this);
   }
 
-  // We have now done enough initialization for the record/replay system to
-  // create checkpoints. Create a checkpoint now, in case this process never
-  // paints later on (the usual place where checkpoints occur).
-  if (recordreplay::IsRecordingOrReplaying()) {
-    recordreplay::child::CreateCheckpoint();
-  }
-
   UpdateVisibility();
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult BrowserChild::RecvInitRendering(
     const TextureFactoryIdentifier& aTextureFactoryIdentifier,
     const layers::LayersId& aLayersId,
@@ -1234,19 +1217,17 @@ mozilla::ipc::IPCResult BrowserChild::Re
   //     the actors in the APZ --> non-APZ case, and always re-creating them
   //     during a non-APZ --> APZ transition).
   mCompositorOptions->SetUseAPZ(aNewOptions.UseAPZ());
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult BrowserChild::RecvUpdateDimensions(
     const DimensionInfo& aDimensionInfo) {
-  // When recording/replaying we need to make sure the dimensions are up to
-  // date on the compositor used in this process.
-  if (mLayersConnected.isNothing() && !recordreplay::IsRecordingOrReplaying()) {
+  if (mLayersConnected.isNothing()) {
     return IPC_OK();
   }
 
   mUnscaledOuterRect = aDimensionInfo.rect();
   mClientOffset = aDimensionInfo.clientOffset();
   mChromeOffset = aDimensionInfo.chromeOffset();
 
   mOrientation = aDimensionInfo.orientation();
@@ -2231,49 +2212,30 @@ mozilla::ipc::IPCResult BrowserChild::Re
   NS_ENSURE_TRUE(window, IPC_OK());
   nsCOMPtr<EventTarget> chromeHandler = window->GetChromeEventHandler();
   NS_ENSURE_TRUE(chromeHandler, IPC_OK());
   RefPtr<ContentListener> listener = new ContentListener(this);
   chromeHandler->AddEventListener(aType, listener, capture);
   return IPC_OK();
 }
 
-// Return whether a remote script should be loaded in middleman processes in
-// addition to any child recording process they have.
-static bool LoadScriptInMiddleman(const nsString& aURL) {
-  return  // Middleman processes run devtools server side scripts.
-      (StringBeginsWith(aURL, NS_LITERAL_STRING("resource://devtools/")) &&
-       recordreplay::parent::DebuggerRunsInMiddleman())
-      // This script includes event listeners needed to propagate document
-      // title changes.
-      || aURL.EqualsLiteral("chrome://global/content/browser-child.js")
-      // This script is needed to respond to session store requests from the
-      // UI process.
-      || aURL.EqualsLiteral("chrome://browser/content/content-sessionStore.js");
-}
-
 mozilla::ipc::IPCResult BrowserChild::RecvLoadRemoteScript(
     const nsString& aURL, const bool& aRunInGlobalScope) {
   if (!InitBrowserChildMessageManager())
     // This can happen if we're half-destroyed.  It's not a fatal
     // error.
     return IPC_OK();
 
   JS::Rooted<JSObject*> mm(RootingCx(),
                            mBrowserChildMessageManager->GetOrCreateWrapper());
   if (!mm) {
     // This can happen if we're half-destroyed.  It's not a fatal error.
     return IPC_OK();
   }
 
-  // Make sure we only load whitelisted scripts in middleman processes.
-  if (recordreplay::IsMiddleman() && !LoadScriptInMiddleman(aURL)) {
-    return IPC_OK();
-  }
-
   LoadScriptInternal(mm, aURL, !aRunInGlobalScope);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult BrowserChild::RecvAsyncMessage(
     const nsString& aMessage, nsTArray<CpowEntry>&& aCpows,
     nsIPrincipal* aPrincipal, const ClonedMessageData& aData) {
   AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING("BrowserChild::RecvAsyncMessage",
@@ -2839,20 +2801,17 @@ void BrowserChild::InitAPZState() {
   cbc->SetEventTargetForActor(apzChild,
                               TabGroup()->EventTargetFor(TaskCategory::Other));
   MOZ_ASSERT(apzChild->GetActorEventTarget());
   cbc->SendPAPZConstructor(apzChild, mLayersId);
 }
 
 void BrowserChild::NotifyPainted() {
   if (!mNotified) {
-    // Recording/replaying processes have a compositor but not a remote frame.
-    if (!recordreplay::IsRecordingOrReplaying()) {
-      SendNotifyCompositorTransaction();
-    }
+    SendNotifyCompositorTransaction();
     mNotified = true;
   }
 }
 
 IPCResult BrowserChild::RecvUpdateEffects(const EffectsInfo& aEffects) {
   mEffectsInfo = aEffects;
   UpdateVisibility();
   return IPC_OK();
--- a/dom/ipc/BrowserHost.cpp
+++ b/dom/ipc/BrowserHost.cpp
@@ -287,30 +287,16 @@ NS_IMETHODIMP
 BrowserHost::StopApzAutoscroll(nsViewID aScrollId, uint32_t aPresShellId) {
   if (!mRoot) {
     return NS_OK;
   }
   mRoot->StopApzAutoscroll(aScrollId, aPresShellId);
   return NS_OK;
 }
 
-/* bool saveRecording (in AString aFileName); */
-NS_IMETHODIMP
-BrowserHost::SaveRecording(const nsAString& aFileName, bool* _retval) {
-  if (!mRoot) {
-    return NS_OK;
-  }
-  nsCOMPtr<nsIFile> file;
-  nsresult rv = NS_NewLocalFile(aFileName, false, getter_AddRefs(file));
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-  return GetContentParent()->SaveRecording(file, _retval);
-}
-
 NS_IMETHODIMP
 BrowserHost::MaybeCancelContentJSExecutionFromScript(
     nsIRemoteTab::NavigationType aNavigationType,
     JS::Handle<JS::Value> aCancelContentJSOptions, JSContext* aCx) {
   // If we're in the process of creating a new window (via window.open), then
   // the load that called this function isn't a "normal" load and should be
   // ignored for the purposes of cancelling content JS.
   if (!mRoot || mRoot->CreatingWindow()) {
--- a/dom/ipc/BrowserParent.cpp
+++ b/dom/ipc/BrowserParent.cpp
@@ -218,18 +218,17 @@ BrowserParent::BrowserParent(ContentPare
       mTabSetsCursor(false),
       mPreserveLayers(false),
       mRenderLayers(true),
       mActiveInPriorityManager(false),
       mHasLayers(false),
       mHasPresented(false),
       mIsReadyToHandleInputEvents(false),
       mIsMouseEnterIntoWidgetEventSuppressed(false),
-      mIsDestroyingForProcessSwitch(false),
-      mIsActiveRecordReplayTab(false) {
+      mIsDestroyingForProcessSwitch(false) {
   MOZ_ASSERT(aManager);
   // When the input event queue is disabled, we don't need to handle the case
   // that some input events are dispatched before PBrowserConstructor.
   mIsReadyToHandleInputEvents = !ContentParent::IsInputEventQueueSupported();
 }
 
 BrowserParent::~BrowserParent() {}
 
@@ -641,18 +640,16 @@ void BrowserParent::DestroyInternal() {
   // is shut down.
   const ManagedContainer<PPluginWidgetParent>& kids =
       ManagedPPluginWidgetParent();
   for (auto iter = kids.ConstIter(); !iter.Done(); iter.Next()) {
     static_cast<mozilla::plugins::PluginWidgetParent*>(iter.Get()->GetKey())
         ->ParentDestroy();
   }
 #endif
-
-  SetIsActiveRecordReplayTab(false);
 }
 
 void BrowserParent::Destroy() {
   // Aggressively release the window to avoid leaking the world in shutdown
   // corner cases.
   mBrowserDOMWindow = nullptr;
 
   if (mIsDestroyed) {
@@ -3338,21 +3335,16 @@ void BrowserParent::SetDocShellIsActive(
           a11y::nsWinUtils::ShowNativeWindow(window);
         } else {
           a11y::nsWinUtils::HideNativeWindow(window);
         }
       }
     }
   }
 #endif
-
-  // Keep track of how many active recording/replaying tabs there are.
-  if (Manager()->IsRecordingOrReplaying()) {
-    SetIsActiveRecordReplayTab(isActive);
-  }
 }
 
 bool BrowserParent::GetHasPresented() { return mHasPresented; }
 
 bool BrowserParent::GetHasLayers() { return mHasLayers; }
 
 bool BrowserParent::GetRenderLayers() { return mRenderLayers; }
 
@@ -3924,26 +3916,16 @@ void BrowserParent::SetBrowserBridgePare
 void BrowserParent::SetBrowserHost(BrowserHost* aBrowser) {
   // We should either be clearing out our reference to a browser host, or not
   // have either a browser bridge, browser host, or owner content yet.
   MOZ_ASSERT(!aBrowser ||
              (!mBrowserBridgeParent && !mBrowserHost && !mFrameElement));
   mBrowserHost = aBrowser;
 }
 
-/* static */
-size_t BrowserParent::gNumActiveRecordReplayTabs;
-
-void BrowserParent::SetIsActiveRecordReplayTab(bool aIsActive) {
-  if (aIsActive != mIsActiveRecordReplayTab) {
-    gNumActiveRecordReplayTabs += aIsActive ? 1 : -1;
-    mIsActiveRecordReplayTab = aIsActive;
-  }
-}
-
 mozilla::ipc::IPCResult BrowserParent::RecvSetSystemFont(
     const nsCString& aFontName) {
   nsCOMPtr<nsIWidget> widget = GetWidget();
   if (widget) {
     widget->SetSystemFont(aFontName);
   }
   return IPC_OK();
 }
--- a/dom/ipc/BrowserParent.h
+++ b/dom/ipc/BrowserParent.h
@@ -128,20 +128,16 @@ class BrowserParent final : public PBrow
 
   static BrowserParent* GetFrom(nsIContent* aContent);
 
   static BrowserParent* GetBrowserParentFromLayersId(
       layers::LayersId aLayersId);
 
   static TabId GetTabIdFrom(nsIDocShell* docshell);
 
-  static bool AreRecordReplayTabsActive() {
-    return gNumActiveRecordReplayTabs != 0;
-  }
-
   const TabId GetTabId() const { return mTabId; }
 
   ContentParent* Manager() const { return mManager; }
 
   CanonicalBrowsingContext* GetBrowsingContext() { return mBrowsingContext; }
 
   already_AddRefed<nsILoadContext> GetLoadContext();
 
@@ -988,25 +984,16 @@ class BrowserParent final : public PBrow
   // was not ready to handle it. We will resend it when the next time we fire a
   // mouse event and the BrowserChild is ready.
   bool mIsMouseEnterIntoWidgetEventSuppressed : 1;
 
   // Set to true if we're currently in the middle of replacing this
   // BrowserParent with a new one connected to a different process, and we
   // should ignore nsIWebProgressListener stop requests.
   bool mIsDestroyingForProcessSwitch : 1;
-
-  // How many record/replay tabs have active docshells in this process.
-  static size_t gNumActiveRecordReplayTabs;
-
-  // Whether this tab is contributing to gNumActiveRecordReplayTabs.
-  bool mIsActiveRecordReplayTab : 1;
-
-  // Update whether this is an active record/replay tab.
-  void SetIsActiveRecordReplayTab(bool aIsActive);
 };
 
 struct MOZ_STACK_CLASS BrowserParent::AutoUseNewTab final {
  public:
   AutoUseNewTab(BrowserParent* aNewTab, nsCString* aURLToLoad)
       : mNewTab(aNewTab), mURLToLoad(aURLToLoad) {
     MOZ_ASSERT(!aNewTab->mCreatingWindow);
 
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -89,17 +89,16 @@
 #include "mozilla/loader/ScriptCacheActors.h"
 #include "mozilla/net/NeckoChild.h"
 #include "mozilla/net/CookieServiceChild.h"
 #include "mozilla/net/CaptivePortalService.h"
 #include "mozilla/PerformanceMetricsCollector.h"
 #include "mozilla/PerformanceUtils.h"
 #include "mozilla/plugins/PluginInstanceParent.h"
 #include "mozilla/plugins/PluginModuleParent.h"
-#include "mozilla/recordreplay/ParentIPC.h"
 #include "mozilla/widget/ScreenManager.h"
 #include "mozilla/widget/WidgetMessageUtils.h"
 #include "nsBaseDragService.h"
 #include "mozilla/media/MediaChild.h"
 #include "mozilla/BasePrincipal.h"
 #include "mozilla/WebBrowserPersistDocumentChild.h"
 #include "mozilla/HangDetails.h"
 #include "mozilla/LoadInfo.h"
@@ -683,27 +682,16 @@ bool ContentChild::Init(MessageLoop* aIO
   // Once we start sending IPC messages, we need the thread manager to be
   // initialized so we can deal with the responses. Do that here before we
   // try to construct the crash reporter.
   nsresult rv = nsThreadManager::get().Init();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return false;
   }
 
-  // Middleman processes use a special channel for forwarding messages to
-  // their own children.
-  if (recordreplay::IsMiddleman()) {
-    SetMiddlemanIPCChannel(recordreplay::parent::ChannelToUIProcess());
-
-    // Eagerly mark this child as connected, as using another IPC channel will
-    // cause that channel's protocol to be marked as connected instead and
-    // prevent this one from being able to send IPDL messages.
-    ActorConnected();
-  }
-
   if (!Open(std::move(aChannel), aParentPid, aIOLoop)) {
     return false;
   }
   sSingleton = this;
 
   // If communications with the parent have broken down, take the process
   // down so it's not hanging around.
   GetIPCChannel()->SetAbortOnError(true);
@@ -1374,22 +1362,18 @@ void ContentChild::InitXPCOM(
   LocaleService::GetInstance()->AssignAppLocales(aXPCOMInit.appLocales());
   LocaleService::GetInstance()->AssignRequestedLocales(
       aXPCOMInit.requestedLocales());
 
   RecvSetCaptivePortalState(aXPCOMInit.captivePortalState());
   RecvBidiKeyboardNotify(aXPCOMInit.isLangRTL(),
                          aXPCOMInit.haveBidiKeyboards());
 
-  // Create the CPOW manager as soon as possible. Middleman processes don't use
-  // CPOWs, because their recording child will also have a CPOW manager that
-  // communicates with the UI process.
-  if (!recordreplay::IsMiddleman()) {
-    SendPJavaScriptConstructor();
-  }
+  // Create the CPOW manager as soon as possible.
+  SendPJavaScriptConstructor();
 
   if (aXPCOMInit.domainPolicy().active()) {
     nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager();
     MOZ_ASSERT(ssm);
     ssm->ActivateDomainPolicyInternal(getter_AddRefs(mPolicy));
     if (!mPolicy) {
       MOZ_CRASH("Failed to activate domain policy.");
     }
@@ -1697,18 +1681,17 @@ static bool StartMacOSContentSandbox() {
     CGError result = CGSSetDenyWindowServerConnections(true);
     MOZ_DIAGNOSTIC_ASSERT(result == kCGErrorSuccess);
 #  if !MOZ_DIAGNOSTIC_ASSERT_ENABLED
     Unused << result;
 #  endif
   }
 
   // If the sandbox is already enabled, there's nothing more to do here.
-  if (Preferences::GetBool("security.sandbox.content.mac.earlyinit") &&
-      !recordreplay::IsRecordingOrReplaying()) {
+  if (Preferences::GetBool("security.sandbox.content.mac.earlyinit")) {
     return true;
   }
 
   nsAutoCString appPath;
   if (!nsMacUtilsImpl::GetAppPath(appPath)) {
     MOZ_CRASH("Error resolving child process app path");
   }
 
@@ -1869,21 +1852,17 @@ mozilla::ipc::IPCResult ContentChild::Re
 }
 
 static StaticRefPtr<CancelableRunnable> gFirstIdleTask;
 
 static void FirstIdle(void) {
   MOZ_ASSERT(gFirstIdleTask);
   gFirstIdleTask = nullptr;
 
-  // When recording or replaying, the middleman process will send this message
-  // instead.
-  if (!recordreplay::IsRecordingOrReplaying()) {
-    ContentChild::GetSingleton()->SendFirstIdle();
-  }
+  ContentChild::GetSingleton()->SendFirstIdle();
 }
 
 mozilla::jsipc::PJavaScriptChild* ContentChild::AllocPJavaScriptChild() {
   MOZ_ASSERT(ManagedPJavaScriptChild().IsEmpty());
 
   return NewJavaScriptChild();
 }
 
@@ -2094,19 +2073,16 @@ bool ContentChild::DeallocPTestShellChil
   return true;
 }
 
 jsipc::CPOWManager* ContentChild::GetCPOWManager() {
   if (PJavaScriptChild* c =
           LoneManagedOrNullAsserts(ManagedPJavaScriptChild())) {
     return CPOWManagerFor(c);
   }
-  if (recordreplay::IsMiddleman()) {
-    return nullptr;
-  }
   return CPOWManagerFor(SendPJavaScriptConstructor());
 }
 
 mozilla::ipc::IPCResult ContentChild::RecvPTestShellConstructor(
     PTestShellChild* actor) {
   return IPC_OK();
 }
 
@@ -3637,22 +3613,16 @@ mozilla::ipc::IPCResult ContentChild::Re
 }
 
 mozilla::ipc::IPCResult ContentChild::RecvAddDynamicScalars(
     nsTArray<DynamicScalarDefinition>&& aDefs) {
   TelemetryIPC::AddDynamicScalarDefinitions(aDefs);
   return IPC_OK();
 }
 
-mozilla::ipc::IPCResult ContentChild::RecvSaveRecording(
-    const FileDescriptor& aFile) {
-  recordreplay::parent::SaveRecording(aFile);
-  return IPC_OK();
-}
-
 mozilla::ipc::IPCResult ContentChild::RecvCrossProcessRedirect(
     RedirectToRealChannelArgs&& aArgs,
     CrossProcessRedirectResolver&& aResolve) {
   nsCOMPtr<nsILoadInfo> loadInfo;
   nsresult rv = mozilla::ipc::LoadInfoArgsToLoadInfo(aArgs.loadInfo(),
                                                      getter_AddRefs(loadInfo));
   if (NS_FAILED(rv)) {
     MOZ_DIAGNOSTIC_ASSERT(false, "LoadInfoArgsToLoadInfo failed");
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -146,17 +146,16 @@
 #include "mozilla/media/MediaParent.h"
 #include "mozilla/mozSpellChecker.h"
 #include "mozilla/net/CookieServiceParent.h"
 #include "mozilla/net/NeckoMessageUtils.h"
 #include "mozilla/net/NeckoParent.h"
 #include "mozilla/net/PCookieServiceParent.h"
 #include "mozilla/plugins/PluginBridge.h"
 #include "mozilla/psm/PSMContentListener.h"
-#include "mozilla/recordreplay/ParentIPC.h"
 #include "mozilla/widget/ScreenManager.h"
 #include "nsAnonymousTemporaryFile.h"
 #include "nsAppRunner.h"
 #include "nsCExternalHandlerService.h"
 #include "nsCOMPtr.h"
 #include "nsChromeRegistryChrome.h"
 #include "nsConsoleMessage.h"
 #include "nsConsoleService.h"
@@ -639,19 +638,17 @@ static const char* sObserverTopics[] = {
 bool ContentParent::sEarlySandboxInit = false;
 #endif
 
 // PreallocateProcess is called by the PreallocatedProcessManager.
 // ContentParent then takes this process back within GetNewOrUsedBrowserProcess.
 /*static*/ RefPtr<ContentParent::LaunchPromise>
 ContentParent::PreallocateProcess() {
   RefPtr<ContentParent> process = new ContentParent(
-      /* aOpener = */ nullptr, NS_LITERAL_STRING(DEFAULT_REMOTE_TYPE),
-      eNotRecordingOrReplaying,
-      /* aRecordingFile = */ EmptyString());
+      /* aOpener = */ nullptr, NS_LITERAL_STRING(DEFAULT_REMOTE_TYPE));
 
   return process->LaunchSubprocessAsync(PROCESS_PRIORITY_PREALLOC);
 }
 
 /*static*/
 void ContentParent::StartUp() {
   // We could launch sub processes from content process
   // FIXME Bug 1023701 - Stop using ContentParent static methods in
@@ -822,54 +819,16 @@ already_AddRefed<ContentParent> ContentP
         min = tabCount;
       }
     }
   }
 
   return candidate.forget();
 }
 
-static bool CreateTemporaryRecordingFile(nsAString& aResult) {
-  static int sNumTemporaryRecordings;
-  nsCOMPtr<nsIFile> file;
-  return !NS_FAILED(
-             NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(file))) &&
-         !NS_FAILED(file->AppendNative(
-             nsPrintfCString("TempRecording.%d.%d", base::GetCurrentProcId(),
-                             ++sNumTemporaryRecordings))) &&
-         !NS_FAILED(file->GetPath(aResult));
-}
-
-/*static*/
-Maybe<ContentParent::RecordReplayState> ContentParent::GetRecordReplayState(
-    Element* aFrameElement, nsAString& aRecordingFile) {
-  if (!aFrameElement) {
-    return Some(eNotRecordingOrReplaying);
-  }
-  aFrameElement->GetAttr(kNameSpaceID_None, nsGkAtoms::ReplayExecution,
-                         aRecordingFile);
-  if (!aRecordingFile.IsEmpty()) {
-    return Some(eReplaying);
-  }
-  aFrameElement->GetAttr(kNameSpaceID_None, nsGkAtoms::RecordExecution,
-                         aRecordingFile);
-  if (aRecordingFile.IsEmpty() &&
-      recordreplay::parent::SaveAllRecordingsDirectory()) {
-    aRecordingFile.AssignLiteral("*");
-  }
-  if (!aRecordingFile.IsEmpty()) {
-    if (aRecordingFile.EqualsLiteral("*") &&
-        !CreateTemporaryRecordingFile(aRecordingFile)) {
-      return Nothing();
-    }
-    return Some(eRecording);
-  }
-  return Some(eNotRecordingOrReplaying);
-}
-
 /*static*/
 already_AddRefed<ContentParent> ContentParent::GetUsedBrowserProcess(
     ContentParent* aOpener, const nsAString& aRemoteType,
     nsTArray<ContentParent*>& aContentParents, uint32_t aMaxContentParents,
     bool aPreferUsed) {
   uint32_t numberOfParents = aContentParents.Length();
   nsTArray<RefPtr<nsIContentProcessInfo>> infos(numberOfParents);
   for (auto* cp : aContentParents) {
@@ -1530,31 +1489,16 @@ void ContentParent::ShutDownProcess(Shut
     static_cast<ScriptableCPInfo*>(mScriptableHelper.get())->ProcessDied();
     mScriptableHelper = nullptr;
   }
 
   // Shutting down by sending a shutdown message works differently than the
   // other methods. We first call Shutdown() in the child. After the child is
   // ready, it calls FinishShutdown() on us. Then we close the channel.
   if (aMethod == SEND_SHUTDOWN_MESSAGE) {
-    if (const char* directory =
-            recordreplay::parent::SaveAllRecordingsDirectory()) {
-      // Save a recording for the child process before it shuts down.
-      static int sNumSavedRecordings;
-      nsCOMPtr<nsIFile> file;
-      if (!NS_FAILED(NS_NewNativeLocalFile(nsDependentCString(directory), false,
-                                           getter_AddRefs(file))) &&
-          !NS_FAILED(file->AppendNative(
-              nsPrintfCString("Recording.%d.%d", base::GetCurrentProcId(),
-                              ++sNumSavedRecordings)))) {
-        bool unused;
-        SaveRecording(file, &unused);
-      }
-    }
-
     if (mIPCOpen && !mShutdownPending) {
       // Stop sending input events with input priority when shutting down.
       SetInputPriorityEventEnabled(false);
       if (SendShutdown()) {
         mShutdownPending = true;
         // Start the force-kill timer if we haven't already.
         StartForceKillTimer();
       }
@@ -1805,24 +1749,16 @@ void ContentParent::ActorDestroy(ActorDe
   mIdleListeners.Clear();
 
   // FIXME (bug 1520997): does this really need an additional dispatch?
   MessageLoop::current()->PostTask(NS_NewRunnableFunction(
       "DelayedDeleteSubprocessRunnable",
       [subprocess = mSubprocess] { subprocess->Destroy(); }));
   mSubprocess = nullptr;
 
-  // Delete any remaining replaying children.
-  for (auto& replayingProcess : mReplayingChildren) {
-    if (replayingProcess) {
-      replayingProcess->Destroy();
-      replayingProcess = nullptr;
-    }
-  }
-
   ContentProcessManager* cpm = ContentProcessManager::GetSingleton();
   cpm->RemoveContentProcess(this->ChildID());
 
   if (mDriverCrashGuard) {
     mDriverCrashGuard->NotifyCrashed();
   }
 
   // Unregister all the BlobURLs registered by the ContentChild.
@@ -1882,22 +1818,16 @@ bool ContentParent::ShouldKeepProcessAli
     return false;
   }
 
   // If we have already been marked as dead, don't prevent shutdown.
   if (!IsAlive()) {
     return false;
   }
 
-  // Recording/replaying content parents cannot be reused and should not be
-  // kept alive.
-  if (this->IsRecordingOrReplaying()) {
-    return false;
-  }
-
   auto contentParents = sBrowserContentParents->Get(mRemoteType);
   if (!contentParents) {
     return false;
   }
 
   // We might want to keep some content processes alive for performance reasons.
   // e.g. test runs and privileged content process for some about: pages.
   // We don't want to alter behavior if the pref is not set, so default to 0.
@@ -1985,94 +1915,16 @@ void ContentParent::NotifyTabDestroyed(c
   // because of popup windows.  When the last one closes, shut
   // us down.
   if (ManagedPBrowserParent().Count() == 1 && !ShouldKeepProcessAlive() &&
       !TryToRecycle()) {
     MaybeAsyncSendShutDownMessage();
   }
 }
 
-mozilla::ipc::IPCResult ContentParent::RecvOpenRecordReplayChannel(
-    const uint32_t& aChannelId, FileDescriptor* aConnection) {
-  // We should only get this message from the child if it is recording or
-  // replaying.
-  if (!this->IsRecordingOrReplaying()) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-
-  recordreplay::parent::OpenChannel(Pid(), aChannelId, aConnection);
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult ContentParent::RecvCreateReplayingProcess(
-    const uint32_t& aChannelId) {
-  // We should only get this message from the child if it is recording or
-  // replaying.
-  if (!this->IsRecordingOrReplaying()) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-
-  if (recordreplay::parent::UseCloudForReplayingProcesses()) {
-    recordreplay::parent::CreateReplayingCloudProcess(Pid(), aChannelId);
-    return IPC_OK();
-  }
-
-  while (aChannelId >= mReplayingChildren.length()) {
-    if (!mReplayingChildren.append(nullptr)) {
-      return IPC_FAIL_NO_REASON(this);
-    }
-  }
-  if (mReplayingChildren[aChannelId]) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-
-  std::vector<std::string> extraArgs;
-  recordreplay::parent::GetArgumentsForChildProcess(
-      Pid(), aChannelId, NS_ConvertUTF16toUTF8(mRecordingFile).get(),
-      /* aRecording = */ false, extraArgs);
-
-  GeckoChildProcessHost* child =
-      new GeckoChildProcessHost(GeckoProcessType_Content);
-  mReplayingChildren[aChannelId] = child;
-  if (!child->LaunchAndWaitForProcessHandle(extraArgs)) {
-    return IPC_FAIL_NO_REASON(this);
-  }
-
-  // Replaying processes can fork themselves, and we can get crashes for
-  // them that correspond with one of those forked processes. When the crash
-  // reporter tries to read exception time annotations for one of these crashes,
-  // it hangs because the original replaying process hasn't actually crashed.
-  // Workaround this by removing the file descriptor for exception time
-  // annotations in replaying processes, so that the crash reporter will not
-  // attempt to read them.
-  ProcessId pid = base::GetProcId(child->GetChildProcessHandle());
-  CrashReporter::DeregisterChildCrashAnnotationFileDescriptor(pid);
-
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult ContentParent::RecvGenerateReplayCrashReport(
-    const uint32_t& aChannelId) {
-  if (aChannelId >= mReplayingChildren.length()) {
-    return IPC_FAIL(this, "invalid channel ID");
-  }
-
-  GeckoChildProcessHost* child = mReplayingChildren[aChannelId];
-  if (!child) {
-    return IPC_FAIL(this, "invalid channel ID");
-  }
-
-  if (mCrashReporter) {
-    ProcessId pid = base::GetProcId(child->GetChildProcessHandle());
-    mCrashReporter->GenerateCrashReport(pid);
-  }
-
-  return IPC_OK();
-}
-
 jsipc::CPOWManager* ContentParent::GetCPOWManager() {
   if (PJavaScriptParent* p =
           LoneManagedOrNullAsserts(ManagedPJavaScriptParent())) {
     return CPOWManagerFor(p);
   }
   return nullptr;
 }
 
@@ -2250,20 +2102,18 @@ bool ContentParent::BeginSubprocessLaunc
   // happen during async launch.
   Preferences::AddStrongObserver(this, "");
 
   if (gSafeMode) {
     extraArgs.push_back("-safeMode");
   }
 
 #if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
-  // If we're launching a middleman process for a
-  // recording or replay, start the sandbox later.
   bool sandboxEnabled = IsContentSandboxEnabled();
-  if (sandboxEnabled && sEarlySandboxInit && !IsRecordingOrReplaying()) {
+  if (sandboxEnabled && sEarlySandboxInit) {
     AppendSandboxParams(extraArgs);
   }
   if (sandboxEnabled) {
     mSubprocess->DisableOSActivityMode();
   }
 #endif
 
   nsCString parentBuildID(mozilla::PlatformBuildID());
@@ -2386,36 +2236,31 @@ RefPtr<ContentParent::LaunchPromise> Con
           return LaunchPromise::CreateAndResolve(self, __func__);
         }
         self->LaunchSubprocessReject();
         return LaunchPromise::CreateAndReject(LaunchError(), __func__);
       });
 }
 
 ContentParent::ContentParent(ContentParent* aOpener,
-                             const nsAString& aRemoteType,
-                             RecordReplayState aRecordReplayState,
-                             const nsAString& aRecordingFile,
-                             int32_t aJSPluginID)
+                             const nsAString& aRemoteType, int32_t aJSPluginID)
     : mSelfRef(nullptr),
       mSubprocess(nullptr),
       mLaunchTS(TimeStamp::Now()),
       mLaunchYieldTS(mLaunchTS),
       mActivateTS(mLaunchTS),
       mOpener(aOpener),
       mRemoteType(aRemoteType),
       mChildID(gContentChildID++),
       mGeolocationWatchID(-1),
       mJSPluginID(aJSPluginID),
       mRemoteWorkerActorData("ContentParent::mRemoteWorkerActorData"),
       mNumDestroyingTabs(0),
       mLifecycleState(LifecycleState::LAUNCHING),
       mIsForBrowser(!mRemoteType.IsEmpty()),
-      mRecordReplayState(aRecordReplayState),
-      mRecordingFile(aRecordingFile),
       mCalledClose(false),
       mCalledKillHard(false),
       mCreatedPairedMinidumps(false),
       mShutdownPending(false),
       mIPCOpen(true),
       mIsRemoteInputEventQueueEnabled(false),
       mIsInputPriorityEventEnabled(false),
       mHangMonitorActor(nullptr) {
@@ -5911,40 +5756,16 @@ PSHistoryParent* ContentParent::AllocPSH
 
   return new SHistoryParent(aContext.get_canonical());
 }
 
 void ContentParent::DeallocPSHistoryParent(PSHistoryParent* aActor) {
   delete static_cast<SHistoryParent*>(aActor);
 }
 
-nsresult ContentParent::SaveRecording(nsIFile* aFile, bool* aRetval) {
-  if (mRecordReplayState != eRecording) {
-    *aRetval = false;
-    return NS_OK;
-  }
-
-  PRFileDesc* prfd;
-  nsresult rv = aFile->OpenNSPRFileDesc(
-      PR_WRONLY | PR_TRUNCATE | PR_CREATE_FILE, 0644, &prfd);
-  if (NS_FAILED(rv)) {
-    return rv;
-  }
-
-  FileDescriptor::PlatformHandleType handle =
-      FileDescriptor::PlatformHandleType(PR_FileDesc2NativeHandle(prfd));
-
-  Unused << SendSaveRecording(FileDescriptor(handle));
-
-  PR_Close(prfd);
-
-  *aRetval = true;
-  return NS_OK;
-}
-
 mozilla::ipc::IPCResult ContentParent::RecvMaybeReloadPlugins() {
   RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
   pluginHost->ReloadPlugins();
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult ContentParent::RecvDeviceReset() {
   GPUProcessManager* pm = GPUProcessManager::Get();
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -309,23 +309,16 @@ class ContentParent final
    *           this plugin window.
    */
   static void SendAsyncUpdate(nsIWidget* aWidget);
 #endif
 
   // Let managees query if it is safe to send messages.
   bool IsDestroyed() const { return !mIPCOpen; }
 
-  mozilla::ipc::IPCResult RecvOpenRecordReplayChannel(
-      const uint32_t& channelId, FileDescriptor* connection);
-  mozilla::ipc::IPCResult RecvCreateReplayingProcess(
-      const uint32_t& aChannelId);
-  mozilla::ipc::IPCResult RecvGenerateReplayCrashReport(
-      const uint32_t& aChannelId);
-
   mozilla::ipc::IPCResult RecvCreateGMPService();
 
   mozilla::ipc::IPCResult RecvLoadPlugin(
       const uint32_t& aPluginId, nsresult* aRv, uint32_t* aRunID,
       Endpoint<PPluginModuleParent>* aEndpoint);
 
   mozilla::ipc::IPCResult RecvMaybeReloadPlugins();
 
@@ -740,30 +733,23 @@ class ContentParent final
       const bool& aSizeSpecified, nsIURI* aURIToLoad,
       const nsCString& aFeatures, const float& aFullZoom,
       uint64_t aNextRemoteTabId, const nsString& aName, nsresult& aResult,
       nsCOMPtr<nsIRemoteTab>& aNewRemoteTab, bool* aWindowIsNew,
       int32_t& aOpenLocation, nsIPrincipal* aTriggeringPrincipal,
       nsIReferrerInfo* aReferrerInfo, bool aLoadUri,
       nsIContentSecurityPolicy* aCsp);
 
-  enum RecordReplayState { eNotRecordingOrReplaying, eRecording, eReplaying };
-
   explicit ContentParent(int32_t aPluginID)
-      : ContentParent(nullptr, EmptyString(), eNotRecordingOrReplaying,
-                      EmptyString(), aPluginID) {}
-  ContentParent(ContentParent* aOpener, const nsAString& aRemoteType,
-                RecordReplayState aRecordReplayState = eNotRecordingOrReplaying,
-                const nsAString& aRecordingFile = EmptyString())
-      : ContentParent(aOpener, aRemoteType, aRecordReplayState, aRecordingFile,
-                      nsFakePluginTag::NOT_JSPLUGIN) {}
+      : ContentParent(nullptr, EmptyString(), aPluginID) {}
+  ContentParent(ContentParent* aOpener, const nsAString& aRemoteType)
+      : ContentParent(aOpener, aRemoteType, nsFakePluginTag::NOT_JSPLUGIN) {}
 
   ContentParent(ContentParent* aOpener, const nsAString& aRemoteType,
-                RecordReplayState aRecordReplayState,
-                const nsAString& aRecordingFile, int32_t aPluginID);
+                int32_t aPluginID);
 
   // Launch the subprocess and associated initialization.
   // Returns false if the process fails to start.
   // Deprecated in favor of LaunchSubprocessAsync.
   bool LaunchSubprocessSync(hal::ProcessPriority aInitialPriority);
 
   // Launch the subprocess and associated initialization;
   // returns a promise and signals failure by rejecting.
@@ -1296,41 +1282,29 @@ class ContentParent final
   void SendGetFilesResponseAndForget(const nsID& aID,
                                      const GetFilesResponseResult& aResult);
 
   bool SendRequestMemoryReport(const uint32_t& aGeneration,
                                const bool& aAnonymize,
                                const bool& aMinimizeMemoryUsage,
                                const Maybe<FileDescriptor>& aDMDFile) override;
 
-  nsresult SaveRecording(nsIFile* aFile, bool* aRetval);
-
-  bool IsRecordingOrReplaying() const {
-    return mRecordReplayState != eNotRecordingOrReplaying;
-  }
-
   void OnBrowsingContextGroupSubscribe(BrowsingContextGroup* aGroup);
   void OnBrowsingContextGroupUnsubscribe(BrowsingContextGroup* aGroup);
 
   // See `BrowsingContext::mEpochs` for an explanation of this field.
   uint64_t GetBrowsingContextFieldEpoch() const {
     return mBrowsingContextFieldEpoch;
   }
 
   void UpdateNetworkLinkType();
 
   static bool ShouldSyncPreference(const char16_t* aData);
 
  private:
-  // Determine the recording/replaying state for this frame.
-  // Return `Nothing` in case of error, typically if we need
-  // to create a temporary recording file but could not.
-  static Maybe<RecordReplayState> GetRecordReplayState(
-      Element* aFrameElement, nsAString& aRecordingFile);
-
   // Return an existing ContentParent if possible. Otherwise, `nullptr`.
   static already_AddRefed<ContentParent> GetUsedBrowserProcess(
       ContentParent* aOpener, const nsAString& aRemoteType,
       nsTArray<ContentParent*>& aContentParents, uint32_t aMaxContentParents,
       bool aPreferUsed);
 
  private:
   // Released in ActorDealloc; deliberately not exposed to the CC.
@@ -1397,26 +1371,16 @@ class ContentParent final
     ALIVE,
     DEAD,
   };
 
   LifecycleState mLifecycleState;
 
   bool mIsForBrowser;
 
-  // Whether this process is recording or replaying its execution, and any
-  // associated recording file.
-  RecordReplayState mRecordReplayState;
-  nsString mRecordingFile;
-
-  // When recording or replaying, the child process is a middleman. This vector
-  // stores any replaying children we have spawned on behalf of that middleman,
-  // indexed by their record/replay channel ID.
-  Vector<mozilla::ipc::GeckoChildProcessHost*> mReplayingChildren;
-
   // These variables track whether we've called Close() and KillHard() on our
   // channel.
   bool mCalledClose;
   bool mCalledKillHard;
   bool mCreatedPairedMinidumps;
   bool mShutdownPending;
   bool mIPCOpen;
 
--- a/dom/ipc/ContentProcess.cpp
+++ b/dom/ipc/ContentProcess.cpp
@@ -4,17 +4,16 @@
  * 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 "mozilla/ipc/IOThreadChild.h"
 
 #include "ContentProcess.h"
 #include "base/shared_memory.h"
 #include "mozilla/Preferences.h"
-#include "mozilla/recordreplay/ParentIPC.h"
 
 #if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
 #  include <stdlib.h>
 #  include "mozilla/Sandbox.h"
 #endif
 
 #if (defined(XP_WIN) || defined(XP_MACOSX)) && defined(MOZ_SANDBOX)
 #  include "mozilla/SandboxSettings.h"
@@ -171,34 +170,25 @@ bool ContentProcess::Init(int aArgc, cha
   }
 
   SharedPreferenceDeserializer deserializer;
   if (!deserializer.DeserializeFromSharedMemory(prefsHandle, prefMapHandle,
                                                 prefsLen, prefMapSize)) {
     return false;
   }
 
-  if (recordreplay::IsMiddleman()) {
-    recordreplay::parent::InitializeMiddleman(aArgc, aArgv, ParentPid(),
-                                              deserializer.GetPrefsHandle(),
-                                              deserializer.GetPrefMapHandle());
-  }
-
   mContent.Init(IOThreadChild::message_loop(), ParentPid(), *parentBuildID,
                 IOThreadChild::TakeChannel(), *childID, *isForBrowser);
 
   mXREEmbed.Start();
 #if (defined(XP_MACOSX)) && defined(MOZ_SANDBOX)
   mContent.SetProfileDir(profileDir);
 #  if defined(DEBUG)
-  // For WebReplay middleman processes, the sandbox is
-  // started after receiving the SetProcessSandbox message.
   if (IsContentSandboxEnabled() &&
-      Preferences::GetBool("security.sandbox.content.mac.earlyinit") &&
-      !recordreplay::IsMiddleman()) {
+      Preferences::GetBool("security.sandbox.content.mac.earlyinit")) {
     AssertMacSandboxEnabled();
   }
 #  endif /* DEBUG */
 #endif   /* XP_MACOSX && MOZ_SANDBOX */
 
 #if defined(XP_WIN) && defined(MOZ_SANDBOX)
   SetUpSandboxEnvironment();
 #endif
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -826,19 +826,16 @@ child:
 
     /*
      * Message to construct a PClientOpenWindowOp actor.  This is used to
      * open windows cross-process and receive notification when the operation
      * has completed.
      */
     async PClientOpenWindowOp(ClientOpenWindowArgs aArgs);
 
-    /* Save the execution up to the current point in a recording process. */
-    async SaveRecording(FileDescriptor file);
-
     // This message is sent to content processes, and triggers the creation of a
     // new HttpChannelChild that will be connected to the parent channel
     // represented by registrarId.
     // This is on PContent not PNecko, as PNecko may not be initialized yet.
     // The returned loadInfo needs to be set on the channel - since the channel
     // moved to a new process it now has different properties.
 
     async CrossProcessRedirect(RedirectToRealChannelArgs args)
@@ -875,21 +872,16 @@ child:
 
     async InternalLoad(MaybeDiscardedBrowsingContext aContext, nsDocShellLoadState aLoadState, bool aTakeFocus);
 
     async DisplayLoadError(MaybeDiscardedBrowsingContext aContext, nsString aURI);
 
 parent:
     async InitBackground(Endpoint<PBackgroundParent> aEndpoint);
 
-    sync OpenRecordReplayChannel(uint32_t channelId)
-        returns (FileDescriptor connection);
-    async CreateReplayingProcess(uint32_t channelId);
-    async GenerateReplayCrashReport(uint32_t channelId);
-
     async CreateGMPService();
 
     async InitStreamFilter(uint64_t channelId, nsString addonId)
         returns (Endpoint<PStreamFilterChild> aEndpoint);
 
     /**
      * This call connects the content process to a plugin process. This call
      * returns an endpoint for a new PluginModuleParent. The corresponding
--- a/dom/ipc/ProcessHangMonitor.cpp
+++ b/dom/ipc/ProcessHangMonitor.cpp
@@ -135,21 +135,17 @@ class HangMonitorChild : public PProcess
   }
   bool IsOnThread() { return mHangMonitor->IsOnThread(); }
 
   void AnnotateHang(BackgroundHangAnnotations& aAnnotations) override;
 
  private:
   void ShutdownOnThread();
 
-  // Ordering of this atomic is not preserved while recording/replaying, as it
-  // may be accessed during the JS interrupt callback.
-  static Atomic<HangMonitorChild*, SequentiallyConsistent,
-                recordreplay::Behavior::DontPreserve>
-      sInstance;
+  static Atomic<HangMonitorChild*, SequentiallyConsistent> sInstance;
 
   const RefPtr<ProcessHangMonitor> mHangMonitor;
   Monitor mMonitor;
 
   // Main thread-only.
   bool mSentReport;
 
   // These fields must be accessed with mMonitor held.
@@ -172,19 +168,17 @@ class HangMonitorChild : public PProcess
   // This field is only accessed on the hang thread.
   bool mIPCOpen;
 
   // Allows us to ensure we NotifyActivity only once, allowing
   // either thread to do so.
   Atomic<bool> mPaintWhileInterruptingJSActive;
 };
 
-Atomic<HangMonitorChild*, SequentiallyConsistent,
-       recordreplay::Behavior::DontPreserve>
-    HangMonitorChild::sInstance;
+Atomic<HangMonitorChild*, SequentiallyConsistent> HangMonitorChild::sInstance;
 
 /* Parent process objects */
 
 class HangMonitorParent;
 
 class HangMonitoredProcess final : public nsIHangReport {
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
@@ -305,19 +299,17 @@ class HangMonitorParent : public PProces
 };
 
 }  // namespace
 
 /* HangMonitorChild implementation */
 
 HangMonitorChild::HangMonitorChild(ProcessHangMonitor* aMonitor)
     : mHangMonitor(aMonitor),
-      // Ordering of this atomic is not preserved while recording/replaying, as
-      // it may be accessed during the JS interrupt callback.
-      mMonitor("HangMonitorChild lock", recordreplay::Behavior::DontPreserve),
+      mMonitor("HangMonitorChild lock"),
       mSentReport(false),
       mTerminateScript(false),
       mTerminateGlobal(false),
       mStartDebugger(false),
       mFinishedStartingDebugger(false),
       mPaintWhileInterruptingJS(false),
       mCancelContentJS(false),
       mCancelContentJSNavigationType(nsIRemoteTab::NAVIGATE_BACK),
@@ -336,23 +328,16 @@ HangMonitorChild::~HangMonitorChild() {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(sInstance == this);
   sInstance = nullptr;
 }
 
 bool HangMonitorChild::InterruptCallback() {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
 
-  // The interrupt callback is triggered at non-deterministic points when
-  // recording/replaying, so don't perform any operations that can interact
-  // with the recording.
-  if (recordreplay::IsRecordingOrReplaying()) {
-    return true;
-  }
-
   // Don't start painting if we're not in a good place to run script. We run
   // chrome script during layout and such, and it wouldn't be good to interrupt
   // painting code from there.
   if (!nsContentUtils::IsSafeToRunScript()) {
     return true;
   }
 
   bool paintWhileInterruptingJS;
--- a/dom/media/CubebUtils.cpp
+++ b/dom/media/CubebUtils.cpp
@@ -428,20 +428,16 @@ cubeb* GetCubebContextUnlocked() {
   sMutex.AssertCurrentThreadOwns();
   if (sCubebForceNullContext) {
     // Pref set such that we should return a null context
     MOZ_LOG(gCubebLog, LogLevel::Debug,
             ("%s: returning null context due to %s!", __func__,
              PREF_CUBEB_FORCE_NULL_CONTEXT));
     return nullptr;
   }
-  if (recordreplay::IsRecordingOrReplaying()) {
-    // Media is not supported when recording or replaying. See bug 1304146.
-    return nullptr;
-  }
   if (sCubebState != CubebState::Uninitialized) {
     // If we have already passed the initialization point (below), just return
     // the current context, which may be null (e.g., after error or shutdown.)
     return sCubebContext;
   }
 
   if (!sBrandName && NS_IsMainThread()) {
     InitBrandName();
@@ -604,17 +600,17 @@ void InitLibrary() {
     cubeb_set_log_callback(CUBEB_LOG_NORMAL, CubebLogCallback);
   }
 
 #ifndef MOZ_WIDGET_ANDROID
   AbstractThread::MainThread()->Dispatch(
       NS_NewRunnableFunction("CubebUtils::InitLibrary", &InitBrandName));
 #endif
 #ifdef MOZ_CUBEB_REMOTING
-  if (sCubebSandbox && XRE_IsContentProcess() && !recordreplay::IsMiddleman()) {
+  if (sCubebSandbox && XRE_IsContentProcess()) {
     InitAudioIPCConnection();
   }
 #endif
 }
 
 void ShutdownLibrary() {
   Preferences::UnregisterCallbacks(PrefChanged, gInitCallbackPrefs);
   Preferences::UnregisterCallbacks(PrefChanged, gCallbackPrefs);
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -330,26 +330,16 @@ MediaResult MediaFormatReader::DecoderFa
   if (!platform) {
     platform = new PDMFactory();
     if (decoder.IsEncrypted()) {
       MOZ_ASSERT(mOwner->mCDMProxy);
       platform->SetCDMProxy(mOwner->mCDMProxy);
     }
   }
 
-  // Media playback is not supported when recording or replaying. See bug
-  // 1304146.
-  if (recordreplay::IsRecordingOrReplaying()) {
-    return MediaResult(
-        NS_ERROR_DOM_MEDIA_FATAL_ERR,
-        nsPrintfCString("error creating %s decoder: "
-                        "media playback is disabled while recording/replaying",
-                        TrackTypeToStr(aData.mTrack)));
-  }
-
   // result may not be updated by PDMFactory::CreateDecoder, as such it must be
   // initialized to a fatal error by default.
   MediaResult result =
       MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
                   nsPrintfCString("error creating %s decoder",
                                   TrackTypeToStr(aData.mTrack)));
 
   switch (aData.mTrack) {
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -290,18 +290,18 @@ void MediaManager::CallOnSuccess(GetUser
  * don't hold a reference to it during late shutdown.
  */
 class SourceListener : public SupportsWeakPtr<SourceListener> {
  public:
   typedef MozPromise<bool /* aIgnored */, RefPtr<MediaMgrError>, true>
       SourceListenerPromise;
 
   MOZ_DECLARE_WEAKREFERENCE_TYPENAME(SourceListener)
-  NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_MAIN_THREAD_DESTRUCTION_AND_RECORDING(
-      SourceListener, recordreplay::Behavior::Preserve)
+  NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_MAIN_THREAD_DESTRUCTION(
+      SourceListener)
 
   SourceListener();
 
   /**
    * Registers this source listener as belonging to the given window listener.
    */
   void Register(GetUserMediaWindowListener* aListener);
 
--- a/dom/media/webaudio/AudioContext.cpp
+++ b/dom/media/webaudio/AudioContext.cpp
@@ -248,23 +248,16 @@ JSObject* AudioContext::WrapObject(JSCon
     return AudioContext_Binding::Wrap(aCx, this, aGivenProto);
   }
 }
 
 /* static */
 already_AddRefed<AudioContext> AudioContext::Constructor(
     const GlobalObject& aGlobal, const AudioContextOptions& aOptions,
     ErrorResult& aRv) {
-  // Audio playback is not yet supported when recording or replaying. See bug
-  // 1304147.
-  if (recordreplay::IsRecordingOrReplaying()) {
-    aRv.Throw(NS_ERROR_NOT_AVAILABLE);
-    return nullptr;
-  }
-
   nsCOMPtr<nsPIDOMWindowInner> window =
       do_QueryInterface(aGlobal.GetAsSupports());
   if (!window) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   float sampleRate = MediaTrackGraph::REQUEST_DEFAULT_SAMPLE_RATE;
@@ -297,23 +290,16 @@ already_AddRefed<AudioContext> AudioCont
   return Constructor(aGlobal, aOptions.mNumberOfChannels, aOptions.mLength,
                      aOptions.mSampleRate, aRv);
 }
 
 /* static */
 already_AddRefed<AudioContext> AudioContext::Constructor(
     const GlobalObject& aGlobal, uint32_t aNumberOfChannels, uint32_t aLength,
     float aSampleRate, ErrorResult& aRv) {
-  // Audio playback is not yet supported when recording or replaying. See bug
-  // 1304147.
-  if (recordreplay::IsRecordingOrReplaying()) {
-    aRv.Throw(NS_ERROR_NOT_AVAILABLE);
-    return nullptr;
-  }
-
   nsCOMPtr<nsPIDOMWindowInner> window =
       do_QueryInterface(aGlobal.GetAsSupports());
   if (!window) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   if (aNumberOfChannels == 0 ||
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -685,22 +685,16 @@ nsresult nsPluginHost::InstantiatePlugin
   PR_LogFlush();
 #endif
 
   if (aMimeType.IsEmpty()) {
     MOZ_ASSERT_UNREACHABLE("Attempting to spawn a plugin with no mime type");
     return NS_ERROR_FAILURE;
   }
 
-  // Plugins are not supported when recording or replaying executions.
-  // See bug 1483232.
-  if (recordreplay::IsRecordingOrReplaying()) {
-    return NS_ERROR_FAILURE;
-  }
-
   RefPtr<nsPluginInstanceOwner> instanceOwner = new nsPluginInstanceOwner();
   if (!instanceOwner) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   nsCOMPtr<nsIContent> ourContent =
       do_QueryInterface(static_cast<nsIImageLoadingContent*>(aContent));
   nsresult rv = instanceOwner->Init(ourContent);
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -537,23 +537,16 @@ void LoadJSGCMemoryOptions(const char* a
 #endif
   }
 }
 
 bool InterruptCallback(JSContext* aCx) {
   WorkerPrivate* worker = GetWorkerPrivateFromContext(aCx);
   MOZ_ASSERT(worker);
 
-  // As with the main thread, the interrupt callback is triggered
-  // non-deterministically when recording/replaying, so return early to avoid
-  // performing any recorded events.
-  if (recordreplay::IsRecordingOrReplaying()) {
-    return true;
-  }
-
   // Now is a good time to turn on profiling if it's pending.
   PROFILER_JS_INTERRUPT_CALLBACK();
 
   return worker->InterruptCallback(aCx);
 }
 
 class LogViolationDetailsRunnable final : public WorkerMainThreadRunnable {
   nsString mFileName;
--- a/gfx/2d/RecordedEvent.h
+++ b/gfx/2d/RecordedEvent.h
@@ -6,16 +6,17 @@
 
 #ifndef MOZILLA_GFX_RECORDEDEVENT_H_
 #define MOZILLA_GFX_RECORDEDEVENT_H_
 
 #include "2D.h"
 #include <ostream>
 #include <sstream>
 #include <cstring>
+#include <functional>
 #include <vector>
 
 #include "RecordingTypes.h"
 
 namespace mozilla {
 namespace gfx {
 
 const uint32_t kMagicInt = 0xc001feed;
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -1336,23 +1336,16 @@ void APZCTreeManager::MarkAsDetached(Lay
   RecursiveMutexAutoLock lock(mTreeLock);
   mDetachedLayersIds.insert(aLayersId);
 }
 
 APZEventResult APZCTreeManager::ReceiveInputEvent(InputData& aEvent) {
   APZThreadUtils::AssertOnControllerThread();
   APZEventResult result;
 
-  // Ignore input events when there are active tabs that are recording or
-  // replaying. APZ does not work with the special layers constructed by
-  // the middleman processes being communicated with here.
-  if (dom::BrowserParent::AreRecordReplayTabsActive()) {
-    return result;
-  }
-
   // Use a RAII class for updating the focus sequence number of this event
   AutoFocusSequenceNumberSetter focusSetter(mFocusState, aEvent);
 
 #if defined(MOZ_WIDGET_ANDROID)
   if (mToolbarAnimator) {
     ScreenPoint scrollOffset;
     {
       RecursiveMutexAutoLock lock(mTreeLock);
--- a/gfx/layers/client/ClientLayerManager.cpp
+++ b/gfx/layers/client/ClientLayerManager.cpp
@@ -467,17 +467,17 @@ CompositorBridgeChild* ClientLayerManage
   if (!mWidget) {
     return nullptr;
   }
 
   return mWidget->GetRemoteRenderer();
 }
 
 CompositorBridgeChild* ClientLayerManager::GetCompositorBridgeChild() {
-  if (!XRE_IsParentProcess() && !recordreplay::IsRecordingOrReplaying()) {
+  if (!XRE_IsParentProcess()) {
     return CompositorBridgeChild::Get();
   }
   return GetRemoteRenderer();
 }
 
 void ClientLayerManager::FlushAsyncPaints() {
   AUTO_PROFILER_LABEL_CATEGORY_PAIR(GRAPHICS_FlushingAsyncPaints);
 
@@ -490,18 +490,16 @@ void ClientLayerManager::FlushAsyncPaint
 void ClientLayerManager::ScheduleComposite() {
   mForwarder->ScheduleComposite();
 }
 
 void ClientLayerManager::DidComposite(TransactionId aTransactionId,
                                       const TimeStamp& aCompositeStart,
                                       const TimeStamp& aCompositeEnd) {
   if (!mWidget) {
-    // When recording/replaying this manager may have already been destroyed.
-    MOZ_ASSERT(recordreplay::IsRecordingOrReplaying());
     return;
   }
 
   // Notifying the observers may tick the refresh driver which can cause
   // a lot of different things to happen that may affect the lifetime of
   // this layer manager. So let's make sure this object stays alive until
   // the end of the method invocation.
   RefPtr<ClientLayerManager> selfRef = this;
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -355,17 +355,17 @@ CompositorBridgeParent::CompositorBridge
       mDeferPluginWindows(false),
       mPluginWindowsHidden(false)
 #endif
 {
 }
 
 void CompositorBridgeParent::InitSameProcess(widget::CompositorWidget* aWidget,
                                              const LayersId& aLayerTreeId) {
-  MOZ_ASSERT(XRE_IsParentProcess() || recordreplay::IsRecordingOrReplaying());
+  MOZ_ASSERT(XRE_IsParentProcess());
   MOZ_ASSERT(NS_IsMainThread());
 
   mWidget = aWidget;
   mRootLayerTreeID = aLayerTreeId;
 
   Initialize();
 }
 
@@ -1016,21 +1016,17 @@ void CompositorBridgeParent::CompositeTo
 
   mCompositionManager->ComputeRotation();
 
   TimeStamp time =
       mTestTime.valueOr(mCompositorScheduler->GetLastComposeTime());
   bool requestNextFrame =
       mCompositionManager->TransformShadowTree(time, mVsyncRate);
 
-  // Don't eagerly schedule new compositions here when recording or replaying.
-  // Recording/replaying processes schedule composites at the top of the main
-  // thread's event loop rather than via PVsync, which can cause the composites
-  // scheduled here to pile up without any drawing actually happening.
-  if (requestNextFrame && !recordreplay::IsRecordingOrReplaying()) {
+  if (requestNextFrame) {
     ScheduleComposition();
 #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
     // If we have visible windowed plugins then we need to wait for content (and
     // then the plugins) to have been updated by the active animation.
     if (!mPluginWindowsHidden && mCachedPluginData.Length()) {
       mWaitForPluginsUntil =
           mCompositorScheduler->GetLastComposeTime() + (mVsyncRate * 2);
     }
--- a/gfx/layers/ipc/CompositorManagerChild.cpp
+++ b/gfx/layers/ipc/CompositorManagerChild.cpp
@@ -141,17 +141,17 @@ CompositorManagerChild::CreateWidgetComp
   bridge->InitForWidget(aProcessToken, aLayerManager, aNamespace);
   return bridge.forget();
 }
 
 /* static */
 already_AddRefed<CompositorBridgeChild>
 CompositorManagerChild::CreateSameProcessWidgetCompositorBridge(
     LayerManager* aLayerManager, uint32_t aNamespace) {
-  MOZ_ASSERT(XRE_IsParentProcess() || recordreplay::IsRecordingOrReplaying());
+  MOZ_ASSERT(XRE_IsParentProcess());
   MOZ_ASSERT(NS_IsMainThread());
   if (NS_WARN_IF(!sInstance || !sInstance->CanSend())) {
     return nullptr;
   }
 
   CompositorBridgeOptions options = SameProcessWidgetCompositorOptions();
 
   RefPtr<CompositorBridgeChild> bridge = new CompositorBridgeChild(sInstance);
--- a/gfx/layers/ipc/CompositorManagerParent.cpp
+++ b/gfx/layers/ipc/CompositorManagerParent.cpp
@@ -24,17 +24,17 @@ StaticMutex CompositorManagerParent::sMu
 #ifdef COMPOSITOR_MANAGER_PARENT_EXPLICIT_SHUTDOWN
 StaticAutoPtr<nsTArray<CompositorManagerParent*>>
     CompositorManagerParent::sActiveActors;
 #endif
 
 /* static */
 already_AddRefed<CompositorManagerParent>
 CompositorManagerParent::CreateSameProcess() {
-  MOZ_ASSERT(XRE_IsParentProcess() || recordreplay::IsRecordingOrReplaying());
+  MOZ_ASSERT(XRE_IsParentProcess());
   MOZ_ASSERT(NS_IsMainThread());
   StaticMutexAutoLock lock(sMutex);
 
   // We are creating a manager for the UI process, inside the combined GPU/UI
   // process. It is created more-or-less the same but we retain a reference to
   // the parent to access state.
   if (NS_WARN_IF(sInstance)) {
     MOZ_ASSERT_UNREACHABLE("Already initialized");
@@ -72,17 +72,17 @@ bool CompositorManagerParent::Create(
   return true;
 }
 
 /* static */
 already_AddRefed<CompositorBridgeParent>
 CompositorManagerParent::CreateSameProcessWidgetCompositorBridge(
     CSSToLayoutDeviceScale aScale, const CompositorOptions& aOptions,
     bool aUseExternalSurfaceSize, const gfx::IntSize& aSurfaceSize) {
-  MOZ_ASSERT(XRE_IsParentProcess() || recordreplay::IsRecordingOrReplaying());
+  MOZ_ASSERT(XRE_IsParentProcess());
   MOZ_ASSERT(NS_IsMainThread());
 
   // When we are in a combined UI / GPU process, InProcessCompositorSession
   // requires both the parent and child PCompositorBridge actors for its own
   // construction, which is done on the main thread. Normally
   // CompositorBridgeParent is created on the compositor thread via the IPDL
   // plumbing (CompositorManagerParent::AllocPCompositorBridgeParent). Thus to
   // actually get a reference to the parent, we would need to block on the
--- a/gfx/layers/ipc/CompositorVsyncScheduler.cpp
+++ b/gfx/layers/ipc/CompositorVsyncScheduler.cpp
@@ -75,18 +75,17 @@ CompositorVsyncScheduler::CompositorVsyn
       mCurrentVRTaskMonitor("CurrentVRTaskMonitor"),
       mCurrentVRTask(nullptr) {
   mVsyncObserver = new Observer(this);
 
   // mAsapScheduling is set on the main thread during init,
   // but is only accessed after on the compositor thread.
   mAsapScheduling =
       StaticPrefs::layers_offmainthreadcomposition_frame_rate() == 0 ||
-      gfxPlatform::IsInLayoutAsapMode() ||
-      recordreplay::IsRecordingOrReplaying();
+      gfxPlatform::IsInLayoutAsapMode();
 }
 
 CompositorVsyncScheduler::~CompositorVsyncScheduler() {
   MOZ_ASSERT(!mIsObservingVsync);
   MOZ_ASSERT(!mVsyncObserver);
   // The CompositorVsyncDispatcher is cleaned up before this in the
   // nsBaseWidget, which stops vsync listeners
   mVsyncSchedulerOwner = nullptr;
--- a/gfx/layers/ipc/LayerTransactionParent.cpp
+++ b/gfx/layers/ipc/LayerTransactionParent.cpp
@@ -142,22 +142,16 @@ class MOZ_STACK_CLASS AutoLayerTransacti
 mozilla::ipc::IPCResult LayerTransactionParent::RecvPaintTime(
     const TransactionId& aTransactionId, const TimeDuration& aPaintTime) {
   mCompositorBridge->UpdatePaintTime(this, aPaintTime);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult LayerTransactionParent::RecvUpdate(
     const TransactionInfo& aInfo) {
-  auto guard = MakeScopeExit([&] {
-    if (recordreplay::IsRecordingOrReplaying()) {
-      recordreplay::child::NotifyPaintComplete();
-    }
-  });
-
   AUTO_PROFILER_TRACING_MARKER("Paint", "LayerTransaction", GRAPHICS);
   AUTO_PROFILER_LABEL("LayerTransactionParent::RecvUpdate", GRAPHICS);
   PerfStats::AutoMetricRecording<PerfStats::Metric::LayerTransactions>
       autoRecording;
 
   TimeStamp updateStart = TimeStamp::Now();
 
   MOZ_LAYERS_LOG(
@@ -493,21 +487,16 @@ mozilla::ipc::IPCResult LayerTransaction
           "%f ms",
           OtherPid(), latency.ToMilliseconds());
     }
 
     mLayerManager->RecordUpdateTime(
         (TimeStamp::Now() - updateStart).ToMilliseconds());
   }
 
-  // Compose after every update when recording/replaying.
-  if (recordreplay::IsRecordingOrReplaying()) {
-    mCompositorBridge->ForceComposeToTarget(nullptr);
-  }
-
   return IPC_OK();
 }
 
 bool LayerTransactionParent::SetLayerAttributes(
     const OpSetLayerAttributes& aOp) {
   Layer* layer = AsLayer(aOp.layer());
   if (!layer) {
     return false;
--- a/gfx/layers/ipc/ShadowLayers.cpp
+++ b/gfx/layers/ipc/ShadowLayers.cpp
@@ -707,20 +707,16 @@ bool ShadowLayerForwarder::EndTransactio
   }
 
   if (startTime) {
     mPaintTiming.sendMs() =
         (TimeStamp::Now() - startTime.value()).ToMilliseconds();
     mShadowManager->SendRecordPaintTimes(mPaintTiming);
   }
 
-  if (recordreplay::IsRecordingOrReplaying()) {
-    recordreplay::child::NotifyPaintStart();
-  }
-
   *aSent = true;
   mIsFirstPaint = false;
   mFocusTarget = FocusTarget();
   MOZ_LAYERS_LOG(("[LayersForwarder] ... done"));
   return true;
 }
 
 RefPtr<CompositableClient> ShadowLayerForwarder::FindCompositable(
--- a/gfx/layers/ipc/ThreadSafeRefcountingWithMainThreadDestruction.h
+++ b/gfx/layers/ipc/ThreadSafeRefcountingWithMainThreadDestruction.h
@@ -43,54 +43,49 @@ struct DeleteOnMainThreadTask : public R
     mToDelete->DeleteToBeCalledOnMainThread();
     return NS_OK;
   }
 };
 
 }  // namespace layers
 }  // namespace mozilla
 
-#define NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_MAIN_THREAD_DESTRUCTION_AND_RECORDING( \
-    _class, _recording)                                                                   \
- public:                                                                                  \
-  NS_METHOD_(MozExternalRefCountType) AddRef(void) {                                      \
-    MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(_class)                                            \
-    MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt");                                  \
-    nsrefcnt count = ++mRefCnt;                                                           \
-    NS_LOG_ADDREF(this, count, #_class, sizeof(*this));                                   \
-    return (nsrefcnt)count;                                                               \
-  }                                                                                       \
-  void DeleteToBeCalledOnMainThread() {                                                   \
-    MOZ_ASSERT(NS_IsMainThread());                                                        \
-    NS_LOG_RELEASE(this, 0, #_class);                                                     \
-    delete this;                                                                          \
-  }                                                                                       \
-  NS_METHOD_(MozExternalRefCountType) Release(void) {                                     \
-    MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release");                                      \
-    nsrefcnt count = --mRefCnt;                                                           \
-    if (count == 0) {                                                                     \
-      if (NS_IsMainThread()) {                                                            \
-        DeleteToBeCalledOnMainThread();                                                   \
-      } else {                                                                            \
-        NS_DispatchToMainThread(                                                          \
-            new mozilla::layers::DeleteOnMainThreadTask<_class>(this));                   \
-      }                                                                                   \
-    } else {                                                                              \
-      NS_LOG_RELEASE(this, count, #_class);                                               \
-    }                                                                                     \
-    return count;                                                                         \
-  }                                                                                       \
-                                                                                          \
- protected:                                                                               \
-  ::mozilla::ThreadSafeAutoRefCntWithRecording<_recording> mRefCnt;                       \
-                                                                                          \
- private:                                                                                 \
-  ::mozilla::layers::HelperForMainThreadDestruction                                       \
-      mHelperForMainThreadDestruction;                                                    \
-                                                                                          \
+#define NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_MAIN_THREAD_DESTRUCTION( \
+    _class)                                                                 \
+ public:                                                                    \
+  NS_METHOD_(MozExternalRefCountType) AddRef(void) {                        \
+    MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(_class)                              \
+    MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt");                    \
+    nsrefcnt count = ++mRefCnt;                                             \
+    NS_LOG_ADDREF(this, count, #_class, sizeof(*this));                     \
+    return (nsrefcnt)count;                                                 \
+  }                                                                         \
+  void DeleteToBeCalledOnMainThread() {                                     \
+    MOZ_ASSERT(NS_IsMainThread());                                          \
+    NS_LOG_RELEASE(this, 0, #_class);                                       \
+    delete this;                                                            \
+  }                                                                         \
+  NS_METHOD_(MozExternalRefCountType) Release(void) {                       \
+    MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release");                        \
+    nsrefcnt count = --mRefCnt;                                             \
+    if (count == 0) {                                                       \
+      if (NS_IsMainThread()) {                                              \
+        DeleteToBeCalledOnMainThread();                                     \
+      } else {                                                              \
+        NS_DispatchToMainThread(                                            \
+            new mozilla::layers::DeleteOnMainThreadTask<_class>(this));     \
+      }                                                                     \
+    } else {                                                                \
+      NS_LOG_RELEASE(this, count, #_class);                                 \
+    }                                                                       \
+    return count;                                                           \
+  }                                                                         \
+                                                                            \
+ protected:                                                                 \
+  ::mozilla::ThreadSafeAutoRefCnt mRefCnt;                                  \
+                                                                            \
+ private:                                                                   \
+  ::mozilla::layers::HelperForMainThreadDestruction                         \
+      mHelperForMainThreadDestruction;                                      \
+                                                                            \
  public:
 
-#define NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_MAIN_THREAD_DESTRUCTION(         \
-    _class)                                                                         \
-  NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_MAIN_THREAD_DESTRUCTION_AND_RECORDING( \
-      _class, recordreplay::Behavior::DontPreserve)
-
 #endif
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -886,17 +886,17 @@ void gfxPlatform::Init() {
     MOZ_CRASH("Already started???");
   }
   gEverInitialized = true;
 
   gfxVars::Initialize();
 
   gfxConfig::Init();
 
-  if (XRE_IsParentProcess() || recordreplay::IsRecordingOrReplaying()) {
+  if (XRE_IsParentProcess()) {
     GPUProcessManager::Initialize();
     RDDProcessManager::Initialize();
 
     if (Preferences::GetBool("media.wmf.skip-blacklist")) {
       gfxVars::SetPDMWMFDisableD3D11Dlls(nsCString());
       gfxVars::SetPDMWMFDisableD3D9Dlls(nsCString());
     } else {
       nsAutoCString d3d11;
@@ -1387,22 +1387,22 @@ void gfxPlatform::Shutdown() {
 /* static */
 void gfxPlatform::InitLayersIPC() {
   if (sLayersIPCIsUp) {
     return;
   }
   sLayersIPCIsUp = true;
 
   if (XRE_IsContentProcess()) {
-    if (gfxVars::UseOMTP() && !recordreplay::IsRecordingOrReplaying()) {
+    if (gfxVars::UseOMTP()) {
       layers::PaintThread::Start();
     }
   }
 
-  if (XRE_IsParentProcess() || recordreplay::IsRecordingOrReplaying()) {
+  if (XRE_IsParentProcess()) {
     if (!gfxConfig::IsEnabled(Feature::GPU_PROCESS) && UseWebRender()) {
       wr::RenderThread::Start();
       image::ImageMemoryReporter::InitForWebRender();
     }
 
     layers::CompositorThreadHolder::Start();
   }
 }
@@ -1417,17 +1417,17 @@ void gfxPlatform::ShutdownLayersIPC() {
   if (XRE_IsContentProcess()) {
     gfx::VRManagerChild::ShutDown();
     // cf bug 1215265.
     if (StaticPrefs::layers_child_process_shutdown()) {
       layers::CompositorManagerChild::Shutdown();
       layers::ImageBridgeChild::ShutDown();
     }
 
-    if (gfxVars::UseOMTP() && !recordreplay::IsRecordingOrReplaying()) {
+    if (gfxVars::UseOMTP()) {
       layers::PaintThread::Shutdown();
     }
   } else if (XRE_IsParentProcess()) {
 #ifdef MOZ_WAYLAND
     widget::WaylandDisplayShutdown();
 #endif
     gfx::VRManagerChild::ShutDown();
     layers::CompositorManagerChild::Shutdown();
@@ -2702,21 +2702,16 @@ void gfxPlatform::InitCompositorAccelera
                          "Acceleration blocked by safe-mode",
                          NS_LITERAL_CSTRING("FEATURE_FAILURE_COMP_SAFEMODE"));
   }
   if (IsHeadless()) {
     feature.ForceDisable(
         FeatureStatus::Blocked, "Acceleration blocked by headless mode",
         NS_LITERAL_CSTRING("FEATURE_FAILURE_COMP_HEADLESSMODE"));
   }
-  if (recordreplay::IsRecordingOrReplaying()) {
-    feature.ForceDisable(
-        FeatureStatus::Blocked, "Acceleration blocked by recording/replaying",
-        NS_LITERAL_CSTRING("FEATURE_FAILURE_COMP_RECORDREPLAY"));
-  }
 }
 
 /*static*/
 bool gfxPlatform::WebRenderPrefEnabled() {
   return StaticPrefs::gfx_webrender_all_AtStartup() ||
          StaticPrefs::gfx_webrender_enabled_AtStartup_DoNotUseDirectly();
 }
 
@@ -2854,22 +2849,16 @@ void gfxPlatform::InitWebRenderConfig() 
   // WR! WR+   => means WR was enabled via gfx.webrender.{all,enabled} or
   //              envvar, possibly on unqualified hardware
   // In all cases WR- means WR was not enabled, for one of many possible
   // reasons. Prior to bug 1523788 landing the gfx.webrender.{all,enabled}
   // prefs only worked on Nightly so keep that in mind when looking at older
   // crash reports.
   ScopedGfxFeatureReporter reporter("WR", prefEnabled || envvarEnabled);
   if (!XRE_IsParentProcess()) {
-    // Force-disable WebRender in recording/replaying child processes, which
-    // have their own compositor.
-    if (recordreplay::IsRecordingOrReplaying()) {
-      gfxVars::SetUseWebRender(false);
-    }
-
     // The parent process runs through all the real decision-making code
     // later in this function. For other processes we still want to report
     // the state of the feature for crash reports.
     if (UseWebRender()) {
       reporter.SetSuccessful();
     }
     return;
   }
@@ -3256,35 +3245,34 @@ bool gfxPlatform::IsInLayoutAsapMode() {
   // the second is that the compositor goes ASAP and the refresh driver
   // goes at whatever the configurated rate is. This only checks the version
   // talos uses, which is the refresh driver and compositor are in lockstep.
   return StaticPrefs::layout_frame_rate() == 0;
 }
 
 /* static */
 bool gfxPlatform::ForceSoftwareVsync() {
-  return StaticPrefs::layout_frame_rate() > 0 ||
-         recordreplay::IsRecordingOrReplaying();
+  return StaticPrefs::layout_frame_rate() > 0;
 }
 
 /* static */
 int gfxPlatform::GetSoftwareVsyncRate() {
   int preferenceRate = StaticPrefs::layout_frame_rate();
   if (preferenceRate <= 0) {
     return gfxPlatform::GetDefaultFrameRate();
   }
   return preferenceRate;
 }
 
 /* static */
 int gfxPlatform::GetDefaultFrameRate() { return 60; }
 
 /* static */
 void gfxPlatform::ReInitFrameRate() {
-  if (XRE_IsParentProcess() || recordreplay::IsRecordingOrReplaying()) {
+  if (XRE_IsParentProcess()) {
     RefPtr<VsyncSource> oldSource = gPlatform->mVsyncSource;
 
     // Start a new one:
     if (gfxPlatform::ForceSoftwareVsync()) {
       gPlatform->mVsyncSource =
           (gPlatform)->gfxPlatform::CreateHardwareVsyncSource();
     } else {
       gPlatform->mVsyncSource = gPlatform->CreateHardwareVsyncSource();
--- a/gfx/thebes/gfxPlatform.h
+++ b/gfx/thebes/gfxPlatform.h
@@ -627,18 +627,17 @@ class gfxPlatform : public mozilla::laye
   static bool UsesOffMainThreadCompositing();
 
   /**
    * Get the hardware vsync source for each platform.
    * Should only exist and be valid on the parent process
    */
   virtual mozilla::gfx::VsyncSource* GetHardwareVsync() {
     MOZ_ASSERT(mVsyncSource != nullptr);
-    MOZ_ASSERT(XRE_IsParentProcess() ||
-               mozilla::recordreplay::IsRecordingOrReplaying());
+    MOZ_ASSERT(XRE_IsParentProcess());
     return mVsyncSource;
   }
 
   /**
    * True if layout rendering should use ASAP mode, which means
    * the refresh driver and compositor should render ASAP.
    * Used for talos testing purposes
    */
--- a/hal/sandbox/SandboxHal.cpp
+++ b/hal/sandbox/SandboxHal.cpp
@@ -86,22 +86,17 @@ void GetCurrentScreenConfiguration(Scree
 }
 
 bool LockScreenOrientation(const hal::ScreenOrientation& aOrientation) {
   bool allowed;
   Hal()->SendLockScreenOrientation(aOrientation, &allowed);
   return allowed;
 }
 
-void UnlockScreenOrientation() {
-  // Don't send this message from both the middleman and recording processes.
-  if (!recordreplay::IsMiddleman()) {
-    Hal()->SendUnlockScreenOrientation();
-  }
-}
+void UnlockScreenOrientation() { Hal()->SendUnlockScreenOrientation(); }
 
 void EnableSensorNotifications(SensorType aSensor) {
   Hal()->SendEnableSensorNotifications(aSensor);
 }
 
 void DisableSensorNotifications(SensorType aSensor) {
   Hal()->SendDisableSensorNotifications(aSensor);
 }
--- a/image/Decoder.h
+++ b/image/Decoder.h
@@ -100,17 +100,17 @@ class IDecoderFrameRecycler {
    *
    * @returns The recycled frame, if any is available.
    */
   virtual RawAccessFrameRef RecycleFrame(gfx::IntRect& aRecycleRect) = 0;
 };
 
 class Decoder {
  public:
-  NS_INLINE_DECL_THREADSAFE_REFCOUNTING_RECORDED(Decoder)
+  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(Decoder)
 
   explicit Decoder(RasterImage* aImage);
 
   /**
    * Initialize an image decoder. Decoders may not be re-initialized.
    *
    * @return NS_OK if the decoder could be initialized successfully.
    */
--- a/image/IDecodingTask.h
+++ b/image/IDecodingTask.h
@@ -62,17 +62,17 @@ class IDecodingTask : public IResumable 
   nsCOMPtr<nsIEventTarget> mEventTarget;
 };
 
 /**
  * An IDecodingTask implementation for metadata decodes of images.
  */
 class MetadataDecodingTask final : public IDecodingTask {
  public:
-  NS_INLINE_DECL_THREADSAFE_REFCOUNTING_RECORDED(MetadataDecodingTask, override)
+  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MetadataDecodingTask, override)
 
   explicit MetadataDecodingTask(NotNull<Decoder*> aDecoder);
 
   void Run() override;
 
   // Metadata decodes are very fast (since they only need to examine an image's
   // header) so there's no reason to refuse to run them synchronously if the
   // caller will allow us to.
@@ -92,18 +92,17 @@ class MetadataDecodingTask final : publi
 };
 
 /**
  * An IDecodingTask implementation for anonymous decoders - that is, decoders
  * with no associated Image object.
  */
 class AnonymousDecodingTask final : public IDecodingTask {
  public:
-  NS_INLINE_DECL_THREADSAFE_REFCOUNTING_RECORDED(AnonymousDecodingTask,
-                                                 override)
+  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AnonymousDecodingTask, override)
 
   explicit AnonymousDecodingTask(NotNull<Decoder*> aDecoder, bool aResumable);
 
   void Run() override;
 
   bool ShouldPreferSyncRun() const override { return true; }
   TaskPriority Priority() const override { return TaskPriority::eLow; }
 
--- a/image/SurfaceCache.cpp
+++ b/image/SurfaceCache.cpp
@@ -99,18 +99,17 @@ class CostEntry {
   Cost GetCost() const { return mCost; }
 
   bool operator==(const CostEntry& aOther) const {
     return mSurface == aOther.mSurface && mCost == aOther.mCost;
   }
 
   bool operator<(const CostEntry& aOther) const {
     return mCost < aOther.mCost ||
-           (mCost == aOther.mCost &&
-            recordreplay::RecordReplayValue(mSurface < aOther.mSurface));
+           (mCost == aOther.mCost && mSurface < aOther.mSurface);
   }
 
  private:
   NotNull<CachedSurface*> mSurface;
   Cost mCost;
 };
 
 /**
--- a/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc
+++ b/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc
@@ -11,23 +11,18 @@
 
 #include <unistd.h>
 
 FileDescriptorSet::FileDescriptorSet() : consumed_descriptor_highwater_(0) {}
 
 FileDescriptorSet::~FileDescriptorSet() {
   if (consumed_descriptor_highwater_ == descriptors_.size()) return;
 
-  // Middleman processes copy FileDescriptorSets before forwarding them to
-  // recording children, and destroying sets without using their descriptors is
-  // expected.
-  if (!mozilla::recordreplay::IsMiddleman()) {
-    CHROMIUM_LOG(WARNING)
-        << "FileDescriptorSet destroyed with unconsumed descriptors";
-  }
+  CHROMIUM_LOG(WARNING)
+      << "FileDescriptorSet destroyed with unconsumed descriptors";
 
   // We close all the descriptors where the close flag is set. If this
   // message should have been transmitted, then closing those with close
   // flags set mirrors the expected behaviour.
   //
   // If this message was received with more descriptors than expected
   // (which could a DOS against the browser by a rogue renderer) then all
   // the descriptors have their close flag set and we free all the extra
--- a/ipc/glue/CrashReporterClient.h
+++ b/ipc/glue/CrashReporterClient.h
@@ -27,21 +27,16 @@ class CrashReporterClient {
   //
   //   async InitCrashReporter(Shmem shmem, NativeThreadId threadId);
   //
   // The parent-side receive function of this message should save the shmem
   // somewhere, and when the top-level actor's ActorDestroy runs (or when the
   // crash reporter needs metadata), the shmem should be parsed.
   template <typename T>
   static void InitSingleton(T* aToplevelProtocol) {
-    // The crash reporter is not enabled in recording/replaying processes.
-    if (recordreplay::IsRecordingOrReplaying()) {
-      return;
-    }
-
     Shmem shmem;
     if (!AllocShmem(aToplevelProtocol, &shmem)) {
       MOZ_DIAGNOSTIC_ASSERT(false, "failed to allocate crash reporter shmem");
       return;
     }
 
     InitSingletonWithShmem(shmem);
     Unused << aToplevelProtocol->SendInitCrashReporter(
--- a/ipc/glue/CrashReporterHost.cpp
+++ b/ipc/glue/CrashReporterHost.cpp
@@ -2,17 +2,16 @@
 /* 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/. */
 
 #include "CrashReporterHost.h"
 #include "CrashReporterMetadataShmem.h"
 #include "mozilla/dom/Promise.h"
-#include "mozilla/recordreplay/ParentIPC.h"
 #include "mozilla/Sprintf.h"
 #include "mozilla/SyncRunnable.h"
 #include "mozilla/Telemetry.h"
 #include "nsICrashService.h"
 #include "nsXULAppAPI.h"
 
 // Consistency checking for nsICrashService constants.  We depend on the
 // equivalence between nsICrashService values and GeckoProcessType values
@@ -96,21 +95,16 @@ bool CrashReporterHost::AdoptMinidump(ns
     return false;
   }
 
   MergeCrashAnnotations(mExtraAnnotations, aAnnotations);
   return true;
 }
 
 int32_t CrashReporterHost::GetCrashType() {
-  if (mExtraAnnotations[CrashReporter::Annotation::RecordReplayHang]
-          .EqualsLiteral("1")) {
-    return nsICrashService::CRASH_TYPE_HANG;
-  }
-
   if (mExtraAnnotations[CrashReporter::Annotation::PluginHang].EqualsLiteral(
           "1")) {
     return nsICrashService::CRASH_TYPE_HANG;
   }
 
   return nsICrashService::CRASH_TYPE_CRASH;
 }
 
--- a/ipc/glue/GeckoChildProcessHost.cpp
+++ b/ipc/glue/GeckoChildProcessHost.cpp
@@ -37,17 +37,16 @@
 #include "nsIObserverService.h"
 
 #include "mozilla/ipc/BrowserProcessSubThread.h"
 #include "mozilla/ipc/EnvironmentMap.h"
 #include "mozilla/LinkedList.h"
 #include "mozilla/Logging.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/Omnijar.h"
-#include "mozilla/RecordReplay.h"
 #include "mozilla/RDDProcessHost.h"
 #include "mozilla/Scoped.h"
 #include "mozilla/Services.h"
 #include "mozilla/SharedThreadPool.h"
 #include "mozilla/StaticMutex.h"
 #include "mozilla/TaskQueue.h"
 #include "mozilla/Telemetry.h"
 #include "ProtocolUtils.h"
@@ -138,24 +137,19 @@ class BaseProcessLauncher {
 #if defined(XP_MACOSX) && defined(MOZ_SANDBOX)
         mDisableOSActivityMode(aHost->mDisableOSActivityMode),
 #endif
         mTmpDirName(aHost->mTmpDirName),
         mChildId(++gChildCounter) {
     SprintfLiteral(mPidString, "%d", base::GetCurrentProcId());
 
     // Compute the serial event target we'll use for launching.
-    if (mozilla::recordreplay::IsMiddleman()) {
-      // During Web Replay, the middleman process launches the actual content
-      // processes, and doesn't initialize enough of XPCOM to use thread pools.
-      mLaunchThread = IOThread();
-    } else {
-      nsCOMPtr<nsIEventTarget> threadOrPool = GetIPCLauncher();
-      mLaunchThread = new TaskQueue(threadOrPool.forget());
-    }
+    nsCOMPtr<nsIEventTarget> threadOrPool = GetIPCLauncher();
+    mLaunchThread = new TaskQueue(threadOrPool.forget());
+
     if (ShouldHaveDirectoryService()) {
       // "Current process directory" means the app dir, not the current
       // working dir or similar.
       mozilla::Unused
           << nsDirectoryService::gService->GetCurrentProcessDirectory(
                  getter_AddRefs(mAppDir));
     }
   }
--- a/ipc/glue/MessageChannel.cpp
+++ b/ipc/glue/MessageChannel.cpp
@@ -556,28 +556,16 @@ static void TryRegisterStrongMemoryRepor
     if (NS_FAILED(RegisterStrongMemoryReporter(reporter))) {
       registered = false;
     }
   }
 }
 
 Atomic<size_t> MessageChannel::gUnresolvedResponses;
 
-// Channels in record/replay middleman processes can forward messages that
-// originated in a child recording process. Middleman processes are given
-// a large negative sequence number so that sequence numbers on their messages
-// can be distinguished from those on recording process messages.
-static const int32_t MiddlemanStartSeqno = -(1 << 30);
-
-/* static */
-bool MessageChannel::MessageOriginatesFromMiddleman(const Message& aMessage) {
-  MOZ_ASSERT(recordreplay::IsMiddleman());
-  return aMessage.seqno() < MiddlemanStartSeqno;
-}
-
 MessageChannel::MessageChannel(const char* aName, IToplevelProtocol* aListener)
     : mName(aName),
       mListener(aListener),
       mChannelState(ChannelClosed),
       mSide(UnknownSide),
       mIsCrossProcess(false),
       mLink(nullptr),
       mWorkerLoop(nullptr),
@@ -617,20 +605,16 @@ MessageChannel::MessageChannel(const cha
 
 #ifdef OS_WIN
   mEvent = CreateEventW(nullptr, TRUE, FALSE, nullptr);
   MOZ_RELEASE_ASSERT(mEvent, "CreateEvent failed! Nothing is going to work!");
 #endif
 
   TryRegisterStrongMemoryReporter<PendingResponseReporter>();
   TryRegisterStrongMemoryReporter<ChannelCountReporter>();
-
-  if (recordreplay::IsMiddleman()) {
-    mNextSeqno = MiddlemanStartSeqno;
-  }
 }
 
 MessageChannel::~MessageChannel() {
   MOZ_COUNT_DTOR(ipc::MessageChannel);
   IPC_ASSERT(mCxxStackFrames.empty(), "mismatched CxxStackFrame ctor/dtors");
 #ifdef OS_WIN
   if (mEvent) {
     BOOL ok = CloseHandle(mEvent);
@@ -2050,25 +2034,16 @@ void MessageChannel::MessageTask::Post()
 void MessageChannel::MessageTask::Clear() {
   mChannel->AssertWorkerThread();
 
   mChannel = nullptr;
 }
 
 NS_IMETHODIMP
 MessageChannel::MessageTask::GetPriority(uint32_t* aPriority) {
-  if (recordreplay::IsRecordingOrReplaying()) {
-    // Ignore message priorities in recording/replaying processes. Incoming
-    // messages were sorted in the middleman process according to their
-    // priority before being forwarded here, and reordering them again in this
-    // process can cause problems such as dispatching messages for an actor
-    // before the constructor for that actor.
-    *aPriority = PRIORITY_NORMAL;
-    return NS_OK;
-  }
   switch (mMessage.priority()) {
     case Message::NORMAL_PRIORITY:
       *aPriority = PRIORITY_NORMAL;
       break;
     case Message::INPUT_PRIORITY:
       *aPriority = PRIORITY_INPUT_HIGH;
       break;
     case Message::HIGH_PRIORITY:
@@ -2160,20 +2135,18 @@ void MessageChannel::DispatchSyncMessage
                                          const Message& aMsg,
                                          Message*& aReply) {
   AssertWorkerThread();
 
   mozilla::TimeStamp start = TimeStamp::Now();
 
   int nestedLevel = aMsg.nested_level();
 
-  MOZ_RELEASE_ASSERT(
-      nestedLevel == IPC::Message::NOT_NESTED || NS_IsMainThread() ||
-      // Middleman processes forward sync messages on a non-main thread.
-      recordreplay::IsMiddleman());
+  MOZ_RELEASE_ASSERT(nestedLevel == IPC::Message::NOT_NESTED ||
+                     NS_IsMainThread());
 #ifdef MOZ_TASK_TRACER
   AutoScopedLabel autolabel("sync message %s", aMsg.name());
 #endif
 
   MessageChannel* dummy;
   MessageChannel*& blockingVar =
       mSide == ChildSide && NS_IsMainThread() ? gParentProcessBlocker : dummy;
 
--- a/ipc/glue/MessageChannel.h
+++ b/ipc/glue/MessageChannel.h
@@ -317,20 +317,16 @@ class MessageChannel : HasResultCodes, M
     sIsPumpingMessages = aIsPumping;
   }
 
   /**
    * Does this MessageChannel cross process boundaries?
    */
   bool IsCrossProcess() const { return mIsCrossProcess; }
 
-  // Return whether a message definitely originated from a middleman process,
-  // due to its sequence number.
-  static bool MessageOriginatesFromMiddleman(const Message& aMessage);
-
 #ifdef OS_WIN
   struct MOZ_STACK_CLASS SyncStackFrame {
     SyncStackFrame(MessageChannel* channel, bool interrupt);
     ~SyncStackFrame();
 
     bool mInterrupt;
     bool mSpinNestedEvents;
     bool mListenerNotified;
--- a/ipc/glue/ProtocolUtils.cpp
+++ b/ipc/glue/ProtocolUtils.cpp
@@ -12,18 +12,16 @@
 #endif
 
 #include "mozilla/IntegerPrintfMacros.h"
 
 #include "mozilla/ipc/ProtocolUtils.h"
 
 #include "mozilla/ipc/MessageChannel.h"
 #include "mozilla/ipc/Transport.h"
-#include "mozilla/recordreplay/ChildIPC.h"
-#include "mozilla/recordreplay/ParentIPC.h"
 #include "mozilla/StaticMutex.h"
 #include "mozilla/SystemGroup.h"
 #include "mozilla/Unused.h"
 #include "nsPrintfCString.h"
 
 #if defined(MOZ_SANDBOX) && defined(XP_WIN)
 #  include "mozilla/sandboxTarget.h"
 #endif
@@ -572,37 +570,28 @@ void IProtocol::DestroySubtree(ActorDest
 }
 
 IToplevelProtocol::IToplevelProtocol(const char* aName, ProtocolId aProtoId,
                                      Side aSide)
     : IProtocol(aProtoId, aSide),
       mOtherPid(mozilla::ipc::kInvalidProcessId),
       mLastLocalId(0),
       mEventTargetMutex("ProtocolEventTargetMutex"),
-      mMiddlemanChannelOverride(nullptr),
       mChannel(aName, this) {
   mToplevel = this;
 }
 
 base::ProcessId IToplevelProtocol::OtherPid() const {
   base::ProcessId pid = OtherPidMaybeInvalid();
   MOZ_RELEASE_ASSERT(pid != kInvalidProcessId);
   return pid;
 }
 
 void IToplevelProtocol::SetOtherProcessId(base::ProcessId aOtherPid) {
-  // When recording an execution, all communication we do is forwarded from
-  // the middleman to the parent process, so use its pid instead of the
-  // middleman's pid.
-  if (recordreplay::IsRecordingOrReplaying() &&
-      aOtherPid == recordreplay::child::MiddlemanProcessId()) {
-    mOtherPid = recordreplay::child::ParentProcessId();
-  } else {
-    mOtherPid = aOtherPid;
-  }
+  mOtherPid = aOtherPid;
 }
 
 bool IToplevelProtocol::Open(UniquePtr<Transport> aTransport,
                              base::ProcessId aOtherPid, MessageLoop* aThread,
                              mozilla::ipc::Side aSide) {
   SetOtherProcessId(aOtherPid);
   return GetIPCChannel()->Open(std::move(aTransport), aThread, aSide);
 }
@@ -634,22 +623,18 @@ void IToplevelProtocol::SetReplyTimeoutM
 }
 
 bool IToplevelProtocol::IsOnCxxStack() const {
   return GetIPCChannel()->IsOnCxxStack();
 }
 
 int32_t IToplevelProtocol::NextId() {
   // Genreate the next ID to use for a shared memory or protocol. Parent and
-  // Child sides of the protocol use different pools, and actors created in the
-  // middleman need to use a distinct pool as well.
+  // Child sides of the protocol use different pools.
   int32_t tag = 0;
-  if (recordreplay::IsMiddleman()) {
-    tag |= 1 << 0;
-  }
   if (GetSide() == ParentSide) {
     tag |= 1 << 1;
   }
 
   // Check any overflow
   MOZ_RELEASE_ASSERT(mLastLocalId < (1 << 29));
 
   // Compute the ID to use with the low two bits as our tag, and the remaining
--- a/ipc/glue/ProtocolUtils.h
+++ b/ipc/glue/ProtocolUtils.h
@@ -19,17 +19,16 @@
 #include "mozilla/AlreadyAddRefed.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/ipc/ByteBuf.h"
 #include "mozilla/ipc/FileDescriptor.h"
 #include "mozilla/ipc/MessageChannel.h"
 #include "mozilla/ipc/Shmem.h"
 #include "mozilla/ipc/Transport.h"
 #include "mozilla/ipc/MessageLink.h"
-#include "mozilla/recordreplay/ChildIPC.h"
 #include "mozilla/LinkedList.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/MozPromise.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/NotNull.h"
 #include "mozilla/Scoped.h"
 #include "mozilla/UniquePtr.h"
 #include "MainThreadUtils.h"
@@ -401,28 +400,18 @@ class IToplevelProtocol : public IProtoc
 
   Shmem::SharedMemory* CreateSharedMemory(size_t aSize,
                                           SharedMemory::SharedMemoryType aType,
                                           bool aUnsafe, int32_t* aId);
   Shmem::SharedMemory* LookupSharedMemory(int32_t aId);
   bool IsTrackingSharedMemory(Shmem::SharedMemory* aSegment);
   bool DestroySharedMemory(Shmem& aShmem);
 
-  MessageChannel* GetIPCChannel() {
-    if (mMiddlemanChannelOverride) {
-      return mMiddlemanChannelOverride;
-    }
-    return &mChannel;
-  }
-  const MessageChannel* GetIPCChannel() const {
-    if (mMiddlemanChannelOverride) {
-      return mMiddlemanChannelOverride;
-    }
-    return &mChannel;
-  }
+  MessageChannel* GetIPCChannel() { return &mChannel; }
+  const MessageChannel* GetIPCChannel() const { return &mChannel; }
 
   // NOTE: The target actor's Manager must already be set.
   void SetEventTargetForActorInternal(IProtocol* aActor,
                                       nsIEventTarget* aEventTarget);
   void ReplaceEventTargetForActor(IProtocol* aActor,
                                   nsIEventTarget* aEventTarget);
   void SetEventTargetForRoute(int32_t aRoute, nsIEventTarget* aEventTarget);
   nsIEventTarget* GetActorEventTarget();
@@ -515,23 +504,16 @@ class IToplevelProtocol : public IProtoc
   virtual void ProcessRemoteNativeEventsInInterruptCall() {}
 
   virtual void OnChannelReceivedMessage(const Message& aMsg) {}
 
   void OnIPCChannelOpened() { ActorConnected(); }
 
   already_AddRefed<nsIEventTarget> GetMessageEventTarget(const Message& aMsg);
 
-  void SetMiddlemanIPCChannel(MessageChannel* aChannel) {
-    // Middleman processes sometimes need to change the channel used by a
-    // protocol.
-    MOZ_RELEASE_ASSERT(recordreplay::IsMiddleman());
-    mMiddlemanChannelOverride = aChannel;
-  }
-
  protected:
   // Override this method in top-level protocols to change the event target
   // for a new actor (and its sub-actors).
   virtual already_AddRefed<nsIEventTarget> GetConstructedEventTarget(
       const Message& aMsg) {
     return nullptr;
   }
 
@@ -556,22 +538,16 @@ class IToplevelProtocol : public IProtoc
   IDMap<Shmem::SharedMemory*> mShmemMap;
 
   // XXX: We no longer need mEventTargetMap for Quantum DOM, so it may be
   // worthwhile to remove it before people start depending on it for other weird
   // things.
   Mutex mEventTargetMutex;
   IDMap<nsCOMPtr<nsIEventTarget>> mEventTargetMap;
 
-  // In the middleman process for recordreplay, we override the channel which
-  // should be used by an actor. Due to this, we need to hold a separate pointer
-  // here which can be used to specify that we shouldn't send messages to our
-  // mChannel actor member. FIXME: This should probably be removed.
-  MessageChannel* mMiddlemanChannelOverride;
-
   MessageChannel mChannel;
 };
 
 class IShmemAllocator {
  public:
   virtual bool AllocShmem(size_t aSize,
                           mozilla::ipc::SharedMemory::SharedMemoryType aShmType,
                           mozilla::ipc::Shmem* aShmem) = 0;
@@ -741,26 +717,17 @@ class Endpoint {
   }
 
   ProcessId OtherPid() const { return mOtherPid; }
 
   // This method binds aActor to this endpoint. After this call, the actor can
   // be used to send and receive messages. The endpoint becomes invalid.
   bool Bind(PFooSide* aActor) {
     MOZ_RELEASE_ASSERT(mValid);
-    if (mMyPid != base::GetCurrentProcId()) {
-      // These pids must match, unless we are recording or replaying, in
-      // which case the parent process will have supplied the pid for the
-      // middleman process instead. Fix this here. If we're replaying
-      // we'll see the pid of the middleman used while recording.
-      MOZ_RELEASE_ASSERT(recordreplay::IsRecordingOrReplaying());
-      MOZ_RELEASE_ASSERT(recordreplay::IsReplaying() ||
-                         mMyPid == recordreplay::child::MiddlemanProcessId());
-      mMyPid = base::GetCurrentProcId();
-    }
+    MOZ_RELEASE_ASSERT(mMyPid == base::GetCurrentProcId());
 
     UniquePtr<Transport> transport =
         mozilla::ipc::OpenDescriptor(mTransport, mMode);
     if (!transport) {
       return false;
     }
     if (!aActor->Open(
             std::move(transport), mOtherPid, XRE_GetIOMessageLoop(),
--- a/ipc/ipdl/sync-messages.ini
+++ b/ipc/ipdl/sync-messages.ini
@@ -972,18 +972,16 @@ description = test only
 [PBrowser::GetSystemFont]
 description = test only
 [PBrowser::SetPrefersReducedMotionOverrideForTest]
 description = test only
 [PBrowser::ResetPrefersReducedMotionOverrideForTest]
 description = test only
 [PContent::SyncMessage]
 description = JS MessageManager implementation
-[PContent::OpenRecordReplayChannel]
-description = bug 1475898 this could be async
 [PContent::LoadPlugin]
 description = Legacy NPAPI IPC
 [PContent::ConnectPluginBridge]
 description = Legacy NPAPI IPC
 [PContent::IsSecureURI]
 description = legacy sync IPC - please add detailed description
 [PContent::PURLClassifier]
 description = legacy sync IPC - please add detailed description
--- a/js/ductwork/debugger/IJSDebugger.idl
+++ b/js/ductwork/debugger/IJSDebugger.idl
@@ -8,14 +8,13 @@
  * Do not use this interface. Instead, write:
  *     Components.utils.import("resource://gre/modules/jsdebugger.jsm");
  *     addDebuggerToGlobal(global);
  */
 [scriptable, uuid(a36fa816-31da-4b23-bc97-6412771f0867)]
 interface IJSDebugger : nsISupports
 {
   /**
-   * Define the global Debugger and RecordReplayControl constructors on a
-   * given global.
+   * Define the global Debugger constructor on a given global.
    */
   [implicit_jscontext]
   void addClass(in jsval global);
 };
--- a/js/ductwork/debugger/JSDebugger.cpp
+++ b/js/ductwork/debugger/JSDebugger.cpp
@@ -45,27 +45,12 @@ JSDebugger::AddClass(JS::Handle<JS::Valu
     return NS_ERROR_INVALID_ARG;
   }
 
   JSAutoRealm ar(cx, obj);
   if (!JS_DefineDebuggerObject(cx, obj)) {
     return NS_ERROR_FAILURE;
   }
 
-  if (recordreplay::IsRecordingOrReplaying() || recordreplay::IsMiddleman()) {
-    if (!recordreplay::DefineRecordReplayControlObject(cx, obj)) {
-      return NS_ERROR_FAILURE;
-    }
-  } else {
-    // Define an empty RecordReplayControl object, to avoid reference errors in
-    // scripts that run in normal processes. DefineRecordReplayControlObject
-    // can't be called in normal processes.
-    JS::RootedObject staticObject(cx, JS_NewObject(cx, nullptr));
-    if (!staticObject ||
-        !JS_DefineProperty(cx, obj, "RecordReplayControl", staticObject, 0)) {
-      return NS_ERROR_FAILURE;
-    }
-  }
-
   return NS_OK;
 }
 
 }  // namespace mozilla::jsdebugger
--- a/js/ipc/JavaScriptShared.cpp
+++ b/js/ipc/JavaScriptShared.cpp
@@ -593,23 +593,17 @@ CrossProcessCpowHolder::CrossProcessCpow
 CrossProcessCpowHolder::~CrossProcessCpowHolder() {
   if (cpows_.Length() && !unwrapped_) {
     // This should only happen if a message manager message
     // containing CPOWs gets ignored for some reason. We need to
     // unwrap every incoming CPOW in this process to ensure that
     // the corresponding part of the CPOW in the other process
     // will eventually be collected. The scope for this object
     // doesn't really matter, because it immediately becomes
-    // garbage. Ignore this for middleman processes used when
-    // recording or replaying, as they do not have a CPOW manager
-    // and the message will also be received in the recording
-    // process.
-    if (recordreplay::IsMiddleman()) {
-      return;
-    }
+    // garbage.
     AutoJSAPI jsapi;
     if (!jsapi.Init(xpc::PrivilegedJunkScope())) {
       return;
     }
     JSContext* cx = jsapi.cx();
     JS::Rooted<JSObject*> cpows(cx);
     js_->Unwrap(cx, cpows_, &cpows);
   }
@@ -623,19 +617,16 @@ bool CrossProcessCpowHolder::ToObject(JS
     return true;
   }
 
   return js_->Unwrap(cx, cpows_, objp);
 }
 
 bool JavaScriptShared::Unwrap(JSContext* cx, const nsTArray<CpowEntry>& aCpows,
                               JS::MutableHandleObject objp) {
-  // Middleman processes never operate on CPOWs.
-  MOZ_ASSERT(!recordreplay::IsMiddleman());
-
   objp.set(nullptr);
 
   if (!aCpows.Length()) {
     return true;
   }
 
   RootedObject obj(cx, JS_NewPlainObject(cx));
   if (!obj) {
--- a/js/public/CharacterEncoding.h
+++ b/js/public/CharacterEncoding.h
@@ -4,16 +4,17 @@
  * 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 js_CharacterEncoding_h
 #define js_CharacterEncoding_h
 
 #include "mozilla/Range.h"
 #include "mozilla/Span.h"
+#include "mozilla/Utf8.h"
 
 #include "js/TypeDecls.h"
 #include "js/Utility.h"
 
 class JSLinearString;
 
 namespace JS {
 
--- a/js/public/Principals.h
+++ b/js/public/Principals.h
@@ -15,19 +15,17 @@
 
 #include "jspubtd.h"
 
 struct JSStructuredCloneReader;
 struct JSStructuredCloneWriter;
 
 struct JSPrincipals {
   /* Don't call "destroy"; use reference counting macros below. */
-  mozilla::Atomic<int32_t, mozilla::SequentiallyConsistent,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      refcount;
+  mozilla::Atomic<int32_t, mozilla::SequentiallyConsistent> refcount;
 
 #ifdef JS_DEBUG
   /* A helper to facilitate principals debugging. */
   uint32_t debugToken;
 #endif
 
   JSPrincipals() : refcount(0) {}
 
--- a/js/public/ProfilingStack.h
+++ b/js/public/ProfilingStack.h
@@ -118,52 +118,40 @@ class ProfilingStackFrame {
   // see an inconsistent state where the stack pointer still points to a
   // ProfilingStackFrame which has already been popped off the stack and whose
   // fields have now been partially repopulated with new values.
   // See the "Concurrency considerations" paragraph at the top of this file
   // for more details.
 
   // Descriptive label for this stack frame. Must be a static string! Can be
   // an empty string, but not a null pointer.
-  mozilla::Atomic<const char*, mozilla::ReleaseAcquire,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      label_;
+  mozilla::Atomic<const char*, mozilla::ReleaseAcquire> label_;
 
   // An additional descriptive string of this frame which is combined with
   // |label_| in profiler output. Need not be (and usually isn't) static. Can
   // be null.
-  mozilla::Atomic<const char*, mozilla::ReleaseAcquire,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      dynamicString_;
+  mozilla::Atomic<const char*, mozilla::ReleaseAcquire> dynamicString_;
 
   // Stack pointer for non-JS stack frames, the script pointer otherwise.
-  mozilla::Atomic<void*, mozilla::ReleaseAcquire,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      spOrScript;
+  mozilla::Atomic<void*, mozilla::ReleaseAcquire> spOrScript;
 
   // The bytecode offset for JS stack frames.
   // Must not be used on non-JS frames; it'll contain either the default 0,
   // or a leftover value from a previous JS stack frame that was using this
   // ProfilingStackFrame object.
-  mozilla::Atomic<int32_t, mozilla::ReleaseAcquire,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      pcOffsetIfJS_;
+  mozilla::Atomic<int32_t, mozilla::ReleaseAcquire> pcOffsetIfJS_;
 
   // ID of the JS Realm for JS stack frames.
   // Must not be used on non-JS frames; it'll contain either the default 0,
   // or a leftover value from a previous JS stack frame that was using this
   // ProfilingStackFrame object.
-  mozilla::Atomic<uint64_t, mozilla::ReleaseAcquire,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      realmID_;
+  mozilla::Atomic<uint64_t, mozilla::ReleaseAcquire> realmID_;
 
   // Bits 0...8 hold the Flags. Bits 9...31 hold the category pair.
-  mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      flagsAndCategoryPair_;
+  mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire> flagsAndCategoryPair_;
 
   static int32_t pcToOffset(JSScript* aScript, jsbytecode* aPc);
 
  public:
   ProfilingStackFrame() = default;
   ProfilingStackFrame& operator=(const ProfilingStackFrame& other) {
     label_ = other.label();
     dynamicString_ = other.dynamicString();
@@ -488,34 +476,31 @@ class JS_FRIEND_API ProfilingStack final
 
   uint32_t capacity = 0;
 
  public:
   // The pointer to the stack frames, this is read from the profiler thread and
   // written from the current thread.
   //
   // This is effectively a unique pointer.
-  mozilla::Atomic<js::ProfilingStackFrame*, mozilla::SequentiallyConsistent,
-                  mozilla::recordreplay::Behavior::DontPreserve>
+  mozilla::Atomic<js::ProfilingStackFrame*, mozilla::SequentiallyConsistent>
       frames{nullptr};
 
   // This may exceed the capacity, so instead use the stackSize() method to
   // determine the number of valid frames in stackFrames. When this is less
   // than stackCapacity(), it refers to the first free stackframe past the top
   // of the in-use stack (i.e. frames[stackPointer - 1] is the top stack
   // frame).
   //
   // WARNING WARNING WARNING
   //
   // This is an atomic variable that uses ReleaseAcquire memory ordering.
   // See the "Concurrency considerations" paragraph at the top of this file
   // for more details.
-  mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      stackPointer;
+  mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire> stackPointer;
 };
 
 namespace js {
 
 class AutoGeckoProfilerEntry;
 class GeckoProfilerEntryMarker;
 class GeckoProfilerBaselineOSRMarker;
 
--- a/js/src/builtin/AtomicsObject.cpp
+++ b/js/src/builtin/AtomicsObject.cpp
@@ -759,18 +759,17 @@ void js::FutexThread::destroy() {
 /* static */
 void js::FutexThread::lock() {
   // Load the atomic pointer.
   js::Mutex* lock = lock_;
 
   lock->lock();
 }
 
-/* static */ mozilla::Atomic<js::Mutex*, mozilla::SequentiallyConsistent,
-                             mozilla::recordreplay::Behavior::DontPreserve>
+/* static */ mozilla::Atomic<js::Mutex*, mozilla::SequentiallyConsistent>
     FutexThread::lock_;
 
 /* static */
 void js::FutexThread::unlock() {
   // Load the atomic pointer.
   js::Mutex* lock = lock_;
 
   lock->unlock();
--- a/js/src/builtin/AtomicsObject.h
+++ b/js/src/builtin/AtomicsObject.h
@@ -124,19 +124,17 @@ class FutexThread {
   // Current futex state for this runtime.  When not in a wait this
   // is Idle; when in a wait it is Waiting or the reason the futex
   // is about to wake up.
   FutexState state_;
 
   // Shared futex lock for all runtimes.  We can perhaps do better,
   // but any lock will need to be per-domain (consider SharedWorker)
   // or coarser.
-  static mozilla::Atomic<js::Mutex*, mozilla::SequentiallyConsistent,
-                         mozilla::recordreplay::Behavior::DontPreserve>
-      lock_;
+  static mozilla::Atomic<js::Mutex*, mozilla::SequentiallyConsistent> lock_;
 
   // A flag that controls whether waiting is allowed.
   ThreadData<bool> canWait_;
 };
 
 // Go to sleep if the int32_t value at the given address equals `value`.
 MOZ_MUST_USE FutexThread::WaitResult atomics_wait_impl(
     JSContext* cx, SharedArrayRawBuffer* sarb, uint32_t byteOffset,
--- a/js/src/builtin/Promise.cpp
+++ b/js/src/builtin/Promise.cpp
@@ -385,22 +385,16 @@ namespace {
 mozilla::Atomic<uint64_t> gIDGenerator(0);
 }  // namespace
 
 static MOZ_ALWAYS_INLINE bool ShouldCaptureDebugInfo(JSContext* cx) {
   return cx->options().asyncStack() || cx->realm()->isDebuggee();
 }
 
 static mozilla::Maybe<mozilla::TimeStamp> MaybeNow() {
-  // ShouldCaptureDebugInfo() may return inconsistent values when recording
-  // or replaying, so in places where we might need the current time for
-  // promise debug info we always capture the current time.
-  if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-    return mozilla::Some(mozilla::TimeStamp::Now());
-  }
   return mozilla::Nothing();
 }
 
 class PromiseDebugInfo : public NativeObject {
  private:
   enum Slots {
     Slot_AllocationSite,
     Slot_ResolutionSite,
@@ -480,17 +474,16 @@ class PromiseDebugInfo : public NativeOb
   }
 
   static void setResolutionInfo(JSContext* cx, Handle<PromiseObject*> promise) {
     mozilla::Maybe<mozilla::TimeStamp> maybeNow = MaybeNow();
 
     if (!ShouldCaptureDebugInfo(cx)) {
       return;
     }
-    mozilla::recordreplay::AutoDisallowThreadEvents disallow;
 
     // If async stacks weren't enabled and the Promise's global wasn't a
     // debuggee when the Promise was created, we won't have a debugInfo
     // object. We still want to capture the resolution stack, so we
     // create the object now and change it's slots' values around a bit.
     Rooted<PromiseDebugInfo*> debugInfo(cx, FromPromise(promise));
     if (!debugInfo) {
       RootedValue idVal(cx, promise->getFixedSlot(PromiseSlot_DebugInfo));
@@ -2229,17 +2222,16 @@ CreatePromiseObjectInternal(JSContext* c
   // Step 7.
   // Implicit, the handled flag is unset by default.
 
   mozilla::Maybe<mozilla::TimeStamp> maybeNow = MaybeNow();
 
   if (MOZ_LIKELY(!ShouldCaptureDebugInfo(cx))) {
     return promise;
   }
-  mozilla::recordreplay::AutoDisallowThreadEvents disallow;
 
   // Store an allocation stack so we can later figure out what the
   // control flow was for some unexpected results. Frightfully expensive,
   // but oh well.
 
   Rooted<PromiseObject*> promiseRoot(cx, promise);
 
   PromiseDebugInfo* debugInfo =
@@ -5763,36 +5755,25 @@ JS::AutoDebuggerJobQueueInterruption::Au
   MOZ_GUARD_OBJECT_NOTIFIER_INIT;
 }
 
 JS::AutoDebuggerJobQueueInterruption::~AutoDebuggerJobQueueInterruption() {
   MOZ_ASSERT_IF(initialized(), cx->jobQueue->empty());
 }
 
 bool JS::AutoDebuggerJobQueueInterruption::init(JSContext* cx) {
-  // When recording or replaying this class doesn't do anything. Callbacks on
-  // the job queue can interact with the recording, and this class can be used
-  // at different places between recording and replay. Because nested event
-  // loops aren't pushed in debugger callbacks when recording/replaying, the
-  // job queue does not need to be saved during debugger callbacks.
-  if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-    return true;
-  }
-
   MOZ_ASSERT(cx->jobQueue);
   this->cx = cx;
   saved = cx->jobQueue->saveJobQueue(cx);
   return !!saved;
 }
 
 void JS::AutoDebuggerJobQueueInterruption::runJobs() {
-  if (!mozilla::recordreplay::IsRecordingOrReplaying()) {
-    JS::AutoSaveExceptionState ases(cx);
-    cx->jobQueue->runJobs(cx);
-  }
+  JS::AutoSaveExceptionState ases(cx);
+  cx->jobQueue->runJobs(cx);
 }
 
 const JSJitInfo promise_then_info = {
     {(JSJitGetterOp)Promise_then_noRetVal},
     {0}, /* unused */
     {0}, /* unused */
     JSJitInfo::IgnoresReturnValueNative,
     JSJitInfo::AliasEverything,
--- a/js/src/debugger/Debugger.cpp
+++ b/js/src/debugger/Debugger.cpp
@@ -7,17 +7,16 @@
 #include "debugger/Debugger-inl.h"
 
 #include "mozilla/Attributes.h"        // for MOZ_STACK_CLASS, MOZ_RAII
 #include "mozilla/DebugOnly.h"         // for DebugOnly
 #include "mozilla/DoublyLinkedList.h"  // for DoublyLinkedList<>::Iterator
 #include "mozilla/GuardObjects.h"      // for MOZ_GUARD_OBJECT_NOTIFIER_PARAM
 #include "mozilla/HashTable.h"         // for HashSet<>::Range, HashMapEntry
 #include "mozilla/Maybe.h"             // for Maybe, Nothing, Some
-#include "mozilla/RecordReplay.h"      // for IsMiddleman
 #include "mozilla/ScopeExit.h"         // for MakeScopeExit, ScopeExit
 #include "mozilla/ThreadLocal.h"       // for ThreadLocal
 #include "mozilla/TimeStamp.h"         // for TimeStamp, TimeDuration
 #include "mozilla/TypeTraits.h"        // for RemoveConst<>::Type
 #include "mozilla/UniquePtr.h"         // for UniquePtr
 #include "mozilla/Variant.h"           // for AsVariant, AsVariantTemporary
 #include "mozilla/Vector.h"            // for Vector, Vector<>::ConstRange
 
@@ -5887,39 +5886,16 @@ bool Debugger::isCompilableUnit(JSContex
 
     cx->clearPendingException();
   }
 
   args.rval().setBoolean(result);
   return true;
 }
 
-/* static */
-bool Debugger::recordReplayProcessKind(JSContext* cx, unsigned argc,
-                                       Value* vp) {
-  CallArgs args = CallArgsFromVp(argc, vp);
-
-  if (mozilla::recordreplay::IsMiddleman()) {
-    JSString* str = JS_NewStringCopyZ(cx, "Middleman");
-    if (!str) {
-      return false;
-    }
-    args.rval().setString(str);
-  } else if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-    JSString* str = JS_NewStringCopyZ(cx, "RecordingReplaying");
-    if (!str) {
-      return false;
-    }
-    args.rval().setString(str);
-  } else {
-    args.rval().setUndefined();
-  }
-  return true;
-}
-
 bool Debugger::CallData::adoptDebuggeeValue() {
   if (!args.requireAtLeast(cx, "Debugger.adoptDebuggeeValue", 1)) {
     return false;
   }
 
   RootedValue v(cx, args[0]);
   if (v.isObject()) {
     RootedObject obj(cx, &v.toObject());
@@ -6038,19 +6014,17 @@ const JSFunctionSpec Debugger::methods[]
     JS_DEBUG_FN("findAllGlobals", findAllGlobals, 0),
     JS_DEBUG_FN("findSourceURLs", findSourceURLs, 0),
     JS_DEBUG_FN("makeGlobalObjectReference", makeGlobalObjectReference, 1),
     JS_DEBUG_FN("adoptDebuggeeValue", adoptDebuggeeValue, 1),
     JS_DEBUG_FN("adoptSource", adoptSource, 1),
     JS_FS_END};
 
 const JSFunctionSpec Debugger::static_methods[]{
-    JS_FN("isCompilableUnit", Debugger::isCompilableUnit, 1, 0),
-    JS_FN("recordReplayProcessKind", Debugger::recordReplayProcessKind, 0, 0),
-    JS_FS_END};
+    JS_FN("isCompilableUnit", Debugger::isCompilableUnit, 1, 0), JS_FS_END};
 
 DebuggerScript* Debugger::newDebuggerScript(
     JSContext* cx, Handle<DebuggerScriptReferent> referent) {
   cx->check(object.get());
 
   RootedObject proto(
       cx, &object->getReservedSlot(JSSLOT_DEBUG_SCRIPT_PROTO).toObject());
   MOZ_ASSERT(proto);
--- a/js/src/doc/Debugger/Debugger.md
+++ b/js/src/doc/Debugger/Debugger.md
@@ -512,22 +512,16 @@ The functions described below are not ca
 
 ### `isCompilableUnit(source)`
 :   Given a string of source code, designated by <i>source</i>, return false if
     the string might become a valid JavaScript statement with the addition of
     more lines. Otherwise return true. The intent is to support interactive
     compilation - accumulate lines in a buffer until isCompilableUnit is true,
     then pass it to the compiler.
 
-### `recordReplayProcessKind()`
-:   Return the kind of record/replay firefox process that is currently
-    running: the string "RecordingReplaying" if this is a recording or
-    replaying process, the string "Middleman" if this is a middleman
-    process, or undefined for normal firefox content or UI processes.
-
 [add]: #adddebuggee-global
 [source]: Debugger.Source.md
 [script]: Debugger.Script.md
 [rv]: Conventions.html#resumption-values
 [object]: Debugger.Object.md
 [vf]: Debugger.Frame.html#visible-frames
 [tracking-allocs]: Debugger.Memory.html#trackingallocationsites
 [frame]: Debugger.Frame.md
--- a/js/src/ds/MemoryProtectionExceptionHandler.cpp
+++ b/js/src/ds/MemoryProtectionExceptionHandler.cpp
@@ -30,18 +30,17 @@
 #include "threading/Thread.h"
 #include "vm/MutexIDs.h"
 #include "vm/Runtime.h"
 
 namespace js {
 
 // Memory protection occurs at non-deterministic points when
 // recording/replaying.
-static mozilla::Atomic<bool, mozilla::SequentiallyConsistent,
-                       mozilla::recordreplay::Behavior::DontPreserve>
+static mozilla::Atomic<bool, mozilla::SequentiallyConsistent>
     sProtectedRegionsInit(false);
 
 /*
  * A class to store the addresses of the regions recognized as protected
  * by this exception handler. We use a splay tree to store these addresses.
  */
 class ProtectedRegionTree {
   struct Region {
--- a/js/src/frontend/BytecodeCompiler.cpp
+++ b/js/src/frontend/BytecodeCompiler.cpp
@@ -390,22 +390,16 @@ static bool CanLazilyParse(const Compila
 }
 
 template <typename Unit>
 bool frontend::SourceAwareCompiler<Unit>::createSourceAndParser(
     LifoAllocScope& allocScope, CompilationInfo& compilationInfo) {
   if (!compilationInfo.assignSource(sourceBuffer_)) {
     return false;
   }
-  // Note the contents of any compiled scripts when recording/replaying.
-  if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-    mozilla::recordreplay::NoteContentParse(
-        this, compilationInfo.options.filename(), "application/javascript",
-        sourceBuffer_.units(), sourceBuffer_.length());
-  }
 
   if (CanLazilyParse(compilationInfo)) {
     syntaxParser.emplace(compilationInfo.cx, compilationInfo.options,
                          sourceBuffer_.units(), sourceBuffer_.length(),
                          /* foldConstants = */ false, compilationInfo, nullptr,
                          nullptr, compilationInfo.sourceObject);
     if (!syntaxParser->checkOptions()) {
       return false;
--- a/js/src/frontend/BytecodeEmitter.h
+++ b/js/src/frontend/BytecodeEmitter.h
@@ -10,18 +10,19 @@
 #define frontend_BytecodeEmitter_h
 
 #include "mozilla/Assertions.h"  // MOZ_ASSERT
 #include "mozilla/Attributes.h"  // MOZ_STACK_CLASS, MOZ_MUST_USE, MOZ_ALWAYS_INLINE, MOZ_NEVER_INLINE, MOZ_RAII
 #include "mozilla/Maybe.h"   // mozilla::Maybe, mozilla::Some
 #include "mozilla/Span.h"    // mozilla::Span
 #include "mozilla/Vector.h"  // mozilla::Vector
 
-#include <stddef.h>  // ptrdiff_t
-#include <stdint.h>  // uint16_t, uint32_t
+#include <functional>  // std::function
+#include <stddef.h>    // ptrdiff_t
+#include <stdint.h>    // uint16_t, uint32_t
 
 #include "jsapi.h"  // CompletionKind
 
 #include "frontend/AbstractScope.h"
 #include "frontend/BCEParserHandle.h"            // BCEParserHandle
 #include "frontend/BytecodeControlStructures.h"  // NestableControl
 #include "frontend/BytecodeOffset.h"             // BytecodeOffset
 #include "frontend/BytecodeSection.h"  // BytecodeSection, PerScriptData, CGScopeList
--- a/js/src/gc/ArenaList.h
+++ b/js/src/gc/ArenaList.h
@@ -257,18 +257,17 @@ class ArenaLists {
 
   enum class ConcurrentUse : uint32_t {
     None,
     BackgroundFinalize,
     ParallelAlloc
   };
 
   using ConcurrentUseState =
-      mozilla::Atomic<ConcurrentUse, mozilla::SequentiallyConsistent,
-                      mozilla::recordreplay::Behavior::DontPreserve>;
+      mozilla::Atomic<ConcurrentUse, mozilla::SequentiallyConsistent>;
 
   // Whether this structure can be accessed by other threads.
   UnprotectedData<AllAllocKindArray<ConcurrentUseState>> concurrentUseState_;
 
   ConcurrentUseState& concurrentUse(AllocKind i) {
     return concurrentUseState_.ref()[i];
   }
   ConcurrentUse concurrentUse(AllocKind i) const {
--- a/js/src/gc/AtomMarking.h
+++ b/js/src/gc/AtomMarking.h
@@ -29,19 +29,17 @@ class AtomMarkingRuntime {
     if (JSAtom* description = symbol->description()) {
       markAtom(cx, description);
     }
   }
 
  public:
   // The extent of all allocated and free words in atom mark bitmaps.
   // This monotonically increases and may be read from without locking.
-  mozilla::Atomic<size_t, mozilla::SequentiallyConsistent,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      allocatedWords;
+  mozilla::Atomic<size_t, mozilla::SequentiallyConsistent> allocatedWords;
 
   AtomMarkingRuntime() : allocatedWords(0) {}
 
   // Mark an arena as holding things in the atoms zone.
   void registerArena(Arena* arena, const AutoLockGC& lock);
 
   // Mark an arena as no longer holding things in the atoms zone.
   void unregisterArena(Arena* arena, const AutoLockGC& lock);
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -1700,18 +1700,17 @@ bool GCRuntime::shouldCompact() {
   }
 
   return !isIncremental ||
          !IsCurrentlyAnimating(rt->lastAnimationTime, TimeStamp::Now());
 }
 
 bool GCRuntime::isCompactingGCEnabled() const {
   return compactingEnabled &&
-         rt->mainContextFromOwnThread()->compactingDisabledCount == 0 &&
-         !mozilla::recordreplay::IsRecordingOrReplaying();
+         rt->mainContextFromOwnThread()->compactingDisabledCount == 0;
 }
 
 AutoDisableCompactingGC::AutoDisableCompactingGC(JSContext* cx) : cx(cx) {
   ++cx->compactingDisabledCount;
   if (cx->runtime()->gc.isIncrementalGCInProgress() &&
       cx->runtime()->gc.isCompactingGc()) {
     FinishGC(cx);
   }
@@ -2912,71 +2911,30 @@ void Nursery::requestMinorGC(JS::GCReaso
   if (minorGCRequested()) {
     return;
   }
 
   minorGCTriggerReason_ = reason;
   runtime()->mainContextFromOwnThread()->requestInterrupt(InterruptReason::GC);
 }
 
-// Return false if a pending GC may not occur because we are recording or
-// replaying. GCs must occur at the same points when replaying as they did
-// while recording, so any trigger reasons whose behavior is non-deterministic
-// between recording and replaying are excluded here.
-//
-// Non-deterministic behaviors here are very narrow: the amount of malloc'ed
-// memory or memory used by GC things may vary between recording or replaying,
-// but other behaviors that would normally be non-deterministic (timers and so
-// forth) are captured in the recording and replayed exactly.
-static bool RecordReplayCheckCanGC(JS::GCReason reason) {
-  if (!mozilla::recordreplay::IsRecordingOrReplaying()) {
-    return true;
-  }
-
-  switch (reason) {
-    case JS::GCReason::EAGER_ALLOC_TRIGGER:
-    case JS::GCReason::LAST_DITCH:
-    case JS::GCReason::TOO_MUCH_MALLOC:
-    case JS::GCReason::ALLOC_TRIGGER:
-    case JS::GCReason::DELAYED_ATOMS_GC:
-    case JS::GCReason::TOO_MUCH_WASM_MEMORY:
-    case JS::GCReason::TOO_MUCH_JIT_CODE:
-    case JS::GCReason::INCREMENTAL_ALLOC_TRIGGER:
-      return false;
-
-    default:
-      break;
-  }
-
-  // If the above filter misses a non-deterministically triggered GC, this
-  // assertion will fail.
-  mozilla::recordreplay::RecordReplayAssert("RecordReplayCheckCanGC %d",
-                                            (int)reason);
-  return true;
-}
-
 bool GCRuntime::triggerGC(JS::GCReason reason) {
   /*
    * Don't trigger GCs if this is being called off the main thread from
    * onTooMuchMalloc().
    */
   if (!CurrentThreadCanAccessRuntime(rt)) {
     return false;
   }
 
   /* GC is already running. */
   if (JS::RuntimeHeapIsCollecting()) {
     return false;
   }
 
-  // GCs can only be triggered in certain ways when recording/replaying.
-  if (!RecordReplayCheckCanGC(reason)) {
-    return false;
-  }
-
   JS::PrepareForFullGC(rt->mainContextFromOwnThread());
   requestMajorGC(reason);
   return true;
 }
 
 void GCRuntime::maybeAllocTriggerZoneGC(Zone* zone, size_t nbytes) {
   if (!CurrentThreadCanAccessRuntime(rt)) {
     // Zones in use by a helper thread can't be collected.
@@ -3107,21 +3065,16 @@ bool GCRuntime::triggerZoneGC(Zone* zone
                               size_t threshold) {
   MOZ_ASSERT(CurrentThreadCanAccessRuntime(rt));
 
   /* GC is already running. */
   if (JS::RuntimeHeapIsBusy()) {
     return false;
   }
 
-  // GCs can only be triggered in certain ways when recording/replaying.
-  if (!RecordReplayCheckCanGC(reason)) {
-    return false;
-  }
-
 #ifdef JS_GC_ZEAL
   if (hasZealMode(ZealMode::Alloc)) {
     MOZ_RELEASE_ASSERT(triggerGC(reason));
     return true;
   }
 #endif
 
   if (zone->isAtomsZone()) {
@@ -5456,20 +5409,16 @@ IncrementalProgress GCRuntime::markUntil
   gcstats::AutoPhase ap(stats(), phase);
   return markUntilBudgetExhausted(sliceBudget);
 }
 
 IncrementalProgress GCRuntime::markUntilBudgetExhausted(
     SliceBudget& sliceBudget) {
   // Run a marking slice and return whether the stack is now empty.
 
-  // Marked GC things may vary between recording and replaying, so marking
-  // and sweeping should not perform any recorded events.
-  mozilla::recordreplay::AutoDisallowThreadEvents disallow;
-
 #ifdef DEBUG
   AutoSetThreadIsMarking threadIsMarking;
 #endif  // DEBUG
 
   if (marker.processMarkQueue() == GCMarker::QueueYielded) {
     return NotFinished;
   }
 
@@ -6082,20 +6031,16 @@ bool GCRuntime::initSweepActions() {
                        Call(&GCRuntime::sweepShapeTree))),
           Call(&GCRuntime::releaseSweptEmptyArenas),
           Call(&GCRuntime::endSweepingSweepGroup)));
 
   return sweepActions != nullptr;
 }
 
 IncrementalProgress GCRuntime::performSweepActions(SliceBudget& budget) {
-  // Marked GC things may vary between recording and replaying, so sweep
-  // actions should not perform any recorded events.
-  mozilla::recordreplay::AutoDisallowThreadEvents disallow;
-
   gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::SWEEP);
   JSFreeOp fop(rt);
 
   // Kick off a parallel task to drain the mark stack, except in the first sweep
   // slice where we must not yield to the mutator until we've starting sweeping
   // a sweep group. The stack must be empty in that case.
   MOZ_ASSERT(initialState <= State::Sweep);
   MOZ_ASSERT_IF(initialState != State::Sweep, marker.isDrained());
@@ -7294,21 +7239,16 @@ SliceBudget GCRuntime::defaultBudget(JS:
       millis = defaultSliceBudgetMS();
     }
   }
 
   return SliceBudget(TimeBudget(millis));
 }
 
 void GCRuntime::gc(JSGCInvocationKind gckind, JS::GCReason reason) {
-  // Watch out for calls to gc() that don't go through triggerGC().
-  if (!RecordReplayCheckCanGC(reason)) {
-    return;
-  }
-
   collect(true, SliceBudget::unlimited(), mozilla::Some(gckind), reason);
 }
 
 void GCRuntime::startGC(JSGCInvocationKind gckind, JS::GCReason reason,
                         int64_t millis) {
   MOZ_ASSERT(!isIncrementalGCInProgress());
   if (!JS::IsIncrementalGCEnabled(rt->mainContextFromOwnThread())) {
     gc(gckind, reason);
@@ -8271,18 +8211,17 @@ JS_PUBLIC_API void JS::SetLowMemoryState
   return cx->runtime()->gc.setLowMemoryState(newState);
 }
 
 JS_PUBLIC_API void JS::DisableIncrementalGC(JSContext* cx) {
   cx->runtime()->gc.disallowIncrementalGC();
 }
 
 JS_PUBLIC_API bool JS::IsIncrementalGCEnabled(JSContext* cx) {
-  return cx->runtime()->gc.isIncrementalGCEnabled() &&
-         !mozilla::recordreplay::IsRecordingOrReplaying();
+  return cx->runtime()->gc.isIncrementalGCEnabled();
 }
 
 JS_PUBLIC_API bool JS::IsIncrementalGCInProgress(JSContext* cx) {
   return cx->runtime()->gc.isIncrementalGCInProgress();
 }
 
 JS_PUBLIC_API bool JS::IsIncrementalGCInProgress(JSRuntime* rt) {
   return rt->gc.isIncrementalGCInProgress() &&
--- a/js/src/gc/GCParallelTask.h
+++ b/js/src/gc/GCParallelTask.h
@@ -65,19 +65,17 @@ class GCParallelTask : public mozilla::L
 
   // Amount of time this task took to execute.
   MainThreadOrGCTaskData<mozilla::TimeDuration> duration_;
 
   explicit GCParallelTask(const GCParallelTask&) = delete;
 
  protected:
   // A flag to signal a request for early completion of the off-thread task.
-  mozilla::Atomic<bool, mozilla::MemoryOrdering::ReleaseAcquire,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      cancel_;
+  mozilla::Atomic<bool, mozilla::MemoryOrdering::ReleaseAcquire> cancel_;
 
  public:
   explicit GCParallelTask(gc::GCRuntime* gc)
       : gc(gc), state_(State::Idle), duration_(nullptr), cancel_(false) {}
   GCParallelTask(GCParallelTask&& other)
       : gc(other.gc),
         state_(other.state_),
         duration_(nullptr),
--- a/js/src/gc/GCRuntime.h
+++ b/js/src/gc/GCRuntime.h
@@ -790,19 +790,17 @@ class GCRuntime {
  public:
   ZoneVector& zones() { return zones_.ref(); }
 
   // The unique atoms zone.
   WriteOnceData<Zone*> atomsZone;
 
  private:
   // Any activity affecting the heap.
-  mozilla::Atomic<JS::HeapState, mozilla::SequentiallyConsistent,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      heapState_;
+  mozilla::Atomic<JS::HeapState, mozilla::SequentiallyConsistent> heapState_;
   friend class AutoHeapSession;
   friend class JS::AutoEnterCycleCollection;
 
   UnprotectedData<gcstats::Statistics> stats_;
 
  public:
   gcstats::Statistics& stats() { return stats_.ref(); }
 
@@ -838,42 +836,36 @@ class GCRuntime {
 
   // When all arenas in a chunk are used, it is moved to the fullChunks pool
   // so as to reduce the cost of operations on the available lists.
   GCLockData<ChunkPool> fullChunks_;
 
   MainThreadData<RootedValueMap> rootsHash;
 
   // An incrementing id used to assign unique ids to cells that require one.
-  mozilla::Atomic<uint64_t, mozilla::ReleaseAcquire,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      nextCellUniqueId_;
+  mozilla::Atomic<uint64_t, mozilla::ReleaseAcquire> nextCellUniqueId_;
 
   /*
    * Number of the committed arenas in all GC chunks including empty chunks.
    */
-  mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      numArenasFreeCommitted;
+  mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire> numArenasFreeCommitted;
   MainThreadData<VerifyPreTracer*> verifyPreData;
 
  private:
   MainThreadData<mozilla::TimeStamp> lastGCStartTime_;
   MainThreadData<mozilla::TimeStamp> lastGCEndTime_;
 
   /*
    * JSGC_MODE
    * prefs: javascript.options.mem.gc_per_zone and
    *   javascript.options.mem.gc_incremental.
    */
   MainThreadData<JSGCMode> mode;
 
-  mozilla::Atomic<size_t, mozilla::ReleaseAcquire,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      numActiveZoneIters;
+  mozilla::Atomic<size_t, mozilla::ReleaseAcquire> numActiveZoneIters;
 
   /*
    * The self hosting zone is collected once after initialization. We don't
    * allow allocation after this point and we don't collect it again.
    */
   WriteOnceData<bool> selfHostingZoneFrozen;
 
   /* During shutdown, the GC needs to clean up every possible object. */
@@ -901,19 +893,17 @@ class GCRuntime {
   }
 
   /*
    * The gray bits can become invalid if UnmarkGray overflows the stack. A
    * full GC will reset this bit, since it fills in all the gray bits.
    */
   UnprotectedData<bool> grayBitsValid;
 
-  mozilla::Atomic<JS::GCReason, mozilla::Relaxed,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      majorGCTriggerReason;
+  mozilla::Atomic<JS::GCReason, mozilla::Relaxed> majorGCTriggerReason;
 
  private:
   /* Perform full GC if rt->keepAtoms() becomes false. */
   MainThreadData<bool> fullGCForAtomsRequested_;
 
   /* Incremented at the start of every minor GC. */
   MainThreadData<uint64_t> minorGCNumber;
 
--- a/js/src/gc/Marking.cpp
+++ b/js/src/gc/Marking.cpp
@@ -3891,20 +3891,16 @@ void UnmarkGrayTracer::unmark(JS::GCCell
     return;
   }
 }
 
 bool js::gc::UnmarkGrayGCThingUnchecked(JSRuntime* rt, JS::GCCellPtr thing) {
   MOZ_ASSERT(thing);
   MOZ_ASSERT(thing.asCell()->isMarkedGray());
 
-  // Gray cell unmarking can occur at different points between recording and
-  // replay, so disallow recorded events from occurring in the tracer.
-  mozilla::recordreplay::AutoDisallowThreadEvents d;
-
   AutoGeckoProfilerEntry profilingStackFrame(
       TlsContext.get(), "UnmarkGrayGCThing", JS::ProfilingCategoryPair::GCCC);
 
   UnmarkGrayTracer unmarker(rt);
   // We don't record phaseTimes when we're running on a helper thread.
   bool enable = TlsContext.get()->isMainThreadContext();
   gcstats::AutoPhase innerPhase(rt->gc.stats(), enable,
                                 gcstats::PhaseKind::UNMARK_GRAY);
--- a/js/src/gc/Memory.cpp
+++ b/js/src/gc/Memory.cpp
@@ -57,23 +57,19 @@ static size_t virtualMemoryLimit = size_
  * workarounds to obtain 47-bit pointers cause addresses to be handed out in
  * increasing order.
  *
  * We do not use the growth direction on Windows, as constraints on VirtualAlloc
  * would make its application failure prone and complex. Tests indicate that
  * VirtualAlloc always hands out regions of memory in increasing order.
  */
 #if defined(XP_DARWIN)
-static mozilla::Atomic<int, mozilla::Relaxed,
-                       mozilla::recordreplay::Behavior::DontPreserve>
-    growthDirection(1);
+static mozilla::Atomic<int, mozilla::Relaxed> growthDirection(1);
 #elif defined(XP_UNIX)
-static mozilla::Atomic<int, mozilla::Relaxed,
-                       mozilla::recordreplay::Behavior::DontPreserve>
-    growthDirection(0);
+static mozilla::Atomic<int, mozilla::Relaxed> growthDirection(0);
 #endif
 
 /*
  * Data from OOM crashes shows there may be up to 24 chunk-sized but unusable
  * chunks available in low memory situations. These chunks may all need to be
  * used up before we gain access to remaining *alignable* chunk-sized regions,
  * so we use a generous limit of 32 unusable chunks to ensure we reach them.
  */
@@ -263,17 +259,16 @@ static inline uint64_t GetNumberInRange(
   const uint64_t MaxRand = UINT64_C(0xffffffffffffffff);
   maxNum -= minNum;
   uint64_t binSize = 1 + (MaxRand - maxNum) / (maxNum + 1);
 
   uint64_t rndNum;
   do {
     mozilla::Maybe<uint64_t> result;
     do {
-      mozilla::recordreplay::AutoPassThroughThreadEvents pt;
       result = mozilla::RandomUint64();
     } while (!result);
     rndNum = result.value() / binSize;
   } while (rndNum > maxNum);
 
   return minNum + rndNum;
 }
 
@@ -830,19 +825,16 @@ bool MarkPagesInUseHard(void* region, si
   return VirtualAlloc(region, length, MEM_COMMIT,
                       DWORD(PageAccess::ReadWrite)) == region;
 #else
   return true;
 #endif
 }
 
 size_t GetPageFaultCount() {
-  if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-    return 0;
-  }
 #ifdef XP_WIN
   PROCESS_MEMORY_COUNTERS pmc;
   if (GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc)) == 0) {
     return 0;
   }
   return pmc.PageFaultCount;
 #else
   struct rusage usage;
--- a/js/src/gc/Nursery.cpp
+++ b/js/src/gc/Nursery.cpp
@@ -240,22 +240,16 @@ js::Nursery::Nursery(GCRuntime* gc)
   }
   env = getenv("MOZ_NURSERY_BIGINTS");
   if (env && *env) {
     canAllocateBigInts_ = (*env == '1');
   }
 }
 
 bool js::Nursery::init(AutoLockGCBgAlloc& lock) {
-  // The nursery is permanently disabled when recording or replaying. Nursery
-  // collections may occur at non-deterministic points in execution.
-  if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-    return true;
-  }
-
   capacity_ = roundSize(tunables().gcMinNurseryBytes());
   if (!allocateNextChunk(0, lock)) {
     capacity_ = 0;
     return false;
   }
   // After this point the Nursery has been enabled.
 
   setCurrentChunk(0);
@@ -294,17 +288,17 @@ bool js::Nursery::init(AutoLockGCBgAlloc
   return true;
 }
 
 js::Nursery::~Nursery() { disable(); }
 
 void js::Nursery::enable() {
   MOZ_ASSERT(isEmpty());
   MOZ_ASSERT(!gc->isVerifyPreBarriersEnabled());
-  if (isEnabled() || mozilla::recordreplay::IsRecordingOrReplaying()) {
+  if (isEnabled()) {
     return;
   }
 
   {
     AutoLockGCBgAlloc lock(gc);
     capacity_ = roundSize(tunables().gcMinNurseryBytes());
     if (!allocateNextChunk(0, lock)) {
       capacity_ = 0;
@@ -959,18 +953,16 @@ static inline bool IsFullStoreBufferReas
          reason == JS::GCReason::FULL_SLOT_BUFFER ||
          reason == JS::GCReason::FULL_SHAPE_BUFFER;
 }
 
 void js::Nursery::collect(JS::GCReason reason) {
   JSRuntime* rt = runtime();
   MOZ_ASSERT(!rt->mainContextFromOwnThread()->suppressGC);
 
-  mozilla::recordreplay::AutoDisallowThreadEvents disallow;
-
   if (!isEnabled() || isEmpty()) {
     // Our barriers are not always exact, and there may be entries in the
     // storebuffer even when the nursery is disabled or empty. It's not safe
     // to keep these entries as they may refer to tenured cells which may be
     // freed after this point.
     gc->storeBuffer().clear();
   }
 
--- a/js/src/gc/Scheduling.h
+++ b/js/src/gc/Scheduling.h
@@ -675,19 +675,17 @@ class GCSchedulingState {
 enum class TriggerKind { None, Incremental, NonIncremental };
 
 struct TriggerResult {
   TriggerKind kind;
   size_t usedBytes;
   size_t thresholdBytes;
 };
 
-using AtomicByteCount =
-    mozilla::Atomic<size_t, mozilla::ReleaseAcquire,
-                    mozilla::recordreplay::Behavior::DontPreserve>;
+using AtomicByteCount = mozilla::Atomic<size_t, mozilla::ReleaseAcquire>;
 
 /*
  * Tracks the size of allocated data. This is used for both GC and malloc data.
  * It automatically maintains the memory usage relationship between parent and
  * child instances, i.e. between those in a GCRuntime and its Zones.
  */
 class HeapSize {
   /*
--- a/js/src/gc/Statistics.h
+++ b/js/src/gc/Statistics.h
@@ -344,20 +344,18 @@ struct Statistics {
   TimeStamp timedGCStart;
   TimeDuration timedGCTime;
 
   /* Total time in a given phase for this GC. */
   PhaseTimeTable phaseTimes;
   PhaseTimeTable parallelTimes;
 
   /* Number of events of this type for this GC. */
-  EnumeratedArray<
-      Count, COUNT_LIMIT,
-      mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire,
-                      mozilla::recordreplay::Behavior::DontPreserve>>
+  EnumeratedArray<Count, COUNT_LIMIT,
+                  mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire>>
       counts;
 
   /* Other GC statistics. */
   EnumeratedArray<Stat, STAT_LIMIT, uint32_t> stats;
 
   /*
    * These events cannot be kept in the above array, we need to take their
    * address.
--- a/js/src/gc/Zone.h
+++ b/js/src/gc/Zone.h
@@ -175,18 +175,17 @@ namespace JS {
 // to delete the last compartment in a live zone.
 class Zone : public js::ZoneAllocator, public js::gc::GraphNodeBase<JS::Zone> {
  private:
   js::WriteOnceData<bool> isAtomsZone_;
   js::WriteOnceData<bool> isSelfHostingZone_;
   js::WriteOnceData<bool> isSystemZone_;
 
   enum class HelperThreadUse : uint32_t { None, Pending, Active };
-  mozilla::Atomic<HelperThreadUse, mozilla::SequentiallyConsistent,
-                  mozilla::recordreplay::Behavior::DontPreserve>
+  mozilla::Atomic<HelperThreadUse, mozilla::SequentiallyConsistent>
       helperThreadUse_;
 
   // The helper thread context with exclusive access to this zone, if
   // usedByHelperThread(), or nullptr when on the main thread.
   js::UnprotectedData<JSContext*> helperThreadOwnerContext_;
 
  public:
   js::gc::ArenaLists arenas;
@@ -226,19 +225,17 @@ class Zone : public js::ZoneAllocator, p
   js::MainThreadData<unsigned> gcSweepGroupIndex;
 #endif
 
  private:
   // Side map for storing unique ids for cells, independent of address.
   js::ZoneOrGCTaskData<js::gc::UniqueIdMap> uniqueIds_;
 
   // Number of allocations since the most recent minor GC for this thread.
-  mozilla::Atomic<uint32_t, mozilla::Relaxed,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      tenuredAllocsSinceMinorGC_;
+  mozilla::Atomic<uint32_t, mozilla::Relaxed> tenuredAllocsSinceMinorGC_;
 
   // Live weakmaps in this zone.
   js::ZoneOrGCTaskData<mozilla::LinkedList<js::WeakMapBase>> gcWeakMapList_;
 
   // The set of compartments in this zone.
   using CompartmentVector =
       js::Vector<JS::Compartment*, 1, js::SystemAllocPolicy>;
   js::MainThreadOrGCTaskData<CompartmentVector> compartments_;
--- a/js/src/jit/BaselineBailouts.cpp
+++ b/js/src/jit/BaselineBailouts.cpp
@@ -476,19 +476,16 @@ static jsbytecode* GetResumePC(JSScript*
   while (true) {
     pc = GetNextNonLoopHeadPc(pc, &skippedLoopHead);
     fasterPc = GetNextNonLoopHeadPc(fasterPc, &skippedLoopHead);
     fasterPc = GetNextNonLoopHeadPc(fasterPc, &skippedLoopHead);
     if (fasterPc == pc) {
       break;
     }
   }
-  if (skippedLoopHead && script->trackRecordReplayProgress()) {
-    mozilla::recordreplay::AdvanceExecutionProgressCounter();
-  }
 
   return pc;
 }
 
 static bool HasLiveStackValueAtDepth(JSContext* cx, HandleScript script,
                                      jsbytecode* pc, uint32_t stackSlotIndex,
                                      uint32_t stackDepth) {
   // Return true iff stackSlotIndex is a stack value that's part of an active
--- a/js/src/jit/BaselineCodeGen.cpp
+++ b/js/src/jit/BaselineCodeGen.cpp
@@ -2243,33 +2243,17 @@ bool BaselineCodeGen<Handler>::emit_Loop
     return false;
   }
   if (!emitInterruptCheck()) {
     return false;
   }
   if (!emitWarmUpCounterIncrement()) {
     return false;
   }
-  return emitIncExecutionProgressCounter(R0.scratchReg());
-}
-
-template <typename Handler>
-bool BaselineCodeGen<Handler>::emitIncExecutionProgressCounter(
-    Register scratch) {
-  if (!mozilla::recordreplay::IsRecordingOrReplaying()) {
-    return true;
-  }
-
-  auto incCounter = [this]() {
-    masm.inc64(
-        AbsoluteAddress(mozilla::recordreplay::ExecutionProgressCounter()));
-    return true;
-  };
-  return emitTestScriptFlag(JSScript::MutableFlags::TrackRecordReplayProgress,
-                            true, incCounter, scratch);
+  return true;
 }
 
 template <typename Handler>
 bool BaselineCodeGen<Handler>::emit_Void() {
   frame.pop();
   frame.push(UndefinedValue());
   return true;
 }
@@ -6729,20 +6713,16 @@ bool BaselineCodeGen<Handler>::emitProlo
   masm.moveStackPtrTo(BaselineFrameReg);
   masm.subFromStackPtr(Imm32(BaselineFrame::Size()));
 
   // Initialize BaselineFrame. Also handles env chain pre-initialization (in
   // case GC gets run during stack check). For global and eval scripts, the env
   // chain is in R1. For function scripts, the env chain is in the callee.
   emitInitFrameFields(R1.scratchReg());
 
-  if (!emitIncExecutionProgressCounter(R2.scratchReg())) {
-    return false;
-  }
-
   // When compiling with Debugger instrumentation, set the debuggeeness of
   // the frame before any operation that can call into the VM.
   if (!emitIsDebuggeeCheck()) {
     return false;
   }
 
   // Initialize the env chain before any operation that may call into the VM and
   // trigger a GC.
--- a/js/src/jit/BaselineCodeGen.h
+++ b/js/src/jit/BaselineCodeGen.h
@@ -169,18 +169,16 @@ class BaselineCodeGen {
   MOZ_MUST_USE bool emitEnterGeneratorCode(Register script,
                                            Register resumeIndex,
                                            Register scratch);
 
   void emitInterpJumpToResumeEntry(Register script, Register resumeIndex,
                                    Register scratch);
   void emitJumpToInterpretOpLabel();
 
-  MOZ_MUST_USE bool emitIncExecutionProgressCounter(Register scratch);
-
   MOZ_MUST_USE bool emitCheckThis(ValueOperand val, bool reinit = false);
   void emitLoadReturnValue(ValueOperand val);
   void emitPushNonArrowFunctionNewTarget();
   void emitGetAliasedVar(ValueOperand dest);
 
   MOZ_MUST_USE bool emitNextIC();
   MOZ_MUST_USE bool emitInterruptCheck();
   MOZ_MUST_USE bool emitWarmUpCounterIncrement();
--- a/js/src/jit/CacheIRCompiler.cpp
+++ b/js/src/jit/CacheIRCompiler.cpp
@@ -4796,21 +4796,16 @@ void CacheIRCompiler::emitRegisterEnumer
 }
 
 void CacheIRCompiler::emitPostBarrierShared(Register obj,
                                             const ConstantOrRegister& val,
                                             Register scratch,
                                             Register maybeIndex) {
   JitSpew(JitSpew_Codegen, "%s", __FUNCTION__);
 
-  // Generational GC is disabled for WebReplay.
-  if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-    return;
-  }
-
   if (val.constant()) {
     MOZ_ASSERT_IF(val.value().isGCThing(),
                   !IsInsideNursery(val.value().toGCThing()));
     return;
   }
 
   TypedOrValueRegister reg = val.reg();
   if (reg.hasTyped()) {
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -13015,21 +13015,16 @@ void CodeGenerator::visitAssertRangeV(LA
   masm.bind(&done);
 }
 
 void CodeGenerator::visitInterruptCheck(LInterruptCheck* lir) {
   using Fn = bool (*)(JSContext*);
   OutOfLineCode* ool =
       oolCallVM<Fn, InterruptCheck>(lir, ArgList(), StoreNothing());
 
-  if (lir->mir()->trackRecordReplayProgress()) {
-    masm.inc64(
-        AbsoluteAddress(mozilla::recordreplay::ExecutionProgressCounter()));
-  }
-
   const void* interruptAddr = gen->runtime->addressOfInterruptBits();
   masm.branch32(Assembler::NotEqual, AbsoluteAddress(interruptAddr), Imm32(0),
                 ool->entry());
   masm.bind(ool->rejoin());
 }
 
 void CodeGenerator::visitWasmInterruptCheck(LWasmInterruptCheck* lir) {
   MOZ_ASSERT(gen->compilingWasm());
--- a/js/src/jit/CompileInfo.h
+++ b/js/src/jit/CompileInfo.h
@@ -165,17 +165,16 @@ class CompileInfo {
       : script_(script),
         fun_(fun),
         osrPc_(osrPc),
         analysisMode_(analysisMode),
         scriptNeedsArgsObj_(scriptNeedsArgsObj),
         hadOverflowBailout_(script->hadOverflowBailout()),
         hadFrequentBailouts_(script->hadFrequentBailouts()),
         mayReadFrameArgsDirectly_(script->mayReadFrameArgsDirectly()),
-        trackRecordReplayProgress_(script->trackRecordReplayProgress()),
         inlineScriptTree_(inlineScriptTree) {
     MOZ_ASSERT_IF(osrPc, JSOp(*osrPc) == JSOp::LoopHead);
 
     // The function here can flow in from anywhere so look up the canonical
     // function to ensure that we do not try to embed a nursery pointer in
     // jit-code. Precisely because it can flow in from anywhere, it's not
     // guaranteed to be non-lazy. Hence, don't access its script!
     if (fun_) {
@@ -226,17 +225,16 @@ class CompileInfo {
       : script_(nullptr),
         fun_(nullptr),
         osrPc_(nullptr),
         analysisMode_(Analysis_None),
         scriptNeedsArgsObj_(false),
         hadOverflowBailout_(false),
         hadFrequentBailouts_(false),
         mayReadFrameArgsDirectly_(false),
-        trackRecordReplayProgress_(false),
         inlineScriptTree_(nullptr),
         needsBodyEnvironmentObject_(false),
         funNeedsSomeEnvironmentObject_(false) {
     nimplicit_ = 0;
     nargs_ = 0;
     nlocals_ = nlocals;
     nstack_ = 1; /* For FunctionCompiler::pushPhiInput/popPhiOutput */
     nslots_ = nlocals_ + nstack_;
@@ -477,17 +475,16 @@ class CompileInfo {
     return true;
   }
 
   // Check previous bailout states to prevent doing the same bailout in the
   // next compilation.
   bool hadOverflowBailout() const { return hadOverflowBailout_; }
   bool hadFrequentBailouts() const { return hadFrequentBailouts_; }
   bool mayReadFrameArgsDirectly() const { return mayReadFrameArgsDirectly_; }
-  bool trackRecordReplayProgress() const { return trackRecordReplayProgress_; }
 
  private:
   unsigned nimplicit_;
   unsigned nargs_;
   unsigned nlocals_;
   unsigned nstack_;
   unsigned nslots_;
   mozilla::Maybe<unsigned> thisSlotForDerivedClassConstructor_;
@@ -502,17 +499,16 @@ class CompileInfo {
   bool scriptNeedsArgsObj_;
 
   // Record the state of previous bailouts in order to prevent compiling the
   // same function identically the next time.
   bool hadOverflowBailout_;
   bool hadFrequentBailouts_;
 
   bool mayReadFrameArgsDirectly_;
-  bool trackRecordReplayProgress_;
 
   InlineScriptTree* inlineScriptTree_;
 
   // Whether a script needs environments within its body. This informs us
   // that the environment chain is not easy to reconstruct.
   bool needsBodyEnvironmentObject_;
   bool funNeedsSomeEnvironmentObject_;
 };
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -1110,24 +1110,16 @@ AbortReasonOr<Ok> IonBuilder::buildInlin
 #ifdef DEBUG
   if (script_->argumentsHasVarBinding()) {
     hasLazyArguments_ = true;
   }
 #endif
 
   insertRecompileCheck(pc);
 
-  // Insert an interrupt check when recording or replaying, which will bump
-  // the record/replay system's progress counter.
-  if (script()->trackRecordReplayProgress()) {
-    MInterruptCheck* check = MInterruptCheck::New(alloc());
-    check->setTrackRecordReplayProgress();
-    current->add(check);
-  }
-
   // Initialize the env chain now that all resume points operands are
   // initialized.
   MOZ_TRY(initEnvironmentChain(callInfo.fun()));
 
   auto clearLastPriorResumePoint = mozilla::MakeScopeExit([&] {
     // Discard unreferenced & pre-allocated resume points.
     replaceMaybeFallbackFunctionGetter(nullptr);
   });
@@ -1816,24 +1808,16 @@ AbortReasonOr<Ok> IonBuilder::visitBackE
 
 AbortReasonOr<Ok> IonBuilder::emitLoopHeadInstructions(jsbytecode* pc) {
   MOZ_ASSERT(JSOp(*pc) == JSOp::LoopHead);
 
   MInterruptCheck* check = MInterruptCheck::New(alloc());
   current->add(check);
   insertRecompileCheck(pc);
 
-  if (script()->trackRecordReplayProgress()) {
-    check->setTrackRecordReplayProgress();
-
-    // When recording/replaying, MInterruptCheck is effectful and should
-    // not reexecute after bailing out.
-    MOZ_TRY(resumeAfter(check));
-  }
-
   return Ok();
 }
 
 AbortReasonOr<Ok> IonBuilder::inspectOpcode(JSOp op, bool* restarted) {
   // Add not yet implemented opcodes at the bottom of the switch!
   switch (op) {
     case JSOp::NopDestructuring:
     case JSOp::TryDestructuring:
@@ -6159,24 +6143,16 @@ AbortReasonOr<Ok> IonBuilder::jsop_call(
 
 AbortReasonOr<bool> IonBuilder::testShouldDOMCall(TypeSet* inTypes,
                                                   JSFunction* func,
                                                   JSJitInfo::OpType opType) {
   if (!func->isNative() || !func->hasJitInfo()) {
     return false;
   }
 
-  // Some DOM optimizations cause execution to skip over recorded events such
-  // as wrapper cache accesses, e.g. through GVN or loop hoisting of the
-  // expression which performs the event. Disable DOM optimizations when
-  // recording or replaying to avoid this problem.
-  if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-    return false;
-  }
-
   // If all the DOM objects flowing through are legal with this
   // property, we can bake in a call to the bottom half of the DOM
   // accessor
   DOMInstanceClassHasProtoAtDepth instanceChecker =
       realm->runtime()->DOMcallbacks()->instanceClassMatchesProto;
 
   const JSJitInfo* jinfo = func->jitInfo();
   if (jinfo->type() != opType) {
@@ -6502,23 +6478,20 @@ AbortReasonOr<Ok> IonBuilder::jsop_eval(
       return pushTypeBarrier(string, types, BarrierKind::TypeSet);
     }
 
     MOZ_TRY(jsop_newtarget());
     MDefinition* newTargetValue = current->pop();
 
     // Try to pattern match 'eval(v + "()")'. In this case v is likely a
     // name on the env chain and the eval is performing a call on that
-    // value. Use an env chain lookup rather than a full eval. Avoid this
-    // optimization if we're tracking script progress, as this will not
-    // execute the script and give an inconsistent progress count.
+    // value. Use an env chain lookup rather than a full eval.
     if (string->isConcat() &&
         string->getOperand(1)->type() == MIRType::String &&
-        string->getOperand(1)->maybeConstantValue() &&
-        !script()->trackRecordReplayProgress()) {
+        string->getOperand(1)->maybeConstantValue()) {
       JSAtom* atom =
           &string->getOperand(1)->maybeConstantValue()->toString()->asAtom();
 
       if (StringEqualsLiteral(atom, "()")) {
         MDefinition* name = string->getOperand(0);
         MInstruction* dynamicName =
             MGetDynamicName::New(alloc(), envChain, name);
         current->add(dynamicName);
@@ -8254,20 +8227,16 @@ AbortReasonOr<Ok> IonBuilder::loadStatic
 
   return loadSlot(obj, slot, NumFixedSlots(staticObject), rvalType, barrier,
                   types);
 }
 
 // Whether a write of the given value may need a post-write barrier for GC
 // purposes.
 bool IonBuilder::needsPostBarrier(MDefinition* value) {
-  // Generational GC is disabled for WebReplay.
-  if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-    return false;
-  }
   CompileZone* zone = realm->zone();
   if (value->mightBeType(MIRType::Object)) {
     return true;
   }
   if (value->mightBeType(MIRType::String) &&
       zone->canNurseryAllocateStrings()) {
     return true;
   }
--- a/js/src/jit/JitRealm.h
+++ b/js/src/jit/JitRealm.h
@@ -222,18 +222,17 @@ class JitRuntime {
   // The number of possible bailing places encounters before forcefully bailing
   // in that place. Zero means inactive.
   MainThreadData<uint32_t> ionBailAfter_;
 #endif
 
   // Number of Ion compilations which were finished off thread and are
   // waiting to be lazily linked. This is only set while holding the helper
   // thread state lock, but may be read from at other times.
-  typedef mozilla::Atomic<size_t, mozilla::SequentiallyConsistent,
-                          mozilla::recordreplay::Behavior::DontPreserve>
+  typedef mozilla::Atomic<size_t, mozilla::SequentiallyConsistent>
       NumFinishedOffThreadTasksType;
   NumFinishedOffThreadTasksType numFinishedOffThreadTasks_;
 
   // List of Ion compilation waiting to get linked.
   using IonCompileTaskList = mozilla::LinkedList<js::jit::IonCompileTask>;
   MainThreadData<IonCompileTaskList> ionLazyLinkList_;
   MainThreadData<size_t> ionLazyLinkListSize_;
 
--- a/js/src/jit/JitScript.h
+++ b/js/src/jit/JitScript.h
@@ -176,19 +176,17 @@ class alignas(uintptr_t) JitScript final
 
   // Ion code for this script. Either nullptr, IonDisabledScriptPtr,
   // IonCompilingScriptPtr or a valid IonScript*.
   IonScript* ionScript_ = nullptr;
 
   // Number of times the script has been called or has had backedges taken.
   // Reset if the script's JIT code is forcibly discarded. See also the
   // ScriptWarmUpData class.
-  mozilla::Atomic<uint32_t, mozilla::Relaxed,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      warmUpCount_ = {};
+  mozilla::Atomic<uint32_t, mozilla::Relaxed> warmUpCount_ = {};
 
   // Offset of the StackTypeSet array.
   uint32_t typeSetOffset_ = 0;
 
   // Offset of the bytecode type map.
   uint32_t bytecodeTypeMapOffset_ = 0;
 
   // This field is used to avoid binary searches for the sought entry when
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -6289,31 +6289,23 @@ class MCheckOverRecursed : public MNulla
   INSTRUCTION_HEADER(CheckOverRecursed)
   TRIVIAL_NEW_WRAPPERS
 
   AliasSet getAliasSet() const override { return AliasSet::None(); }
 };
 
 // Check whether we need to fire the interrupt handler.
 class MInterruptCheck : public MNullaryInstruction {
-  bool trackRecordReplayProgress_;
-
-  MInterruptCheck()
-      : MNullaryInstruction(classOpcode), trackRecordReplayProgress_(false) {
-    setGuard();
-  }
+  MInterruptCheck() : MNullaryInstruction(classOpcode) { setGuard(); }
 
  public:
   INSTRUCTION_HEADER(InterruptCheck)
   TRIVIAL_NEW_WRAPPERS
 
   AliasSet getAliasSet() const override { return AliasSet::None(); }
-
-  bool trackRecordReplayProgress() const { return trackRecordReplayProgress_; }
-  void setTrackRecordReplayProgress() { trackRecordReplayProgress_ = true; }
 };
 
 // Check whether we need to fire the interrupt handler (in wasm code).
 class MWasmInterruptCheck : public MUnaryInstruction,
                             public NoTypePolicy::Data {
   wasm::BytecodeOffset bytecodeOffset_;
 
   MWasmInterruptCheck(MDefinition* tlsPointer,
--- a/js/src/jit/MIRGenerator.h
+++ b/js/src/jit/MIRGenerator.h
@@ -128,19 +128,17 @@ class MIRGenerator final {
  private:
   // The CompileInfo for the outermost script.
   const CompileInfo* outerInfo_;
 
   const OptimizationInfo* optimizationInfo_;
   TempAllocator* alloc_;
   MIRGraph* graph_;
   AbortReasonOr<Ok> offThreadStatus_;
-  mozilla::Atomic<bool, mozilla::Relaxed,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      cancelBuild_;
+  mozilla::Atomic<bool, mozilla::Relaxed> cancelBuild_;
 
   uint32_t wasmMaxStackArgBytes_;
   bool needsOverrecursedCheck_;
   bool needsStaticStackAlignment_;
 
   bool instrumentedProfiling_;
   bool instrumentedProfilingIsCached_;
   bool safeForMinorGC_;
--- a/js/src/jit/ProcessExecutableMemory.cpp
+++ b/js/src/jit/ProcessExecutableMemory.cpp
@@ -505,19 +505,17 @@ class ProcessExecutableMemory {
   // ExecutableCodePageSize.
   uint8_t* base_;
 
   // The fields below should only be accessed while we hold the lock.
   Mutex lock_;
 
   // pagesAllocated_ is an Atomic so that bytesAllocated does not have to
   // take the lock.
-  mozilla::Atomic<size_t, mozilla::ReleaseAcquire,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      pagesAllocated_;
+  mozilla::Atomic<size_t, mozilla::ReleaseAcquire> pagesAllocated_;
 
   // Page where we should try to allocate next.
   size_t cursor_;
 
   mozilla::Maybe<mozilla::non_crypto::XorShift128PlusRNG> rng_;
   PageBitSet<MaxCodePages> pages_;
 
  public:
--- a/js/src/jit/shared/CodeGenerator-shared.cpp
+++ b/js/src/jit/shared/CodeGenerator-shared.cpp
@@ -111,21 +111,16 @@ bool CodeGeneratorShared::generateProlog
   masm.pushReturnAddress();
 #endif
 
   // If profiling, save the current frame pointer to a per-thread global field.
   if (isProfilerInstrumentationEnabled()) {
     masm.profilerEnterFrame(masm.getStackPointer(), CallTempReg0);
   }
 
-  if (gen->outerInfo().trackRecordReplayProgress()) {
-    masm.inc64(
-        AbsoluteAddress(mozilla::recordreplay::ExecutionProgressCounter()));
-  }
-
   // Ensure that the Ion frame is properly aligned.
   masm.assertStackAlignment(JitStackAlignment, 0);
 
   // Note that this automatically sets MacroAssembler::framePushed().
   masm.reserveStack(frameSize());
   masm.checkStackAlignment();
 
   if (JS::TraceLoggerSupported()) {
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -2696,24 +2696,16 @@ namespace JS {
  * If the given object is an exception object (or an unwrappable
  * cross-compartment wrapper for one), return the stack for that exception, if
  * any.  Will return null if the given object is not an exception object
  * (including if it's null or a security wrapper that can't be unwrapped) or if
  * the exception has no stack.
  */
 extern JS_PUBLIC_API JSObject* ExceptionStackOrNull(JS::HandleObject obj);
 
-/**
- * If this process is recording or replaying and the given value is an
- * exception object (or an unwrappable cross-compartment wrapper for one),
- * return the point where this exception was thrown, for time warping later.
- * Returns zero otherwise.
- */
-extern JS_PUBLIC_API uint64_t ExceptionTimeWarpTarget(JS::HandleValue exn);
-
 } /* namespace JS */
 
 /**
  * A JS context always has an "owner thread". The owner thread is set when the
  * context is created (to the current thread) and practically all entry points
  * into the JS engine check that a context (or anything contained in the
  * context: runtime, compartment, object, etc) is only touched by its owner
  * thread. Embeddings may check this invariant outside the JS engine by calling
--- a/js/src/jsexn.cpp
+++ b/js/src/jsexn.cpp
@@ -253,29 +253,16 @@ JS_PUBLIC_API JSObject* JS::ExceptionSta
   ErrorObject* obj = objArg->maybeUnwrapIf<ErrorObject>();
   if (!obj) {
     return nullptr;
   }
 
   return obj->stack();
 }
 
-JS_PUBLIC_API uint64_t JS::ExceptionTimeWarpTarget(JS::HandleValue value) {
-  if (!value.isObject()) {
-    return 0;
-  }
-
-  ErrorObject* obj = value.toObject().maybeUnwrapIf<ErrorObject>();
-  if (!obj) {
-    return 0;
-  }
-
-  return obj->timeWarpTarget();
-}
-
 JS_FRIEND_API JSLinearString* js::GetErrorTypeName(JSContext* cx,
                                                    int16_t exnType) {
   /*
    * JSEXN_INTERNALERR returns null to prevent that "InternalError: "
    * is prepended before "uncaught exception: "
    */
   if (exnType < 0 || exnType >= JSEXN_LIMIT || exnType == JSEXN_INTERNALERR ||
       exnType == JSEXN_WARN || exnType == JSEXN_NOTE) {
--- a/js/src/threading/Mutex.h
+++ b/js/src/threading/Mutex.h
@@ -3,16 +3,17 @@
 /* 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 threading_Mutex_h
 #define threading_Mutex_h
 
 #include "mozilla/Assertions.h"
+#include "mozilla/Maybe.h"
 #include "mozilla/PlatformMutex.h"
 #include "mozilla/ThreadLocal.h"
 #include "mozilla/Vector.h"
 
 #include <utility>
 
 #include "threading/ThreadId.h"
 
@@ -30,19 +31,17 @@ struct MutexId {
 
 // The Mutex class below wraps mozilla::detail::MutexImpl, but we don't want to
 // use public inheritance, and private inheritance is problematic because
 // Mutex's friends can access the private parent class as if it was public
 // inheritance.  So use a data member, but for Mutex to access the data member
 // we must override it and make Mutex a friend.
 class MutexImpl : public mozilla::detail::MutexImpl {
  protected:
-  MutexImpl()
-      : mozilla::detail::MutexImpl(
-            mozilla::recordreplay::Behavior::DontPreserve) {}
+  MutexImpl() : mozilla::detail::MutexImpl() {}
 
   friend class Mutex;
 };
 
 // In debug builds, js::Mutex is a wrapper over MutexImpl that checks correct
 // locking order is observed.
 //
 // The class maintains a per-thread stack of currently-held mutexes to enable it
--- a/js/src/threading/ProtectedData.cpp
+++ b/js/src/threading/ProtectedData.cpp
@@ -9,18 +9,17 @@
 #include "gc/Zone.h"
 #include "vm/HelperThreads.h"
 #include "vm/JSContext.h"
 
 namespace js {
 
 #ifdef JS_HAS_PROTECTED_DATA_CHECKS
 
-/* static */ mozilla::Atomic<size_t, mozilla::SequentiallyConsistent,
-                             mozilla::recordreplay::Behavior::DontPreserve>
+/* static */ mozilla::Atomic<size_t, mozilla::SequentiallyConsistent>
     AutoNoteSingleThreadedRegion::count(0);
 
 template <AllowedHelperThread Helper>
 static inline bool OnHelperThread() {
   if (Helper == AllowedHelperThread::IonCompile ||
       Helper == AllowedHelperThread::GCTaskOrIonCompile) {
     if (CurrentThreadIsIonCompiling()) {
       return true;
--- a/js/src/threading/ProtectedData.h
+++ b/js/src/threading/ProtectedData.h
@@ -57,19 +57,17 @@ namespace js {
 // any ProtectedData checks.
 //
 // Note that in practice there may be multiple threads running when this class
 // is used, due to the presence of multiple runtimes in the process. When each
 // process has only a single runtime this will no longer be a concern.
 class MOZ_RAII AutoNoteSingleThreadedRegion {
  public:
 #ifdef JS_HAS_PROTECTED_DATA_CHECKS
-  static mozilla::Atomic<size_t, mozilla::SequentiallyConsistent,
-                         mozilla::recordreplay::Behavior::DontPreserve>
-      count;
+  static mozilla::Atomic<size_t, mozilla::SequentiallyConsistent> count;
   AutoNoteSingleThreadedRegion() { count++; }
   ~AutoNoteSingleThreadedRegion() { count--; }
 #else
   AutoNoteSingleThreadedRegion() {}
 #endif
 };
 
 // Class for protected data that may be written to any number of times. Checks
--- a/js/src/threading/posix/PosixThread.cpp
+++ b/js/src/threading/posix/PosixThread.cpp
@@ -101,17 +101,17 @@ void ThisThread::SetName(const char* nam
 #elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
   pthread_set_name_np(pthread_self(), name);
   rv = 0;
 #elif defined(__NetBSD__)
   rv = pthread_setname_np(pthread_self(), "%s", (void*)name);
 #else
   rv = pthread_setname_np(pthread_self(), name);
 #endif
-  MOZ_RELEASE_ASSERT(!rv || mozilla::recordreplay::IsRecordingOrReplaying());
+  MOZ_RELEASE_ASSERT(!rv);
 }
 
 void ThisThread::GetName(char* nameBuffer, size_t len) {
   MOZ_RELEASE_ASSERT(len >= 16);
 
   int rv = -1;
 #ifdef HAVE_PTHREAD_GETNAME_NP
   rv = pthread_getname_np(pthread_self(), nameBuffer, len);
--- a/js/src/util/StructuredSpewer.cpp
+++ b/js/src/util/StructuredSpewer.cpp
@@ -33,43 +33,37 @@ const StructuredSpewer::NameArray Struct
 #      define DEFAULT_SPEW_DIRECTORY "/data/local/tmp"
 #    else
 #      define DEFAULT_SPEW_DIRECTORY "."
 #    endif
 #  endif
 
 bool StructuredSpewer::ensureInitializationAttempted() {
   if (!outputInitializationAttempted_) {
-    // We cannot call getenv during record replay, so disable
-    // the spewer.
-    if (!mozilla::recordreplay::IsRecordingOrReplaying()) {
-      char filename[2048] = {0};
-      // For ease of use with Treeherder
-      if (getenv("SPEW_UPLOAD") && getenv("MOZ_UPLOAD_DIR")) {
-        SprintfLiteral(filename, "%s/spew_output", getenv("MOZ_UPLOAD_DIR"));
-      } else if (getenv("SPEW_FILE")) {
-        SprintfLiteral(filename, "%s", getenv("SPEW_FILE"));
-      } else {
-        SprintfLiteral(filename, "%s/spew_output", DEFAULT_SPEW_DIRECTORY);
-      }
-      tryToInitializeOutput(filename);
+    char filename[2048] = {0};
+    // For ease of use with Treeherder
+    if (getenv("SPEW_UPLOAD") && getenv("MOZ_UPLOAD_DIR")) {
+      SprintfLiteral(filename, "%s/spew_output", getenv("MOZ_UPLOAD_DIR"));
+    } else if (getenv("SPEW_FILE")) {
+      SprintfLiteral(filename, "%s", getenv("SPEW_FILE"));
+    } else {
+      SprintfLiteral(filename, "%s/spew_output", DEFAULT_SPEW_DIRECTORY);
     }
+    tryToInitializeOutput(filename);
     // We can't use the intialization state of the Fprinter, as it is not
     // marked as initialized in a case where we cannot open the output, so
     // we track the attempt separately.
     outputInitializationAttempted_ = true;
   }
 
   return json_.isSome();
 }
 
 void StructuredSpewer::tryToInitializeOutput(const char* path) {
-  static mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire,
-                         mozilla::recordreplay::Behavior::DontPreserve>
-      threadCounter;
+  static mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire> threadCounter;
 
   char suffix_path[2048] = {0};
   SprintfLiteral(suffix_path, "%s.%d.%d", path, getpid(), threadCounter++);
 
   if (!output_.init(suffix_path)) {
     // Returning here before we've emplaced the JSONPrinter
     // means this is effectively disabled, but fail earlier
     // we also disable all the bits
@@ -101,20 +95,16 @@ static bool MatchJSScript(JSScript* scri
   return result != nullptr;
 }
 
 bool StructuredSpewer::enabled(JSScript* script) {
   if (!spewingEnabled_) {
     return false;
   }
 
-  // We cannot call getenv under record/replay.
-  if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-    return false;
-  }
   static const char* pattern = getenv("SPEW_FILTER");
   if (!pattern || MatchJSScript(script, pattern)) {
     return true;
   }
   return false;
 }
 
 bool StructuredSpewer::enabled(JSContext* cx, const JSScript* script,
--- a/js/src/util/StructuredSpewer.h
+++ b/js/src/util/StructuredSpewer.h
@@ -107,20 +107,16 @@ class StructuredSpewFilter {
 
 class StructuredSpewer {
  public:
   StructuredSpewer()
       : outputInitializationAttempted_(false),
         spewingEnabled_(false),
         json_(mozilla::Nothing()),
         selectedChannels_() {
-    // If we are recording or replaying, we cannot use getenv
-    if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-      return;
-    }
     if (getenv("SPEW")) {
       parseSpewFlags(getenv("SPEW"));
     }
   }
 
   ~StructuredSpewer() { disableSpewing(); }
 
   void enableSpewing() { spewingEnabled_ = true; }
--- a/js/src/vm/ErrorObject-inl.h
+++ b/js/src/vm/ErrorObject-inl.h
@@ -30,14 +30,9 @@ inline uint32_t js::ErrorObject::columnN
   const HeapSlot& slot = getReservedSlotRef(COLUMNNUMBER_SLOT);
   return slot.isInt32() ? slot.toInt32() : 0;
 }
 
 inline JSObject* js::ErrorObject::stack() const {
   return getReservedSlotRef(STACK_SLOT).toObjectOrNull();
 }
 
-inline uint64_t js::ErrorObject::timeWarpTarget() const {
-  const HeapSlot& slot = getReservedSlotRef(TIME_WARP_SLOT);
-  return slot.isDouble() ? slot.toDouble() : 0;
-}
-
 #endif /* vm_ErrorObject_inl_h */
--- a/js/src/vm/ErrorObject.cpp
+++ b/js/src/vm/ErrorObject.cpp
@@ -5,17 +5,16 @@
  * 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 "vm/ErrorObject-inl.h"
 
 #include "mozilla/Assertions.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/DebugOnly.h"
-#include "mozilla/RecordReplay.h"
 
 #include <utility>
 
 #include "jsapi.h"
 #include "jsexn.h"
 #include "jsfriendapi.h"
 #include "jsnum.h"
 #include "jspubtd.h"
@@ -478,29 +477,16 @@ bool js::ErrorObject::init(JSContext* cx
   obj->initReservedSlot(FILENAME_SLOT, StringValue(fileName));
   obj->initReservedSlot(LINENUMBER_SLOT, Int32Value(lineNumber));
   obj->initReservedSlot(COLUMNNUMBER_SLOT, Int32Value(columnNumber));
   if (message) {
     obj->setSlotWithType(cx, messageShape, StringValue(message));
   }
   obj->initReservedSlot(SOURCEID_SLOT, Int32Value(sourceId));
 
-  // When recording/replaying and running on the main thread, get a counter
-  // which the devtools can use to warp to this point in the future.
-  if (mozilla::recordreplay::IsRecordingOrReplaying() &&
-      !cx->runtime()->parentRuntime) {
-    uint64_t timeWarpTarget = mozilla::recordreplay::NewTimeWarpTarget();
-
-    // Make sure we don't truncate the time warp target by storing it as a
-    // double.
-    MOZ_RELEASE_ASSERT(timeWarpTarget <
-                       uint64_t(DOUBLE_INTEGRAL_PRECISION_LIMIT));
-    obj->initReservedSlot(TIME_WARP_SLOT, DoubleValue(timeWarpTarget));
-  }
-
   return true;
 }
 
 /* static */
 ErrorObject* js::ErrorObject::create(JSContext* cx, JSExnType errorType,
                                      HandleObject stack, HandleString fileName,
                                      uint32_t sourceId, uint32_t lineNumber,
                                      uint32_t columnNumber,
--- a/js/src/vm/ErrorObject.h
+++ b/js/src/vm/ErrorObject.h
@@ -46,19 +46,18 @@ class ErrorObject : public NativeObject 
   static const uint32_t EXNTYPE_SLOT = 0;
   static const uint32_t STACK_SLOT = EXNTYPE_SLOT + 1;
   static const uint32_t ERROR_REPORT_SLOT = STACK_SLOT + 1;
   static const uint32_t FILENAME_SLOT = ERROR_REPORT_SLOT + 1;
   static const uint32_t LINENUMBER_SLOT = FILENAME_SLOT + 1;
   static const uint32_t COLUMNNUMBER_SLOT = LINENUMBER_SLOT + 1;
   static const uint32_t MESSAGE_SLOT = COLUMNNUMBER_SLOT + 1;
   static const uint32_t SOURCEID_SLOT = MESSAGE_SLOT + 1;
-  static const uint32_t TIME_WARP_SLOT = SOURCEID_SLOT + 1;
 
-  static const uint32_t RESERVED_SLOTS = TIME_WARP_SLOT + 1;
+  static const uint32_t RESERVED_SLOTS = SOURCEID_SLOT + 1;
 
  public:
   static const JSClass classes[JSEXN_ERROR_LIMIT];
 
   static const JSClass* classForType(JSExnType type) {
     MOZ_ASSERT(type < JSEXN_WARN);
     return &classes[type];
   }
@@ -100,17 +99,16 @@ class ErrorObject : public NativeObject 
 
   JSErrorReport* getOrCreateErrorReport(JSContext* cx);
 
   inline JSString* fileName(JSContext* cx) const;
   inline uint32_t sourceId() const;
   inline uint32_t lineNumber() const;
   inline uint32_t columnNumber() const;
   inline JSObject* stack() const;
-  inline uint64_t timeWarpTarget() const;
 
   JSString* getMessage() const {
     const HeapSlot& slot = getReservedSlotRef(MESSAGE_SLOT);
     return slot.isString() ? slot.toString() : nullptr;
   }
 
   // Getter and setter for the Error.prototype.stack accessor.
   static bool getStack(JSContext* cx, unsigned argc, Value* vp);
--- a/js/src/vm/HelperThreads.cpp
+++ b/js/src/vm/HelperThreads.cpp
@@ -1995,17 +1995,17 @@ void HelperThread::destroy() {
     }
 
     thread->join();
     thread.reset();
   }
 }
 
 void HelperThread::ensureRegisteredWithProfiler() {
-  if (profilingStack || mozilla::recordreplay::IsRecordingOrReplaying()) {
+  if (profilingStack) {
     return;
   }
 
   // Note: To avoid dead locks, we should not hold on the helper thread lock
   // while calling this function. This is safe because the registerThread field
   // is a WriteOnceData<> type stored on the global helper tread state.
   JS::RegisterThreadCallback callback = HelperThreadState().registerThread;
   if (callback) {
@@ -2028,20 +2028,16 @@ void HelperThread::unregisterWithProfile
     profilingStack = nullptr;
   }
 }
 
 /* static */
 void HelperThread::ThreadMain(void* arg) {
   ThisThread::SetName("JS Helper");
 
-  // Helper threads are allowed to run differently during recording and
-  // replay, as compiled scripts and GCs are allowed to vary. Because of
-  // this, no recorded events at all should occur while on helper threads.
-  mozilla::recordreplay::AutoDisallowThreadEvents d;
   auto helper = static_cast<HelperThread*>(arg);
 
   helper->ensureRegisteredWithProfiler();
   helper->threadLoop();
   helper->unregisterWithProfilerIfNeeded();
 }
 
 void HelperThread::handleWasmTier1Workload(AutoLockHelperThreadState& locked) {
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -1950,19 +1950,16 @@ static MOZ_NEVER_INLINE JS_HAZ_JSNATIVE_
           }
 
           if (activation.entryFrame() != REGS.fp()) {
             goto jit_return_pop_frame;
           }
           goto leave_on_safe_point;
         }
       }
-      if (script->trackRecordReplayProgress()) {
-        mozilla::recordreplay::AdvanceExecutionProgressCounter();
-      }
     }
     END_CASE(LoopHead)
 
     CASE(Lineno)
     END_CASE(Lineno)
 
     CASE(ForceInterpreter) {
       // Ensure pattern matching still works.
--- a/js/src/vm/JSContext.cpp
+++ b/js/src/vm/JSContext.cpp
@@ -288,17 +288,16 @@ JS_FRIEND_API void js::ReportOutOfMemory
 #ifdef JS_MORE_DETERMINISTIC
   /*
    * OOMs are non-deterministic, especially across different execution modes
    * (e.g. interpreter vs JIT). In more-deterministic builds, print to stderr
    * so that the fuzzers can detect this.
    */
   fprintf(stderr, "ReportOutOfMemory called\n");
 #endif
-  mozilla::recordreplay::InvalidateRecording("OutOfMemory exception thrown");
 
   if (cx->isHelperThreadContext()) {
     return cx->addPendingOutOfMemory();
   }
 
   cx->runtime()->hadOutOfMemory = true;
   gc::AutoSuppressGC suppressGC(cx);
 
@@ -329,17 +328,16 @@ void js::ReportOverRecursed(JSContext* m
    * implementations (e.g. JIT vs. interpreter will differ in
    * their maximum stack depth).
    * However, we can detect externally when we hit the maximum
    * stack depth which is useful for external testing programs
    * like fuzzers.
    */
   fprintf(stderr, "ReportOverRecursed called\n");
 #endif
-  mozilla::recordreplay::InvalidateRecording("OverRecursed exception thrown");
   if (maybecx) {
     if (!maybecx->isHelperThreadContext()) {
       JS_ReportErrorNumberASCII(maybecx, GetErrorMessage, nullptr, errorNumber);
       maybecx->overRecursed_ = true;
     } else {
       maybecx->addPendingOverRecursed();
     }
   }
--- a/js/src/vm/JSContext.h
+++ b/js/src/vm/JSContext.h
@@ -182,19 +182,17 @@ struct JS_PUBLIC_API JSContext : public 
 
   // Thread that the JSContext is currently running on, if in use.
   js::ThreadId currentThread_;
 
   js::ParseTask* parseTask_;
 
   // When a helper thread is using a context, it may need to periodically
   // free unused memory.
-  mozilla::Atomic<bool, mozilla::ReleaseAcquire,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      freeUnusedMemory;
+  mozilla::Atomic<bool, mozilla::ReleaseAcquire> freeUnusedMemory;
 
  public:
   // This is used by helper threads to change the runtime their context is
   // currently operating on.
   void setRuntime(JSRuntime* rt);
 
   void setHelperThread(js::AutoLockHelperThreadState& locked);
   void clearHelperThread(js::AutoLockHelperThreadState& locked);
@@ -639,18 +637,17 @@ struct JS_PUBLIC_API JSContext : public 
 
   void verifyIsSafeToGC() {
     MOZ_DIAGNOSTIC_ASSERT(!inUnsafeRegion,
                           "[AutoAssertNoGC] possible GC in GC-unsafe region");
   }
 
   /* Whether sampling should be enabled or not. */
  private:
-  mozilla::Atomic<bool, mozilla::SequentiallyConsistent,
-                  mozilla::recordreplay::Behavior::DontPreserve>
+  mozilla::Atomic<bool, mozilla::SequentiallyConsistent>
       suppressProfilerSampling;
 
  public:
   bool isProfilerSamplingEnabled() const { return !suppressProfilerSampling; }
   void disableProfilerSampling() { suppressProfilerSampling = true; }
   void enableProfilerSampling() { suppressProfilerSampling = false; }
 
   // Used by wasm::EnsureThreadSignalHandlers(cx) to install thread signal
@@ -845,19 +842,17 @@ struct JS_PUBLIC_API JSContext : public 
  public:
   InterruptCallbackVector& interruptCallbacks() {
     return interruptCallbacks_.ref();
   }
 
   js::ContextData<bool> interruptCallbackDisabled;
 
   // Bitfield storing InterruptReason values.
-  mozilla::Atomic<uint32_t, mozilla::Relaxed,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      interruptBits_;
+  mozilla::Atomic<uint32_t, mozilla::Relaxed> interruptBits_;
 
   // Any thread can call requestInterrupt() to request that this thread
   // stop running. To stop this thread, requestInterrupt sets two fields:
   // interruptBits_ (a bitset of InterruptReasons) and jitStackLimit_ (set to
   // UINTPTR_MAX). The JS engine must continually poll one of these fields
   // and call handleInterrupt if either field has the interrupt value.
   //
   // The point of setting jitStackLimit_ to UINTPTR_MAX is that JIT code
@@ -922,19 +917,17 @@ struct JS_PUBLIC_API JSContext : public 
     return v;
   }
   void setIonReturnOverride(const js::Value& v) {
     MOZ_ASSERT(!hasIonReturnOverride());
     MOZ_ASSERT(!v.isMagic());
     ionReturnOverride_ = v;
   }
 
-  mozilla::Atomic<uintptr_t, mozilla::Relaxed,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      jitStackLimit;
+  mozilla::Atomic<uintptr_t, mozilla::Relaxed> jitStackLimit;
 
   // Like jitStackLimit, but not reset to trigger interrupts.
   js::ContextData<uintptr_t> jitStackLimitNoInterrupt;
 
   // Queue of pending jobs as described in ES2016 section 8.4.
   //
   // This is a non-owning pointer to either:
   // - a JobQueue implementation the embedding provided by calling
--- a/js/src/vm/JSScript.cpp
+++ b/js/src/vm/JSScript.cpp
@@ -3760,50 +3760,16 @@ XDRResult ScriptSource::xdrData(XDRState
   // The range-check on |type| far above ought ensure the above |switch| is
   // exhaustive and all cases will return, but not all compilers understand
   // this.  Make the Missing case break to here so control obviously never flows
   // off the end.
   MOZ_ASSERT(tag == DataType::Missing);
   return Ok();
 }
 
-// Note the content of sources decoded when recording or replaying.
-static bool MaybeNoteContentParse(JSContext* cx, ScriptSource* ss) {
-  if (!mozilla::recordreplay::IsRecordingOrReplaying()) {
-    return true;
-  }
-  if (!ss->hasSourceText()) {
-    return true;
-  }
-
-  UncompressedSourceCache::AutoHoldEntry holder;
-  if (ss->hasSourceType<Utf8Unit>()) {
-    // UTF-8 source text.
-    ScriptSource::PinnedUnits<Utf8Unit> units(cx, ss, holder, 0, ss->length());
-    if (!units.get()) {
-      return false;
-    }
-    mozilla::recordreplay::NoteContentParse(ss, ss->filename(),
-                                            "application/javascript",
-                                            units.get(), ss->length());
-  } else {
-    // UTF-16 source text.
-    MOZ_ASSERT(ss->hasSourceType<char16_t>());
-    ScriptSource::PinnedUnits<char16_t> units(cx, ss, holder, 0, ss->length());
-    if (!units.get()) {
-      return false;
-    }
-    mozilla::recordreplay::NoteContentParse(ss, ss->filename(),
-                                            "application/javascript",
-                                            units.get(), ss->length());
-  }
-
-  return true;
-}
-
 template <XDRMode mode>
 /* static */
 XDRResult ScriptSource::XDR(XDRState<mode>* xdr,
                             const mozilla::Maybe<JS::CompileOptions>& options,
                             MutableHandle<ScriptSourceHolder> holder) {
   JSContext* cx = xdr->cx();
   ScriptSource* ss = nullptr;
 
@@ -3877,21 +3843,16 @@ XDRResult ScriptSource::XDR(XDRState<mod
       // NOTE: If the decoder has an option, then the filename is defined by
       // the CompileOption from the document.
       if (!xdr->hasOptions()) {
         if (!ss->setFilename(cx, std::move(chars.ref<UniqueChars>()))) {
           return xdr->fail(JS::TranscodeResult_Throw);
         }
       }
       MOZ_ASSERT(ss->filename());
-
-      // Note the content of sources decoded when recording or replaying.
-      if (!MaybeNoteContentParse(xdr->cx(), ss)) {
-        return xdr->fail(JS::TranscodeResult_Throw);
-      }
     }
   }
 
   return Ok();
 }
 
 // Format and return a cx->pod_malloc'ed URL for a generated script like:
 //   {filename} line {lineno} > {introducer}
@@ -4060,18 +4021,17 @@ bool ScriptSource::setSourceMapURL(JSCon
   if (url[0] == '\0') {
     return true;
   }
 
   sourceMapURL_ = getOrCreateStringZ(cx, std::move(url));
   return sourceMapURL_.isSome();
 }
 
-/* static */ mozilla::Atomic<uint32_t, mozilla::SequentiallyConsistent,
-                             mozilla::recordreplay::Behavior::DontPreserve>
+/* static */ mozilla::Atomic<uint32_t, mozilla::SequentiallyConsistent>
     ScriptSource::idCount_;
 
 /*
  * [SMDOC] JSScript data layout (immutable)
  *
  * Script data that shareable across processes. There are no pointers (GC or
  * otherwise) and the data is relocatable.
  *
@@ -4315,27 +4275,16 @@ JSScript* JSScript::New(JSContext* cx, H
 #else
   uint8_t* stubEntry = nullptr;
 #endif
 
   return new (script)
       JSScript(stubEntry, functionOrGlobal, sourceObject, extent);
 }
 
-static bool ShouldTrackRecordReplayProgress(JSScript* script) {
-  // Progress is only tracked when recording or replaying, and only for
-  // scripts associated with the main thread's runtime. Whether self hosted
-  // scripts execute may depend on performed Ion optimizations (for example,
-  // self hosted TypedObject logic), so they are ignored.
-  return MOZ_UNLIKELY(mozilla::recordreplay::IsRecordingOrReplaying()) &&
-         !script->runtimeFromAnyThread()->parentRuntime &&
-         !script->selfHosted() &&
-         mozilla::recordreplay::ShouldUpdateProgressCounter(script->filename());
-}
-
 /* static */
 JSScript* JSScript::Create(JSContext* cx, HandleObject functionOrGlobal,
                            const ReadOnlyCompileOptions& options,
                            HandleScriptSourceObject sourceObject,
                            const SourceExtent& extent) {
   return JSScript::Create(cx, functionOrGlobal, sourceObject,
                           ImmutableScriptFlags::fromCompileOptions(options),
                           options.hideScriptFromDebugger, extent);
@@ -4352,18 +4301,16 @@ JSScript* JSScript::Create(JSContext* cx
     return nullptr;
   }
 
   // Record compile options that get checked at runtime.
   MOZ_ASSERT(script->immutableScriptFlags_ == 0);
   script->setImmutableFlags(flags);
 
   script->setFlag(MutableFlags::HideScriptFromDebugger, hideScriptFromDebugger);
-  script->setFlag(MutableFlags::TrackRecordReplayProgress,
-                  ShouldTrackRecordReplayProgress(script));
 
   return script;
 }
 
 /* static */ JSScript* JSScript::CreateFromLazy(JSContext* cx,
                                                 Handle<LazyScript*> lazy) {
   RootedScriptSourceObject sourceObject(cx, lazy->sourceObject());
   RootedObject fun(cx, lazy->function());
@@ -4375,19 +4322,16 @@ JSScript* JSScript::Create(JSContext* cx
   // Propagate flags.
   if (lazy->isLikelyConstructorWrapper()) {
     script->setIsLikelyConstructorWrapper();
   }
   if (lazy->hasBeenCloned()) {
     script->setHasBeenCloned();
   }
 
-  script->setFlag(MutableFlags::TrackRecordReplayProgress,
-                  ShouldTrackRecordReplayProgress(script));
-
   return script;
 }
 
 #ifdef MOZ_VTUNE
 uint32_t JSScript::vtuneMethodID() {
   if (!zone()->scriptVTuneIdMap) {
     auto map = MakeUnique<ScriptVTuneIdMap>();
     if (!map) {
--- a/js/src/vm/JSScript.h
+++ b/js/src/vm/JSScript.h
@@ -600,19 +600,17 @@ class ScriptSource {
                        Uncompressed<char16_t, SourceRetrievable::No>,
                        Retrievable<mozilla::Utf8Unit>, Retrievable<char16_t>,
                        Missing, BinAST>;
 
   //
   // Start of fields.
   //
 
-  mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      refs = {};
+  mozilla::Atomic<uint32_t, mozilla::ReleaseAcquire> refs = {};
 
   // An id for this source that is unique across the process. This can be used
   // to refer to this source from places that don't want to hold a strong
   // reference on the source itself.
   //
   // This is a 32 bit ID and could overflow, in which case the ID will not be
   // unique anymore.
   uint32_t id_ = 0;
@@ -688,19 +686,17 @@ class ScriptSource {
   // Set to true if parser saw  asmjs directives.
   bool containsAsmJS_ = false;
 
   //
   // End of fields.
   //
 
   // How many ids have been handed out to sources.
-  static mozilla::Atomic<uint32_t, mozilla::SequentiallyConsistent,
-                         mozilla::recordreplay::Behavior::DontPreserve>
-      idCount_;
+  static mozilla::Atomic<uint32_t, mozilla::SequentiallyConsistent> idCount_;
 
   template <typename Unit>
   const Unit* chunkUnits(JSContext* cx,
                          UncompressedSourceCache::AutoHoldEntry& holder,
                          size_t chunk);
 
   // Return a string containing the chars starting at |begin| and ending at
   // |begin + len|.
@@ -1836,19 +1832,17 @@ class alignas(uint32_t) ImmutableScriptD
   ImmutableScriptData& operator=(const ImmutableScriptData&) = delete;
 };
 
 // Script data that is shareable across a JSRuntime.
 class RuntimeScriptData final {
   // This class is reference counted as follows: each pointer from a JSScript
   // counts as one reference plus there may be one reference from the shared
   // script data table.
-  mozilla::Atomic<uint32_t, mozilla::SequentiallyConsistent,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      refCount_ = {};
+  mozilla::Atomic<uint32_t, mozilla::SequentiallyConsistent> refCount_ = {};
 
   uint32_t natoms_ = 0;
 
   js::UniquePtr<ImmutableScriptData> isd_ = nullptr;
 
   // NOTE: The raw bytes of this structure are used for hashing so use explicit
   // padding values as needed for predicatable results across compilers.
 
@@ -2236,18 +2230,16 @@ setterLevel:                            
                                       ShouldDeclareArguments)
   IMMUTABLE_FLAG_GETTER(isFunction, IsFunction)
   IMMUTABLE_FLAG_GETTER_SETTER_PUBLIC(hasDirectEval, HasDirectEval)
   IMMUTABLE_FLAG_GETTER(isLazyScript, IsLazyScript)
 
   MUTABLE_FLAG_GETTER_SETTER(warnedAboutUndefinedProp, WarnedAboutUndefinedProp)
   MUTABLE_FLAG_GETTER_SETTER(hasRunOnce, HasRunOnce)
   MUTABLE_FLAG_GETTER_SETTER(hasBeenCloned, HasBeenCloned)
-  MUTABLE_FLAG_GETTER_SETTER(trackRecordReplayProgress,
-                             TrackRecordReplayProgress)
   // N.B.: no setter -- custom logic in JSScript.
   MUTABLE_FLAG_GETTER(hasScriptCounts, HasScriptCounts)
   // Access the flag for whether this script has a DebugScript in its realm's
   // map. This should only be used by the DebugScript class.
   MUTABLE_FLAG_GETTER_SETTER(hasDebugScript, HasDebugScript)
   MUTABLE_FLAG_GETTER_SETTER(doNotRelazify, DoNotRelazify)
   MUTABLE_FLAG_GETTER_SETTER(failedBoundsCheck, FailedBoundsCheck)
   MUTABLE_FLAG_GETTER_SETTER(failedShapeGuard, FailedShapeGuard)
--- a/js/src/vm/NativeObject.cpp
+++ b/js/src/vm/NativeObject.cpp
@@ -160,19 +160,18 @@ void ObjectElements::FreezeOrSeal(JSCont
   }
 
   if (level == IntegrityLevel::Frozen) {
     obj->getElementsHeader()->freeze();
   }
 }
 
 #ifdef DEBUG
-static mozilla::Atomic<bool, mozilla::Relaxed,
-                       mozilla::recordreplay::Behavior::DontPreserve>
-    gShapeConsistencyChecksEnabled(false);
+static mozilla::Atomic<bool, mozilla::Relaxed> gShapeConsistencyChecksEnabled(
+    false);
 
 /* static */
 void js::NativeObject::enableShapeConsistencyChecks() {
   gShapeConsistencyChecksEnabled = true;
 }
 
 void js::NativeObject::checkShapeConsistency() {
   if (!gShapeConsistencyChecksEnabled) {
--- a/js/src/vm/OffThreadScriptCompilation.cpp
+++ b/js/src/vm/OffThreadScriptCompilation.cpp
@@ -56,18 +56,17 @@ static bool CanDoOffThread(JSContext* cx
         return false;
       }
       if (what == OffThread::DecodeBinAST && length < HUGE_BINAST_LENGTH) {
         return false;
       }
     }
   }
 
-  return cx->runtime()->canUseParallelParsing() && CanUseExtraThreads() &&
-         !mozilla::recordreplay::IsRecordingOrReplaying();
+  return cx->runtime()->canUseParallelParsing() && CanUseExtraThreads();
 }
 
 JS_PUBLIC_API bool JS::CanCompileOffThread(
     JSContext* cx, const ReadOnlyCompileOptions& options, size_t length) {
   return CanDoOffThread(cx, options, length, OffThread::Compile);
 }
 
 JS_PUBLIC_API bool JS::CompileOffThread(JSContext* cx,
--- a/js/src/vm/Probes-inl.h
+++ b/js/src/vm/Probes-inl.h
@@ -43,20 +43,16 @@ inline bool probes::EnterScript(JSContex
     if (!cx->geckoProfiler().enter(cx, script)) {
       return false;
     }
     MOZ_ASSERT_IF(!fp->script()->isGenerator() && !fp->script()->isAsync(),
                   !fp->hasPushedGeckoProfilerFrame());
     fp->setPushedGeckoProfilerFrame();
   }
 
-  if (script->trackRecordReplayProgress()) {
-    mozilla::recordreplay::AdvanceExecutionProgressCounter();
-  }
-
   return true;
 }
 
 inline void probes::ExitScript(JSContext* cx, JSScript* script,
                                JSFunction* maybeFun, bool popProfilerFrame) {
 #ifdef INCLUDE_MOZILLA_DTRACE
   if (JAVASCRIPT_FUNCTION_RETURN_ENABLED()) {
     DTraceExitJSFun(cx, maybeFun, script);
--- a/js/src/vm/Runtime.cpp
+++ b/js/src/vm/Runtime.cpp
@@ -396,23 +396,16 @@ void JSRuntime::addSizeOfIncludingThis(m
 
   rtSizes->wasmRuntime +=
       wasmInstances.lock()->sizeOfExcludingThis(mallocSizeOf);
 }
 
 static bool HandleInterrupt(JSContext* cx, bool invokeCallback) {
   MOZ_ASSERT(!cx->zone()->isAtomsZone());
 
-  // Interrupts can occur at different points between recording and replay,
-  // so no recorded behaviors should occur while handling an interrupt.
-  // Additionally, returning false here will change subsequent behavior, so
-  // such an event cannot occur during recording or replay without
-  // invalidating the recording.
-  mozilla::recordreplay::AutoDisallowThreadEvents d;
-
   cx->runtime()->gc.gcIfRequested();
 
   // A worker thread may have requested an interrupt after finishing an Ion
   // compilation.
   jit::AttachFinishedCompilations(cx);
 
   // Don't call the interrupt callback if we only interrupted for GC or Ion.
   if (!invokeCallback) {
@@ -436,18 +429,16 @@ static bool HandleInterrupt(JSContext* c
   if (!stop) {
     // Debugger treats invoking the interrupt callback as a "step", so
     // invoke the onStep handler.
     if (cx->realm()->isDebuggee()) {
       ScriptFrameIter iter(cx);
       if (!iter.done() && cx->compartment() == iter.compartment() &&
           DebugAPI::stepModeEnabled(iter.script())) {
         if (!DebugAPI::onSingleStep(cx)) {
-          mozilla::recordreplay::InvalidateRecording(
-              "Debugger single-step tried to change recorded behavior");
           return false;
         }
       }
     }
 
     return true;
   }
 
@@ -467,18 +458,16 @@ static bool HandleInterrupt(JSContext* c
   if (stringChars) {
     chars = stringChars.get();
   } else {
     chars = u"(stack not available)";
   }
   JS_ReportErrorFlagsAndNumberUC(cx, JSREPORT_WARNING, GetErrorMessage, nullptr,
                                  JSMSG_TERMINATED, chars);
 
-  mozilla::recordreplay::InvalidateRecording(
-      "Interrupt callback forced return");
   return false;
 }
 
 void JSContext::requestInterrupt(InterruptReason reason) {
   interruptBits_ |= uint32_t(reason);
   jitStackLimit = UINTPTR_MAX;
 
   if (reason == InterruptReason::CallbackUrgent) {
--- a/js/src/vm/Runtime.h
+++ b/js/src/vm/Runtime.h
@@ -301,18 +301,17 @@ struct JSRuntime {
    * if some buffer entries at the start of the sample have left the buffer,
    * the entire sample will be considered inaccessible.
    * This means that, once profilerSampleBufferRangeStart_ advances beyond
    * the sample position that's stored on a JitcodeGlobalTable entry, the
    * buffer entries that reference this JitcodeGlobalTable entry will be
    * considered inaccessible, and those JitcodeGlobalTable entry can be
    * disposed of.
    */
-  mozilla::Atomic<uint64_t, mozilla::ReleaseAcquire,
-                  mozilla::recordreplay::Behavior::DontPreserve>
+  mozilla::Atomic<uint64_t, mozilla::ReleaseAcquire>
       profilerSampleBufferRangeStart_;
 
   mozilla::Maybe<uint64_t> profilerSampleBufferRangeStart() {
     if (beingDestroyed_ || !geckoProfiler().enabled()) {
       return mozilla::Nothing();
     }
     uint64_t rangeStart = profilerSampleBufferRangeStart_;
     return mozilla::Some(rangeStart);
@@ -351,19 +350,17 @@ struct JSRuntime {
   js::GlobalObject* getIncumbentGlobal(JSContext* cx);
   bool enqueuePromiseJob(JSContext* cx, js::HandleFunction job,
                          js::HandleObject promise,
                          js::Handle<js::GlobalObject*> incumbentGlobal);
   void addUnhandledRejectedPromise(JSContext* cx, js::HandleObject promise);
   void removeUnhandledRejectedPromise(JSContext* cx, js::HandleObject promise);
 
   /* Had an out-of-memory error which did not populate an exception. */
-  mozilla::Atomic<bool, mozilla::SequentiallyConsistent,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      hadOutOfMemory;
+  mozilla::Atomic<bool, mozilla::SequentiallyConsistent> hadOutOfMemory;
 
   /*
    * Allow relazifying functions in compartments that are active. This is
    * only used by the relazifyFunctions() testing function.
    */
   js::MainThreadData<bool> allowRelazificationForTesting;
 
   /* Compartment destroy callback. */
@@ -494,18 +491,17 @@ struct JSRuntime {
    * main thread which could access this.
    */
   js::Mutex scriptDataLock;
 #ifdef DEBUG
   bool activeThreadHasScriptDataAccess;
 #endif
 
   // Number of zones which may be operated on by helper threads.
-  mozilla::Atomic<size_t, mozilla::SequentiallyConsistent,
-                  mozilla::recordreplay::Behavior::DontPreserve>
+  mozilla::Atomic<size_t, mozilla::SequentiallyConsistent>
       numActiveHelperThreadZones;
 
   friend class js::AutoLockScriptData;
 
  public:
   void setUsedByHelperThread(JS::Zone* zone);
   void clearUsedByHelperThread(JS::Zone* zone);
 
@@ -887,21 +883,19 @@ struct JSRuntime {
 
   static const unsigned LARGE_ALLOCATION = 25 * 1024 * 1024;
 
   void addSizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf,
                               JS::RuntimeSizes* rtSizes);
 
  private:
   // Settings for how helper threads can be used.
-  mozilla::Atomic<bool, mozilla::SequentiallyConsistent,
-                  mozilla::recordreplay::Behavior::DontPreserve>
+  mozilla::Atomic<bool, mozilla::SequentiallyConsistent>
       offthreadIonCompilationEnabled_;
-  mozilla::Atomic<bool, mozilla::SequentiallyConsistent,
-                  mozilla::recordreplay::Behavior::DontPreserve>
+  mozilla::Atomic<bool, mozilla::SequentiallyConsistent>
       parallelParsingEnabled_;
 
 #ifdef DEBUG
   mozilla::Atomic<uint32_t> offThreadParsesRunning_;
   mozilla::Atomic<bool> offThreadParsingBlocked_;
 #endif
 
   js::MainThreadData<bool> autoWritableJitCodeActive_;
--- a/js/src/vm/SharedStencil.h
+++ b/js/src/vm/SharedStencil.h
@@ -190,20 +190,16 @@ enum class MutableScriptFlagsEnum : uint
   WarnedAboutUndefinedProp = 1 << 8,
 
   // If treatAsRunOnce, whether script has executed.
   HasRunOnce = 1 << 9,
 
   // Script has been reused for a clone.
   HasBeenCloned = 1 << 10,
 
-  // Whether the record/replay execution progress counter (see RecordReplay.h)
-  // should be updated as this script runs.
-  TrackRecordReplayProgress = 1 << 11,
-
   // Script has an entry in Realm::scriptCountsMap.
   HasScriptCounts = 1 << 12,
 
   // Script has an entry in Realm::debugScriptMap.
   HasDebugScript = 1 << 13,
 
   // Do not relazify this script. This is used by the relazify() testing
   // function for scripts that are on the stack and also by the AutoDelazify
--- a/js/src/vm/Stack.cpp
+++ b/js/src/vm/Stack.cpp
@@ -201,20 +201,16 @@ bool InterpreterFrame::prologue(JSContex
   RootedScript script(cx, this->script());
 
   MOZ_ASSERT(cx->interpreterRegs().pc == script->code());
   MOZ_ASSERT(cx->realm() == script->realm());
 
   if (isEvalFrame() || isGlobalFrame()) {
     HandleObject env = environmentChain();
     if (!CheckGlobalOrEvalDeclarationConflicts(cx, env, script)) {
-      // Treat this as a script entry, for consistency with Ion.
-      if (script->trackRecordReplayProgress()) {
-        mozilla::recordreplay::AdvanceExecutionProgressCounter();
-      }
       return false;
     }
     return probes::EnterScript(cx, script, nullptr, this);
   }
 
   if (isModuleFrame()) {
     return probes::EnterScript(cx, script, nullptr, this);
   }
--- a/js/src/vm/StructuredClone.cpp
+++ b/js/src/vm/StructuredClone.cpp
@@ -560,23 +560,16 @@ struct JSStructuredCloneWriter {
   // Memory until a serialization operation is finished
   using CloneMemory =
       GCHashMap<JSObject*, uint32_t, MovableCellHasher<JSObject*>,
                 SystemAllocPolicy>;
   Rooted<CloneMemory> memory;
 
   struct TransferableObjectsHasher : public DefaultHasher<JSObject*> {
     static inline HashNumber hash(const Lookup& l) {
-      // Iteration order of the transferable objects table must be
-      // preserved during recording/replaying, as the callbacks used
-      // during transfer may interact with the recording. Just use the
-      // same hash number for all elements to ensure this.
-      if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-        return 0;
-      }
       return DefaultHasher<JSObject*>::hash(l);
     }
   };
 
   // Set of transferable objects
   RootedValue transferable;
   typedef GCHashSet<JSObject*, TransferableObjectsHasher>
       TransferableObjectsSet;
--- a/js/src/vm/Time.h
+++ b/js/src/vm/Time.h
@@ -2,17 +2,16 @@
  * 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 vm_Time_h
 #define vm_Time_h
 
-#include "mozilla/RecordReplay.h"
 #include "mozilla/TimeStamp.h"
 
 #include <stddef.h>
 #include <stdint.h>
 
 #if !JS_HAS_INTL_API || MOZ_SYSTEM_ICU
 /*
  * Broken down form of 64 bit time value.
@@ -125,54 +124,41 @@ extern size_t PRMJ_FormatTime(char* buf,
  * [2] http://www.agner.org/optimize/instruction_tables.pdf
  */
 
 #define MOZ_HAVE_RDTSC 1
 
 #if defined(_WIN32) && (defined(_M_IX86) || defined(_M_AMD64))
 
 #  include <intrin.h>
-static __inline uint64_t ReadTimestampCounter(void) {
-  if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-    return 0;
-  }
-  return __rdtsc();
-}
+static __inline uint64_t ReadTimestampCounter(void) { return __rdtsc(); }
 
 #elif defined(__i386__)
 
 static __inline__ uint64_t ReadTimestampCounter(void) {
-  if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-    return 0;
-  }
   uint64_t x;
   __asm__ volatile(".byte 0x0f, 0x31" : "=A"(x));
   return x;
 }
 
 #elif defined(__x86_64__)
 
 static __inline__ uint64_t ReadTimestampCounter(void) {
-  if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-    return 0;
-  }
   unsigned hi, lo;
   __asm__ __volatile__("rdtsc" : "=a"(lo), "=d"(hi));
   return ((uint64_t)lo) | (((uint64_t)hi) << 32);
 }
 
 #else
 
 #  undef MOZ_HAVE_RDTSC
 
 #endif
 
 namespace js {
 
-// Get the current time, bypassing any record/replay instrumentation.
 static inline mozilla::TimeStamp ReallyNow() {
-  mozilla::recordreplay::AutoPassThroughThreadEvents pt;
   return mozilla::TimeStamp::NowUnfuzzed();
 }
 
 }  // namespace js
 
 #endif /* vm_Time_h */
--- a/js/src/vm/TypeInference.cpp
+++ b/js/src/vm/TypeInference.cpp
@@ -164,19 +164,16 @@ UniqueChars TypeSet::ObjectGroupString(c
 #ifdef DEBUG
 
 bool js::InferSpewActive(TypeSpewChannel channel) {
   static bool active[SPEW_COUNT];
   static bool checked = false;
   if (!checked) {
     checked = true;
     PodArrayZero(active);
-    if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-      return false;
-    }
     const char* env = getenv("INFERFLAGS");
     if (!env) {
       return false;
     }
     if (strstr(env, "ops")) {
       active[ISpewOps] = true;
     }
     if (strstr(env, "result")) {
@@ -192,19 +189,16 @@ bool js::InferSpewActive(TypeSpewChannel
 }
 
 static bool InferSpewColorable() {
   /* Only spew colors on xterm-color to not screw up emacs. */
   static bool colorable = false;
   static bool checked = false;
   if (!checked) {
     checked = true;
-    if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-      return false;
-    }
     const char* env = getenv("TERM");
     if (!env) {
       return false;
     }
     if (strcmp(env, "xterm-color") == 0 || strcmp(env, "xterm-256color") == 0) {
       colorable = true;
     }
   }
--- a/js/src/wasm/WasmSignalHandlers.cpp
+++ b/js/src/wasm/WasmSignalHandlers.cpp
@@ -992,21 +992,16 @@ void wasm::EnsureEagerProcessSignalHandl
   eagerInstallState->tried = true;
   MOZ_RELEASE_ASSERT(eagerInstallState->success == false);
 
 #if defined(JS_CODEGEN_NONE)
   // If there is no JIT, then there should be no Wasm signal handlers.
   return;
 #endif
 
-  // Signal handlers are currently disabled when recording or replaying.
-  if (mozilla::recordreplay::IsRecordingOrReplaying()) {
-    return;
-  }
-
 #if defined(ANDROID) && defined(MOZ_LINKER)
   // Signal handling is broken on some android systems.
   if (IsSignalHandlingBroken()) {
     return;
   }
 #endif
 
   sAlreadyHandlingTrap.infallibleInit();
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -831,23 +831,16 @@ nsresult mozJSComponentLoader::ObjectFor
     // ReadCachedScript may have set a pending exception.
     JS_ClearPendingException(cx);
   }
 
   if (!script) {
     // The script wasn't in the cache , so compile it now.
     LOG(("Slow loading %s\n", nativePath.get()));
 
-    // If we are debugging a replaying process and have diverged from the
-    // recording, trying to load and compile new code will cause the
-    // debugger operation to fail, so just abort now.
-    if (recordreplay::HasDivergedFromRecording()) {
-      return NS_ERROR_FAILURE;
-    }
-
     // Use lazy source if we're using the startup cache. Non-lazy source +
     // startup cache regresses installer size (due to source code stored in
     // XDR encoded modules in omni.ja). Also, XDR decoding is relatively
     // fast. When we're not using the startup cache, we want to use non-lazy
     // source code so that we can use lazy parsing.
     // See bug 1303754.
     CompileOptions options(cx);
     options.setNoScriptRval(true)
--- a/js/xpconnect/src/SandboxPrivate.h
+++ b/js/xpconnect/src/SandboxPrivate.h
@@ -29,20 +29,16 @@ class SandboxPrivate : public nsIGlobalO
     sbp->SetWrapper(global);
     sbp->PreserveWrapper(ToSupports(sbp.get()));
 
     // Pass on ownership of sbp to |global|.
     // The type used to cast to void needs to match the one in GetPrivate.
     nsIScriptObjectPrincipal* sop =
         static_cast<nsIScriptObjectPrincipal*>(sbp.forget().take());
     JS_SetPrivate(global, sop);
-
-    // Never collect the global while recording or replaying, so that the
-    // principal reference is not released at a non-deterministic point.
-    mozilla::recordreplay::HoldJSObject(global);
   }
 
   static SandboxPrivate* GetPrivate(JSObject* obj) {
     // The type used to cast to void needs to match the one in Create.
     return static_cast<SandboxPrivate*>(
         static_cast<nsIScriptObjectPrincipal*>(JS_GetPrivate(obj)));
   }
 
--- a/js/xpconnect/src/XPCInlines.h
+++ b/js/xpconnect/src/XPCInlines.h
@@ -313,23 +313,17 @@ inline void XPCWrappedNative::SweepTearO
     to->Unmark();
     if (marked) {
       continue;
     }
 
     // If this tearoff does not have a live dedicated JSObject,
     // then let's recycle it.
     if (!to->GetJSObjectPreserveColor()) {
-      RefPtr<nsISupports> native = to->TakeNative();
-      if (native && mozilla::recordreplay::IsRecordingOrReplaying()) {
-        // Finalization must be deferred while recording/replaying to
-        // match the RecordReplayRegisterDeferredFinalizeThing call
-        // when the tearoff was initialized.
-        mozilla::DeferredFinalize(native.forget().take());
-      }
+      to->SetNative(nullptr);
       to->SetInterface(nullptr);
     }
   }
 }
 
 /***************************************************************************/
 
 inline bool xpc_ForcePropertyResolve(JSContext* cx, JS::HandleObject obj,
--- a/js/xpconnect/src/XPCJSContext.cpp
+++ b/js/xpconnect/src/XPCJSContext.cpp
@@ -553,22 +553,16 @@ bool XPCJSContext::RecordScriptActivity(
   }
 
   bool oldValue = xpccx->SetHasScriptActivity(aActive);
   if (aActive == oldValue) {
     // Nothing to do.
     return oldValue;
   }
 
-  // Since the slow script dialog never activates if we are recording or
-  // replaying, don't record/replay JS activity notifications.
-  if (recordreplay::IsRecordingOrReplaying()) {
-    return oldValue;
-  }
-
   if (!aActive) {
     ProcessHangMonitor::ClearHang();
   }
   xpccx->mWatchdogManager->RecordContextActivity(xpccx, aActive);
 
   return oldValue;
 }
 
@@ -577,22 +571,16 @@ AutoScriptActivity::AutoScriptActivity(b
       mOldValue(XPCJSContext::RecordScriptActivity(aActive)) {}
 
 AutoScriptActivity::~AutoScriptActivity() {
   MOZ_ALWAYS_TRUE(mActive == XPCJSContext::RecordScriptActivity(mOldValue));
 }
 
 // static
 bool XPCJSContext::InterruptCallback(JSContext* cx) {
-  // The slow script dialog never activates if we are recording or replaying,
-  // since the precise timing of the dialog cannot be replayed.
-  if (recordreplay::IsRecordingOrReplaying()) {
-    return true;
-  }
-
   XPCJSContext* self = XPCJSContext::Get();
 
   // Now is a good time to turn on profiling if it's pending.
   PROFILER_JS_INTERRUPT_CALLBACK();
 
   // Normally we record mSlowScriptCheckpoint when we start to process an
   // event. However, we can run JS outside of event handlers. This code takes
   // care of that case.
--- a/js/xpconnect/src/XPCWrappedNative.cpp
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
@@ -541,20 +541,16 @@ inline void XPCWrappedNative::SetFlatJSO
   MOZ_ASSERT(!mFlatJSObject);
   MOZ_ASSERT(object);
 
   JS::AddAssociatedMemory(object, sizeof(*this) * GCMemoryFactor,
                           JS::MemoryUse::XPCWrappedNative);
 
   mFlatJSObject = object;
   mFlatJSObject.setFlags(FLAT_JS_OBJECT_VALID);
-
-  // Never collect the wrapper object while recording or replaying, to avoid
-  // non-deterministically releasing references during finalization.
-  recordreplay::HoldJSObject(object);
 }
 
 inline void XPCWrappedNative::UnsetFlatJSObject() {
   MOZ_ASSERT(mFlatJSObject);
 
   JS::RemoveAssociatedMemory(mFlatJSObject.unbarrieredGetPtr(),
                              sizeof(*this) * GCMemoryFactor,
                              JS::MemoryUse::XPCWrappedNative);
--- a/js/xpconnect/src/XPCWrappedNativeProto.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeProto.cpp
@@ -53,20 +53,16 @@ bool XPCWrappedNativeProto::Init(JSConte
   mScriptable = scriptable;
 
   JS::RootedObject proto(cx, JS::GetRealmObjectPrototype(cx));
   mJSProtoObject = JS_NewObjectWithUniqueType(cx, &XPC_WN_Proto_JSClass, proto);
 
   bool success = !!mJSProtoObject;
   if (success) {
     JS_SetPrivate(mJSProtoObject, this);
-
-    // Never collect the proto object while recording or replaying, to avoid
-    // non-deterministically releasing references during finalization.
-    recordreplay::HoldJSObject(mJSProtoObject);
   }
 
   return success;
 }
 
 void XPCWrappedNativeProto::JSProtoObjectFinalized(JSFreeOp* fop,
                                                    JSObject* obj) {
   MOZ_ASSERT(obj == mJSProtoObject, "huh?");
--- a/js/xpconnect/src/nsXPConnect.cpp
+++ b/js/xpconnect/src/nsXPConnect.cpp
@@ -296,25 +296,18 @@ void xpc::ErrorReport::LogToStderr() {
     note.LogToStderr();
   }
 }
 
 void xpc::ErrorReport::LogToConsole() {
   LogToConsoleWithStack(nullptr, nullptr);
 }
 
-void xpc::ErrorReport::LogToConsoleWithStack(
-    JS::HandleObject aStack, JS::HandleObject aStackGlobal,
-    uint64_t aTimeWarpTarget /* = 0 */) {
-  // Don't log failures after diverging from a recording during replay, as
-  // this will cause the associated debugger operation to fail.
-  if (recordreplay::HasDivergedFromRecording()) {
-    return;
-  }
-
+void xpc::ErrorReport::LogToConsoleWithStack(JS::HandleObject aStack,
+                                             JS::HandleObject aStackGlobal) {
   if (aStack) {
     MOZ_ASSERT(aStackGlobal);
     MOZ_ASSERT(JS_IsGlobalObject(aStackGlobal));
     js::AssertSameCompartment(aStack, aStackGlobal);
   } else {
     MOZ_ASSERT(!aStackGlobal);
   }
 
@@ -338,17 +331,16 @@ void xpc::ErrorReport::LogToConsoleWithS
     // As we cache messages in the console service,
     // we have to ensure not leaking them after the related
     // context is destroyed and we only track document lifecycle for now.
     errorObject = new nsScriptErrorWithStack(aStack, aStackGlobal);
   } else {
     errorObject = new nsScriptError();
   }
   errorObject->SetErrorMessageName(mErrorMsgName);
-  errorObject->SetTimeWarpTarget(aTimeWarpTarget);
 
   nsresult rv = errorObject->InitWithWindowID(
       mErrorMsg, mFileName, mSourceLine, mLineNumber, mColumn, mFlags,
       mCategory, mWindowID,
       mCategory.Equals(NS_LITERAL_CSTRING("chrome javascript")));
   NS_ENSURE_SUCCESS_VOID(rv);
 
   rv = errorObject->InitSourceId(mSourceId);
--- a/js/xpconnect/src/xpcpublic.h
+++ b/js/xpconnect/src/xpcpublic.h
@@ -596,21 +596,19 @@ class ErrorReport : public ErrorBase {
 
   // Log the error report to the console.  Which console will depend on the
   // window id it was initialized with.
   void LogToConsole();
   // Log to console, using the given stack object (which should be a stack of
   // the sort that JS::CaptureCurrentStack produces).  aStack is allowed to be
   // null. If aStack is non-null, aStackGlobal must be a non-null global
   // object that's same-compartment with aStack. Note that aStack might be a
-  // CCW. When recording/replaying, aTimeWarpTarget optionally indicates
-  // where the error occurred in the process' execution.
+  // CCW.
   void LogToConsoleWithStack(JS::HandleObject aStack,
-                             JS::HandleObject aStackGlobal,
-                             uint64_t aTimeWarpTarget = 0);
+                             JS::HandleObject aStackGlobal);
 
   // Produce an error event message string from the given JSErrorReport.  Note
   // that this may produce an empty string if aReport doesn't have a
   // message attached.
   static void ErrorReportToMessageString(JSErrorReport* aReport,
                                          nsAString& aString);
 
   // Log the error report to the stderr.
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -5885,20 +5885,16 @@ void PresShell::Paint(nsView* aViewToPai
   if (contentRoot) {
     uri = contentRoot->GetDocumentURI();
   }
   url = uri ? uri->GetSpecOrDefault() : NS_LITERAL_CSTRING("N/A");
 #ifdef MOZ_GECKO_PROFILER
   AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING("PresShell::Paint", GRAPHICS, url);
 #endif
 
-  // When recording/replaying, create a checkpoint after every paint. This can
-  // cause content JS to run, so must live outside |nojs|.
-  auto createCheckpoint = MakeScopeExit(recordreplay::child::CreateCheckpoint);
-
   Maybe<js::AutoAssertNoContentJS> nojs;
 
   // On Android, Flash can call into content JS during painting, so we can't
   // assert there. However, we don't rely on this assertion on Android because
   // we don't paint while JS is running.
 #if !defined(MOZ_WIDGET_ANDROID)
   if (!(aFlags & PaintFlags::PaintComposite)) {
     // We need to allow content JS when the flag is set since we may trigger
--- a/layout/ipc/VsyncChild.cpp
+++ b/layout/ipc/VsyncChild.cpp
@@ -39,45 +39,32 @@ bool VsyncChild::SendUnobserve() {
   return true;
 }
 
 void VsyncChild::ActorDestroy(ActorDestroyReason aActorDestroyReason) {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!mIsShutdown);
   mIsShutdown = true;
   mObserver = nullptr;
-
-  if (recordreplay::IsRecordingOrReplaying()) {
-    recordreplay::child::SetVsyncObserver(nullptr);
-  }
 }
 
 mozilla::ipc::IPCResult VsyncChild::RecvNotify(const VsyncEvent& aVsync) {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!mIsShutdown);
 
   SchedulerGroup::MarkVsyncRan();
   if (mObservingVsync && mObserver) {
-    if (recordreplay::IsRecordingOrReplaying() &&
-        !recordreplay::child::OnVsync()) {
-      return IPC_OK();
-    }
-
     mObserver->NotifyVsync(aVsync);
   }
   return IPC_OK();
 }
 
 void VsyncChild::SetVsyncObserver(VsyncObserver* aVsyncObserver) {
   MOZ_ASSERT(NS_IsMainThread());
   mObserver = aVsyncObserver;
-
-  if (recordreplay::IsRecordingOrReplaying()) {
-    recordreplay::child::SetVsyncObserver(mObserver);
-  }
 }
 
 TimeDuration VsyncChild::GetVsyncRate() {
   if (mVsyncRate == TimeDuration::Forever()) {
     PVsyncChild::SendRequestVsyncRate();
   }
 
   return mVsyncRate;
--- a/layout/style/ImageLoader.cpp
+++ b/layout/style/ImageLoader.cpp
@@ -92,30 +92,23 @@ void ImageLoader::DropDocumentReference(
   // It's okay if GetPresContext returns null here (due to the presshell pointer
   // on the document being null) as that means the presshell has already
   // been destroyed, and it also calls ClearFrames when it is destroyed.
   ClearFrames(GetPresContext());
 
   mDocument = nullptr;
 }
 
-// Normally, arrays of requests and frames are sorted by their pointer address,
-// for faster lookup. When recording or replaying, we don't do this, so that
-// the arrays retain their insertion order and are consistent between recording
-// and replaying.
+// Arrays of requests and frames are sorted by their pointer address,
+// for faster lookup.
 template <typename Elem, typename Item,
           typename Comparator = nsDefaultComparator<Elem, Item>>
 static size_t GetMaybeSortedIndex(const nsTArray<Elem>& aArray,
                                   const Item& aItem, bool* aFound,
                                   Comparator aComparator = Comparator()) {
-  if (recordreplay::IsRecordingOrReplaying()) {
-    size_t index = aArray.IndexOf(aItem, 0, aComparator);
-    *aFound = index != nsTArray<Elem>::NoIndex;
-    return *aFound ? index + 1 : aArray.Length();
-  }
   size_t index = aArray.IndexOfFirstElementGt(aItem, aComparator);
   *aFound = index > 0 && aComparator.Equals(aItem, aArray.ElementAt(index - 1));
   return index;
 }
 
 void ImageLoader::AssociateRequestToFrame(imgIRequest* aRequest,
                                           nsIFrame* aFrame, FrameFlags aFlags) {
   MOZ_ASSERT(NS_IsMainThread());
@@ -293,21 +286,17 @@ void ImageLoader::DeregisterImageRequest
   }
 }
 
 void ImageLoader::RemoveFrameToRequestMapping(imgIRequest* aRequest,
                                               nsIFrame* aFrame) {
   if (auto entry = mFrameToRequestMap.Lookup(aFrame)) {
     const auto& requestSet = entry.Data();
     MOZ_ASSERT(requestSet, "This should never be null");
-    if (recordreplay::IsRecordingOrReplaying()) {
-      requestSet->RemoveElement(aRequest);
-    } else {
-      requestSet->RemoveElementSorted(aRequest);
-    }
+    requestSet->RemoveElementSorted(aRequest);
     if (requestSet->IsEmpty()) {
       aFrame->SetHasImageRequest(false);
       entry.Remove();
     }
   }
 }
 
 void ImageLoader::DisassociateRequestFromFrame(imgIRequest* aRequest,
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -1645,25 +1645,16 @@ nsresult Loader::LoadSheet(SheetLoadData
  */
 Loader::Completed Loader::ParseSheet(const nsACString& aBytes,
                                      SheetLoadData& aLoadData,
                                      AllowAsyncParse aAllowAsync) {
   LOG(("css::Loader::ParseSheet"));
   AUTO_PROFILER_LABEL("css::Loader::ParseSheet", LAYOUT_CSSParsing);
   aLoadData.mIsBeingParsed = true;
 
-  // Tell the record/replay system about any sheets that are being parsed,
-  // so that devtools code can find them later.
-  if (recordreplay::IsRecordingOrReplaying() && aLoadData.mURI) {
-    recordreplay::NoteContentParse(
-        &aLoadData, aLoadData.mURI->GetSpecOrDefault().get(), "text/css",
-        reinterpret_cast<const Utf8Unit*>(aBytes.BeginReading()),
-        aBytes.Length());
-  }
-
   StyleSheet* sheet = aLoadData.mSheet;
   MOZ_ASSERT(sheet);
 
   // Some cases, like inline style and UA stylesheets, need to be parsed
   // synchronously. The former may trigger child loads, the latter must not.
   if (aLoadData.mSyncLoad || aAllowAsync == AllowAsyncParse::No) {
     sheet->ParseSheetSync(this, aBytes, &aLoadData, aLoadData.mLineNumber);
     aLoadData.mIsBeingParsed = false;
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -1110,21 +1110,16 @@ already_AddRefed<nsDOMDataChannel> PeerC
 NS_IMETHODIMP
 PeerConnectionImpl::CreateDataChannel(
     const nsAString& aLabel, const nsAString& aProtocol, uint16_t aType,
     bool ordered, uint16_t aMaxTime, uint16_t aMaxNum, bool aExternalNegotiated,
     uint16_t aStream, nsDOMDataChannel** aRetval) {
   PC_AUTO_ENTER_API_CALL(false);
   MOZ_ASSERT(aRetval);
 
-  // WebRTC is not enabled when recording/replaying (being removed) bug 1304149.
-  if (recordreplay::IsRecordingOrReplaying()) {
-    return NS_ERROR_UNEXPECTED;
-  }
-
   RefPtr<DataChannel> dataChannel;
   DataChannelConnection::Type theType =
       static_cast<DataChannelConnection::Type>(aType);
 
   nsresult rv = EnsureDataConnection(
       WEBRTC_DATACHANNEL_PORT_DEFAULT, WEBRTC_DATACHANNEL_STREAMS_DEFAULT,
       WEBRTC_DATACHANNEL_MAX_MESSAGE_SIZE_REMOTE_DEFAULT, false);
   if (NS_FAILED(rv)) {
--- a/memory/build/mozjemalloc.cpp
+++ b/memory/build/mozjemalloc.cpp
@@ -499,21 +499,18 @@ GLOBAL_ASSERT(kQuantum <= gPageSize);
 GLOBAL_ASSERT(kChunkSize >= gPageSize);
 GLOBAL_ASSERT(kQuantum * 4 <= kChunkSize);
 END_GLOBALS
 
 // Recycle at most 128 MiB of chunks. This means we retain at most
 // 6.25% of the process address space on a 32-bit OS for later use.
 static const size_t gRecycleLimit = 128_MiB;
 
-// The current amount of recycled bytes, updated atomically. Malloc may be
-// called non-deterministically when recording/replaying, so this atomic's
-// accesses are not recorded.
-static Atomic<size_t, ReleaseAcquire, recordreplay::Behavior::DontPreserve>
-    gRecycledSize;
+// The current amount of recycled bytes, updated atomically.
+static Atomic<size_t, ReleaseAcquire> gRecycledSize;
 
 // Maximum number of dirty pages per arena.
 #define DIRTY_MAX_DEFAULT (1U << 8)
 
 static size_t opt_dirty_max = DIRTY_MAX_DEFAULT;
 
 // Return the smallest chunk multiple that is >= s.
 #define CHUNK_CEILING(s) (((s) + kChunkSizeMask) & ~kChunkSizeMask)
@@ -542,21 +539,17 @@ static void* base_alloc(size_t aSize);
 // run after `malloc_init` has been called once, which triggers multiple
 // initializations.
 // We work around the problem by not using an Atomic<bool> at all. There is a
 // theoretical problem with using `malloc_initialized` non-atomically, but
 // practically, this is only true if `malloc_init` is never called before
 // threads are created.
 static bool malloc_initialized;
 #else
-// Malloc may be called non-deterministically when recording/replaying, so this
-// atomic's accesses are not recorded.
-static Atomic<bool, SequentiallyConsistent,
-              recordreplay::Behavior::DontPreserve>
-    malloc_initialized;
+static Atomic<bool, SequentiallyConsistent> malloc_initialized;
 #endif
 
 static StaticMutex gInitLock = {STATIC_MUTEX_INIT};
 
 // ***************************************************************************
 // Statistics data structures.
 
 struct arena_stats_t {
@@ -2834,22 +2827,18 @@ void* arena_t::MallocSmall(size_t aSize,
     if (MOZ_UNLIKELY(mRandomizeSmallAllocations && mPRNG == nullptr)) {
       // This is frustrating. Because the code backing RandomUint64 (arc4random
       // for example) may allocate memory, and because
       // mRandomizeSmallAllocations is true and we haven't yet initilized mPRNG,
       // we would re-enter this same case and cause a deadlock inside e.g.
       // arc4random.  So we temporarily disable mRandomizeSmallAllocations to
       // skip this case and then re-enable it
       mRandomizeSmallAllocations = false;
-      mozilla::Maybe<uint64_t> prngState1, prngState2;
-      {
-        mozilla::recordreplay::AutoEnsurePassThroughThreadEvents pt;
-        prngState1 = mozilla::RandomUint64();
-        prngState2 = mozilla::RandomUint64();
-      }
+      mozilla::Maybe<uint64_t> prngState1 = mozilla::RandomUint64();
+      mozilla::Maybe<uint64_t> prngState2 = mozilla::RandomUint64();
       void* backing =
           base_alloc(sizeof(mozilla::non_crypto::XorShift128PlusRNG));
       mPRNG = new (backing) mozilla::non_crypto::XorShift128PlusRNG(
           prngState1.valueOr(0), prngState2.valueOr(0));
       mRandomizeSmallAllocations = true;
     }
 
     MutexAutoLock lock(mLock);
@@ -3620,21 +3609,17 @@ arena_t* ArenaCollection::CreateArena(bo
   }
 
   // For private arenas, generate a cryptographically-secure random id for the
   // new arena. If an attacker manages to get control of the process, this
   // should make it more difficult for them to "guess" the ID of a memory
   // arena, stopping them from getting data they may want
 
   while (true) {
-    mozilla::Maybe<uint64_t> maybeRandomId;
-    {
-      mozilla::recordreplay::AutoEnsurePassThroughThreadEvents pt;
-      maybeRandomId = mozilla::RandomUint64();
-    }
+    mozilla::Maybe<uint64_t> maybeRandomId = mozilla::RandomUint64();
     MOZ_RELEASE_ASSERT(maybeRandomId.isSome());
 
     // Avoid 0 as an arena Id. We use 0 for disposed arenas.
     if (!maybeRandomId.value()) {
       continue;
     }
 
     // Keep looping until we ensure that the random number we just generated
@@ -4560,18 +4545,17 @@ static malloc_table_t gOriginalMallocTab
 // comments above that function for more details.)
 static malloc_table_t gDynamicMallocTable = {
 #  include "malloc_decls.h"
 };
 
 // This briefly points to gDefaultMallocTable at startup. After that, it points
 // to either gOriginalMallocTable or gDynamicMallocTable. It's atomic to avoid
 // races when switching between tables.
-static Atomic<malloc_table_t const*, mozilla::MemoryOrdering::Relaxed,
-              recordreplay::Behavior::DontPreserve>
+static Atomic<malloc_table_t const*, mozilla::MemoryOrdering::Relaxed>
     gMallocTablePtr;
 
 #  ifdef MOZ_DYNAMIC_REPLACE_INIT
 #    undef replace_init
 typedef decltype(replace_init_decl) replace_init_impl_t;
 static replace_init_impl_t* replace_init = nullptr;
 #  endif
 
--- a/memory/replace/logalloc/replay/moz.build
+++ b/memory/replace/logalloc/replay/moz.build
@@ -5,17 +5,16 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 Program('logalloc-replay')
 
 SOURCES += [
     '/mfbt/Assertions.cpp',
     '/mfbt/Poison.cpp',
     '/mfbt/RandomNum.cpp',
-    '/mfbt/RecordReplay.cpp',
     '/mfbt/TaggedAnonymousMemory.cpp',
     '/mfbt/Unused.cpp',
     'Replay.cpp',
 ]
 
 if CONFIG['MOZ_REPLACE_MALLOC_STATIC'] and \
    (CONFIG['MOZ_DMD'] or CONFIG['MOZ_PHC']):
     UNIFIED_SOURCES += [
--- a/memory/replace/phc/PHC.cpp
+++ b/memory/replace/phc/PHC.cpp
@@ -86,17 +86,16 @@
 #include "mozilla/Attributes.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/StackWalk.h"
 #include "mozilla/ThreadLocal.h"
 #include "mozilla/XorShift128PlusRNG.h"
 
 using namespace mozilla;
-using namespace mozilla::recordreplay;
 
 //---------------------------------------------------------------------------
 // Utilities
 //---------------------------------------------------------------------------
 
 #ifdef ANDROID
 // Android doesn't have pthread_atfork defined in pthread.h.
 extern "C" MOZ_EXPORT int pthread_atfork(void (*)(void), void (*)(void),
@@ -326,26 +325,26 @@ class GAtomic {
   static int32_t DecrementDelay() { return --sAllocDelay; }
 
   static void SetAllocDelay(Delay aAllocDelay) { sAllocDelay = aAllocDelay; }
 
  private:
   // The current time. Relaxed semantics because it's primarily used for
   // determining if an allocation can be recycled yet and therefore it doesn't
   // need to be exact.
-  static Atomic<Time, Relaxed, Behavior::DontPreserve> sNow;
+  static Atomic<Time, Relaxed> sNow;
 
   // Delay until the next attempt at a page allocation. See the comment in
   // MaybePageAlloc() for an explanation of why it is a signed integer, and why
   // it uses ReleaseAcquire semantics.
-  static Atomic<Delay, ReleaseAcquire, Behavior::DontPreserve> sAllocDelay;
+  static Atomic<Delay, ReleaseAcquire> sAllocDelay;
 };
 
-Atomic<Time, Relaxed, Behavior::DontPreserve> GAtomic::sNow;
-Atomic<Delay, ReleaseAcquire, Behavior::DontPreserve> GAtomic::sAllocDelay;
+Atomic<Time, Relaxed> GAtomic::sNow;
+Atomic<Delay, ReleaseAcquire> GAtomic::sAllocDelay;
 
 // Shared, immutable global state. Initialized by replace_init() and never
 // changed after that. replace_init() runs early enough that no synchronization
 // is needed.
 class GConst {
  private:
   // The bounds of the allocated pages.
   uint8_t* const mPagesStart;
--- a/mfbt/Assertions.cpp
+++ b/mfbt/Assertions.cpp
@@ -18,19 +18,17 @@ MOZ_BEGIN_EXTERN_C
  */
 MFBT_DATA const char* gMozCrashReason = nullptr;
 
 static char sPrintfCrashReason[sPrintfCrashReasonSize] = {};
 
 // Accesses to this atomic are not included in web replay recordings, so that
 // if we crash in an area where recorded events are not allowed the true reason
 // for the crash is not obscured by a record/replay error.
-static mozilla::Atomic<bool, mozilla::SequentiallyConsistent,
-                       mozilla::recordreplay::Behavior::DontPreserve>
-    sCrashing(false);
+static mozilla::Atomic<bool, mozilla::SequentiallyConsistent> sCrashing(false);
 
 MFBT_API MOZ_COLD MOZ_NEVER_INLINE MOZ_FORMAT_PRINTF(1, 2) const
     char* MOZ_CrashPrintf(const char* aFormat, ...) {
   if (!sCrashing.compareExchange(false, true)) {
     // In the unlikely event of a race condition, skip
     // setting the crash reason and just crash safely.
     MOZ_RELEASE_ASSERT(false);
   }
--- a/mfbt/Atomics.h
+++ b/mfbt/Atomics.h
@@ -14,17 +14,16 @@
  */
 
 #ifndef mozilla_Atomics_h
 #define mozilla_Atomics_h
 
 #include "mozilla/Assertions.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/Compiler.h"
-#include "mozilla/RecordReplay.h"
 #include "mozilla/TypeTraits.h"
 
 #include <atomic>
 
 #include <stdint.h>
 
 namespace mozilla {
 
@@ -140,43 +139,16 @@ enum MemoryOrdering {
    * you don't know what order to use, use this one.
    */
   SequentiallyConsistent,
 };
 
 namespace detail {
 
 /*
- * Structure which can be used to preserve the ordering of atomic accesses
- * when recording or replaying an execution, depending on the Recording enum.
- *
- * Atomic access ordering is preserved by default when recording/replaying.
- * This should be overridden for atomics that can be accessed in code that
- * runs non-deterministically when recording/replaying, such as during GC, the
- * JS interrupt callback, or code that is affected by JIT compilation or
- * debugger activity.
- */
-template <recordreplay::Behavior Recording>
-struct AutoRecordAtomicAccess;
-
-template <>
-struct AutoRecordAtomicAccess<recordreplay::Behavior::DontPreserve> {
-  explicit AutoRecordAtomicAccess(const void* aValue) {}
-  ~AutoRecordAtomicAccess() = default;
-};
-
-template <>
-struct AutoRecordAtomicAccess<recordreplay::Behavior::Preserve> {
-  explicit AutoRecordAtomicAccess(const void* aValue) {
-    recordreplay::BeginOrderedAtomicAccess(aValue);
-  }
-  ~AutoRecordAtomicAccess() { recordreplay::EndOrderedAtomicAccess(); }
-};
-
-/*
  * We provide CompareExchangeFailureOrder to work around a bug in some
  * versions of GCC's <atomic> header.  See bug 898491.
  */
 template <MemoryOrdering Order>
 struct AtomicOrderConstraints;
 
 template <>
 struct AtomicOrderConstraints<Relaxed> {
@@ -206,125 +178,113 @@ struct AtomicOrderConstraints<Sequential
 };
 
 template <typename T, MemoryOrdering Order>
 struct IntrinsicBase {
   typedef std::atomic<T> ValueType;
   typedef AtomicOrderConstraints<Order> OrderedOp;
 };
 
-template <typename T, MemoryOrdering Order, recordreplay::Behavior Recording>
+template <typename T, MemoryOrdering Order>
 struct IntrinsicMemoryOps : public IntrinsicBase<T, Order> {
   typedef IntrinsicBase<T, Order> Base;
 
   static T load(const typename Base::ValueType& aPtr) {
-    AutoRecordAtomicAccess<Recording> record(&aPtr);
     return aPtr.load(Base::OrderedOp::LoadOrder);
   }
 
   static void store(typename Base::ValueType& aPtr, T aVal) {
-    AutoRecordAtomicAccess<Recording> record(&aPtr);
     aPtr.store(aVal, Base::OrderedOp::StoreOrder);
   }
 
   static T exchange(typename Base::ValueType& aPtr, T aVal) {
-    AutoRecordAtomicAccess<Recording> record(&aPtr);
     return aPtr.exchange(aVal, Base::OrderedOp::AtomicRMWOrder);
   }
 
   static bool compareExchange(typename Base::ValueType& aPtr, T aOldVal,
                               T aNewVal) {
-    AutoRecordAtomicAccess<Recording> record(&aPtr);
     return aPtr.compare_exchange_strong(
         aOldVal, aNewVal, Base::OrderedOp::AtomicRMWOrder,
         Base::OrderedOp::CompareExchangeFailureOrder);
   }
 };
 
-template <typename T, MemoryOrdering Order, recordreplay::Behavior Recording>
+template <typename T, MemoryOrdering Order>
 struct IntrinsicAddSub : public IntrinsicBase<T, Order> {
   typedef IntrinsicBase<T, Order> Base;
 
   static T add(typename Base::ValueType& aPtr, T aVal) {
-    AutoRecordAtomicAccess<Recording> record(&aPtr);
     return aPtr.fetch_add(aVal, Base::OrderedOp::AtomicRMWOrder);
   }
 
   static T sub(typename Base::ValueType& aPtr, T aVal) {
-    AutoRecordAtomicAccess<Recording> record(&aPtr);
     return aPtr.fetch_sub(aVal, Base::OrderedOp::AtomicRMWOrder);
   }
 };
 
-template <typename T, MemoryOrdering Order, recordreplay::Behavior Recording>
-struct IntrinsicAddSub<T*, Order, Recording> : public IntrinsicBase<T*, Order> {
+template <typename T, MemoryOrdering Order>
+struct IntrinsicAddSub<T*, Order> : public IntrinsicBase<T*, Order> {
   typedef IntrinsicBase<T*, Order> Base;
 
   static T* add(typename Base::ValueType& aPtr, ptrdiff_t aVal) {
-    AutoRecordAtomicAccess<Recording> record(&aPtr);
     return aPtr.fetch_add(aVal, Base::OrderedOp::AtomicRMWOrder);
   }
 
   static T* sub(typename Base::ValueType& aPtr, ptrdiff_t aVal) {
-    AutoRecordAtomicAccess<Recording> record(&aPtr);
     return aPtr.fetch_sub(aVal, Base::OrderedOp::AtomicRMWOrder);
   }
 };
 
-template <typename T, MemoryOrdering Order, recordreplay::Behavior Recording>
-struct IntrinsicIncDec : public IntrinsicAddSub<T, Order, Recording> {
+template <typename T, MemoryOrdering Order>
+struct IntrinsicIncDec : public IntrinsicAddSub<T, Order> {
   typedef IntrinsicBase<T, Order> Base;
 
   static T inc(typename Base::ValueType& aPtr) {
-    return IntrinsicAddSub<T, Order, Recording>::add(aPtr, 1);
+    return IntrinsicAddSub<T, Order>::add(aPtr, 1);
   }
 
   static T dec(typename Base::ValueType& aPtr) {
-    return IntrinsicAddSub<T, Order, Recording>::sub(aPtr, 1);
+    return IntrinsicAddSub<T, Order>::sub(aPtr, 1);
   }
 };
 
-template <typename T, MemoryOrdering Order, recordreplay::Behavior Recording>
-struct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order, Recording>,
-                          public IntrinsicIncDec<T, Order, Recording> {
+template <typename T, MemoryOrdering Order>
+struct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,
+                          public IntrinsicIncDec<T, Order> {
   typedef IntrinsicBase<T, Order> Base;
 
   static T or_(typename Base::ValueType& aPtr, T aVal) {
-    AutoRecordAtomicAccess<Recording> record(&aPtr);
     return aPtr.fetch_or(aVal, Base::OrderedOp::AtomicRMWOrder);
   }
 
   static T xor_(typename Base::ValueType& aPtr, T aVal) {
-    AutoRecordAtomicAccess<Recording> record(&aPtr);
     return aPtr.fetch_xor(aVal, Base::OrderedOp::AtomicRMWOrder);
   }
 
   static T and_(typename Base::ValueType& aPtr, T aVal) {
-    AutoRecordAtomicAccess<Recording> record(&aPtr);
     return aPtr.fetch_and(aVal, Base::OrderedOp::AtomicRMWOrder);
   }
 };
 
-template <typename T, MemoryOrdering Order, recordreplay::Behavior Recording>
-struct AtomicIntrinsics<T*, Order, Recording>
-    : public IntrinsicMemoryOps<T*, Order, Recording>,
-      public IntrinsicIncDec<T*, Order, Recording> {};
+template <typename T, MemoryOrdering Order>
+struct AtomicIntrinsics<T*, Order> : public IntrinsicMemoryOps<T*, Order>,
+                                     public IntrinsicIncDec<T*, Order> {};
 
 template <typename T>
 struct ToStorageTypeArgument {
   static constexpr T convert(T aT) { return aT; }
 };
 
-template <typename T, MemoryOrdering Order, recordreplay::Behavior Recording>
+template <typename T, MemoryOrdering Order>
 class AtomicBase {
   static_assert(sizeof(T) == 4 || sizeof(T) == 8,
                 "mozilla/Atomics.h only supports 32-bit and 64-bit types");
 
  protected:
-  typedef typename detail::AtomicIntrinsics<T, Order, Recording> Intrinsics;
+  typedef typename detail::AtomicIntrinsics<T, Order> Intrinsics;
   typedef typename Intrinsics::ValueType ValueType;
   ValueType mValue;
 
  public:
   constexpr AtomicBase() : mValue() {}
   explicit constexpr AtomicBase(T aInit)
       : mValue(ToStorageTypeArgument<T>::convert(aInit)) {}
 
@@ -358,19 +318,19 @@ class AtomicBase {
   bool compareExchange(T aOldValue, T aNewValue) {
     return Intrinsics::compareExchange(mValue, aOldValue, aNewValue);
   }
 
  private:
   AtomicBase(const AtomicBase& aCopy) = delete;
 };
 
-template <typename T, MemoryOrdering Order, recordreplay::Behavior Recording>
-class AtomicBaseIncDec : public AtomicBase<T, Order, Recording> {
-  typedef typename detail::AtomicBase<T, Order, Recording> Base;
+template <typename T, MemoryOrdering Order>
+class AtomicBaseIncDec : public AtomicBase<T, Order> {
+  typedef typename detail::AtomicBase<T, Order> Base;
 
  public:
   constexpr AtomicBaseIncDec() : Base() {}
   explicit constexpr AtomicBaseIncDec(T aInit) : Base(aInit) {}
 
   using Base::operator=;
 
   operator T() const { return Base::Intrinsics::load(Base::mValue); }
@@ -398,34 +358,33 @@ class AtomicBaseIncDec : public AtomicBa
  * you have a compelling reason to do otherwise.
  *
  * There is one exception to the case of atomic memory accesses: providing an
  * initial value of the atomic value is not guaranteed to be atomic.  This is a
  * deliberate design choice that enables static atomic variables to be declared
  * without introducing extra static constructors.
  */
 template <typename T, MemoryOrdering Order = SequentiallyConsistent,
-          recordreplay::Behavior Recording = recordreplay::Behavior::Preserve,
           typename Enable = void>
 class Atomic;
 
 /**
  * Atomic<T> implementation for integral types.
  *
  * In addition to atomic store and load operations, compound assignment and
  * increment/decrement operators are implemented which perform the
  * corresponding read-modify-write operation atomically.  Finally, an atomic
  * swap method is provided.
  */
-template <typename T, MemoryOrdering Order, recordreplay::Behavior Recording>
+template <typename T, MemoryOrdering Order>
 class Atomic<
-    T, Order, Recording,
+    T, Order,
     typename EnableIf<IsIntegral<T>::value && !IsSame<T, bool>::value>::Type>
-    : public detail::AtomicBaseIncDec<T, Order, Recording> {
-  typedef typename detail::AtomicBaseIncDec<T, Order, Recording> Base;
+    : public detail::AtomicBaseIncDec<T, Order> {
+  typedef typename detail::AtomicBaseIncDec<T, Order> Base;
 
  public:
   constexpr Atomic() : Base() {}
   explicit constexpr Atomic(T aInit) : Base(aInit) {}
 
   using Base::operator=;
 
   T operator+=(T aDelta) {
@@ -455,20 +414,19 @@ class Atomic<
 /**
  * Atomic<T> implementation for pointer types.
  *
  * An atomic compare-and-swap primitive for pointer variables is provided, as
  * are atomic increment and decement operators.  Also provided are the compound
  * assignment operators for addition and subtraction. Atomic swap (via
  * exchange()) is included as well.
  */
-template <typename T, MemoryOrdering Order, recordreplay::Behavior Recording>
-class Atomic<T*, Order, Recording>
-    : public detail::AtomicBaseIncDec<T*, Order, Recording> {
-  typedef typename detail::AtomicBaseIncDec<T*, Order, Recording> Base;
+template <typename T, MemoryOrdering Order>
+class Atomic<T*, Order> : public detail::AtomicBaseIncDec<T*, Order> {
+  typedef typename detail::AtomicBaseIncDec<T*, Order> Base;
 
  public:
   constexpr Atomic() : Base() {}
   explicit constexpr Atomic(T* aInit) : Base(aInit) {}
 
   using Base::operator=;
 
   T* operator+=(ptrdiff_t aDelta) {
@@ -483,20 +441,20 @@ class Atomic<T*, Order, Recording>
   Atomic(Atomic& aOther) = delete;
 };
 
 /**
  * Atomic<T> implementation for enum types.
  *
  * The atomic store and load operations and the atomic swap method is provided.
  */
-template <typename T, MemoryOrdering Order, recordreplay::Behavior Recording>
-class Atomic<T, Order, Recording, typename EnableIf<IsEnum<T>::value>::Type>
-    : public detail::AtomicBase<T, Order, Recording> {
-  typedef typename detail::AtomicBase<T, Order, Recording> Base;
+template <typename T, MemoryOrdering Order>
+class Atomic<T, Order, typename EnableIf<IsEnum<T>::value>::Type>
+    : public detail::AtomicBase<T, Order> {
+  typedef typename detail::AtomicBase<T, Order> Base;
 
  public:
   constexpr Atomic() : Base() {}
   explicit constexpr Atomic(T aInit) : Base(aInit) {}
 
   operator T() const { return T(Base::Intrinsics::load(Base::mValue)); }
 
   using Base::operator=;
@@ -516,20 +474,19 @@ class Atomic<T, Order, Recording, typena
  *   bool and/or some implementations of std::atomic. This is allowed in
  *   [atomic.types.generic]p9.
  *
  * - It's not obvious whether the 8-bit atomic functions on Windows are always
  *   inlined or not. If they are not inlined, the corresponding functions in the
  *   runtime library are not available on Windows XP. This is why we implement
  *   Atomic<bool> with an underlying type of uint32_t.
  */
-template <MemoryOrdering Order, recordreplay::Behavior Recording>
-class Atomic<bool, Order, Recording>
-    : protected detail::AtomicBase<uint32_t, Order, Recording> {
-  typedef typename detail::AtomicBase<uint32_t, Order, Recording> Base;
+template <MemoryOrdering Order>
+class Atomic<bool, Order> : protected detail::AtomicBase<uint32_t, Order> {
+  typedef typename detail::AtomicBase<uint32_t, Order> Base;
 
  public:
   constexpr Atomic() : Base() {}
   explicit constexpr Atomic(bool aInit) : Base(aInit) {}
 
   // We provide boolean wrappers for the underlying AtomicBase methods.
   MOZ_IMPLICIT operator bool() const {
     return Base::Intrinsics::load(Base::mValue);
--- a/mfbt/ChaosMode.cpp
+++ b/mfbt/ChaosMode.cpp
@@ -5,14 +5,13 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ChaosMode.h"
 
 namespace mozilla {
 
 namespace detail {
 
-Atomic<uint32_t, SequentiallyConsistent, recordreplay::Behavior::DontPreserve>
-    gChaosModeCounter(0);
+Atomic<uint32_t, SequentiallyConsistent> gChaosModeCounter(0);
 ChaosFeature gChaosFeatures = None;
 
 } /* namespace detail */
 } /* namespace mozilla */
--- a/mfbt/ChaosMode.h
+++ b/mfbt/ChaosMode.h
@@ -32,19 +32,17 @@ enum ChaosFeature {
   // Delay dispatching threads to encourage dispatched tasks to run.
   TaskDispatching = 0x40,
   // Delay task running to encourage sending threads to run.
   TaskRunning = 0x80,
   Any = 0xffffffff,
 };
 
 namespace detail {
-extern MFBT_DATA Atomic<uint32_t, SequentiallyConsistent,
-                        recordreplay::Behavior::DontPreserve>
-    gChaosModeCounter;
+extern MFBT_DATA Atomic<uint32_t, SequentiallyConsistent> gChaosModeCounter;
 extern MFBT_DATA ChaosFeature gChaosFeatures;
 }  // namespace detail
 
 /**
  * When "chaos mode" is activated, code that makes implicitly nondeterministic
  * choices is encouraged to make random and extreme choices, to test more
  * code paths and uncover bugs.
  */
deleted file mode 100644
--- a/mfbt/RecordReplay.cpp
+++ /dev/null
@@ -1,186 +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/. */
-
-#include "RecordReplay.h"
-
-#include "js/GCAnnotations.h"
-#include "mozilla/Atomics.h"
-#include "mozilla/Casting.h"
-#include "mozilla/Utf8.h"
-
-#include <stdlib.h>
-
-// Recording and replaying is only enabled on Mac nightlies.
-#if defined(XP_MACOSX) && defined(NIGHTLY_BUILD)
-#  define ENABLE_RECORD_REPLAY
-#endif
-
-#ifdef ENABLE_RECORD_REPLAY
-#  include <dlfcn.h>
-#endif
-
-namespace mozilla::recordreplay {
-
-// clang-format off
-#define FOR_EACH_INTERFACE(Macro)                                              \
-  Macro(InternalAreThreadEventsPassedThrough, bool, (), ())                    \
-  Macro(InternalAreThreadEventsDisallowed, bool, (), ())                       \
-  Macro(InternalRecordReplayValue, size_t, (size_t aValue), (aValue))          \
-  Macro(InternalHasDivergedFromRecording, bool, (), ())                        \
-  Macro(InternalGeneratePLDHashTableCallbacks, const PLDHashTableOps*,         \
-        (const PLDHashTableOps* aOps), (aOps))                                 \
-  Macro(InternalUnwrapPLDHashTableCallbacks, const PLDHashTableOps*,           \
-        (const PLDHashTableOps* aOps), (aOps))                                 \
-  Macro(InternalThingIndex, size_t, (void* aThing), (aThing))                  \
-  Macro(InternalVirtualThingName, const char*, (void* aThing), (aThing))       \
-  Macro(ExecutionProgressCounter, ProgressCounter*, (), ())                    \
-  Macro(NewTimeWarpTarget, ProgressCounter, (), ())                            \
-  Macro(ShouldUpdateProgressCounter, bool, (const char* aURL), (aURL))         \
-  Macro(DefineRecordReplayControlObject, bool, (void* aCx, void* aObj),        \
-        (aCx, aObj))
-
-#define FOR_EACH_INTERFACE_VOID(Macro)                                         \
-  Macro(InternalBeginOrderedAtomicAccess, (const void* aValue), (aValue))      \
-  Macro(InternalEndOrderedAtomicAccess, (), ())                                \
-  Macro(InternalBeginPassThroughThreadEvents, (), ())                          \
-  Macro(InternalEndPassThroughThreadEvents, (), ())                            \
-  Macro(InternalBeginPassThroughThreadEventsWithLocalReplay, (), ())           \
-  Macro(InternalEndPassThroughThreadEventsWithLocalReplay, (), ())             \
-  Macro(InternalBeginDisallowThreadEvents, (), ())                             \
-  Macro(InternalEndDisallowThreadEvents, (), ())                               \
-  Macro(InternalRecordReplayBytes, (void* aData, size_t aSize),                \
-        (aData, aSize))                                                        \
-  Macro(InternalInvalidateRecording, (const char* aWhy), (aWhy))               \
-  Macro(InternalDestroyPLDHashTableCallbacks, (const PLDHashTableOps* aOps),   \
-        (aOps))                                                                \
-  Macro(InternalMovePLDHashTableContents,                                      \
-        (const PLDHashTableOps* aFirstOps, const PLDHashTableOps* aSecondOps), \
-        (aFirstOps, aSecondOps))                                               \
-  Macro(InternalHoldJSObject, (void* aJSObj), (aJSObj))                        \
-  Macro(InternalRecordReplayAssert, (const char* aFormat, va_list aArgs),      \
-        (aFormat, aArgs))                                                      \
-  Macro(InternalRecordReplayAssertBytes, (const void* aData, size_t aSize),    \
-        (aData, aSize))                                                        \
-  Macro(InternalRegisterThing, (void* aThing), (aThing))                       \
-  Macro(InternalUnregisterThing, (void* aThing), (aThing))                     \
-  Macro(BeginContentParse,                                                     \
-        (const void* aToken, const char* aURL, const char* aContentType),      \
-        (aToken, aURL, aContentType))                                          \
-  Macro(AddContentParseData8,                                                  \
-        (const void* aToken, const mozilla::Utf8Unit* aUtf8Buffer,             \
-         size_t aLength),                                                      \
-        (aToken, aUtf8Buffer, aLength))                                        \
-  Macro(AddContentParseData16,                                                 \
-        (const void* aToken, const char16_t* aBuffer, size_t aLength),         \
-        (aToken, aBuffer, aLength))                                            \
-  Macro(EndContentParse, (const void* aToken), (aToken))
-// clang-format on
-
-#define DECLARE_SYMBOL(aName, aReturnType, aFormals, _) \
-  static aReturnType(*gPtr##aName) aFormals;
-#define DECLARE_SYMBOL_VOID(aName, aFormals, _) \
-  DECLARE_SYMBOL(aName, void, aFormals, _)
-
-FOR_EACH_INTERFACE(DECLARE_SYMBOL)
-FOR_EACH_INTERFACE_VOID(DECLARE_SYMBOL_VOID)
-
-#undef DECLARE_SYMBOL
-#undef DECLARE_SYMBOL_VOID
-
-static void* LoadSymbol(const char* aName) {
-#ifdef ENABLE_RECORD_REPLAY
-  void* rv = dlsym(RTLD_DEFAULT, aName);
-  if (!rv) {
-    fprintf(stderr, "Record/Replay LoadSymbol failed: %s\n", aName);
-    MOZ_CRASH("LoadSymbol");
-  }
-  return rv;
-#else
-  return nullptr;
-#endif
-}
-
-void Initialize(int aArgc, char* aArgv[]) {
-  // Only initialize if the right command line option was specified.
-  bool found = false;
-  for (int i = 0; i < aArgc; i++) {
-    if (!strcmp(aArgv[i], gProcessKindOption)) {
-      found = true;
-      break;
-    }
-  }
-  if (!found) {
-    return;
-  }
-
-  void (*initialize)(int, char**);
-  BitwiseCast(LoadSymbol("RecordReplayInterface_Initialize"), &initialize);
-  if (!initialize) {
-    return;
-  }
-
-#define INIT_SYMBOL(aName, _1, _2, _3) \
-  BitwiseCast(LoadSymbol("RecordReplayInterface_" #aName), &gPtr##aName);
-#define INIT_SYMBOL_VOID(aName, _2, _3) INIT_SYMBOL(aName, void, _2, _3)
-
-  FOR_EACH_INTERFACE(INIT_SYMBOL)
-  FOR_EACH_INTERFACE_VOID(INIT_SYMBOL_VOID)
-
-#undef INIT_SYMBOL
-#undef INIT_SYMBOL_VOID
-
-  initialize(aArgc, aArgv);
-}
-
-// Record/replay API functions can't GC, but we can't use
-// JS::AutoSuppressGCAnalysis here due to linking issues.
-struct AutoSuppressGCAnalysis {
-  AutoSuppressGCAnalysis() {
-    // Need nontrivial constructor for the rooting hazard analysis, and to
-    // prevent unused variable warnings.
-  }
-#ifdef XGILL_PLUGIN
-  ~AutoSuppressGCAnalysis() {
-    // Need nontrivial destructor.
-    static Atomic<int, SequentiallyConsistent, Behavior::DontPreserve> dummy;
-    dummy++;
-  }
-
-#endif
-} JS_HAZ_GC_SUPPRESSED;
-
-#define DEFINE_WRAPPER(aName, aReturnType, aFormals, aActuals) \
-  aReturnType aName aFormals {                                 \
-    AutoSuppressGCAnalysis suppress;                           \
-    MOZ_ASSERT(IsRecordingOrReplaying() || IsMiddleman());     \
-    return gPtr##aName aActuals;                               \
-  }
-
-#define DEFINE_WRAPPER_VOID(aName, aFormals, aActuals)     \
-  void aName aFormals {                                    \
-    AutoSuppressGCAnalysis suppress;                       \
-    MOZ_ASSERT(IsRecordingOrReplaying() || IsMiddleman()); \
-    gPtr##aName aActuals;                                  \
-  }
-
-FOR_EACH_INTERFACE(DEFINE_WRAPPER)
-FOR_EACH_INTERFACE_VOID(DEFINE_WRAPPER_VOID)
-
-#undef DEFINE_WRAPPER
-#undef DEFINE_WRAPPER_VOID
-
-#ifdef ENABLE_RECORD_REPLAY
-
-bool gIsRecordingOrReplaying;
-bool gIsRecording;
-bool gIsReplaying;
-bool gIsMiddleman;
-
-#endif  // ENABLE_RECORD_REPLAY
-
-#undef ENABLE_RECORD_REPLAY
-
-}  // namespace mozilla::recordreplay
deleted file mode 100644
--- a/mfbt/RecordReplay.h
+++ /dev/null
@@ -1,434 +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/. */
-
-/* Public API for Web Replay. */
-
-#ifndef mozilla_RecordReplay_h
-#define mozilla_RecordReplay_h
-
-#include "mozilla/Attributes.h"
-#include "mozilla/GuardObjects.h"
-#include "mozilla/TemplateLib.h"
-#include "mozilla/Types.h"
-#include "mozilla/Utf8.h"
-
-#include <functional>
-#include <stdarg.h>
-
-struct PLDHashTableOps;
-
-namespace mozilla {
-namespace recordreplay {
-
-// Record/Replay Overview.
-//
-// Firefox content processes can be specified to record or replay their
-// behavior. Whether a process is recording or replaying is initialized at the
-// start of the main() routine, and is afterward invariant for the process.
-//
-// Recording and replaying works by controlling non-determinism in the browser:
-// non-deterministic behaviors are initially recorded, then later replayed
-// exactly to force the browser to behave deterministically. Two types of
-// non-deterministic behaviors are captured: intra-thread and inter-thread.
-// Intra-thread non-deterministic behaviors are non-deterministic even in the
-// absence of actions by other threads, and inter-thread non-deterministic
-// behaviors are those affected by interleaving execution with other threads.
-//
-// Intra-thread non-determinism is recorded and replayed as a stream of events
-// for each thread. Most events originate from calls to system library
-// functions (for i/o and such); the record/replay system handles these
-// internally by redirecting these library functions so that code can be
-// injected and the event recorded/replayed. Events can also be manually
-// performed using the RecordReplayValue and RecordReplayBytes APIs below.
-//
-// Inter-thread non-determinism is recorded and replayed by keeping track of
-// the order in which threads acquire locks or perform atomic accesses. If the
-// program is data race free, then reproducing the order of these operations
-// will give an interleaving that is functionally (if not exactly) the same
-// as during the recording. As for intra-thread non-determinism, system library
-// redirections are used to capture most inter-thread non-determinism, but the
-// {Begin,End}OrderedAtomicAccess APIs below can be used to add new ordering
-// constraints.
-//
-// Some behaviors can differ between recording and replay. Mainly, pointer
-// values can differ, and JS GCs can occur at different points (a more complete
-// list is at the URL below). Some of the APIs below are used to accommodate
-// these behaviors and keep the replaying process on track.
-//
-// A third process type, middleman processes, are normal content processes
-// which facilitate communication with recording and replaying processes,
-// managing the graphics data they generate, and running devtools code that
-// interacts with them.
-//
-// This file contains the main public API for places where mozilla code needs
-// to interact with the record/replay system. There are a few additional public
-// APIs in toolkit/recordreplay/ipc, for the IPC performed by
-// recording/replaying processes and middleman processes.
-//
-// A more complete description of Web Replay can be found at this URL:
-// https://developer.mozilla.org/en-US/docs/WebReplay
-
-///////////////////////////////////////////////////////////////////////////////
-// Public API
-///////////////////////////////////////////////////////////////////////////////
-
-// Recording and replaying is only enabled on Mac nightlies.
-#if defined(XP_MACOSX) && defined(NIGHTLY_BUILD)
-
-extern MFBT_DATA bool gIsRecordingOrReplaying;
-extern MFBT_DATA bool gIsRecording;
-extern MFBT_DATA bool gIsReplaying;
-extern MFBT_DATA bool gIsMiddleman;
-
-// Get the kind of recording/replaying process this is, if any.
-static inline bool IsRecordingOrReplaying() { return gIsRecordingOrReplaying; }
-static inline bool IsRecording() { return gIsRecording; }
-static inline bool IsReplaying() { return gIsReplaying; }
-static inline bool IsMiddleman() { return gIsMiddleman; }
-
-#else  // XP_MACOSX && NIGHTLY_BUILD
-
-// On unsupported platforms, getting the kind of process is a no-op.
-static inline bool IsRecordingOrReplaying() { return false; }
-static inline bool IsRecording() { return false; }
-static inline bool IsReplaying() { return false; }
-static inline bool IsMiddleman() { return false; }
-
-#endif  // XP_MACOSX && NIGHTLY_BUILD
-
-// Mark a region which occurs atomically wrt the recording. No two threads can
-// be in an atomic region at once, and the order in which atomic sections are
-// executed by the various threads for the same aValue will be the same in the
-// replay as in the recording. These calls have no effect when not recording or
-// replaying.
-static inline void BeginOrderedAtomicAccess(const void* aValue);
-static inline void EndOrderedAtomicAccess();
-
-// RAII class for an atomic access.
-struct MOZ_RAII AutoOrderedAtomicAccess {
-  explicit AutoOrderedAtomicAccess(const void* aValue) {
-    BeginOrderedAtomicAccess(aValue);
-  }
-  ~AutoOrderedAtomicAccess() { EndOrderedAtomicAccess(); }
-};
-
-// Mark a region where thread events are passed through the record/replay
-// system. While recording, no information from system calls or other events
-// will be recorded for the thread. While replaying, system calls and other
-// events are performed normally.
-static inline void BeginPassThroughThreadEvents();
-static inline void EndPassThroughThreadEvents();
-
-// Whether events in this thread are passed through.
-static inline bool AreThreadEventsPassedThrough();
-
-// RAII class for regions where thread events are passed through.
-struct MOZ_RAII AutoPassThroughThreadEvents {
-  AutoPassThroughThreadEvents() { BeginPassThroughThreadEvents(); }
-  ~AutoPassThroughThreadEvents() { EndPassThroughThreadEvents(); }
-};
-
-// As for AutoPassThroughThreadEvents, but may be used when events are already
-// passed through.
-struct MOZ_RAII AutoEnsurePassThroughThreadEvents {
-  AutoEnsurePassThroughThreadEvents()
-      : mPassedThrough(AreThreadEventsPassedThrough()) {
-    if (!mPassedThrough) BeginPassThroughThreadEvents();
-  }
-
-  ~AutoEnsurePassThroughThreadEvents() {
-    if (!mPassedThrough) EndPassThroughThreadEvents();
-  }
-
- private:
-  bool mPassedThrough;
-};
-
-// Mark a region where thread events are passed through when locally replaying.
-// Replaying processes can run either on a local machine as a content process
-// associated with a firefox parent process, or on remote machines in the cloud.
-// We want local replaying processes to be able to interact with the system so
-// that they can connect with the parent process and e.g. report crashes.
-// We also want to avoid such interaction when replaying in the cloud, as there
-// won't be a parent process to connect to. Using these methods allows us to
-// handle both of these cases without changing the calling code's control flow.
-static inline void BeginPassThroughThreadEventsWithLocalReplay();
-static inline void EndPassThroughThreadEventsWithLocalReplay();
-
-// RAII class for regions where thread events are passed through when replaying
-// locally.
-struct MOZ_RAII AutoPassThroughThreadEventsWithLocalReplay {
-  AutoPassThroughThreadEventsWithLocalReplay() {
-    BeginPassThroughThreadEventsWithLocalReplay();
-  }
-  ~AutoPassThroughThreadEventsWithLocalReplay() {
-    EndPassThroughThreadEventsWithLocalReplay();
-  }
-};
-
-// Mark a region where thread events are not allowed to occur. The process will
-// crash immediately if an event does happen.
-static inline void BeginDisallowThreadEvents();
-static inline void EndDisallowThreadEvents();
-
-// Whether events in this thread are disallowed.
-static inline bool AreThreadEventsDisallowed();
-
-// RAII class for a region where thread events are disallowed.
-struct MOZ_RAII AutoDisallowThreadEvents {
-  AutoDisallowThreadEvents() { BeginDisallowThreadEvents(); }
-  ~AutoDisallowThreadEvents() { EndDisallowThreadEvents(); }
-};
-
-// Record or replay a value in the current thread's event stream.
-static inline size_t RecordReplayValue(size_t aValue);
-
-// Record or replay the contents of a range of memory in the current thread's
-// event stream.
-static inline void RecordReplayBytes(void* aData, size_t aSize);
-
-// During recording or replay, mark the recording as unusable. There are some
-// behaviors that can't be reliably recorded or replayed. For more information,
-// see 'Unrecordable Executions' in the URL above.
-static inline void InvalidateRecording(const char* aWhy);
-
-// API for ensuring deterministic recording and replaying of PLDHashTables.
-// This allows PLDHashTables to behave deterministically by generating a custom
-// set of operations for each table and requiring no other instrumentation.
-// (PLHashTables have a similar mechanism, though it is not exposed here.)
-static inline const PLDHashTableOps* GeneratePLDHashTableCallbacks(
-    const PLDHashTableOps* aOps);
-static inline const PLDHashTableOps* UnwrapPLDHashTableCallbacks(
-    const PLDHashTableOps* aOps);
-static inline void DestroyPLDHashTableCallbacks(const PLDHashTableOps* aOps);
-static inline void MovePLDHashTableContents(const PLDHashTableOps* aFirstOps,
-                                            const PLDHashTableOps* aSecondOps);
-
-// Prevent a JS object from ever being collected while recording or replaying.
-// GC behavior is non-deterministic when recording/replaying, and preventing
-// an object from being collected ensures that finalizers which might interact
-// with the recording will not execute. "aJSObj" must be a JSObject* pointer,
-// but we can't include JSObject's header here and we can't forward-declare it
-// due to some peculiarities with the compiler's visibility attributes.
-// See https://bugzilla.mozilla.org/show_bug.cgi?id=1426865
-static inline void HoldJSObject(void* aJSObj);
-
-// Some devtools operations which execute in a replaying process can cause code
-// to run which did not run while recording. For example, the JS debugger can
-// run arbitrary JS while paused at a breakpoint, by doing an eval(). In such
-// cases we say that execution has diverged from the recording, and if recorded
-// events are encountered the associated devtools operation fails. This API can
-// be used to test for such cases and avoid causing the operation to fail.
-static inline bool HasDivergedFromRecording();
-
-// API for debugging inconsistent behavior between recording and replay.
-// By calling Assert or AssertBytes a thread event will be inserted and any
-// inconsistent execution order of events will be detected (as for normal
-// thread events) and reported to the console.
-//
-// RegisterThing/UnregisterThing associate arbitrary pointers with indexes that
-// will be consistent between recording/replaying and can be used in assertion
-// strings.
-static inline void RecordReplayAssert(const char* aFormat, ...);
-static inline void RecordReplayAssertBytes(const void* aData, size_t aSize);
-static inline void RegisterThing(void* aThing);
-static inline void UnregisterThing(void* aThing);
-static inline size_t ThingIndex(void* aThing);
-
-// Helper for record/replay asserts, try to determine a name for a C++ object
-// with virtual methods based on its vtable.
-static inline const char* VirtualThingName(void* aThing);
-
-// Enum which describes whether to preserve behavior between recording and
-// replay sessions.
-enum class Behavior { DontPreserve, Preserve };
-
-// Determine whether this is a recording/replaying or middleman process, and
-// initialize record/replay state if so.
-MFBT_API void Initialize(int aArgc, char* aArgv[]);
-
-// Kinds of recording/replaying processes that can be spawned.
-enum class ProcessKind {
-  Recording,
-  Replaying,
-  MiddlemanRecording,
-  MiddlemanReplaying
-};
-
-// Command line option for specifying the record/replay kind of a process.
-static const char gProcessKindOption[] = "-recordReplayKind";
-
-// Command line option for specifying the recording file to use.
-static const char gRecordingFileOption[] = "-recordReplayFile";
-
-///////////////////////////////////////////////////////////////////////////////
-// JS interface
-///////////////////////////////////////////////////////////////////////////////
-
-// Get the counter used to keep track of how much progress JS execution has
-// made while running on the main thread. Progress must advance whenever a JS
-// function is entered or loop entry point is reached, so that no script
-// location may be hit twice while the progress counter is the same. See
-// JSControl.h for more.
-typedef uint64_t ProgressCounter;
-MFBT_API ProgressCounter* ExecutionProgressCounter();
-
-static inline void AdvanceExecutionProgressCounter() {
-  ++*ExecutionProgressCounter();
-}
-
-// Get an identifier for the current execution point which can be used to warp
-// here later.
-MFBT_API ProgressCounter NewTimeWarpTarget();
-
-// Return whether a script should update the progress counter when it runs.
-MFBT_API bool ShouldUpdateProgressCounter(const char* aURL);
-
-// Define a RecordReplayControl object on the specified global object, with
-// methods specialized to the current recording/replaying or middleman process
-// kind. "aCx" must be a JSContext* pointer, and "aObj" must be a JSObject*
-// pointer, as with HoldJSObject above.
-MFBT_API bool DefineRecordReplayControlObject(void* aCx, void* aObj);
-
-// Notify the infrastructure that some URL which contains JavaScript or CSS is
-// being parsed. This is used to provide the complete contents of the URL to
-// devtools code when it is inspecting the state of this process; that devtools
-// code can't simply fetch the URL itself since it may have been changed since
-// the recording was made or may no longer exist. The token for a parse may not
-// be used in other parses until after EndContentParse() is called.
-MFBT_API void BeginContentParse(const void* aToken, const char* aURL,
-                                const char* aContentType);
-
-// Add some UTF-8 parse data to an existing content parse.
-MFBT_API void AddContentParseData8(const void* aToken,
-                                   const Utf8Unit* aUtf8Buffer, size_t aLength);
-
-// Add some UTF-16 parse data to an existing content parse.
-MFBT_API void AddContentParseData16(const void* aToken, const char16_t* aBuffer,
-                                    size_t aLength);
-
-// Mark a content parse as having completed.
-MFBT_API void EndContentParse(const void* aToken);
-
-// Perform an entire content parse of UTF-8 data.
-static inline void NoteContentParse(const void* aToken, const char* aURL,
-                                    const char* aContentType,
-                                    const Utf8Unit* aUtf8Buffer,
-                                    size_t aLength) {
-  BeginContentParse(aToken, aURL, aContentType);
-  AddContentParseData8(aToken, aUtf8Buffer, aLength);
-  EndContentParse(aToken);
-}
-
-// Perform an entire content parse of UTF-16 data.
-static inline void NoteContentParse(const void* aToken, const char* aURL,
-                                    const char* aContentType,
-                                    const char16_t* aBuffer, size_t aLength) {
-  BeginContentParse(aToken, aURL, aContentType);
-  AddContentParseData16(aToken, aBuffer, aLength);
-  EndContentParse(aToken);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// API inline function implementation
-///////////////////////////////////////////////////////////////////////////////
-
-// Define inline wrappers on builds where recording/replaying is enabled.
-#if defined(XP_MACOSX) && defined(NIGHTLY_BUILD)
-
-#  define MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(aName, aFormals, aActuals) \
-    MFBT_API void Internal##aName aFormals;                              \
-    static inline void aName aFormals {                                  \
-      if (IsRecordingOrReplaying()) {                                    \
-        Internal##aName aActuals;                                        \
-      }                                                                  \
-    }
-
-#  define MOZ_MAKE_RECORD_REPLAY_WRAPPER(aName, aReturnType, aDefaultValue, \
-                                         aFormals, aActuals)                \
-    MFBT_API aReturnType Internal##aName aFormals;                          \
-    static inline aReturnType aName aFormals {                              \
-      if (IsRecordingOrReplaying()) {                                       \
-        return Internal##aName aActuals;                                    \
-      }                                                                     \
-      return aDefaultValue;                                                 \
-    }
-
-// Define inline wrappers on other builds. Avoiding references to the out of
-// line method avoids link errors when e.g. using Atomic<> but not linking
-// against MFBT.
-#else
-
-#  define MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(aName, aFormals, aActuals) \
-    static inline void aName aFormals {}
-
-#  define MOZ_MAKE_RECORD_REPLAY_WRAPPER(aName, aReturnType, aDefaultValue, \
-                                         aFormals, aActuals)                \
-    static inline aReturnType aName aFormals { return aDefaultValue; }
-
-#endif
-
-MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(BeginOrderedAtomicAccess,
-                                    (const void* aValue), (aValue))
-MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(EndOrderedAtomicAccess, (), ())
-MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(BeginPassThroughThreadEvents, (), ())
-MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(EndPassThroughThreadEvents, (), ())
-MOZ_MAKE_RECORD_REPLAY_WRAPPER(AreThreadEventsPassedThrough, bool, false, (),
-                               ())
-MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(BeginPassThroughThreadEventsWithLocalReplay,
-                                    (), ())
-MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(EndPassThroughThreadEventsWithLocalReplay,
-                                    (), ())
-MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(BeginDisallowThreadEvents, (), ())
-MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(EndDisallowThreadEvents, (), ())
-MOZ_MAKE_RECORD_REPLAY_WRAPPER(AreThreadEventsDisallowed, bool, false, (), ())
-MOZ_MAKE_RECORD_REPLAY_WRAPPER(RecordReplayValue, size_t, aValue,
-                               (size_t aValue), (aValue))
-MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(RecordReplayBytes,
-                                    (void* aData, size_t aSize), (aData, aSize))
-MOZ_MAKE_RECORD_REPLAY_WRAPPER(HasDivergedFromRecording, bool, false, (), ())
-MOZ_MAKE_RECORD_REPLAY_WRAPPER(GeneratePLDHashTableCallbacks,
-                               const PLDHashTableOps*, aOps,
-                               (const PLDHashTableOps* aOps), (aOps))
-MOZ_MAKE_RECORD_REPLAY_WRAPPER(UnwrapPLDHashTableCallbacks,
-                               const PLDHashTableOps*, aOps,
-                               (const PLDHashTableOps* aOps), (aOps))
-MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(DestroyPLDHashTableCallbacks,
-                                    (const PLDHashTableOps* aOps), (aOps))
-MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(MovePLDHashTableContents,
-                                    (const PLDHashTableOps* aFirstOps,
-                                     const PLDHashTableOps* aSecondOps),
-                                    (aFirstOps, aSecondOps))
-MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(InvalidateRecording, (const char* aWhy),
-                                    (aWhy))
-MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(HoldJSObject, (void* aJSObj), (aJSObj))
-MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(RecordReplayAssertBytes,
-                                    (const void* aData, size_t aSize),
-                                    (aData, aSize))
-MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(RegisterThing, (void* aThing), (aThing))
-MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID(UnregisterThing, (void* aThing), (aThing))
-MOZ_MAKE_RECORD_REPLAY_WRAPPER(ThingIndex, size_t, 0, (void* aThing), (aThing))
-MOZ_MAKE_RECORD_REPLAY_WRAPPER(VirtualThingName, const char*, nullptr,
-                               (void* aThing), (aThing))
-
-#undef MOZ_MAKE_RECORD_REPLAY_WRAPPER_VOID
-#undef MOZ_MAKERECORDREPLAYWRAPPER
-
-MFBT_API void InternalRecordReplayAssert(const char* aFormat, va_list aArgs);
-
-static inline void RecordReplayAssert(const char* aFormat, ...) {
-  if (IsRecordingOrReplaying()) {
-    va_list ap;
-    va_start(ap, aFormat);
-    InternalRecordReplayAssert(aFormat, ap);
-    va_end(ap);
-  }
-}
-
-}  // namespace recordreplay
-}  // namespace mozilla
-
-#endif /* mozilla_RecordReplay_h */
--- a/mfbt/RefCounted.h
+++ b/mfbt/RefCounted.h
@@ -79,57 +79,54 @@ class RefCountLogger {
     NS_LogRelease(const_cast<void*>(aPointer), aRefCount, aTypeName);
   }
 };
 #endif
 
 // This is used WeakPtr.h as well as this file.
 enum RefCountAtomicity { AtomicRefCount, NonAtomicRefCount };
 
-template <typename T, RefCountAtomicity Atomicity,
-          recordreplay::Behavior Recording>
+template <typename T, RefCountAtomicity Atomicity>
 class RC {
  public:
   explicit RC(T aCount) : mValue(aCount) {}
 
   T operator++() { return ++mValue; }
   T operator--() { return --mValue; }
 
   void operator=(const T& aValue) { mValue = aValue; }
 
   operator T() const { return mValue; }
 
  private:
   T mValue;
 };
 
-template <typename T, recordreplay::Behavior Recording>
-class RC<T, AtomicRefCount, Recording> {
+template <typename T>
+class RC<T, AtomicRefCount> {
  public:
   explicit RC(T aCount) : mValue(aCount) {}
 
   T operator++() {
     // Memory synchronization is not required when incrementing a
     // reference count.  The first increment of a reference count on a
     // thread is not important, since the first use of the object on a
     // thread can happen before it.  What is important is the transfer
     // of the pointer to that thread, which may happen prior to the
     // first increment on that thread.  The necessary memory
     // synchronization is done by the mechanism that transfers the
     // pointer between threads.
-    AutoRecordAtomicAccess<Recording> record(this);
     return mValue.fetch_add(1, std::memory_order_relaxed) + 1;
   }
 
   T operator--() {
     // Since this may be the last release on this thread, we need
     // release semantics so that prior writes on this thread are visible
     // to the thread that destroys the object when it reads mValue with
     // acquire semantics.
-    AutoRecordAtomicAccess<Recording> record(this);
     T result = mValue.fetch_sub(1, std::memory_order_release) - 1;
     if (result == 0) {
       // We're going to destroy the object on this thread, so we need
       // acquire semantics to synchronize with the memory released by
       // the last release on other threads, that is, to ensure that
       // writes prior to that release are now visible on this thread.
 #ifdef MOZ_TSAN
       // TSan doesn't understand std::atomic_thread_fence, so in order
@@ -141,33 +138,30 @@ class RC<T, AtomicRefCount, Recording> {
 #endif
     }
     return result;
   }
 
   // This method is only called in debug builds, so we're not too concerned
   // about its performance.
   void operator=(const T& aValue) {
-    AutoRecordAtomicAccess<Recording> record(this);
     mValue.store(aValue, std::memory_order_seq_cst);
   }
 
   operator T() const {
     // Use acquire semantics since we're not sure what the caller is
     // doing.
-    AutoRecordAtomicAccess<Recording> record(this);
     return mValue.load(std::memory_order_acquire);
   }
 
  private:
   std::atomic<T> mValue;
 };
 
-template <typename T, RefCountAtomicity Atomicity,
-          recordreplay::Behavior Recording = recordreplay::Behavior::Preserve>
+template <typename T, RefCountAtomicity Atomicity>
 class RefCounted {
  protected:
   RefCounted() : mRefCnt(0) {}
   ~RefCounted() { MOZ_ASSERT(mRefCnt == detail::DEAD); }
 
  public:
   // Compatibility with nsRefPtr.
   void AddRef() const {
@@ -214,17 +208,17 @@ class RefCounted {
   void deref() { Release(); }
   MozRefCountType refCount() const { return mRefCnt; }
   bool hasOneRef() const {
     MOZ_ASSERT(mRefCnt > 0);
     return mRefCnt == 1;
   }
 
  private:
-  mutable RC<MozRefCountType, Atomicity, Recording> mRefCnt;
+  mutable RC<MozRefCountType, Atomicity> mRefCnt;
 };
 
 #ifdef MOZ_REFCOUNTED_LEAK_CHECKING
 // Passing override for the optional argument marks the typeName and
 // typeSize functions defined by this macro as overrides.
 #  define MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(T, ...)           \
     virtual const char* typeName() const __VA_ARGS__ { return #T; } \
     virtual size_t typeSize() const __VA_ARGS__ { return sizeof(*this); }
@@ -254,21 +248,19 @@ namespace external {
 
 /**
  * AtomicRefCounted<T> is like RefCounted<T>, with an atomically updated
  * reference counter.
  *
  * NOTE: Please do not use this class, use NS_INLINE_DECL_THREADSAFE_REFCOUNTING
  * instead.
  */
-template <typename T,
-          recordreplay::Behavior Recording = recordreplay::Behavior::Preserve>
+template <typename T>
 class AtomicRefCounted
-    : public mozilla::detail::RefCounted<T, mozilla::detail::AtomicRefCount,
-                                         Recording> {
+    : public mozilla::detail::RefCounted<T, mozilla::detail::AtomicRefCount> {
  public:
   ~AtomicRefCounted() {
     static_assert(std::is_base_of<AtomicRefCounted, T>::value,
                   "T must derive from AtomicRefCounted<T>");
   }
 };
 
 }  // namespace external
--- a/mfbt/moz.build
+++ b/mfbt/moz.build
@@ -73,17 +73,16 @@ EXPORTS.mozilla = [
     'Pair.h',
     'Path.h',
     'PodOperations.h',
     'Poison.h',
     'RandomNum.h',
     'Range.h',
     'RangedArray.h',
     'RangedPtr.h',
-    'RecordReplay.h',
     'ReentrancyGuard.h',
     'RefCounted.h',
     'RefCountType.h',
     'RefPtr.h',
     'Result.h',
     'ResultExtensions.h',
     'ReverseIterator.h',
     'RollingMean.h',
@@ -160,21 +159,16 @@ UNIFIED_SOURCES += [
     'SHA1.cpp',
     'TaggedAnonymousMemory.cpp',
     'UniquePtrExtensions.cpp',
     'Unused.cpp',
     'Utf8.cpp',
 ]
 
 if CONFIG['MOZ_BUILD_APP'] not in ('memory', 'tools/crashreporter', 'tools/update-packaging'):
-    # RecordReplay.cpp uses files from js/
-    UNIFIED_SOURCES += [
-        'RecordReplay.cpp',
-    ]
-
     # Building MFBT tests adds a large overhead when building
     # tools/crashreporter.
     TEST_DIRS += ['tests']
 
 DEFINES['IMPL_MFBT'] = True
 
 SOURCES += [
     'Compression.cpp',
--- a/mfbt/tests/TestAtomics.cpp
+++ b/mfbt/tests/TestAtomics.cpp
@@ -9,23 +9,22 @@
 
 #include <stdint.h>
 
 using mozilla::Atomic;
 using mozilla::MemoryOrdering;
 using mozilla::Relaxed;
 using mozilla::ReleaseAcquire;
 using mozilla::SequentiallyConsistent;
-using mozilla::recordreplay::Behavior;
 
 #define A(a, b) MOZ_RELEASE_ASSERT(a, b)
 
 template <typename T, MemoryOrdering Order>
 static void TestTypeWithOrdering() {
-  Atomic<T, Order, Behavior::DontPreserve> atomic(5);
+  Atomic<T, Order> atomic(5);
   A(atomic == 5, "Atomic variable did not initialize");
 
   // Test atomic increment
   A(++atomic == T(6), "Atomic increment did not work");
   A(atomic++ == T(6), "Atomic post-increment did not work");
   A(atomic == T(7), "Atomic post-increment did not work");
 
   // Test atomic decrement
@@ -79,17 +78,17 @@ static void TestTypeWithOrdering() {
   boolResult = atomic.compareExchange(1, 42);
   A(boolResult, "CAS should have succeeded.");
   A(atomic == T(42), "CAS should have changed atomic's value.");
 }
 
 template <typename T, MemoryOrdering Order>
 static void TestPointerWithOrdering() {
   T array1[10];
-  Atomic<T*, Order, Behavior::DontPreserve> atomic(array1);
+  Atomic<T*, Order> atomic(array1);
   A(atomic == array1, "Atomic variable did not initialize");
 
   // Test atomic increment
   A(++atomic == array1 + 1, "Atomic increment did not work");
   A(atomic++ == array1 + 1, "Atomic post-increment did not work");
   A(atomic == array1 + 2, "Atomic post-increment did not work");
 
   // Test atomic decrement
@@ -131,17 +130,17 @@ enum EnumType {
   EnumType_0 = 0,
   EnumType_1 = 1,
   EnumType_2 = 2,
   EnumType_3 = 3
 };
 
 template <MemoryOrdering Order>
 static void TestEnumWithOrdering() {
-  Atomic<EnumType, Order, Behavior::DontPreserve> atomic(EnumType_2);
+  Atomic<EnumType, Order> atomic(EnumType_2);
   A(atomic == EnumType_2, "Atomic variable did not initialize");
 
   // Test assignment
   EnumType result;
   result = (atomic = EnumType_3);
   A(atomic == EnumType_3, "Atomic assignment failed");
   A(result == EnumType_3, "Atomic assignment returned the wrong value");
 
@@ -166,17 +165,17 @@ enum class EnumClass : uint32_t {
   Value0 = 0,
   Value1 = 1,
   Value2 = 2,
   Value3 = 3
 };
 
 template <MemoryOrdering Order>
 static void TestEnumClassWithOrdering() {
-  Atomic<EnumClass, Order, Behavior::DontPreserve> atomic(EnumClass::Value2);
+  Atomic<EnumClass, Order> atomic(EnumClass::Value2);
   A(atomic == EnumClass::Value2, "Atomic variable did not initialize");
 
   // Test assignment
   EnumClass result;
   result = (atomic = EnumClass::Value3);
   A(atomic == EnumClass::Value3, "Atomic assignment failed");
   A(result == EnumClass::Value3, "Atomic assignment returned the wrong value");
 
@@ -195,17 +194,17 @@ static void TestEnumClassWithOrdering() 
 
   boolResult = atomic.compareExchange(EnumClass::Value1, EnumClass::Value3);
   A(boolResult, "CAS should have succeeded.");
   A(atomic == EnumClass::Value3, "CAS should have changed atomic's value.");
 }
 
 template <MemoryOrdering Order>
 static void TestBoolWithOrdering() {
-  Atomic<bool, Order, Behavior::DontPreserve> atomic(false);
+  Atomic<bool, Order> atomic(false);
   A(atomic == false, "Atomic variable did not initialize");
 
   // Test assignment
   bool result;
   result = (atomic = true);
   A(atomic == true, "Atomic assignment failed");
   A(result == true, "Atomic assignment returned the wrong value");
 
--- a/modules/libjar/nsJARChannel.cpp
+++ b/modules/libjar/nsJARChannel.cpp
@@ -53,19 +53,17 @@ static LazyLogModule gJarProtocolLog("ns
 //-----------------------------------------------------------------------------
 // nsJARInputThunk
 //
 // this class allows us to do some extra work on the stream transport thread.
 //-----------------------------------------------------------------------------
 
 class nsJARInputThunk : public nsIInputStream {
  public:
-  // Preserve refcount changes when record/replaying, as otherwise the thread
-  // which destroys the thunk may vary between recording and replaying.
-  NS_DECL_THREADSAFE_ISUPPORTS_WITH_RECORDING(recordreplay::Behavior::Preserve)
+  NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIINPUTSTREAM
 
   nsJARInputThunk(nsIZipReader* zipReader, nsIURI* fullJarURI,
                   const nsACString& jarEntry, bool usingJarCache)
       : mUsingJarCache(usingJarCache),
         mJarReader(zipReader),
         mJarEntry(jarEntry),
         mContentLength(-1) {
--- a/modules/libpref/StaticPrefsBase.h
+++ b/modules/libpref/StaticPrefsBase.h
@@ -12,67 +12,57 @@
 namespace mozilla {
 
 class SharedPrefMapBuilder;
 
 // These typedefs are for use within init/StaticPrefList*.h.
 
 typedef const char* String;
 
-typedef Atomic<bool, Relaxed, recordreplay::Behavior::DontPreserve>
-    RelaxedAtomicBool;
-typedef Atomic<bool, ReleaseAcquire, recordreplay::Behavior::DontPreserve>
-    ReleaseAcquireAtomicBool;
-typedef Atomic<bool, SequentiallyConsistent,
-               recordreplay::Behavior::DontPreserve>
-    SequentiallyConsistentAtomicBool;
+typedef Atomic<bool, Relaxed> RelaxedAtomicBool;
+typedef Atomic<bool, ReleaseAcquire> ReleaseAcquireAtomicBool;
+typedef Atomic<bool, SequentiallyConsistent> SequentiallyConsistentAtomicBool;
 
-typedef Atomic<int32_t, Relaxed, recordreplay::Behavior::DontPreserve>
-    RelaxedAtomicInt32;
-typedef Atomic<int32_t, ReleaseAcquire, recordreplay::Behavior::DontPreserve>
-    ReleaseAcquireAtomicInt32;
-typedef Atomic<int32_t, SequentiallyConsistent,
-               recordreplay::Behavior::DontPreserve>
+typedef Atomic<int32_t, Relaxed> RelaxedAtomicInt32;
+typedef Atomic<int32_t, ReleaseAcquire> ReleaseAcquireAtomicInt32;
+typedef Atomic<int32_t, SequentiallyConsistent>
     SequentiallyConsistentAtomicInt32;
 
-typedef Atomic<uint32_t, Relaxed, recordreplay::Behavior::DontPreserve>
-    RelaxedAtomicUint32;
-typedef Atomic<uint32_t, ReleaseAcquire, recordreplay::Behavior::DontPreserve>
-    ReleaseAcquireAtomicUint32;
-typedef Atomic<uint32_t, SequentiallyConsistent,
-               recordreplay::Behavior::DontPreserve>
+typedef Atomic<uint32_t, Relaxed> RelaxedAtomicUint32;
+typedef Atomic<uint32_t, ReleaseAcquire> ReleaseAcquireAtomicUint32;
+typedef Atomic<uint32_t, SequentiallyConsistent>
     SequentiallyConsistentAtomicUint32;
 
 // XXX: Atomic<float> currently doesn't work (see bug 1552086). Once it's
 // supported we will be able to use Atomic<float> here.
 typedef std::atomic<float> AtomicFloat;
 
 template <typename T>
 struct StripAtomicImpl {
   typedef T Type;
 };
 
-template <typename T, MemoryOrdering Order, recordreplay::Behavior Recording>
-struct StripAtomicImpl<Atomic<T, Order, Recording>> {
+template <typename T, MemoryOrdering Order>
+struct StripAtomicImpl<Atomic<T, Order>> {
   typedef T Type;
 };
 
 template <typename T>
 struct StripAtomicImpl<std::atomic<T>> {
   typedef T Type;
 };
 
 template <typename T>
 using StripAtomic = typename StripAtomicImpl<T>::Type;
 
 template <typename T>
 struct IsAtomic : FalseType {};
 
-template <typename T, MemoryOrdering Order, recordreplay::Behavior Recording>
-struct IsAtomic<Atomic<T, Order, Recording>> : TrueType {};
+template <typename T, MemoryOrdering Order>
+struct IsAtomic<Atomic<T, Order>> : TrueType {};
 
 template <typename T>
 struct IsAtomic<std::atomic<T>> : TrueType {};
 
 namespace StaticPrefs {
 
 void MaybeInitOncePrefs();
 
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -830,32 +830,16 @@ pref("toolkit.content-background-hang-mo
   pref("devtools.console.stdout.chrome", true, sticky);
 #endif
 
 pref("devtools.console.stdout.content", false, sticky);
 
 // Controls whether EventEmitter module throws dump message on each emit
 pref("toolkit.dump.emit", false);
 
-// Enable recording/replaying executions.
-#if defined(XP_MACOSX) && defined(NIGHTLY_BUILD)
-  pref("devtools.recordreplay.enabled", true);
-  pref("devtools.recordreplay.enableRewinding", true);
-#else
-  pref("devtools.recordreplay.enabled", false);
-#endif
-
-pref("devtools.recordreplay.mvp.enabled", false);
-pref("devtools.recordreplay.allowRepaintFailures", true);
-pref("devtools.recordreplay.includeSystemScripts", false);
-pref("devtools.recordreplay.logging", false);
-pref("devtools.recordreplay.loggingFull", false);
-pref("devtools.recordreplay.fastLogpoints", false);
-pref("devtools.recordreplay.cloudServer", "");
-
 // Preferences for the new performance panel.
 // This pref configures the base URL for the profiler.firefox.com instance to
 // use. This is useful so that a developer can change it while working on
 // profiler.firefox.com, or in tests. This isn't exposed directly to the user.
 pref("devtools.performance.recording.ui-base-url", "https://profiler.firefox.com");
 
 // The preset to use for the recording settings. If set to "custom" then the pref
 // values below will be used.
--- a/mozglue/baseprofiler/core/PageInformation.h
+++ b/mozglue/baseprofiler/core/PageInformation.h
@@ -63,17 +63,15 @@ class PageInformation final {
   const std::string mUrl;
   const uint64_t mEmbedderInnerWindowID;
 
   // Holds the buffer position when page is unregistered.
   // It's used to determine if we still use this page in the profiler or
   // not.
   Maybe<uint64_t> mBufferPositionWhenUnregistered;
 
-  mutable Atomic<int32_t, MemoryOrdering::ReleaseAcquire,
-                 recordreplay::Behavior::DontPreserve>
-      mRefCnt;
+  mutable Atomic<int32_t, MemoryOrdering::ReleaseAcquire> mRefCnt;
 };
 
 }  // namespace baseprofiler
 }  // namespace mozilla
 
 #endif  // PageInformation_h
--- a/mozglue/baseprofiler/core/ProfilerMarkerPayload.cpp
+++ b/mozglue/baseprofiler/core/ProfilerMarkerPayload.cpp
@@ -24,18 +24,17 @@ namespace baseprofiler {
 static UniquePtr<ProfilerMarkerPayload> DeserializeNothing(
     mozilla::BlocksRingBuffer::EntryReader&) {
   return nullptr;
 }
 
 // Number of currently-registered deserializers.
 // Starting at 1 for the initial `DeserializeNothing`.
 // static
-Atomic<ProfilerMarkerPayload::DeserializerTagAtomic, ReleaseAcquire,
-       recordreplay::Behavior::DontPreserve>
+Atomic<ProfilerMarkerPayload::DeserializerTagAtomic, ReleaseAcquire>
     ProfilerMarkerPayload::sDeserializerCount{1};
 
 // Initialize `sDeserializers` with `DeserializeNothing` at index 0, all others
 // are nullptrs.
 // static
 ProfilerMarkerPayload::Deserializer
     ProfilerMarkerPayload::sDeserializers[DeserializerMax] = {
         DeserializeNothing};
--- a/mozglue/baseprofiler/core/RegisteredThread.h
+++ b/mozglue/baseprofiler/core/RegisteredThread.h
@@ -120,20 +120,17 @@ class RacyRegisteredThread final {
   // before we can tell that duplication is allowed.
   //
   static const int AWAKE = 0;
   static const int SLEEPING_NOT_OBSERVED = 1;
   static const int SLEEPING_OBSERVED = 2;
   Atomic<int> mSleep;
 
   // Is this thread being profiled? (e.g., should markers be recorded?)
-  // Accesses to this atomic are not recorded by web replay as they may occur
-  // at non-deterministic points.
-  Atomic<bool, MemoryOrdering::Relaxed, recordreplay::Behavior::DontPreserve>
-      mIsBeingProfiled;
+  Atomic<bool, MemoryOrdering::Relaxed> mIsBeingProfiled;
 };
 
 // This class contains information that's relevant to a single thread only
 // while that thread is running and registered with the profiler, but
 // regardless of whether the profiler is running. All accesses to it are
 // protected by the profiler state lock.
 class RegisteredThread final {
  public:
--- a/mozglue/baseprofiler/core/ThreadInfo.h
+++ b/mozglue/baseprofiler/core/ThreadInfo.h
@@ -47,17 +47,15 @@ class ThreadInfo final {
   bool IsMainThread() const { return mIsMainThread; }
 
  private:
   const std::string mName;
   const TimeStamp mRegisterTime;
   const int mThreadId;
   const bool mIsMainThread;
 
-  mutable Atomic<int32_t, MemoryOrdering::ReleaseAcquire,
-                 recordreplay::Behavior::DontPreserve>
-      mRefCnt;
+  mutable Atomic<int32_t, MemoryOrdering::ReleaseAcquire> mRefCnt;
 };
 
 }  // namespace baseprofiler
 }  // namespace mozilla
 
 #endif  // ThreadInfo_h
--- a/mozglue/baseprofiler/core/platform.cpp
+++ b/mozglue/baseprofiler/core/platform.cpp
@@ -938,18 +938,17 @@ class ActivePS {
 
 ActivePS* ActivePS::sInstance = nullptr;
 uint32_t ActivePS::sNextGeneration = 0;
 
 #  undef PS_GET
 #  undef PS_GET_LOCKLESS
 #  undef PS_GET_AND_SET
 
-Atomic<uint32_t, MemoryOrdering::Relaxed, recordreplay::Behavior::DontPreserve>
-    RacyFeatures::sActiveAndFeatures(0);
+Atomic<uint32_t, MemoryOrdering::Relaxed> RacyFeatures::sActiveAndFeatures(0);
 
 /* static */
 void RacyFeatures::SetActive(uint32_t aFeatures) {
   sActiveAndFeatures = Active | aFeatures;
 }
 
 /* static */
 void RacyFeatures::SetInactive() { sActiveAndFeatures = 0; }
--- a/mozglue/baseprofiler/public/BaseProfiler.h
+++ b/mozglue/baseprofiler/public/BaseProfiler.h
@@ -87,16 +87,17 @@
 #  include "mozilla/GuardObjects.h"
 #  include "mozilla/Maybe.h"
 #  include "mozilla/PowerOfTwo.h"
 #  include "mozilla/Sprintf.h"
 #  include "mozilla/ThreadLocal.h"
 #  include "mozilla/TimeStamp.h"
 #  include "mozilla/UniquePtr.h"
 
+#  include <functional>
 #  include <stdint.h>
 #  include <string>
 
 namespace mozilla {
 
 class MallocAllocPolicy;
 template <class T, size_t MinInlineCapacity, class AllocPolicy>
 class Vector;
@@ -214,22 +215,19 @@ class RacyFeatures {
 #  define NO_OVERLAP(n_, str_, Name_, desc_) \
     static_assert(ProfilerFeature::Name_ != Paused, "bad feature value");
 
   BASE_PROFILER_FOR_EACH_FEATURE(NO_OVERLAP);
 
 #  undef NO_OVERLAP
 
   // We combine the active bit with the feature bits so they can be read or
-  // written in a single atomic operation. Accesses to this atomic are not
-  // recorded by web replay as they may occur at non-deterministic points.
+  // written in a single atomic operation.
   // TODO: Could this be MFBT_DATA for better inlining optimization?
-  static Atomic<uint32_t, MemoryOrdering::Relaxed,
-                recordreplay::Behavior::DontPreserve>
-      sActiveAndFeatures;
+  static Atomic<uint32_t, MemoryOrdering::Relaxed> sActiveAndFeatures;
 };
 
 MFBT_API bool IsThreadBeingProfiled();
 
 }  // namespace detail
 
 //---------------------------------------------------------------------------
 // Start and stop the profiler
--- a/mozglue/baseprofiler/public/BaseProfilerDetail.h
+++ b/mozglue/baseprofiler/public/BaseProfilerDetail.h
@@ -22,22 +22,19 @@
 #  endif  // MOZ_BASE_PROFILER
 #endif    // DEBUG
 
 namespace mozilla {
 namespace baseprofiler {
 namespace detail {
 
 // Thin shell around mozglue PlatformMutex, for Base Profiler internal use.
-// Does not preserve behavior in JS record/replay.
 class BaseProfilerMutex : private ::mozilla::detail::MutexImpl {
  public:
-  BaseProfilerMutex()
-      : ::mozilla::detail::MutexImpl(
-            ::mozilla::recordreplay::Behavior::DontPreserve) {}
+  BaseProfilerMutex() : ::mozilla::detail::MutexImpl() {}
 
   BaseProfilerMutex(const BaseProfilerMutex&) = delete;
   BaseProfilerMutex& operator=(const BaseProfilerMutex&) = delete;
   BaseProfilerMutex(BaseProfilerMutex&&) = delete;
   BaseProfilerMutex& operator=(BaseProfilerMutex&&) = delete;
 
 #ifdef MOZ_BASE_PROFILER_DEBUG
   ~BaseProfilerMutex() { MOZ_ASSERT(mOwningThreadId == 0); }
@@ -72,19 +69,17 @@ class BaseProfilerMutex : private ::mozi
   void AssertCurrentThreadOwns() const {
 #ifdef MOZ_BASE_PROFILER_DEBUG
     MOZ_ASSERT(mOwningThreadId == baseprofiler::profiler_current_thread_id());
 #endif  // MOZ_BASE_PROFILER_DEBUG
   }
 
 #ifdef MOZ_BASE_PROFILER_DEBUG
  private:
-  Atomic<int, MemoryOrdering::SequentiallyConsistent,
-         recordreplay::Behavior::DontPreserve>
-      mOwningThreadId{0};
+  Atomic<int, MemoryOrdering::SequentiallyConsistent> mOwningThreadId{0};
 #endif  // MOZ_BASE_PROFILER_DEBUG
 };
 
 // RAII class to lock a mutex.
 class MOZ_RAII BaseProfilerAutoLock {
  public:
   explicit BaseProfilerAutoLock(BaseProfilerMutex& aMutex) : mMutex(aMutex) {
     mMutex.Lock();
@@ -98,17 +93,16 @@ class MOZ_RAII BaseProfilerAutoLock {
   ~BaseProfilerAutoLock() { mMutex.Unlock(); }
 
  private:
   BaseProfilerMutex& mMutex;
 };
 
 // Thin shell around mozglue PlatformMutex, for Base Profiler internal use.
 // Actual mutex may be disabled at construction time.
-// Does not preserve behavior in JS record/replay.
 class BaseProfilerMaybeMutex : private ::mozilla::detail::MutexImpl {
  public:
   explicit BaseProfilerMaybeMutex(bool aActivate) {
     if (aActivate) {
       mMaybeMutex.emplace();
     }
   }
 
--- a/mozglue/baseprofiler/public/BaseProfilerMarkerPayload.h
+++ b/mozglue/baseprofiler/public/BaseProfilerMarkerPayload.h
@@ -100,19 +100,17 @@ class ProfilerMarkerPayload {
   // ProfilerMarkerPayload.
   static constexpr DeserializerTag DeserializerMax = 32;
 
   // We need an atomic type that can hold a `DeserializerTag`. (Atomic doesn't
   // work with too-small types.)
   using DeserializerTagAtomic = int;
 
   // Number of currently-registered deserializers.
-  static Atomic<DeserializerTagAtomic, ReleaseAcquire,
-                recordreplay::Behavior::DontPreserve>
-      sDeserializerCount;
+  static Atomic<DeserializerTagAtomic, ReleaseAcquire> sDeserializerCount;
 
   // List of currently-registered deserializers.
   // sDeserializers[0] is a no-payload deserializer.
   static Deserializer sDeserializers[DeserializerMax];
 
   // Get the `DeserializerTag` for a `Deserializer` (which gets registered on
   // the first call.) Tag 0 means no payload; a null `aDeserializer` gives that
   // 0 tag.
--- a/mozglue/baseprofiler/public/BaseProfilingStack.h
+++ b/mozglue/baseprofiler/public/BaseProfilingStack.h
@@ -120,47 +120,40 @@ class ProfilingStackFrame {
   // see an inconsistent state where the stack pointer still points to a
   // ProfilingStackFrame which has already been popped off the stack and whose
   // fields have now been partially repopulated with new values.
   // See the "Concurrency considerations" paragraph at the top of this file
   // for more details.
 
   // Descriptive label for this stack frame. Must be a static string! Can be
   // an empty string, but not a null pointer.
-  Atomic<const char*, ReleaseAcquire, recordreplay::Behavior::DontPreserve>
-      label_;
+  Atomic<const char*, ReleaseAcquire> label_;
 
   // An additional descriptive string of this frame which is combined with
   // |label_| in profiler output. Need not be (and usually isn't) static. Can
   // be null.
-  Atomic<const char*, ReleaseAcquire, recordreplay::Behavior::DontPreserve>
-      dynamicString_;
+  Atomic<const char*, ReleaseAcquire> dynamicString_;
 
   // Stack pointer for non-JS stack frames, the script pointer otherwise.
-  Atomic<void*, ReleaseAcquire, recordreplay::Behavior::DontPreserve>
-      spOrScript;
+  Atomic<void*, ReleaseAcquire> spOrScript;
 
   // The bytecode offset for JS stack frames.
   // Must not be used on non-JS frames; it'll contain either the default 0,
   // or a leftover value from a previous JS stack frame that was using this
   // ProfilingStackFrame object.
-  Atomic<int32_t, ReleaseAcquire, recordreplay::Behavior::DontPreserve>
-      pcOffsetIfJS_;
+  Atomic<int32_t, ReleaseAcquire> pcOffsetIfJS_;
 
   // ID of the JS Realm for JS stack frames.
   // Must not be used on non-JS frames; it'll contain either the default 0,
   // or a leftover value from a previous JS stack frame that was using this
   // ProfilingStackFrame object.
-  mozilla::Atomic<uint64_t, mozilla::ReleaseAcquire,
-                  mozilla::recordreplay::Behavior::DontPreserve>
-      realmID_;
+  mozilla::Atomic<uint64_t, mozilla::ReleaseAcquire> realmID_;
 
   // Bits 0...8 hold the Flags. Bits 9...31 hold the category pair.
-  Atomic<uint32_t, ReleaseAcquire, recordreplay::Behavior::DontPreserve>
-      flagsAndCategoryPair_;
+  Atomic<uint32_t, ReleaseAcquire> flagsAndCategoryPair_;
 
  public:
   ProfilingStackFrame() = default;
   ProfilingStackFrame& operator=(const ProfilingStackFrame& other) {
     label_ = other.label();
     dynamicString_ = other.dynamicString();
     void* spScript = other.spOrScript;
     spOrScript = spScript;
@@ -454,33 +447,30 @@ class ProfilingStack final {
 
   uint32_t capacity = 0;
 
  public:
   // The pointer to the stack frames, this is read from the profiler thread and
   // written from the current thread.
   //
   // This is effectively a unique pointer.
-  Atomic<ProfilingStackFrame*, SequentiallyConsistent,
-         recordreplay::Behavior::DontPreserve>
-      frames{nullptr};
+  Atomic<ProfilingStackFrame*, SequentiallyConsistent> frames{nullptr};
 
   // This may exceed the capacity, so instead use the stackSize() method to
   // determine the number of valid frames in stackFrames. When this is less
   // than stackCapacity(), it refers to the first free stackframe past the top
   // of the in-use stack (i.e. frames[stackPointer - 1] is the top stack
   // frame).
   //
   // WARNING WARNING WARNING
   //
   // This is an atomic variable that uses ReleaseAcquire memory ordering.
   // See the "Concurrency considerations" paragraph at the top of this file
   // for more details.
-  Atomic<uint32_t, ReleaseAcquire, recordreplay::Behavior::DontPreserve>
-      stackPointer;
+  Atomic<uint32_t, ReleaseAcquire> stackPointer;
 };
 
 class AutoGeckoProfilerEntry;
 class GeckoProfilerEntry