Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
authorSylvestre Ledru <sledru@mozilla.com>
Fri, 05 Apr 2019 21:41:42 +0000
changeset 513690 662b776a02e6d046b0358cb89b53c19477a4bc67
parent 513689 161cd9e81d7104807d1e8a68933ca28bed1f2e8c
child 513691 55ed5f885d52c347f6ef98bb86d2eb71f2a729c3
push idunknown
push userunknown
push dateunknown
reviewersEhsan
bugs1519636
milestone68.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 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan clang-format-8 upstream had some improvements wrt macros See: https://reviews.llvm.org/D33440 This is why the diff is bigger than usual # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D26098
accessible/base/MarkupMap.h
dom/base/AnonymousContent.cpp
dom/base/DocGroup.cpp
dom/base/TreeOrderedArrayInlines.h
dom/base/UIDirectionManager.cpp
dom/base/nsAttrValue.cpp
dom/base/nsAttrValueInlines.h
dom/base/nsCCUncollectableMarker.cpp
dom/cache/Context.cpp
dom/canvas/CanvasRenderingContext2D.cpp
dom/canvas/WebGLContextVertices.cpp
dom/canvas/WebGLTexelConversions.h
dom/canvas/WebGLTexture.h
dom/canvas/WebGLTypes.h
dom/clients/api/Client.cpp
dom/clients/api/ClientDOMUtil.h
dom/clients/api/Clients.cpp
dom/clients/manager/ClientHandle.cpp
dom/clients/manager/ClientHandleOpParent.cpp
dom/clients/manager/ClientManagerOpParent.cpp
dom/clients/manager/ClientNavigateOpChild.cpp
dom/clients/manager/ClientOpenWindowOpChild.cpp
dom/clients/manager/ClientOpenWindowUtils.cpp
dom/clients/manager/ClientPrincipalUtils.cpp
dom/clients/manager/ClientSource.cpp
dom/clients/manager/ClientSourceOpChild.cpp
dom/clients/manager/ClientThing.h
dom/clients/manager/ClientValidation.cpp
dom/encoding/FallbackEncoding.cpp
dom/events/EventStateManager.cpp
dom/html/HTMLMediaElement.cpp
dom/indexedDB/ActorsChild.cpp
dom/ipc/SharedStringMap.cpp
dom/ipc/TabContext.cpp
dom/ipc/TabParent.cpp
dom/media/Benchmark.cpp
dom/media/ChannelMediaDecoder.cpp
dom/media/DOMMediaStream.cpp
dom/media/MediaDecoderStateMachine.cpp
dom/media/MediaDevices.cpp
dom/media/MediaFormatReader.cpp
dom/media/MediaManager.cpp
dom/media/MediaRecorder.cpp
dom/media/ReaderProxy.cpp
dom/media/VideoFrameConverter.h
dom/media/eme/MediaKeySystemAccess.cpp
dom/media/encoder/VP8TrackEncoder.cpp
dom/media/gmp/ChromiumCDMChild.cpp
dom/media/gmp/ChromiumCDMProxy.cpp
dom/media/gmp/GMPService.cpp
dom/media/gmp/GMPServiceParent.cpp
dom/media/gtest/TestCDMStorage.cpp
dom/media/gtest/TestMP4Demuxer.cpp
dom/media/gtest/TestMediaDataEncoder.cpp
dom/media/ipc/RemoteDecoderModule.cpp
dom/media/ipc/RemoteDecoderParent.cpp
dom/media/ipc/RemoteMediaDataDecoder.cpp
dom/media/mediasink/VideoSink.cpp
dom/media/mediasource/SourceBuffer.cpp
dom/media/mediasource/TrackBuffersManager.cpp
dom/media/platforms/AllocationPolicy.cpp
dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp
dom/media/platforms/omx/OmxDataDecoder.cpp
dom/media/platforms/omx/OmxPromiseLayer.cpp
dom/media/platforms/wmf/MFTDecoder.h
dom/media/platforms/wrappers/MediaChangeMonitor.cpp
dom/media/systemservices/MediaUtils.h
dom/media/webaudio/blink/DenormalDisabler.h
dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
dom/media/webspeech/recognition/SpeechRecognition.cpp
dom/payments/PaymentActionResponse.cpp
dom/payments/PaymentMethodChangeEvent.cpp
dom/payments/PaymentRequestManager.cpp
dom/payments/PaymentRequestService.cpp
dom/payments/ipc/PaymentRequestParent.cpp
dom/quota/ActorsParent.cpp
dom/serviceworkers/ServiceWorkerContainerImpl.cpp
dom/serviceworkers/ServiceWorkerContainerParent.cpp
dom/serviceworkers/ServiceWorkerManager.cpp
dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp
dom/webauthn/U2FTokenManager.cpp
dom/workers/WorkerDebugger.cpp
dom/xhr/XMLHttpRequestMainThread.cpp
dom/xslt/xml/txXMLUtils.cpp
dom/xslt/xpath/XPathResult.cpp
dom/xslt/xpath/txCoreFunctionCall.cpp
dom/xslt/xpath/txRelationalExpr.cpp
dom/xslt/xpath/txResultRecycler.cpp
dom/xslt/xslt/txBufferingHandler.cpp
dom/xslt/xslt/txMozillaXSLTProcessor.cpp
editor/spellchecker/EditorSpellCheck.cpp
extensions/cookie/nsPermissionManager.cpp
gfx/2d/BlurLS3.cpp
gfx/gl/GLReadTexImageHelper.cpp
gfx/layers/ScrollableLayerGuid.h
gfx/layers/TreeTraversal.h
gfx/layers/composite/TextureHost.cpp
gfx/layers/d3d11/TextureD3D11.cpp
gfx/layers/ipc/CompositableTransactionParent.cpp
gfx/layers/mlgpu/LayerManagerMLGPU.cpp
gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp
gfx/layers/opengl/TextureHostOGL.cpp
gfx/layers/wr/WebRenderCommandBuilder.cpp
gfx/src/FilterSupport.cpp
gfx/thebes/gfxFontUtils.h
gfx/thebes/gfxTypes.h
gfx/vr/VRDisplayClient.cpp
gfx/vr/ipc/VRChild.cpp
intl/locale/nsLanguageAtomService.cpp
intl/strres/nsStringBundle.cpp
intl/uconv/nsTextToSubURI.cpp
ipc/glue/WindowsMessageLoop.cpp
ipc/mscom/AgileReference.cpp
js/public/Conversions.h
js/public/RegExp.h
js/src/builtin/String.cpp
js/src/gc/Barrier.h
js/src/gc/GC.cpp
js/src/jit/BaselineJIT.cpp
js/src/jit/ExecutableAllocator.h
js/src/jit/arm/MacroAssembler-arm.cpp
js/src/jit/arm64/MacroAssembler-arm64.cpp
js/src/jit/none/MacroAssembler-none.h
js/src/jit/shared/AtomicOperations-shared-jit.cpp
js/src/jsapi-tests/testChromeBuffer.cpp
js/src/jsapi-tests/testCompileUtf8.cpp
js/src/jsapi-tests/testSetProperty.cpp
js/src/jsapi-tests/testUbiNode.cpp
js/src/jsapi-tests/tests.h
js/src/shell/js.cpp
js/src/vm/BigIntType.cpp
js/src/vm/Debugger.cpp
js/src/vm/MallocProvider.h
js/src/vm/TypedArrayObject.cpp
js/src/vm/TypedArrayObject.h
js/src/wasm/WasmBaselineCompile.cpp
js/src/wasm/WasmCraneliftCompile.cpp
js/src/wasm/WasmInstance.cpp
js/src/wasm/WasmIonCompile.cpp
js/src/wasm/WasmJS.cpp
js/src/wasm/WasmStubs.cpp
js/src/wasm/WasmValidate.cpp
js/xpconnect/loader/AutoMemMap.h
layout/build/nsContentDLF.cpp
layout/generic/WritingModes.h
layout/generic/nsTextFrameUtils.cpp
layout/painting/FrameLayerBuilder.cpp
layout/style/Loader.cpp
layout/style/MediaList.cpp
layout/style/StyleColorInlines.h
media/webrtc/signaling/src/media-conduit/RtpSourceObserver.cpp
media/webrtc/signaling/src/media-conduit/WebrtcMediaDataDecoderCodec.cpp
media/webrtc/signaling/src/peerconnection/MediaTransportHandlerIPC.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
media/webrtc/signaling/src/peerconnection/WebrtcGlobalInformation.cpp
media/webrtc/signaling/src/sdp/SipccSdpAttributeList.cpp
mfbt/Variant.h
modules/libpref/SharedPrefMap.cpp
netwerk/base/ProxyAutoConfig.cpp
netwerk/base/nsBaseChannel.cpp
netwerk/protocol/http/HttpChannelParent.cpp
parser/html/nsHtml5MetaScanner.cpp
parser/html/nsHtml5Tokenizer.cpp
parser/html/nsHtml5TreeBuilder.cpp
parser/html/nsHtml5TreeOperation.cpp
security/sandbox/mac/Sandbox.mm
toolkit/components/extensions/webrequest/StreamFilter.cpp
toolkit/components/perfmonitoring/PerformanceMetricsCollector.cpp
toolkit/crashreporter/minidump-analyzer/Win64ModuleUnwindMetadata.cpp
toolkit/crashreporter/nsExceptionHandler.cpp
toolkit/recordreplay/HashTable.cpp
tools/profiler/gecko/nsProfiler.cpp
widget/PuppetWidget.cpp
widget/cocoa/nsPrintDialogX.mm
widget/gtk/nsFilePicker.cpp
widget/gtk/nsNativeThemeGTK.cpp
widget/windows/ToastNotificationHandler.cpp
widget/windows/nsClipboard.cpp
xpcom/base/nsSystemInfo.cpp
xpcom/ds/PLDHashTable.cpp
xpcom/ds/nsTArray.h
xpcom/reflect/xptinfo/xptinfo.h
xpcom/tests/gtest/TestMozPromise.cpp
xpcom/tests/gtest/TestObserverArray.cpp
xpcom/tests/gtest/TestTArray2.cpp
xpcom/threads/MozPromise.h
xpcom/threads/nsThreadUtils.cpp
--- a/accessible/base/MarkupMap.h
+++ b/accessible/base/MarkupMap.h
@@ -1,60 +1,61 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:expandtab:shiftwidth=2:tabstop=2:
  */
 /* 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/. */
 
-MARKUPMAP(a,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            // Only some roles truly enjoy life as HTMLLinkAccessibles, for
-            // details see closed bug 494807.
-            const nsRoleMapEntry* roleMapEntry = aria::GetRoleMap(aElement);
-            if (roleMapEntry && roleMapEntry->role != roles::NOTHING &&
-                roleMapEntry->role != roles::LINK) {
-              return new HyperTextAccessibleWrap(aElement,
-                                                 aContext->Document());
-            }
+MARKUPMAP(
+    a,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      // Only some roles truly enjoy life as HTMLLinkAccessibles, for
+      // details see closed bug 494807.
+      const nsRoleMapEntry* roleMapEntry = aria::GetRoleMap(aElement);
+      if (roleMapEntry && roleMapEntry->role != roles::NOTHING &&
+          roleMapEntry->role != roles::LINK) {
+        return new HyperTextAccessibleWrap(aElement, aContext->Document());
+      }
 
-            return new HTMLLinkAccessible(aElement, aContext->Document());
-          },
-          roles::LINK)
+      return new HTMLLinkAccessible(aElement, aContext->Document());
+    },
+    roles::LINK)
 
 MARKUPMAP(abbr, New_HyperText, 0)
 
 MARKUPMAP(acronym, New_HyperText, 0)
 
 MARKUPMAP(article, New_HyperText, roles::ARTICLE, Attr(xmlroles, article))
 
 MARKUPMAP(aside, New_HyperText, roles::LANDMARK)
 
 MARKUPMAP(blockquote, New_HyperText, roles::BLOCKQUOTE)
 
-MARKUPMAP(button,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLButtonAccessible(aElement, aContext->Document());
-          },
-          0)
+MARKUPMAP(
+    button,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLButtonAccessible(aElement, aContext->Document());
+    },
+    0)
 
-MARKUPMAP(caption,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            if (aContext->IsTable()) {
-              dom::HTMLTableElement* tableEl =
-                  dom::HTMLTableElement::FromNode(aContext->GetContent());
-              if (tableEl && tableEl == aElement->GetParent() &&
-                  tableEl->GetCaption() == aElement) {
-                return new HTMLCaptionAccessible(aElement,
-                                                 aContext->Document());
-              }
-            }
-            return nullptr;
-          },
-          0)
+MARKUPMAP(
+    caption,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      if (aContext->IsTable()) {
+        dom::HTMLTableElement* tableEl =
+            dom::HTMLTableElement::FromNode(aContext->GetContent());
+        if (tableEl && tableEl == aElement->GetParent() &&
+            tableEl->GetCaption() == aElement) {
+          return new HTMLCaptionAccessible(aElement, aContext->Document());
+        }
+      }
+      return nullptr;
+    },
+    0)
 
 MARKUPMAP(dd, New_HTMLDtOrDd<HyperTextAccessibleWrap>, roles::DEFINITION)
 
 MARKUPMAP(del, New_HyperText, roles::CONTENT_DELETION)
 
 MARKUPMAP(details, New_HyperText, roles::DETAILS)
 
 MARKUPMAP(
@@ -115,139 +116,148 @@ MARKUPMAP(
             return new HyperTextAccessibleWrap(aElement, aContext->Document());
           }
         }
       }
       return nullptr;
     },
     roles::SECTION)
 
-MARKUPMAP(dl,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLListAccessible(aElement, aContext->Document());
-          },
-          roles::DEFINITION_LIST)
+MARKUPMAP(
+    dl,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLListAccessible(aElement, aContext->Document());
+    },
+    roles::DEFINITION_LIST)
 
 MARKUPMAP(dt, New_HTMLDtOrDd<HTMLLIAccessible>, roles::TERM)
 
-MARKUPMAP(figcaption,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLFigcaptionAccessible(aElement, aContext->Document());
-          },
-          roles::CAPTION)
+MARKUPMAP(
+    figcaption,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLFigcaptionAccessible(aElement, aContext->Document());
+    },
+    roles::CAPTION)
 
-MARKUPMAP(figure,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLFigureAccessible(aElement, aContext->Document());
-          },
-          roles::FIGURE, Attr(xmlroles, figure))
+MARKUPMAP(
+    figure,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLFigureAccessible(aElement, aContext->Document());
+    },
+    roles::FIGURE, Attr(xmlroles, figure))
 
-MARKUPMAP(fieldset,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLGroupboxAccessible(aElement, aContext->Document());
-          },
-          0)
+MARKUPMAP(
+    fieldset,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLGroupboxAccessible(aElement, aContext->Document());
+    },
+    0)
 
-MARKUPMAP(form,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLFormAccessible(aElement, aContext->Document());
-          },
-          0)
+MARKUPMAP(
+    form,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLFormAccessible(aElement, aContext->Document());
+    },
+    0)
 
-MARKUPMAP(footer,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLHeaderOrFooterAccessible(aElement,
-                                                    aContext->Document());
-          },
-          0)
+MARKUPMAP(
+    footer,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLHeaderOrFooterAccessible(aElement, aContext->Document());
+    },
+    0)
 
-MARKUPMAP(header,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLHeaderOrFooterAccessible(aElement,
-                                                    aContext->Document());
-          },
-          0)
+MARKUPMAP(
+    header,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLHeaderOrFooterAccessible(aElement, aContext->Document());
+    },
+    0)
 
 MARKUPMAP(h1, New_HyperText, roles::HEADING)
 
 MARKUPMAP(h2, New_HyperText, roles::HEADING)
 
 MARKUPMAP(h3, New_HyperText, roles::HEADING)
 
 MARKUPMAP(h4, New_HyperText, roles::HEADING)
 
 MARKUPMAP(h5, New_HyperText, roles::HEADING)
 
 MARKUPMAP(h6, New_HyperText, roles::HEADING)
 
-MARKUPMAP(hr,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLHRAccessible(aElement, aContext->Document());
-          },
-          0)
+MARKUPMAP(
+    hr,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLHRAccessible(aElement, aContext->Document());
+    },
+    0)
 
-MARKUPMAP(input,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            // TODO(emilio): This would be faster if it used
-            // HTMLInputElement's already-parsed representation.
-            if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
-                                      nsGkAtoms::checkbox, eIgnoreCase)) {
-              return new CheckboxAccessible(aElement, aContext->Document());
-            }
-            if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
-                                      nsGkAtoms::image, eIgnoreCase)) {
-              return new HTMLButtonAccessible(aElement, aContext->Document());
-            }
-            if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
-                                      nsGkAtoms::radio, eIgnoreCase)) {
-              return new HTMLRadioButtonAccessible(aElement,
-                                                   aContext->Document());
-            }
-            if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
-                                      nsGkAtoms::time, eIgnoreCase)) {
-              return new EnumRoleAccessible<roles::GROUPING>(
-                  aElement, aContext->Document());
-            }
-            if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
-                                      nsGkAtoms::date, eIgnoreCase)) {
-              return new EnumRoleAccessible<roles::DATE_EDITOR>(
-                  aElement, aContext->Document());
-            }
-            return nullptr;
-          },
-          0)
+MARKUPMAP(
+    input,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      // TODO(emilio): This would be faster if it used
+      // HTMLInputElement's already-parsed representation.
+      if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+                                nsGkAtoms::checkbox, eIgnoreCase)) {
+        return new CheckboxAccessible(aElement, aContext->Document());
+      }
+      if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+                                nsGkAtoms::image, eIgnoreCase)) {
+        return new HTMLButtonAccessible(aElement, aContext->Document());
+      }
+      if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+                                nsGkAtoms::radio, eIgnoreCase)) {
+        return new HTMLRadioButtonAccessible(aElement, aContext->Document());
+      }
+      if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+                                nsGkAtoms::time, eIgnoreCase)) {
+        return new EnumRoleAccessible<roles::GROUPING>(aElement,
+                                                       aContext->Document());
+      }
+      if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
+                                nsGkAtoms::date, eIgnoreCase)) {
+        return new EnumRoleAccessible<roles::DATE_EDITOR>(aElement,
+                                                          aContext->Document());
+      }
+      return nullptr;
+    },
+    0)
 
 MARKUPMAP(ins, New_HyperText, roles::CONTENT_INSERTION)
 
-MARKUPMAP(label,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLLabelAccessible(aElement, aContext->Document());
-          },
-          roles::LABEL)
+MARKUPMAP(
+    label,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLLabelAccessible(aElement, aContext->Document());
+    },
+    roles::LABEL)
 
-MARKUPMAP(legend,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLLegendAccessible(aElement, aContext->Document());
-          },
-          roles::LABEL)
+MARKUPMAP(
+    legend,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLLegendAccessible(aElement, aContext->Document());
+    },
+    roles::LABEL)
 
-MARKUPMAP(li,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            // If list item is a child of accessible list then create an
-            // accessible for it unconditionally by tag name. nsBlockFrame
-            // creates the list item accessible for other elements styled as
-            // list items.
-            if (aContext->IsList() &&
-                aContext->GetContent() == aElement->GetParent()) {
-              return new HTMLLIAccessible(aElement, aContext->Document());
-            }
+MARKUPMAP(
+    li,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      // If list item is a child of accessible list then create an
+      // accessible for it unconditionally by tag name. nsBlockFrame
+      // creates the list item accessible for other elements styled as
+      // list items.
+      if (aContext->IsList() &&
+          aContext->GetContent() == aElement->GetParent()) {
+        return new HTMLLIAccessible(aElement, aContext->Document());
+      }
 
-            return nullptr;
-          },
-          0)
+      return nullptr;
+    },
+    0)
 
 MARKUPMAP(main, New_HyperText, roles::LANDMARK)
 
 MARKUPMAP(map, nullptr, roles::TEXT_CONTAINER)
 
 MARKUPMAP(math, New_HyperText, roles::MATHML_MATH)
 
 MARKUPMAP(mi_, New_HyperText, roles::MATHML_IDENTIFIER)
@@ -296,41 +306,44 @@ MARKUPMAP(mover_, New_HyperText, roles::
           AttrFromDOM(accent_, accent_), AttrFromDOM(align, align))
 
 MARKUPMAP(munderover_, New_HyperText, roles::MATHML_UNDER_OVER,
           AttrFromDOM(accent_, accent_),
           AttrFromDOM(accentunder_, accentunder_), AttrFromDOM(align, align))
 
 MARKUPMAP(mmultiscripts_, New_HyperText, roles::MATHML_MULTISCRIPTS)
 
-MARKUPMAP(mtable_,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLTableAccessible(aElement, aContext->Document());
-          },
-          roles::MATHML_TABLE, AttrFromDOM(align, align),
-          AttrFromDOM(columnlines_, columnlines_),
-          AttrFromDOM(rowlines_, rowlines_))
+MARKUPMAP(
+    mtable_,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLTableAccessible(aElement, aContext->Document());
+    },
+    roles::MATHML_TABLE, AttrFromDOM(align, align),
+    AttrFromDOM(columnlines_, columnlines_), AttrFromDOM(rowlines_, rowlines_))
 
-MARKUPMAP(mlabeledtr_,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLTableRowAccessible(aElement, aContext->Document());
-          },
-          roles::MATHML_LABELED_ROW)
+MARKUPMAP(
+    mlabeledtr_,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLTableRowAccessible(aElement, aContext->Document());
+    },
+    roles::MATHML_LABELED_ROW)
 
-MARKUPMAP(mtr_,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLTableRowAccessible(aElement, aContext->Document());
-          },
-          roles::MATHML_TABLE_ROW)
+MARKUPMAP(
+    mtr_,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLTableRowAccessible(aElement, aContext->Document());
+    },
+    roles::MATHML_TABLE_ROW)
 
-MARKUPMAP(mtd_,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLTableCellAccessible(aElement, aContext->Document());
-          },
-          roles::MATHML_CELL)
+MARKUPMAP(
+    mtd_,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLTableCellAccessible(aElement, aContext->Document());
+    },
+    roles::MATHML_CELL)
 
 MARKUPMAP(maction_, New_HyperText, roles::MATHML_ACTION,
           AttrFromDOM(actiontype_, actiontype_),
           AttrFromDOM(selection_, selection_))
 
 MARKUPMAP(merror_, New_HyperText, roles::MATHML_ERROR)
 
 MARKUPMAP(mstack_, New_HyperText, roles::MATHML_STACK,
@@ -351,178 +364,188 @@ MARKUPMAP(mscarries_, New_HyperText, rol
 MARKUPMAP(mscarry_, New_HyperText, roles::MATHML_STACK_CARRY,
           AttrFromDOM(crossout_, crossout_))
 
 MARKUPMAP(msline_, New_HyperText, roles::MATHML_STACK_LINE,
           AttrFromDOM(position, position))
 
 MARKUPMAP(nav, New_HyperText, roles::LANDMARK)
 
-MARKUPMAP(ol,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLListAccessible(aElement, aContext->Document());
-          },
-          roles::LIST)
+MARKUPMAP(
+    ol,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLListAccessible(aElement, aContext->Document());
+    },
+    roles::LIST)
 
-MARKUPMAP(option,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLSelectOptionAccessible(aElement,
-                                                  aContext->Document());
-          },
-          0)
+MARKUPMAP(
+    option,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLSelectOptionAccessible(aElement, aContext->Document());
+    },
+    0)
 
-MARKUPMAP(optgroup,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLSelectOptGroupAccessible(aElement,
-                                                    aContext->Document());
-          },
-          0)
+MARKUPMAP(
+    optgroup,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLSelectOptGroupAccessible(aElement, aContext->Document());
+    },
+    0)
 
-MARKUPMAP(output,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLOutputAccessible(aElement, aContext->Document());
-          },
-          roles::SECTION, Attr(live, polite))
+MARKUPMAP(
+    output,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLOutputAccessible(aElement, aContext->Document());
+    },
+    roles::SECTION, Attr(live, polite))
 
 MARKUPMAP(p, nullptr, roles::PARAGRAPH)
 
-MARKUPMAP(progress,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLProgressAccessible(aElement, aContext->Document());
-          },
-          0)
+MARKUPMAP(
+    progress,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLProgressAccessible(aElement, aContext->Document());
+    },
+    0)
 
 MARKUPMAP(q, New_HyperText, 0)
 
-MARKUPMAP(section,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLSectionAccessible(aElement, aContext->Document());
-          },
-          0)
+MARKUPMAP(
+    section,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLSectionAccessible(aElement, aContext->Document());
+    },
+    0)
 
-MARKUPMAP(summary,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLSummaryAccessible(aElement, aContext->Document());
-          },
-          roles::SUMMARY)
+MARKUPMAP(
+    summary,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLSummaryAccessible(aElement, aContext->Document());
+    },
+    roles::SUMMARY)
 
-MARKUPMAP(table,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            if (aElement->GetPrimaryFrame() &&
-                aElement->GetPrimaryFrame()->AccessibleType() !=
-                    eHTMLTableType) {
-              return new ARIAGridAccessibleWrap(aElement, aContext->Document());
-            }
-            return nullptr;
-          },
-          0)
+MARKUPMAP(
+    table,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      if (aElement->GetPrimaryFrame() &&
+          aElement->GetPrimaryFrame()->AccessibleType() != eHTMLTableType) {
+        return new ARIAGridAccessibleWrap(aElement, aContext->Document());
+      }
+      return nullptr;
+    },
+    0)
 
 MARKUPMAP(time, New_HyperText, 0, Attr(xmlroles, time),
           AttrFromDOM(datetime, datetime))
 
-MARKUPMAP(tbody,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            // Expose this as a grouping if its frame type is non-standard.
-            if (aElement->GetPrimaryFrame() &&
-                aElement->GetPrimaryFrame()->IsTableRowGroupFrame()) {
-              return nullptr;
-            }
-            return new HyperTextAccessibleWrap(aElement, aContext->Document());
-          },
-          roles::GROUPING)
+MARKUPMAP(
+    tbody,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      // Expose this as a grouping if its frame type is non-standard.
+      if (aElement->GetPrimaryFrame() &&
+          aElement->GetPrimaryFrame()->IsTableRowGroupFrame()) {
+        return nullptr;
+      }
+      return new HyperTextAccessibleWrap(aElement, aContext->Document());
+    },
+    roles::GROUPING)
 
-MARKUPMAP(td,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            if (aContext->IsTableRow() &&
-                aContext->GetContent() == aElement->GetParent()) {
-              // If HTML:td element is part of its HTML:table, which has CSS
-              // display style other than 'table', then create a generic table
-              // cell accessible, because there's no underlying table layout and
-              // thus native HTML table cell class doesn't work. The same is
-              // true if the cell itself has CSS display:block;.
-              if (!aContext->IsHTMLTableRow() ||
-                  (aElement->GetPrimaryFrame() &&
-                   aElement->GetPrimaryFrame()->AccessibleType() !=
-                       eHTMLTableCellType)) {
-                return new ARIAGridCellAccessibleWrap(aElement,
-                                                      aContext->Document());
-              }
-              if (aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::scope)) {
-                return new HTMLTableHeaderCellAccessibleWrap(
-                    aElement, aContext->Document());
-              }
-            }
-            return nullptr;
-          },
-          0)
+MARKUPMAP(
+    td,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      if (aContext->IsTableRow() &&
+          aContext->GetContent() == aElement->GetParent()) {
+        // If HTML:td element is part of its HTML:table, which has CSS
+        // display style other than 'table', then create a generic table
+        // cell accessible, because there's no underlying table layout and
+        // thus native HTML table cell class doesn't work. The same is
+        // true if the cell itself has CSS display:block;.
+        if (!aContext->IsHTMLTableRow() ||
+            (aElement->GetPrimaryFrame() &&
+             aElement->GetPrimaryFrame()->AccessibleType() !=
+                 eHTMLTableCellType)) {
+          return new ARIAGridCellAccessibleWrap(aElement, aContext->Document());
+        }
+        if (aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::scope)) {
+          return new HTMLTableHeaderCellAccessibleWrap(aElement,
+                                                       aContext->Document());
+        }
+      }
+      return nullptr;
+    },
+    0)
 
-MARKUPMAP(tfoot,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            // Expose this as a grouping if its frame type is non-standard.
-            if (aElement->GetPrimaryFrame() &&
-                aElement->GetPrimaryFrame()->IsTableRowGroupFrame()) {
-              return nullptr;
-            }
-            return new HyperTextAccessibleWrap(aElement, aContext->Document());
-          },
-          roles::GROUPING)
+MARKUPMAP(
+    tfoot,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      // Expose this as a grouping if its frame type is non-standard.
+      if (aElement->GetPrimaryFrame() &&
+          aElement->GetPrimaryFrame()->IsTableRowGroupFrame()) {
+        return nullptr;
+      }
+      return new HyperTextAccessibleWrap(aElement, aContext->Document());
+    },
+    roles::GROUPING)
 
-MARKUPMAP(th,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            if (aContext->IsTableRow() &&
-                aContext->GetContent() == aElement->GetParent()) {
-              if (!aContext->IsHTMLTableRow()) {
-                return new ARIAGridCellAccessibleWrap(aElement,
-                                                      aContext->Document());
-              }
-              return new HTMLTableHeaderCellAccessibleWrap(
-                  aElement, aContext->Document());
-            }
-            return nullptr;
-          },
-          0)
+MARKUPMAP(
+    th,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      if (aContext->IsTableRow() &&
+          aContext->GetContent() == aElement->GetParent()) {
+        if (!aContext->IsHTMLTableRow()) {
+          return new ARIAGridCellAccessibleWrap(aElement, aContext->Document());
+        }
+        return new HTMLTableHeaderCellAccessibleWrap(aElement,
+                                                     aContext->Document());
+      }
+      return nullptr;
+    },
+    0)
 
-MARKUPMAP(tfoot,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            // Expose this as a grouping if its frame type is non-standard.
-            if (aElement->GetPrimaryFrame() &&
-                aElement->GetPrimaryFrame()->IsTableRowGroupFrame()) {
-              return nullptr;
-            }
-            return new HyperTextAccessibleWrap(aElement, aContext->Document());
-          },
-          roles::GROUPING)
+MARKUPMAP(
+    tfoot,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      // Expose this as a grouping if its frame type is non-standard.
+      if (aElement->GetPrimaryFrame() &&
+          aElement->GetPrimaryFrame()->IsTableRowGroupFrame()) {
+        return nullptr;
+      }
+      return new HyperTextAccessibleWrap(aElement, aContext->Document());
+    },
+    roles::GROUPING)
 
-MARKUPMAP(tr,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            // If HTML:tr element is part of its HTML:table, which has CSS
-            // display style other than 'table', then create a generic table row
-            // accessible, because there's no underlying table layout and thus
-            // native HTML table row class doesn't work. Refer to
-            // CreateAccessibleByFrameType dual logic.
-            Accessible* table = aContext->IsTable() ? aContext : nullptr;
-            if (!table && aContext->Parent() && aContext->Parent()->IsTable()) {
-              table = aContext->Parent();
-            }
-            if (table) {
-              nsIContent* parentContent = aElement->GetParent();
-              nsIFrame* parentFrame = parentContent->GetPrimaryFrame();
-              if (parentFrame && !parentFrame->IsTableWrapperFrame()) {
-                parentContent = parentContent->GetParent();
-                parentFrame = parentContent->GetPrimaryFrame();
-                if (table->GetContent() == parentContent &&
-                    ((parentFrame && !parentFrame->IsTableWrapperFrame()) ||
-                     (aElement->GetPrimaryFrame() &&
-                      aElement->GetPrimaryFrame()->AccessibleType() !=
-                          eHTMLTableRowType))) {
-                  return new ARIARowAccessible(aElement, aContext->Document());
-                }
-              }
-            }
-            return nullptr;
-          },
-          0)
+MARKUPMAP(
+    tr,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      // If HTML:tr element is part of its HTML:table, which has CSS
+      // display style other than 'table', then create a generic table row
+      // accessible, because there's no underlying table layout and thus
+      // native HTML table row class doesn't work. Refer to
+      // CreateAccessibleByFrameType dual logic.
+      Accessible* table = aContext->IsTable() ? aContext : nullptr;
+      if (!table && aContext->Parent() && aContext->Parent()->IsTable()) {
+        table = aContext->Parent();
+      }
+      if (table) {
+        nsIContent* parentContent = aElement->GetParent();
+        nsIFrame* parentFrame = parentContent->GetPrimaryFrame();
+        if (parentFrame && !parentFrame->IsTableWrapperFrame()) {
+          parentContent = parentContent->GetParent();
+          parentFrame = parentContent->GetPrimaryFrame();
+          if (table->GetContent() == parentContent &&
+              ((parentFrame && !parentFrame->IsTableWrapperFrame()) ||
+               (aElement->GetPrimaryFrame() &&
+                aElement->GetPrimaryFrame()->AccessibleType() !=
+                    eHTMLTableRowType))) {
+            return new ARIARowAccessible(aElement, aContext->Document());
+          }
+        }
+      }
+      return nullptr;
+    },
+    0)
 
-MARKUPMAP(ul,
-          [](Element* aElement, Accessible* aContext) -> Accessible* {
-            return new HTMLListAccessible(aElement, aContext->Document());
-          },
-          roles::LIST)
+MARKUPMAP(
+    ul,
+    [](Element* aElement, Accessible* aContext) -> Accessible* {
+      return new HTMLListAccessible(aElement, aContext->Document());
+    },
+    roles::LIST)
--- a/dom/base/AnonymousContent.cpp
+++ b/dom/base/AnonymousContent.cpp
@@ -192,18 +192,17 @@ void AnonymousContent::GetComputedStyleP
   }
 
   RefPtr<nsComputedDOMStyle> cs =
       new nsComputedDOMStyle(element, NS_LITERAL_STRING(""),
                              element->OwnerDoc(), nsComputedDOMStyle::eAll);
   aRv = cs->GetPropertyValue(aPropertyName, aResult);
 }
 
-void AnonymousContent::GetTargetIdForEvent(Event& aEvent, DOMString& aResult)
-{
+void AnonymousContent::GetTargetIdForEvent(Event& aEvent, DOMString& aResult) {
   nsCOMPtr<Element> el = do_QueryInterface(aEvent.GetOriginalTarget());
   if (el && el->IsInNativeAnonymousSubtree() && mContentNode->Contains(el)) {
     aResult.SetKnownLiveAtom(el->GetID(), DOMString::eTreatNullAsNull);
     return;
   }
 
   aResult.SetNull();
 }
--- a/dom/base/DocGroup.cpp
+++ b/dom/base/DocGroup.cpp
@@ -138,30 +138,31 @@ RefPtr<PerformanceInfoPromise> DocGroup:
                         items),
         __func__);
   }
 
   MOZ_ASSERT(mainThread);
   RefPtr<DocGroup> self = this;
 
   return CollectMemoryInfo(top, mainThread)
-      ->Then(mainThread, __func__,
-             [self, host, pid, windowID, duration, isTopLevel,
-              items](const PerformanceMemoryInfo& aMemoryInfo) {
-               PerformanceInfo info =
-                   PerformanceInfo(host, pid, windowID, duration,
-                                   self->mPerformanceCounter->GetID(), false,
-                                   isTopLevel, aMemoryInfo, items);
+      ->Then(
+          mainThread, __func__,
+          [self, host, pid, windowID, duration, isTopLevel,
+           items](const PerformanceMemoryInfo& aMemoryInfo) {
+            PerformanceInfo info =
+                PerformanceInfo(host, pid, windowID, duration,
+                                self->mPerformanceCounter->GetID(), false,
+                                isTopLevel, aMemoryInfo, items);
 
-               return PerformanceInfoPromise::CreateAndResolve(std::move(info),
-                                                               __func__);
-             },
-             [self](const nsresult rv) {
-               return PerformanceInfoPromise::CreateAndReject(rv, __func__);
-             });
+            return PerformanceInfoPromise::CreateAndResolve(std::move(info),
+                                                            __func__);
+          },
+          [self](const nsresult rv) {
+            return PerformanceInfoPromise::CreateAndReject(rv, __func__);
+          });
 }
 
 nsresult DocGroup::Dispatch(TaskCategory aCategory,
                             already_AddRefed<nsIRunnable>&& aRunnable) {
   if (mPerformanceCounter) {
     mPerformanceCounter->IncrementDispatchCounter(DispatchCategory(aCategory));
   }
   return mTabGroup->DispatchWithDocGroup(aCategory, std::move(aRunnable), this);
--- a/dom/base/TreeOrderedArrayInlines.h
+++ b/dom/base/TreeOrderedArrayInlines.h
@@ -42,17 +42,16 @@ size_t TreeOrderedArray<Node>::Insert(No
       if (nsContentUtils::PositionIsBefore(&mNode, curNode)) {
         return -1;
       }
       return 1;
     }
   };
 
   size_t idx;
-  BinarySearchIf(mList, 0, mList.Length(),
-                 PositionComparator(aNode), &idx);
+  BinarySearchIf(mList, 0, mList.Length(), PositionComparator(aNode), &idx);
   mList.InsertElementAt(idx, &aNode);
   return idx;
 }
 
 }  // namespace dom
 }  // namespace mozilla
 #endif
--- a/dom/base/UIDirectionManager.cpp
+++ b/dom/base/UIDirectionManager.cpp
@@ -46,18 +46,17 @@ void OnPrefChange(const char* aPrefName,
     }
   }
 }
 
 /* static */
 void UIDirectionManager::Initialize() {
   DebugOnly<nsresult> rv =
       Preferences::RegisterCallback(OnPrefChange, "intl.uidirection");
-  MOZ_ASSERT(NS_SUCCEEDED(rv),
-             "Failed to observe \"intl.uidirection\"");
+  MOZ_ASSERT(NS_SUCCEEDED(rv), "Failed to observe \"intl.uidirection\"");
 }
 
 /* static */
 void UIDirectionManager::Shutdown() {
   Preferences::UnregisterCallback(OnPrefChange, "intl.uidirection");
 }
 
 }  // namespace dom
--- a/dom/base/nsAttrValue.cpp
+++ b/dom/base/nsAttrValue.cpp
@@ -1641,17 +1641,19 @@ MiscContainer* nsAttrValue::ClearMiscCon
         case eAtomArray: {
           delete cont->mValue.mAtomArray;
           break;
         }
         case eIntMarginValue: {
           delete cont->mValue.mIntMargin;
           break;
         }
-        default: { break; }
+        default: {
+          break;
+        }
       }
     }
     ResetMiscAtomOrString();
   } else {
     ResetIfSet();
   }
 
   return cont;
--- a/dom/base/nsAttrValueInlines.h
+++ b/dom/base/nsAttrValueInlines.h
@@ -238,13 +238,15 @@ inline void nsAttrValue::ToString(mozill
       // else aResult is already empty
       return;
     }
     case eAtom: {
       nsAtom* atom = static_cast<nsAtom*>(GetPtr());
       aResult.SetKnownLiveAtom(atom, mozilla::dom::DOMString::eNullNotExpected);
       break;
     }
-    default: { ToString(aResult.AsAString()); }
+    default: {
+      ToString(aResult.AsAString());
+    }
   }
 }
 
 #endif
--- a/dom/base/nsCCUncollectableMarker.cpp
+++ b/dom/base/nsCCUncollectableMarker.cpp
@@ -421,17 +421,19 @@ nsresult nsCCUncollectableMarker::Observ
           mozilla::services::GetObserverService();
       static_cast<nsObserverService*>(obs.get())->UnmarkGrayStrongObservers();
       break;
     }
     case eUnmarkJSHolders: {
       xpc_UnmarkSkippableJSHolders();
       break;
     }
-    default: { break; }
+    default: {
+      break;
+    }
   }
 
   return NS_OK;
 }
 
 void mozilla::dom::TraceBlackJS(JSTracer* aTrc, bool aIsShutdownGC) {
 #ifdef MOZ_XUL
   // Mark the scripts held in the XULPrototypeCache. This is required to keep
--- a/dom/cache/Context.cpp
+++ b/dom/cache/Context.cpp
@@ -432,17 +432,19 @@ Context::QuotaInitRunnable::Run() {
 
       // Explicitly cleanup here as the destructor could fire on any of
       // the threads we have bounced through.
       Clear();
       break;
     }
     // -----
     case STATE_WAIT_FOR_DIRECTORY_LOCK:
-    default: { MOZ_CRASH("unexpected state in QuotaInitRunnable"); }
+    default: {
+      MOZ_CRASH("unexpected state in QuotaInitRunnable");
+    }
   }
 
   if (resolver->Resolved()) {
     Complete(resolver->Result());
   }
 
   return NS_OK;
 }
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -888,17 +888,17 @@ NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_B
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CanvasRenderingContext2D)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsICanvasRenderingContextInternal)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
-CanvasRenderingContext2D::ContextState::ContextState() =  default;
+CanvasRenderingContext2D::ContextState::ContextState() = default;
 
 CanvasRenderingContext2D::ContextState::ContextState(const ContextState& aOther)
     : fontGroup(aOther.fontGroup),
       fontLanguage(aOther.fontLanguage),
       fontFont(aOther.fontFont),
       gradientStyles(aOther.gradientStyles),
       patternStyles(aOther.patternStyles),
       colorStyles(aOther.colorStyles),
--- a/dom/canvas/WebGLContextVertices.cpp
+++ b/dom/canvas/WebGLContextVertices.cpp
@@ -397,18 +397,18 @@ void WebGLContext::VertexAttribAnyPointe
     gl->fVertexAttribIPointer(index, size, type, stride,
                               reinterpret_cast<void*>(byteOffset));
   } else {
     gl->fVertexAttribPointer(index, size, type, normalized, stride,
                              reinterpret_cast<void*>(byteOffset));
   }
 
   WebGLVertexAttribData& vd = mBoundVertexArray->mAttribs[index];
-  vd.VertexAttribPointer(isFuncInt, buffer, AutoAssertCast(size), type, normalized, stride,
-                         byteOffset);
+  vd.VertexAttribPointer(isFuncInt, buffer, AutoAssertCast(size), type,
+                         normalized, stride, byteOffset);
   mBoundVertexArray->InvalidateCaches();
 }
 
 ////////////////////////////////////////
 
 void WebGLContext::VertexAttribDivisor(GLuint index, GLuint divisor) {
   const FuncScope funcScope(*this, "vertexAttribDivisor");
   if (IsContextLost()) return;
--- a/dom/canvas/WebGLTexelConversions.h
+++ b/dom/canvas/WebGLTexelConversions.h
@@ -957,42 +957,44 @@ pack<WebGLTexelFormat::RG32F, WebGLTexel
 
 ////////////////////////////////////////////////////////////////////////////////
 // 3-channel formats
 template <>
 MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGB565, WebGLTexelPremultiplicationOp::None, uint8_t,
      uint16_t>(const uint8_t* __restrict src, uint16_t* __restrict dst) {
   *dst = uint16_t(((src[0] & 0xF8) << 8) | ((src[1] & 0xFC) << 3) |
-          ((src[2] & 0xF8) >> 3));
+                  ((src[2] & 0xF8) >> 3));
 }
 
 template <>
 MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGB565, WebGLTexelPremultiplicationOp::Premultiply,
      uint8_t, uint16_t>(const uint8_t* __restrict src,
                         uint16_t* __restrict dst) {
   float scaleFactor = src[3] / 255.0f;
   uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
   uint8_t srcG = static_cast<uint8_t>(src[1] * scaleFactor);
   uint8_t srcB = static_cast<uint8_t>(src[2] * scaleFactor);
-  *dst = uint16_t(((srcR & 0xF8) << 8) | ((srcG & 0xFC) << 3) | ((srcB & 0xF8) >> 3));
+  *dst = uint16_t(((srcR & 0xF8) << 8) | ((srcG & 0xFC) << 3) |
+                  ((srcB & 0xF8) >> 3));
 }
 
 // FIXME: this routine is lossy and must be removed.
 template <>
 MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGB565, WebGLTexelPremultiplicationOp::Unpremultiply,
      uint8_t, uint16_t>(const uint8_t* __restrict src,
                         uint16_t* __restrict dst) {
   float scaleFactor = src[3] ? 255.0f / src[3] : 1.0f;
   uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
   uint8_t srcG = static_cast<uint8_t>(src[1] * scaleFactor);
   uint8_t srcB = static_cast<uint8_t>(src[2] * scaleFactor);
-  *dst = uint16_t(((srcR & 0xF8) << 8) | ((srcG & 0xFC) << 3) | ((srcB & 0xF8) >> 3));
+  *dst = uint16_t(((srcR & 0xF8) << 8) | ((srcG & 0xFC) << 3) |
+                  ((srcB & 0xF8) >> 3));
 }
 
 template <>
 MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGB8, WebGLTexelPremultiplicationOp::None, uint8_t,
      uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst) {
   dst[0] = src[0];
   dst[1] = src[1];
@@ -1116,80 +1118,80 @@ pack<WebGLTexelFormat::RGB32F, WebGLTexe
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // 4-channel formats
 template <>
 MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGBA4444, WebGLTexelPremultiplicationOp::None, uint8_t,
      uint16_t>(const uint8_t* __restrict src, uint16_t* __restrict dst) {
-  *dst = uint16_t(((src[0] & 0xF0) << 8) | ((src[1] & 0xF0) << 4) | (src[2] & 0xF0) |
-          (src[3] >> 4));
+  *dst = uint16_t(((src[0] & 0xF0) << 8) | ((src[1] & 0xF0) << 4) |
+                  (src[2] & 0xF0) | (src[3] >> 4));
 }
 
 template <>
 MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGBA4444, WebGLTexelPremultiplicationOp::Premultiply,
      uint8_t, uint16_t>(const uint8_t* __restrict src,
                         uint16_t* __restrict dst) {
   float scaleFactor = src[3] / 255.0f;
   uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
   uint8_t srcG = static_cast<uint8_t>(src[1] * scaleFactor);
   uint8_t srcB = static_cast<uint8_t>(src[2] * scaleFactor);
   *dst = uint16_t(((srcR & 0xF0) << 8) | ((srcG & 0xF0) << 4) | (srcB & 0xF0) |
-          (src[3] >> 4));
+                  (src[3] >> 4));
 }
 
 // FIXME: this routine is lossy and must be removed.
 template <>
 MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGBA4444, WebGLTexelPremultiplicationOp::Unpremultiply,
      uint8_t, uint16_t>(const uint8_t* __restrict src,
                         uint16_t* __restrict dst) {
   float scaleFactor = src[3] ? 255.0f / src[3] : 1.0f;
   uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
   uint8_t srcG = static_cast<uint8_t>(src[1] * scaleFactor);
   uint8_t srcB = static_cast<uint8_t>(src[2] * scaleFactor);
   *dst = uint16_t(((srcR & 0xF0) << 8) | ((srcG & 0xF0) << 4) | (srcB & 0xF0) |
-          (src[3] >> 4));
+                  (src[3] >> 4));
 }
 
 template <>
 MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGBA5551, WebGLTexelPremultiplicationOp::None, uint8_t,
      uint16_t>(const uint8_t* __restrict src, uint16_t* __restrict dst) {
   *dst = uint16_t(((src[0] & 0xF8) << 8) | ((src[1] & 0xF8) << 3) |
-          ((src[2] & 0xF8) >> 2) | (src[3] >> 7));
+                  ((src[2] & 0xF8) >> 2) | (src[3] >> 7));
 }
 
 template <>
 MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGBA5551, WebGLTexelPremultiplicationOp::Premultiply,
      uint8_t, uint16_t>(const uint8_t* __restrict src,
                         uint16_t* __restrict dst) {
   float scaleFactor = src[3] / 255.0f;
   uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
   uint8_t srcG = static_cast<uint8_t>(src[1] * scaleFactor);
   uint8_t srcB = static_cast<uint8_t>(src[2] * scaleFactor);
-  *dst = uint16_t(((srcR & 0xF8) << 8) | ((srcG & 0xF8) << 3) | ((srcB & 0xF8) >> 2) |
-          (src[3] >> 7));
+  *dst = uint16_t(((srcR & 0xF8) << 8) | ((srcG & 0xF8) << 3) |
+                  ((srcB & 0xF8) >> 2) | (src[3] >> 7));
 }
 
 // FIXME: this routine is lossy and must be removed.
 template <>
 MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGBA5551, WebGLTexelPremultiplicationOp::Unpremultiply,
      uint8_t, uint16_t>(const uint8_t* __restrict src,
                         uint16_t* __restrict dst) {
   float scaleFactor = src[3] ? 255.0f / src[3] : 1.0f;
   uint8_t srcR = static_cast<uint8_t>(src[0] * scaleFactor);
   uint8_t srcG = static_cast<uint8_t>(src[1] * scaleFactor);
   uint8_t srcB = static_cast<uint8_t>(src[2] * scaleFactor);
-  *dst = uint16_t(((srcR & 0xF8) << 8) | ((srcG & 0xF8) << 3) | ((srcB & 0xF8) >> 2) |
-          (src[3] >> 7));
+  *dst = uint16_t(((srcR & 0xF8) << 8) | ((srcG & 0xF8) << 3) |
+                  ((srcB & 0xF8) >> 2) | (src[3] >> 7));
 }
 
 template <>
 MOZ_ALWAYS_INLINE void
 pack<WebGLTexelFormat::RGBA8, WebGLTexelPremultiplicationOp::None, uint8_t,
      uint8_t>(const uint8_t* __restrict src, uint8_t* __restrict dst) {
   dst[0] = src[0];
   dst[1] = src[1];
--- a/dom/canvas/WebGLTexture.h
+++ b/dom/canvas/WebGLTexture.h
@@ -265,17 +265,18 @@ class WebGLTexture final : public nsWrap
     GLenum rawTexImageTarget = texImageTarget.get();
     switch (rawTexImageTarget) {
       case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X:
       case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
       case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
       case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
       case LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
       case LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
-        return AutoAssertCast(rawTexImageTarget - LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X);
+        return AutoAssertCast(rawTexImageTarget -
+                              LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X);
 
       default:
         return 0;
     }
   }
 
   auto& ImageInfoAtFace(uint8_t face, uint32_t level) {
     MOZ_ASSERT(face < mFaceCount);
--- a/dom/canvas/WebGLTypes.h
+++ b/dom/canvas/WebGLTypes.h
@@ -55,32 +55,32 @@ inline void* calloc(const ForbidNarrowin
                     const ForbidNarrowing<size_t> size) {
   return ::calloc(size_t(n), size_t(size));
 }
 
 // -
 
 namespace detail {
 
-template<typename From>
+template <typename From>
 class AutoAssertCastT final {
   const From mVal;
 
-public:
-  explicit AutoAssertCastT(const From val) : mVal(val) { }
+ public:
+  explicit AutoAssertCastT(const From val) : mVal(val) {}
 
-  template<typename To>
+  template <typename To>
   operator To() const {
     return AssertedCast<To>(mVal);
   }
 };
 
 }  // namespace detail
 
-template<typename From>
+template <typename From>
 inline auto AutoAssertCast(const From val) {
   return detail::AutoAssertCastT<From>(val);
 }
 
 /*
  * Implementing WebGL (or OpenGL ES 2.0) on top of desktop OpenGL requires
  * emulating the vertex attrib 0 array when it's not enabled. Indeed,
  * OpenGL ES 2.0 allows drawing without vertex attrib 0 array enabled, but
--- a/dom/clients/api/Client.cpp
+++ b/dom/clients/api/Client.cpp
@@ -145,29 +145,30 @@ already_AddRefed<Promise> Client::Focus(
 
   EnsureHandle();
 
   IPCClientInfo ipcClientInfo(mData->info());
   auto holder =
       MakeRefPtr<DOMMozPromiseRequestHolder<ClientStatePromise>>(mGlobal);
 
   mHandle->Focus()
-      ->Then(mGlobal->EventTargetFor(TaskCategory::Other), __func__,
-             [ipcClientInfo, holder, outerPromise](const ClientState& aResult) {
-               holder->Complete();
-               NS_ENSURE_TRUE_VOID(holder->GetParentObject());
-               RefPtr<Client> newClient = new Client(
-                   holder->GetParentObject(),
-                   ClientInfoAndState(ipcClientInfo, aResult.ToIPC()));
-               outerPromise->MaybeResolve(newClient);
-             },
-             [holder, outerPromise](nsresult aResult) {
-               holder->Complete();
-               outerPromise->MaybeReject(aResult);
-             })
+      ->Then(
+          mGlobal->EventTargetFor(TaskCategory::Other), __func__,
+          [ipcClientInfo, holder, outerPromise](const ClientState& aResult) {
+            holder->Complete();
+            NS_ENSURE_TRUE_VOID(holder->GetParentObject());
+            RefPtr<Client> newClient =
+                new Client(holder->GetParentObject(),
+                           ClientInfoAndState(ipcClientInfo, aResult.ToIPC()));
+            outerPromise->MaybeResolve(newClient);
+          },
+          [holder, outerPromise](nsresult aResult) {
+            holder->Complete();
+            outerPromise->MaybeReject(aResult);
+          })
       ->Track(*holder);
 
   return outerPromise.forget();
 }
 
 already_AddRefed<Promise> Client::Navigate(const nsAString& aURL,
                                            ErrorResult& aRv) {
   MOZ_ASSERT(!NS_IsMainThread());
--- a/dom/clients/api/ClientDOMUtil.h
+++ b/dom/clients/api/ClientDOMUtil.h
@@ -27,24 +27,25 @@ void StartClientManagerOp(Func aFunc, co
 
   nsCOMPtr<nsISerialEventTarget> target =
       aGlobal->EventTargetFor(TaskCategory::Other);
 
   auto holder =
       MakeRefPtr<DOMMozPromiseRequestHolder<ClientOpPromise>>(aGlobal);
 
   aFunc(aArg, target)
-      ->Then(target, __func__,
-             [aResolve, holder](const ClientOpResult& aResult) {
-               holder->Complete();
-               aResolve(aResult);
-             },
-             [aReject, holder](nsresult aResult) {
-               holder->Complete();
-               aReject(aResult);
-             })
+      ->Then(
+          target, __func__,
+          [aResolve, holder](const ClientOpResult& aResult) {
+            holder->Complete();
+            aResolve(aResult);
+          },
+          [aReject, holder](nsresult aResult) {
+            holder->Complete();
+            aReject(aResult);
+          })
       ->Track(*holder);
 }
 
 }  // namespace dom
 }  // namespace mozilla
 
 #endif  // _mozilla_dom_ClientDOMUtil_h
--- a/dom/clients/api/Clients.cpp
+++ b/dom/clients/api/Clients.cpp
@@ -75,40 +75,41 @@ already_AddRefed<Promise> Clients::Get(c
   RefPtr<ClientOpPromise> innerPromise = ClientManager::GetInfoAndState(
       ClientGetInfoAndStateArgs(id, principalInfo), target);
 
   nsCString scope = workerPrivate->ServiceWorkerScope();
   auto holder =
       MakeRefPtr<DOMMozPromiseRequestHolder<ClientOpPromise>>(mGlobal);
 
   innerPromise
-      ->Then(target, __func__,
-             [outerPromise, holder, scope](const ClientOpResult& aResult) {
-               holder->Complete();
-               NS_ENSURE_TRUE_VOID(holder->GetParentObject());
-               RefPtr<Client> client = new Client(
-                   holder->GetParentObject(), aResult.get_ClientInfoAndState());
-               if (client->GetStorageAccess() ==
-                   nsContentUtils::StorageAccess::eAllow) {
-                 outerPromise->MaybeResolve(std::move(client));
-                 return;
-               }
-               nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction(
-                   "Clients::Get() storage denied", [scope] {
-                     ServiceWorkerManager::LocalizeAndReportToAllClients(
-                         scope, "ServiceWorkerGetClientStorageError",
-                         nsTArray<nsString>());
-                   });
-               SystemGroup::Dispatch(TaskCategory::Other, r.forget());
-               outerPromise->MaybeResolveWithUndefined();
-             },
-             [outerPromise, holder](nsresult aResult) {
-               holder->Complete();
-               outerPromise->MaybeResolveWithUndefined();
-             })
+      ->Then(
+          target, __func__,
+          [outerPromise, holder, scope](const ClientOpResult& aResult) {
+            holder->Complete();
+            NS_ENSURE_TRUE_VOID(holder->GetParentObject());
+            RefPtr<Client> client = new Client(
+                holder->GetParentObject(), aResult.get_ClientInfoAndState());
+            if (client->GetStorageAccess() ==
+                nsContentUtils::StorageAccess::eAllow) {
+              outerPromise->MaybeResolve(std::move(client));
+              return;
+            }
+            nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction(
+                "Clients::Get() storage denied", [scope] {
+                  ServiceWorkerManager::LocalizeAndReportToAllClients(
+                      scope, "ServiceWorkerGetClientStorageError",
+                      nsTArray<nsString>());
+                });
+            SystemGroup::Dispatch(TaskCategory::Other, r.forget());
+            outerPromise->MaybeResolveWithUndefined();
+          },
+          [outerPromise, holder](nsresult aResult) {
+            holder->Complete();
+            outerPromise->MaybeResolveWithUndefined();
+          })
       ->Track(*holder);
 
   return outerPromise.forget();
 }
 
 namespace {
 
 class MatchAllComparator final {
--- a/dom/clients/manager/ClientHandle.cpp
+++ b/dom/clients/manager/ClientHandle.cpp
@@ -105,39 +105,41 @@ RefPtr<GenericPromise> ClientHandle::Con
   RefPtr<GenericPromise::Private> outerPromise =
       new GenericPromise::Private(__func__);
 
   // We should never have a cross-origin controller.  Since this would be
   // same-origin policy violation we do a full release assertion here.
   MOZ_RELEASE_ASSERT(ClientMatchPrincipalInfo(mClientInfo.PrincipalInfo(),
                                               aServiceWorker.PrincipalInfo()));
 
-  StartOp(ClientControlledArgs(aServiceWorker.ToIPC()),
-          [outerPromise](const ClientOpResult& aResult) {
-            outerPromise->Resolve(true, __func__);
-          },
-          [outerPromise](const ClientOpResult& aResult) {
-            outerPromise->Reject(aResult.get_nsresult(), __func__);
-          });
+  StartOp(
+      ClientControlledArgs(aServiceWorker.ToIPC()),
+      [outerPromise](const ClientOpResult& aResult) {
+        outerPromise->Resolve(true, __func__);
+      },
+      [outerPromise](const ClientOpResult& aResult) {
+        outerPromise->Reject(aResult.get_nsresult(), __func__);
+      });
 
   return outerPromise.forget();
 }
 
 RefPtr<ClientStatePromise> ClientHandle::Focus() {
   RefPtr<ClientStatePromise::Private> outerPromise =
       new ClientStatePromise::Private(__func__);
 
-  StartOp(ClientFocusArgs(),
-          [outerPromise](const ClientOpResult& aResult) {
-            outerPromise->Resolve(
-                ClientState::FromIPC(aResult.get_IPCClientState()), __func__);
-          },
-          [outerPromise](const ClientOpResult& aResult) {
-            outerPromise->Reject(aResult.get_nsresult(), __func__);
-          });
+  StartOp(
+      ClientFocusArgs(),
+      [outerPromise](const ClientOpResult& aResult) {
+        outerPromise->Resolve(
+            ClientState::FromIPC(aResult.get_IPCClientState()), __func__);
+      },
+      [outerPromise](const ClientOpResult& aResult) {
+        outerPromise->Reject(aResult.get_nsresult(), __func__);
+      });
 
   return outerPromise.forget();
 }
 
 RefPtr<GenericPromise> ClientHandle::PostMessage(
     StructuredCloneData& aData, const ServiceWorkerDescriptor& aSource) {
   if (IsShutdown()) {
     return GenericPromise::CreateAndReject(NS_ERROR_DOM_INVALID_STATE_ERR,
@@ -151,23 +153,24 @@ RefPtr<GenericPromise> ClientHandle::Pos
           GetActor()->Manager()->Manager(), args.clonedData())) {
     return GenericPromise::CreateAndReject(NS_ERROR_DOM_INVALID_STATE_ERR,
                                            __func__);
   }
 
   RefPtr<GenericPromise::Private> outerPromise =
       new GenericPromise::Private(__func__);
 
-  StartOp(args,
-          [outerPromise](const ClientOpResult& aResult) {
-            outerPromise->Resolve(true, __func__);
-          },
-          [outerPromise](const ClientOpResult& aResult) {
-            outerPromise->Reject(aResult.get_nsresult(), __func__);
-          });
+  StartOp(
+      args,
+      [outerPromise](const ClientOpResult& aResult) {
+        outerPromise->Resolve(true, __func__);
+      },
+      [outerPromise](const ClientOpResult& aResult) {
+        outerPromise->Reject(aResult.get_nsresult(), __func__);
+      });
 
   return outerPromise.forget();
 }
 
 RefPtr<GenericPromise> ClientHandle::OnDetach() {
   NS_ASSERT_OWNINGTHREAD(ClientSource);
 
   if (!mDetachPromise) {
--- a/dom/clients/manager/ClientHandleOpParent.cpp
+++ b/dom/clients/manager/ClientHandleOpParent.cpp
@@ -57,22 +57,23 @@ void ClientHandleOpParent::Init(const Cl
   // Other argument types can just be forwarded straight through.
   else {
     p = source->StartOp(aArgs);
   }
 
   // Capturing 'this' is safe here because we disconnect the promise in
   // ActorDestroy() which ensures neither lambda is called if the actor
   // is destroyed before the source operation completes.
-  p->Then(GetCurrentThreadSerialEventTarget(), __func__,
-          [this](const ClientOpResult& aResult) {
-            mPromiseRequestHolder.Complete();
-            Unused << PClientHandleOpParent::Send__delete__(this, aResult);
-          },
-          [this](nsresult aRv) {
-            mPromiseRequestHolder.Complete();
-            Unused << PClientHandleOpParent::Send__delete__(this, aRv);
-          })
+  p->Then(
+       GetCurrentThreadSerialEventTarget(), __func__,
+       [this](const ClientOpResult& aResult) {
+         mPromiseRequestHolder.Complete();
+         Unused << PClientHandleOpParent::Send__delete__(this, aResult);
+       },
+       [this](nsresult aRv) {
+         mPromiseRequestHolder.Complete();
+         Unused << PClientHandleOpParent::Send__delete__(this, aRv);
+       })
       ->Track(mPromiseRequestHolder);
 }
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/clients/manager/ClientManagerOpParent.cpp
+++ b/dom/clients/manager/ClientManagerOpParent.cpp
@@ -19,25 +19,26 @@ void ClientManagerOpParent::DoServiceOp(
   // Note, we need perfect forarding of the template type in order
   // to allow already_AddRefed<> to be passed as an arg.
   RefPtr<ClientOpPromise> p =
       (mService->*aMethod)(std::forward<Args>(aArgs)...);
 
   // Capturing `this` is safe here because we disconnect the promise in
   // ActorDestroy() which ensures neither lambda is called if the actor
   // is destroyed before the source operation completes.
-  p->Then(GetCurrentThreadSerialEventTarget(), __func__,
-          [this](const mozilla::dom::ClientOpResult& aResult) {
-            mPromiseRequestHolder.Complete();
-            Unused << PClientManagerOpParent::Send__delete__(this, aResult);
-          },
-          [this](nsresult aRv) {
-            mPromiseRequestHolder.Complete();
-            Unused << PClientManagerOpParent::Send__delete__(this, aRv);
-          })
+  p->Then(
+       GetCurrentThreadSerialEventTarget(), __func__,
+       [this](const mozilla::dom::ClientOpResult& aResult) {
+         mPromiseRequestHolder.Complete();
+         Unused << PClientManagerOpParent::Send__delete__(this, aResult);
+       },
+       [this](nsresult aRv) {
+         mPromiseRequestHolder.Complete();
+         Unused << PClientManagerOpParent::Send__delete__(this, aRv);
+       })
       ->Track(mPromiseRequestHolder);
 }
 
 void ClientManagerOpParent::ActorDestroy(ActorDestroyReason aReason) {
   mPromiseRequestHolder.DisconnectIfExists();
 }
 
 ClientManagerOpParent::ClientManagerOpParent(ClientManagerService* aService)
--- a/dom/clients/manager/ClientNavigateOpChild.cpp
+++ b/dom/clients/manager/ClientNavigateOpChild.cpp
@@ -282,22 +282,23 @@ void ClientNavigateOpChild::Init(const C
   // target.
   if (!mSerialEventTarget) {
     mSerialEventTarget = GetCurrentThreadSerialEventTarget();
   }
 
   // Capturing `this` is safe here since we clear the mPromiseRequestHolder in
   // ActorDestroy.
   promise
-      ->Then(mSerialEventTarget, __func__,
-             [this](const ClientOpResult& aResult) {
-               mPromiseRequestHolder.Complete();
-               PClientNavigateOpChild::Send__delete__(this, aResult);
-             },
-             [this](nsresult aResult) {
-               mPromiseRequestHolder.Complete();
-               PClientNavigateOpChild::Send__delete__(this, aResult);
-             })
+      ->Then(
+          mSerialEventTarget, __func__,
+          [this](const ClientOpResult& aResult) {
+            mPromiseRequestHolder.Complete();
+            PClientNavigateOpChild::Send__delete__(this, aResult);
+          },
+          [this](nsresult aResult) {
+            mPromiseRequestHolder.Complete();
+            PClientNavigateOpChild::Send__delete__(this, aResult);
+          })
       ->Track(mPromiseRequestHolder);
 }
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/clients/manager/ClientOpenWindowOpChild.cpp
+++ b/dom/clients/manager/ClientOpenWindowOpChild.cpp
@@ -17,22 +17,23 @@ RefPtr<ClientOpPromise> ClientOpenWindow
 }
 
 void ClientOpenWindowOpChild::ActorDestroy(ActorDestroyReason aReason) {
   mPromiseRequestHolder.DisconnectIfExists();
 }
 
 void ClientOpenWindowOpChild::Init(const ClientOpenWindowArgs& aArgs) {
   DoOpenWindow(aArgs)
-      ->Then(SystemGroup::EventTargetFor(TaskCategory::Other), __func__,
-             [this](const ClientOpResult& aResult) {
-               mPromiseRequestHolder.Complete();
-               PClientOpenWindowOpChild::Send__delete__(this, aResult);
-             },
-             [this](nsresult aResult) {
-               mPromiseRequestHolder.Complete();
-               PClientOpenWindowOpChild::Send__delete__(this, aResult);
-             })
+      ->Then(
+          SystemGroup::EventTargetFor(TaskCategory::Other), __func__,
+          [this](const ClientOpResult& aResult) {
+            mPromiseRequestHolder.Complete();
+            PClientOpenWindowOpChild::Send__delete__(this, aResult);
+          },
+          [this](nsresult aResult) {
+            mPromiseRequestHolder.Complete();
+            PClientOpenWindowOpChild::Send__delete__(this, aResult);
+          })
       ->Track(mPromiseRequestHolder);
 }
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/clients/manager/ClientOpenWindowUtils.cpp
+++ b/dom/clients/manager/ClientOpenWindowUtils.cpp
@@ -297,19 +297,20 @@ void WaitForLoad(const ClientOpenWindowA
   rv = webProgress->AddProgressListener(listener,
                                         nsIWebProgress::NOTIFY_STATE_DOCUMENT);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     promise->Reject(rv, __func__);
     return;
   }
 
   // Hold the listener alive until the promise settles
-  ref->Then(aOuterWindow->EventTargetFor(TaskCategory::Other), __func__,
-            [listener](const ClientOpResult& aResult) {},
-            [listener](nsresult aResult) {});
+  ref->Then(
+      aOuterWindow->EventTargetFor(TaskCategory::Other), __func__,
+      [listener](const ClientOpResult& aResult) {},
+      [listener](nsresult aResult) {});
 }
 
 #ifdef MOZ_WIDGET_ANDROID
 
 class LaunchObserver final : public nsIObserver {
   RefPtr<GenericPromise::Private> mPromise;
 
   LaunchObserver() : mPromise(new GenericPromise::Private(__func__)) {}
--- a/dom/clients/manager/ClientPrincipalUtils.cpp
+++ b/dom/clients/manager/ClientPrincipalUtils.cpp
@@ -30,17 +30,19 @@ bool ClientMatchPrincipalInfo(const Prin
     case PrincipalInfo::TSystemPrincipalInfo: {
       // system principal always matches
       return true;
     }
     case PrincipalInfo::TNullPrincipalInfo: {
       // null principal never matches
       return false;
     }
-    default: { break; }
+    default: {
+      break;
+    }
   }
 
   // Clients (windows/workers) should never have an expanded principal type.
   MOZ_CRASH("unexpected principal type!");
 }
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/clients/manager/ClientSource.cpp
+++ b/dom/clients/manager/ClientSource.cpp
@@ -598,25 +598,26 @@ RefPtr<ClientOpPromise> ClientSource::Cl
   }
 
   RefPtr<ClientOpPromise::Private> outerPromise =
       new ClientOpPromise::Private(__func__);
 
   auto holder = MakeRefPtr<DOMMozPromiseRequestHolder<GenericPromise>>(global);
 
   innerPromise
-      ->Then(mEventTarget, __func__,
-             [outerPromise, holder](bool aResult) {
-               holder->Complete();
-               outerPromise->Resolve(NS_OK, __func__);
-             },
-             [outerPromise, holder](nsresult aResult) {
-               holder->Complete();
-               outerPromise->Reject(aResult, __func__);
-             })
+      ->Then(
+          mEventTarget, __func__,
+          [outerPromise, holder](bool aResult) {
+            holder->Complete();
+            outerPromise->Resolve(NS_OK, __func__);
+          },
+          [outerPromise, holder](nsresult aResult) {
+            holder->Complete();
+            outerPromise->Reject(aResult, __func__);
+          })
       ->Track(*holder);
 
   return outerPromise.forget();
 }
 
 RefPtr<ClientOpPromise> ClientSource::GetInfoAndState(
     const ClientGetInfoAndStateArgs& aArgs) {
   ClientState state;
--- a/dom/clients/manager/ClientSourceOpChild.cpp
+++ b/dom/clients/manager/ClientSourceOpChild.cpp
@@ -51,25 +51,26 @@ void ClientSourceOpChild::DoSourceOp(Met
   // ActorDestroy() which ensures neither lambda is called if the
   // actor is destroyed before the source operation completes.
   //
   // Also capture the promise to ensure it lives until we get a reaction
   // or the actor starts shutting down and we disconnect our Thenable.
   // If the ClientSource is doing something async it may throw away the
   // promise on its side if the global is closed.
   promise
-      ->Then(target, __func__,
-             [this, promise](const mozilla::dom::ClientOpResult& aResult) {
-               mPromiseRequestHolder.Complete();
-               Unused << PClientSourceOpChild::Send__delete__(this, aResult);
-             },
-             [this, promise](nsresult aRv) {
-               mPromiseRequestHolder.Complete();
-               Unused << PClientSourceOpChild::Send__delete__(this, aRv);
-             })
+      ->Then(
+          target, __func__,
+          [this, promise](const mozilla::dom::ClientOpResult& aResult) {
+            mPromiseRequestHolder.Complete();
+            Unused << PClientSourceOpChild::Send__delete__(this, aResult);
+          },
+          [this, promise](nsresult aRv) {
+            mPromiseRequestHolder.Complete();
+            Unused << PClientSourceOpChild::Send__delete__(this, aRv);
+          })
       ->Track(mPromiseRequestHolder);
 }
 
 void ClientSourceOpChild::ActorDestroy(ActorDestroyReason aReason) {
   mPromiseRequestHolder.DisconnectIfExists();
 }
 
 void ClientSourceOpChild::Init(const ClientOpConstructorArgs& aArgs) {
--- a/dom/clients/manager/ClientThing.h
+++ b/dom/clients/manager/ClientThing.h
@@ -63,18 +63,18 @@ class ClientThing {
   // Returns true if ShutdownThing() has been called.
   bool IsShutdown() const {
     AssertIsValid();
     return mShutdown;
   }
 
   // Conditionally execute the given callable based on the current state.
   template <typename Callable>
-  void MaybeExecute(const Callable& aSuccess,
-                    const std::function<void()>& aFailure = [] {}) {
+  void MaybeExecute(
+      const Callable& aSuccess, const std::function<void()>& aFailure = [] {}) {
     AssertIsValid();
     if (mShutdown) {
       aFailure();
       return;
     }
     MOZ_DIAGNOSTIC_ASSERT(mActor);
     aSuccess(mActor);
   }
--- a/dom/clients/manager/ClientValidation.cpp
+++ b/dom/clients/manager/ClientValidation.cpp
@@ -53,17 +53,19 @@ bool ClientIsValidPrincipalInfo(const Pr
       // For now require Clients to have a principal where both its
       // originNoSuffix and spec have the same origin.  This will
       // exclude a variety of unusual combinations within the browser
       // but its adequate for the features need to support right now.
       // If necessary we could expand this function to handle more
       // cases in the future.
       return specOrigin == originOrigin;
     }
-    default: { break; }
+    default: {
+      break;
+    }
   }
 
   // Windows and workers should not have expanded URLs, etc.
   return false;
 }
 
 bool ClientIsValidCreationURL(const PrincipalInfo& aPrincipalInfo,
                               const nsACString& aURL) {
@@ -139,17 +141,19 @@ bool ClientIsValidCreationURL(const Prin
     case PrincipalInfo::TNullPrincipalInfo: {
       // A wide variety of clients can have a null principal.  For example,
       // sandboxed iframes can have a normal content URL.  For now allow
       // any parsable URL for null principals.  This is relatively safe since
       // null principals have unique origins and won't most ClientManagerService
       // queries anyway.
       return true;
     }
-    default: { break; }
+    default: {
+      break;
+    }
   }
 
   // Clients (windows/workers) should never have an expanded principal type.
   return false;
 }
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/encoding/FallbackEncoding.cpp
+++ b/dom/encoding/FallbackEncoding.cpp
@@ -24,21 +24,22 @@ struct EncodingProp {
   NotNull<const Encoding*> mValue;
 };
 
 template <int32_t N>
 static NotNull<const Encoding*> SearchEncodingProp(
     const EncodingProp (&aProperties)[N], const nsACString& aKey) {
   const nsCString& flat = PromiseFlatCString(aKey);
   size_t index;
-  if (!BinarySearchIf(aProperties, 0, ArrayLength(aProperties),
-                      [&flat](const EncodingProp& aProperty) {
-                        return flat.Compare(aProperty.mKey);
-                      },
-                      &index)) {
+  if (!BinarySearchIf(
+          aProperties, 0, ArrayLength(aProperties),
+          [&flat](const EncodingProp& aProperty) {
+            return flat.Compare(aProperty.mKey);
+          },
+          &index)) {
     return WINDOWS_1252_ENCODING;
   }
   return aProperties[index].mValue;
 }
 
 static const EncodingProp localesFallbacks[] = {
 #include "localesfallbacks.properties.h"
 };
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -1291,17 +1291,19 @@ void EventStateManager::DispatchCrossPro
                                    IPC::Principal(principal));
       return;
     }
     case ePluginEventClass: {
       *aStatus = nsEventStatus_eConsumeNoDefault;
       remote->SendPluginEvent(*aEvent->AsPluginEvent());
       return;
     }
-    default: { MOZ_CRASH("Attempt to send non-whitelisted event?"); }
+    default: {
+      MOZ_CRASH("Attempt to send non-whitelisted event?");
+    }
   }
 }
 
 bool EventStateManager::IsRemoteTarget(nsIContent* target) {
   return !!TabParent::GetFrom(target);
 }
 
 bool EventStateManager::HandleCrossProcessEvent(WidgetEvent* aEvent,
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -6445,34 +6445,35 @@ bool HTMLMediaElement::TryRemoveMediaKey
   // let this object's attaching media keys value be false and reject promise
   // with a new DOMException whose name is NotSupportedError.
   // 5.2.2 If the association cannot currently be removed, let this object's
   // attaching media keys value be false and reject promise with a new
   // DOMException whose name is InvalidStateError.
   if (mDecoder) {
     RefPtr<HTMLMediaElement> self = this;
     mDecoder->SetCDMProxy(nullptr)
-        ->Then(mAbstractMainThread, __func__,
-               [self]() {
-                 self->mSetCDMRequest.Complete();
-
-                 self->RemoveMediaKeys();
-                 if (self->AttachNewMediaKeys()) {
-                   // No incoming MediaKeys object or MediaDecoder is not
-                   // created yet.
-                   self->MakeAssociationWithCDMResolved();
-                 }
-               },
-               [self](const MediaResult& aResult) {
-                 self->mSetCDMRequest.Complete();
-                 // 5.2.4 If the preceding step failed, let this object's
-                 // attaching media keys value be false and reject promise with
-                 // a new DOMException whose name is the appropriate error name.
-                 self->SetCDMProxyFailure(aResult);
-               })
+        ->Then(
+            mAbstractMainThread, __func__,
+            [self]() {
+              self->mSetCDMRequest.Complete();
+
+              self->RemoveMediaKeys();
+              if (self->AttachNewMediaKeys()) {
+                // No incoming MediaKeys object or MediaDecoder is not
+                // created yet.
+                self->MakeAssociationWithCDMResolved();
+              }
+            },
+            [self](const MediaResult& aResult) {
+              self->mSetCDMRequest.Complete();
+              // 5.2.4 If the preceding step failed, let this object's
+              // attaching media keys value be false and reject promise with
+              // a new DOMException whose name is the appropriate error name.
+              self->SetCDMProxyFailure(aResult);
+            })
         ->Track(mSetCDMRequest);
     return false;
   }
 
   RemoveMediaKeys();
   return true;
 }
 
@@ -6518,25 +6519,26 @@ bool HTMLMediaElement::TryMakeAssociatio
   // 5.3.3 Queue a task to run the "Attempt to Resume Playback If Necessary"
   // algorithm on the media element.
   // Note: Setting the CDMProxy on the MediaDecoder will unblock playback.
   if (mDecoder) {
     // CDMProxy is set asynchronously in MediaFormatReader, once it's done,
     // HTMLMediaElement should resolve or reject the DOM promise.
     RefPtr<HTMLMediaElement> self = this;
     mDecoder->SetCDMProxy(aProxy)
-        ->Then(mAbstractMainThread, __func__,
-               [self]() {
-                 self->mSetCDMRequest.Complete();
-                 self->MakeAssociationWithCDMResolved();
-               },
-               [self](const MediaResult& aResult) {
-                 self->mSetCDMRequest.Complete();
-                 self->SetCDMProxyFailure(aResult);
-               })
+        ->Then(
+            mAbstractMainThread, __func__,
+            [self]() {
+              self->mSetCDMRequest.Complete();
+              self->MakeAssociationWithCDMResolved();
+            },
+            [self](const MediaResult& aResult) {
+              self->mSetCDMRequest.Complete();
+              self->SetCDMProxyFailure(aResult);
+            })
         ->Track(mSetCDMRequest);
     return false;
   }
   return true;
 }
 
 bool HTMLMediaElement::AttachNewMediaKeys() {
   LOG(LogLevel::Debug,
--- a/dom/indexedDB/ActorsChild.cpp
+++ b/dom/indexedDB/ActorsChild.cpp
@@ -1715,23 +1715,24 @@ mozilla::ipc::IPCResult BackgroundFactor
   }
 
   RefPtr<TabChild> tabChild = mFactory->GetTabChild();
   MOZ_ASSERT(tabChild);
 
   IPC::Principal ipcPrincipal(principal);
 
   tabChild->SendIndexedDBPermissionRequest(ipcPrincipal)
-      ->Then(GetCurrentThreadSerialEventTarget(), __func__,
-             [this](const uint32_t& aPermission) {
-               this->AssertIsOnOwningThread();
-               MaybeCollectGarbageOnIPCMessage();
-               this->SendPermissionRetry();
-             },
-             [](const mozilla::ipc::ResponseRejectReason) {});
+      ->Then(
+          GetCurrentThreadSerialEventTarget(), __func__,
+          [this](const uint32_t& aPermission) {
+            this->AssertIsOnOwningThread();
+            MaybeCollectGarbageOnIPCMessage();
+            this->SendPermissionRetry();
+          },
+          [](const mozilla::ipc::ResponseRejectReason) {});
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult BackgroundFactoryRequestChild::RecvBlocked(
     const uint64_t& aCurrentVersion) {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mRequest);
--- a/dom/ipc/SharedStringMap.cpp
+++ b/dom/ipc/SharedStringMap.cpp
@@ -62,21 +62,22 @@ bool SharedStringMap::Get(const nsCStrin
 
   aValue.Assign(ValueTable().Get(entries[index].mValue));
   return true;
 }
 
 bool SharedStringMap::Find(const nsCString& aKey, size_t* aIndex) {
   const auto& keys = KeyTable();
 
-  return BinarySearchIf(Entries(), 0, EntryCount(),
-                        [&](const Entry& aEntry) {
-                          return aKey.Compare(keys.GetBare(aEntry.mKey));
-                        },
-                        aIndex);
+  return BinarySearchIf(
+      Entries(), 0, EntryCount(),
+      [&](const Entry& aEntry) {
+        return aKey.Compare(keys.GetBare(aEntry.mKey));
+      },
+      aIndex);
 }
 
 void SharedStringMapBuilder::Add(const nsCString& aKey,
                                  const nsString& aValue) {
   mEntries.Put(aKey, {mKeyTable.Add(aKey), mValueTable.Add(aValue)});
 }
 
 Result<Ok, nsresult> SharedStringMapBuilder::Finalize(
--- a/dom/ipc/TabContext.cpp
+++ b/dom/ipc/TabContext.cpp
@@ -214,17 +214,19 @@ MaybeInvalidTabContext::MaybeInvalidTabC
       // it might be used to escalate privileges.
       if (!StaticPrefs::dom_serviceWorkers_enabled()) {
         mInvalidReason = "ServiceWorkers should be enabled.";
         return;
       }
 
       break;
     }
-    default: { MOZ_CRASH(); }
+    default: {
+      MOZ_CRASH();
+    }
   }
 
   bool rv;
   if (jsPluginId >= 0) {
     rv = mTabContext.SetTabContextForJSPluginFrame(jsPluginId);
   } else {
     rv = mTabContext.SetTabContext(isMozBrowserElement, chromeOuterWindowID,
                                    showAccelerators, showFocusRings,
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -153,17 +153,18 @@ namespace dom {
 TabParent::LayerToTabParentTable* TabParent::sLayerToTabParentTable = nullptr;
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TabParent)
   NS_INTERFACE_MAP_ENTRY(nsITabParent)
   NS_INTERFACE_MAP_ENTRY(nsIAuthPromptProvider)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsITabParent)
 NS_INTERFACE_MAP_END
-NS_IMPL_CYCLE_COLLECTION(TabParent, mFrameElement, mBrowserDOMWindow, mLoadContext, mFrameLoader, mBrowsingContext)
+NS_IMPL_CYCLE_COLLECTION(TabParent, mFrameElement, mBrowserDOMWindow,
+                         mLoadContext, mFrameLoader, mBrowsingContext)
 NS_IMPL_CYCLE_COLLECTING_ADDREF(TabParent)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(TabParent)
 
 TabParent::TabParent(ContentParent* aManager, const TabId& aTabId,
                      const TabContext& aContext,
                      CanonicalBrowsingContext* aBrowsingContext,
                      uint32_t aChromeFlags,
                      BrowserBridgeParent* aBrowserBridgeParent)
@@ -3042,28 +3043,29 @@ TabParent::GetContentBlockingLog(Promise
   if (rv.Failed()) {
     return NS_ERROR_FAILURE;
   }
 
   RefPtr<Promise> copy(jsPromise);
   copy.forget(aPromise);
 
   auto cblPromise = SendGetContentBlockingLog();
-  cblPromise->Then(GetMainThreadSerialEventTarget(), __func__,
-                   [jsPromise](Tuple<nsCString, bool>&& aResult) {
-                     if (Get<1>(aResult)) {
-                       NS_ConvertUTF8toUTF16 utf16(Get<0>(aResult));
-                       jsPromise->MaybeResolve(std::move(utf16));
-                     } else {
-                       jsPromise->MaybeRejectWithUndefined();
-                     }
-                   },
-                   [jsPromise](ResponseRejectReason&& aReason) {
-                     jsPromise->MaybeRejectWithUndefined();
-                   });
+  cblPromise->Then(
+      GetMainThreadSerialEventTarget(), __func__,
+      [jsPromise](Tuple<nsCString, bool>&& aResult) {
+        if (Get<1>(aResult)) {
+          NS_ConvertUTF8toUTF16 utf16(Get<0>(aResult));
+          jsPromise->MaybeResolve(std::move(utf16));
+        } else {
+          jsPromise->MaybeRejectWithUndefined();
+        }
+      },
+      [jsPromise](ResponseRejectReason&& aReason) {
+        jsPromise->MaybeRejectWithUndefined();
+      });
 
   return NS_OK;
 }
 
 void TabParent::SuppressDisplayport(bool aEnabled) {
   if (IsDestroyed()) {
     return;
   }
@@ -3153,38 +3155,40 @@ void TabParent::LayerTreeUpdate(const La
 }
 
 void TabParent::RequestRootPaint(gfx::CrossProcessPaint* aPaint, IntRect aRect,
                                  float aScale, nscolor aBackgroundColor) {
   auto promise = SendRequestRootPaint(aRect, aScale, aBackgroundColor);
 
   RefPtr<gfx::CrossProcessPaint> paint(aPaint);
   TabId tabId(GetTabId());
-  promise->Then(GetMainThreadSerialEventTarget(), __func__,
-                [paint, tabId](PaintFragment&& aFragment) {
-                  paint->ReceiveFragment(tabId, std::move(aFragment));
-                },
-                [paint, tabId](ResponseRejectReason&& aReason) {
-                  paint->LostFragment(tabId);
-                });
+  promise->Then(
+      GetMainThreadSerialEventTarget(), __func__,
+      [paint, tabId](PaintFragment&& aFragment) {
+        paint->ReceiveFragment(tabId, std::move(aFragment));
+      },
+      [paint, tabId](ResponseRejectReason&& aReason) {
+        paint->LostFragment(tabId);
+      });
 }
 
 void TabParent::RequestSubPaint(gfx::CrossProcessPaint* aPaint, float aScale,
                                 nscolor aBackgroundColor) {
   auto promise = SendRequestSubPaint(aScale, aBackgroundColor);
 
   RefPtr<gfx::CrossProcessPaint> paint(aPaint);
   TabId tabId(GetTabId());
-  promise->Then(GetMainThreadSerialEventTarget(), __func__,
-                [paint, tabId](PaintFragment&& aFragment) {
-                  paint->ReceiveFragment(tabId, std::move(aFragment));
-                },
-                [paint, tabId](ResponseRejectReason&& aReason) {
-                  paint->LostFragment(tabId);
-                });
+  promise->Then(
+      GetMainThreadSerialEventTarget(), __func__,
+      [paint, tabId](PaintFragment&& aFragment) {
+        paint->ReceiveFragment(tabId, std::move(aFragment));
+      },
+      [paint, tabId](ResponseRejectReason&& aReason) {
+        paint->LostFragment(tabId);
+      });
 }
 
 mozilla::ipc::IPCResult TabParent::RecvPaintWhileInterruptingJSNoOp(
     const LayersObserverEpoch& aEpoch) {
   // We sent a PaintWhileInterruptingJS message when layers were already
   // visible. In this case, we should act as if an update occurred even though
   // we already have the layers.
   LayerTreeUpdate(aEpoch, true);
--- a/dom/media/Benchmark.cpp
+++ b/dom/media/Benchmark.cpp
@@ -277,25 +277,25 @@ void BenchmarkPlayback::GlobalShutdown()
   MOZ_ASSERT(OnThread());
 
   MOZ_ASSERT(!mFinished, "We've already shutdown");
 
   mFinished = true;
 
   if (mDecoder) {
     RefPtr<Benchmark> ref(mGlobalState);
-    mDecoder->Flush()->Then(Thread(), __func__,
-                            [ref, this]() {
-                              mDecoder->Shutdown()->Then(
-                                  Thread(), __func__,
-                                  [ref, this]() { FinalizeShutdown(); },
-                                  []() { MOZ_CRASH("not reached"); });
-                              mDecoder = nullptr;
-                            },
-                            []() { MOZ_CRASH("not reached"); });
+    mDecoder->Flush()->Then(
+        Thread(), __func__,
+        [ref, this]() {
+          mDecoder->Shutdown()->Then(
+              Thread(), __func__, [ref, this]() { FinalizeShutdown(); },
+              []() { MOZ_CRASH("not reached"); });
+          mDecoder = nullptr;
+        },
+        []() { MOZ_CRASH("not reached"); });
   } else {
     FinalizeShutdown();
   }
 }
 
 void BenchmarkPlayback::Output(MediaDataDecoder::DecodedData&& aResults) {
   MOZ_ASSERT(OnThread());
   MOZ_ASSERT(!mFinished);
@@ -340,40 +340,42 @@ void BenchmarkPlayback::InputExhausted()
 
   RefPtr<MediaRawData> sample = mSamples[mSampleIndex];
   RefPtr<Benchmark> ref(mGlobalState);
   RefPtr<MediaDataDecoder::DecodePromise> p = mDecoder->Decode(sample);
 
   mSampleIndex++;
   if (mSampleIndex == mSamples.Length() && !ref->mParameters.mStopAtFrame) {
     // Complete current frame decode then drain if still necessary.
-    p->Then(Thread(), __func__,
-            [ref, this](MediaDataDecoder::DecodedData&& aResults) {
-              Output(std::move(aResults));
-              if (!mFinished) {
-                mDecoder->Drain()->Then(
-                    Thread(), __func__,
-                    [ref, this](MediaDataDecoder::DecodedData&& aResults) {
-                      mDrained = true;
-                      Output(std::move(aResults));
-                      MOZ_ASSERT(mFinished, "We must be done now");
-                    },
-                    [ref, this](const MediaResult& aError) { Error(aError); });
-              }
-            },
-            [ref, this](const MediaResult& aError) { Error(aError); });
+    p->Then(
+        Thread(), __func__,
+        [ref, this](MediaDataDecoder::DecodedData&& aResults) {
+          Output(std::move(aResults));
+          if (!mFinished) {
+            mDecoder->Drain()->Then(
+                Thread(), __func__,
+                [ref, this](MediaDataDecoder::DecodedData&& aResults) {
+                  mDrained = true;
+                  Output(std::move(aResults));
+                  MOZ_ASSERT(mFinished, "We must be done now");
+                },
+                [ref, this](const MediaResult& aError) { Error(aError); });
+          }
+        },
+        [ref, this](const MediaResult& aError) { Error(aError); });
   } else {
     if (mSampleIndex == mSamples.Length() && ref->mParameters.mStopAtFrame) {
       mSampleIndex = 0;
     }
     // Continue decoding
-    p->Then(Thread(), __func__,
-            [ref, this](MediaDataDecoder::DecodedData&& aResults) {
-              Output(std::move(aResults));
-              if (!mFinished) {
-                InputExhausted();
-              }
-            },
-            [ref, this](const MediaResult& aError) { Error(aError); });
+    p->Then(
+        Thread(), __func__,
+        [ref, this](MediaDataDecoder::DecodedData&& aResults) {
+          Output(std::move(aResults));
+          if (!mFinished) {
+            InputExhausted();
+          }
+        },
+        [ref, this](const MediaResult& aError) { Error(aError); });
   }
 }
 
 }  // namespace mozilla
--- a/dom/media/ChannelMediaDecoder.cpp
+++ b/dom/media/ChannelMediaDecoder.cpp
@@ -382,29 +382,30 @@ void ChannelMediaDecoder::DownloadProgre
               [playbackStats = mPlaybackStatistics,
                res = RefPtr<BaseMediaResource>(mResource), duration = mDuration,
                pos = mPlaybackPosition]() {
                 auto rate = ComputePlaybackRate(playbackStats, res, duration);
                 UpdatePlaybackRate(rate, res);
                 MediaStatistics stats = GetStatistics(rate, res, pos);
                 return StatsPromise::CreateAndResolve(stats, __func__);
               })
-      ->Then(mAbstractMainThread, __func__,
-             [=, self = RefPtr<ChannelMediaDecoder>(this)](
-                 MediaStatistics aStats) {
-               if (IsShutdown()) {
-                 return;
-               }
-               mCanPlayThrough = aStats.CanPlayThrough();
-               GetStateMachine()->DispatchCanPlayThrough(mCanPlayThrough);
-               mResource->ThrottleReadahead(ShouldThrottleDownload(aStats));
-               // Update readyState since mCanPlayThrough might have changed.
-               GetOwner()->UpdateReadyState();
-             },
-             []() { MOZ_ASSERT_UNREACHABLE("Promise not resolved"); });
+      ->Then(
+          mAbstractMainThread, __func__,
+          [=,
+           self = RefPtr<ChannelMediaDecoder>(this)](MediaStatistics aStats) {
+            if (IsShutdown()) {
+              return;
+            }
+            mCanPlayThrough = aStats.CanPlayThrough();
+            GetStateMachine()->DispatchCanPlayThrough(mCanPlayThrough);
+            mResource->ThrottleReadahead(ShouldThrottleDownload(aStats));
+            // Update readyState since mCanPlayThrough might have changed.
+            GetOwner()->UpdateReadyState();
+          },
+          []() { MOZ_ASSERT_UNREACHABLE("Promise not resolved"); });
 }
 
 /* static */ ChannelMediaDecoder::PlaybackRateInfo
 ChannelMediaDecoder::ComputePlaybackRate(const MediaChannelStatistics& aStats,
                                          BaseMediaResource* aResource,
                                          double aDuration) {
   MOZ_ASSERT(!NS_IsMainThread());
 
--- a/dom/media/DOMMediaStream.cpp
+++ b/dom/media/DOMMediaStream.cpp
@@ -1050,21 +1050,22 @@ nsresult DOMMediaStream::DispatchTrackEv
 }
 
 void DOMMediaStream::BlockPlaybackTrack(TrackPort* aTrack) {
   MOZ_ASSERT(aTrack);
   ++mTracksPendingRemoval;
   RefPtr<DOMMediaStream> that = this;
   aTrack
       ->BlockSourceTrackId(aTrack->GetTrack()->mTrackID, BlockingMode::CREATION)
-      ->Then(GetCurrentThreadSerialEventTarget(), __func__,
-             [this, that](bool aIgnore) { NotifyPlaybackTrackBlocked(); },
-             [](const nsresult& aIgnore) {
-               NS_ERROR("Could not remove track from MSG");
-             });
+      ->Then(
+          GetCurrentThreadSerialEventTarget(), __func__,
+          [this, that](bool aIgnore) { NotifyPlaybackTrackBlocked(); },
+          [](const nsresult& aIgnore) {
+            NS_ERROR("Could not remove track from MSG");
+          });
 }
 
 void DOMMediaStream::NotifyPlaybackTrackBlocked() {
   MOZ_ASSERT(mTracksPendingRemoval > 0,
              "A track reported finished blocking more times than we asked for");
   if (--mTracksPendingRemoval == 0) {
     // The MediaStreamGraph has reported a track was blocked and we are not
     // waiting for any further tracks to get blocked. It is now safe to
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -311,21 +311,22 @@ class MediaDecoderStateMachine::DecodeMe
     MOZ_ASSERT(!mMaster->mVideoDecodeSuspended);
     MOZ_ASSERT(!mMetadataRequest.Exists());
     SLOG("Dispatching AsyncReadMetadata");
 
     // We disconnect mMetadataRequest in Exit() so it is fine to capture
     // a raw pointer here.
     Reader()
         ->ReadMetadata()
-        ->Then(OwnerThread(), __func__,
-               [this](MetadataHolder&& aMetadata) {
-                 OnMetadataRead(std::move(aMetadata));
-               },
-               [this](const MediaResult& aError) { OnMetadataNotRead(aError); })
+        ->Then(
+            OwnerThread(), __func__,
+            [this](MetadataHolder&& aMetadata) {
+              OnMetadataRead(std::move(aMetadata));
+            },
+            [this](const MediaResult& aError) { OnMetadataNotRead(aError); })
         ->Track(mMetadataRequest);
   }
 
   void Exit() override { mMetadataRequest.DisconnectIfExists(); }
 
   State GetState() const override { return DECODER_STATE_DECODING_METADATA; }
 
   RefPtr<MediaDecoder::SeekPromise> HandleSeek(SeekTarget aTarget) override {
@@ -705,22 +706,23 @@ class MediaDecoderStateMachine::Decoding
     if (mMaster->mMinimizePreroll) {
       SetState<DormantState>();
       return;
     }
 
     TimeStamp target =
         TimeStamp::Now() + TimeDuration::FromMilliseconds(timeout);
 
-    mDormantTimer.Ensure(target,
-                         [this]() {
-                           mDormantTimer.CompleteRequest();
-                           SetState<DormantState>();
-                         },
-                         [this]() { mDormantTimer.CompleteRequest(); });
+    mDormantTimer.Ensure(
+        target,
+        [this]() {
+          mDormantTimer.CompleteRequest();
+          SetState<DormantState>();
+        },
+        [this]() { mDormantTimer.CompleteRequest(); });
   }
 
   // Time at which we started decoding.
   TimeStamp mDecodeStartTime;
 
   // When we start decoding (either for the first time, or after a pause)
   // we may be low on decoded data. We don't want our "low data" logic to
   // kick in and decide that we're low on decoded data because the download
@@ -813,48 +815,49 @@ class MediaDecoderStateMachine::LoopingD
     RequestAudioDataFromStartPosition();
   }
 
  private:
   void RequestAudioDataFromStartPosition() {
     Reader()->ResetDecode(TrackInfo::kAudioTrack);
     Reader()
         ->Seek(SeekTarget(media::TimeUnit::Zero(), SeekTarget::Accurate))
-        ->Then(OwnerThread(), __func__,
-               [this]() -> void {
-                 mAudioSeekRequest.Complete();
-                 SLOG(
-                     "seeking completed, start to request first sample, "
-                     "queueing audio task - queued=%zu, decoder-queued=%zu",
-                     AudioQueue().GetSize(),
-                     Reader()->SizeOfAudioQueueInFrames());
-
-                 Reader()
-                     ->RequestAudioData()
-                     ->Then(OwnerThread(), __func__,
-                            [this](RefPtr<AudioData> aAudio) {
-                              mIsReachingAudioEOS = false;
-                              mAudioDataRequest.Complete();
-                              SLOG(
-                                  "got audio decoded sample "
-                                  "[%" PRId64 ",%" PRId64 "]",
-                                  aAudio->mTime.ToMicroseconds(),
-                                  aAudio->GetEndTime().ToMicroseconds());
-                              HandleAudioDecoded(aAudio);
-                            },
-                            [this](const MediaResult& aError) {
-                              mAudioDataRequest.Complete();
-                              HandleError(aError);
-                            })
-                     ->Track(mAudioDataRequest);
-               },
-               [this](const SeekRejectValue& aReject) -> void {
-                 mAudioSeekRequest.Complete();
-                 HandleError(aReject.mError);
-               })
+        ->Then(
+            OwnerThread(), __func__,
+            [this]() -> void {
+              mAudioSeekRequest.Complete();
+              SLOG(
+                  "seeking completed, start to request first sample, "
+                  "queueing audio task - queued=%zu, decoder-queued=%zu",
+                  AudioQueue().GetSize(), Reader()->SizeOfAudioQueueInFrames());
+
+              Reader()
+                  ->RequestAudioData()
+                  ->Then(
+                      OwnerThread(), __func__,
+                      [this](RefPtr<AudioData> aAudio) {
+                        mIsReachingAudioEOS = false;
+                        mAudioDataRequest.Complete();
+                        SLOG(
+                            "got audio decoded sample "
+                            "[%" PRId64 ",%" PRId64 "]",
+                            aAudio->mTime.ToMicroseconds(),
+                            aAudio->GetEndTime().ToMicroseconds());
+                        HandleAudioDecoded(aAudio);
+                      },
+                      [this](const MediaResult& aError) {
+                        mAudioDataRequest.Complete();
+                        HandleError(aError);
+                      })
+                  ->Track(mAudioDataRequest);
+            },
+            [this](const SeekRejectValue& aReject) -> void {
+              mAudioSeekRequest.Complete();
+              HandleError(aReject.mError);
+            })
         ->Track(mAudioSeekRequest);
   }
 
   void UpdatePlaybackPositionToZeroIfNeeded() {
     MOZ_ASSERT(mIsReachingAudioEOS);
     MOZ_ASSERT(mAudioLoopingOffset == media::TimeUnit::Zero());
     // If we have already reached EOS before starting media sink, the sink
     // has not started yet and the current position is larger than last decoded
@@ -1228,27 +1231,28 @@ class MediaDecoderStateMachine::Accurate
                     !mMaster->IsWaitingVideoData());
 
       // Fire 'waiting' to notify the player that we are waiting for data.
       mMaster->mOnNextFrameStatus.Notify(
           MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE_SEEKING);
 
       Reader()
           ->WaitForData(aReject.mType)
-          ->Then(OwnerThread(), __func__,
-                 [this](MediaData::Type aType) {
-                   SLOG("OnSeekRejected wait promise resolved");
-                   mWaitRequest.Complete();
-                   DemuxerSeek();
-                 },
-                 [this](const WaitForDataRejectValue& aRejection) {
-                   SLOG("OnSeekRejected wait promise rejected");
-                   mWaitRequest.Complete();
-                   mMaster->DecodeError(NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA);
-                 })
+          ->Then(
+              OwnerThread(), __func__,
+              [this](MediaData::Type aType) {
+                SLOG("OnSeekRejected wait promise resolved");
+                mWaitRequest.Complete();
+                DemuxerSeek();
+              },
+              [this](const WaitForDataRejectValue& aRejection) {
+                SLOG("OnSeekRejected wait promise rejected");
+                mWaitRequest.Complete();
+                mMaster->DecodeError(NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA);
+              })
           ->Track(mWaitRequest);
       return;
     }
 
     if (aReject.mError == NS_ERROR_DOM_MEDIA_END_OF_STREAM) {
       if (!mDoneAudioSeeking) {
         HandleEndOfAudioInternal();
       }
@@ -2126,19 +2130,20 @@ void MediaDecoderStateMachine::StateObje
 
   seekJob.mTarget.emplace(aTarget, type, true /* aVideoOnly */);
 
   // Hold mMaster->mAbstractMainThread here because this->mMaster will be
   // invalid after the current state object is deleted in SetState();
   RefPtr<AbstractThread> mainThread = mMaster->mAbstractMainThread;
 
   SetSeekingState(std::move(seekJob), EventVisibility::Suppressed)
-      ->Then(mainThread, __func__,
-             [start, info, hw]() { ReportRecoveryTelemetry(start, info, hw); },
-             []() {});
+      ->Then(
+          mainThread, __func__,
+          [start, info, hw]() { ReportRecoveryTelemetry(start, info, hw); },
+          []() {});
 }
 
 RefPtr<MediaDecoder::SeekPromise>
 MediaDecoderStateMachine::StateObject::SetSeekingState(
     SeekJob&& aSeekJob, EventVisibility aVisibility) {
   if (aSeekJob.mTarget->IsAccurate() || aSeekJob.mTarget->IsFast()) {
     if (aSeekJob.mTarget->IsVideoOnly()) {
       return SetState<VideoOnlySeekingState>(std::move(aSeekJob), aVisibility);
@@ -2963,19 +2968,19 @@ void MediaDecoderStateMachine::SetVideoD
   // Set new video decode mode.
   mVideoDecodeMode = aMode;
 
   // Start timer to trigger suspended video decoding.
   if (mVideoDecodeMode == VideoDecodeMode::Suspend) {
     TimeStamp target = TimeStamp::Now() + SuspendBackgroundVideoDelay();
 
     RefPtr<MediaDecoderStateMachine> self = this;
-    mVideoDecodeSuspendTimer.Ensure(target,
-                                    [=]() { self->OnSuspendTimerResolved(); },
-                                    []() { MOZ_DIAGNOSTIC_ASSERT(false); });
+    mVideoDecodeSuspendTimer.Ensure(
+        target, [=]() { self->OnSuspendTimerResolved(); },
+        []() { MOZ_DIAGNOSTIC_ASSERT(false); });
     mOnPlaybackEvent.Notify(MediaPlaybackEvent::StartVideoSuspendTimer);
     return;
   }
 
   // Resuming from suspended decoding
 
   // If suspend timer exists, destroy it.
   CancelSuspendTimer();
@@ -3059,46 +3064,47 @@ void MediaDecoderStateMachine::RequestAu
   MOZ_ASSERT(IsAudioDecoding());
   MOZ_ASSERT(!IsRequestingAudioData());
   MOZ_ASSERT(!IsWaitingAudioData());
   LOGV("Queueing audio task - queued=%zu, decoder-queued=%zu",
        AudioQueue().GetSize(), mReader->SizeOfAudioQueueInFrames());
 
   RefPtr<MediaDecoderStateMachine> self = this;
   mReader->RequestAudioData()
-      ->Then(OwnerThread(), __func__,
-             [this, self](RefPtr<AudioData> aAudio) {
-               MOZ_ASSERT(aAudio);
-               mAudioDataRequest.Complete();
-               // audio->GetEndTime() is not always mono-increasing in chained
-               // ogg.
-               mDecodedAudioEndTime =
-                   std::max(aAudio->GetEndTime(), mDecodedAudioEndTime);
-               LOGV("OnAudioDecoded [%" PRId64 ",%" PRId64 "]",
-                    aAudio->mTime.ToMicroseconds(),
-                    aAudio->GetEndTime().ToMicroseconds());
-               mStateObj->HandleAudioDecoded(aAudio);
-             },
-             [this, self](const MediaResult& aError) {
-               LOGV("OnAudioNotDecoded aError=%s", aError.ErrorName().get());
-               mAudioDataRequest.Complete();
-               switch (aError.Code()) {
-                 case NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA:
-                   mStateObj->HandleWaitingForAudio();
-                   break;
-                 case NS_ERROR_DOM_MEDIA_CANCELED:
-                   mStateObj->HandleAudioCanceled();
-                   break;
-                 case NS_ERROR_DOM_MEDIA_END_OF_STREAM:
-                   mStateObj->HandleEndOfAudio();
-                   break;
-                 default:
-                   DecodeError(aError);
-               }
-             })
+      ->Then(
+          OwnerThread(), __func__,
+          [this, self](RefPtr<AudioData> aAudio) {
+            MOZ_ASSERT(aAudio);
+            mAudioDataRequest.Complete();
+            // audio->GetEndTime() is not always mono-increasing in chained
+            // ogg.
+            mDecodedAudioEndTime =
+                std::max(aAudio->GetEndTime(), mDecodedAudioEndTime);
+            LOGV("OnAudioDecoded [%" PRId64 ",%" PRId64 "]",
+                 aAudio->mTime.ToMicroseconds(),
+                 aAudio->GetEndTime().ToMicroseconds());
+            mStateObj->HandleAudioDecoded(aAudio);
+          },
+          [this, self](const MediaResult& aError) {
+            LOGV("OnAudioNotDecoded aError=%s", aError.ErrorName().get());
+            mAudioDataRequest.Complete();
+            switch (aError.Code()) {
+              case NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA:
+                mStateObj->HandleWaitingForAudio();
+                break;
+              case NS_ERROR_DOM_MEDIA_CANCELED:
+                mStateObj->HandleAudioCanceled();
+                break;
+              case NS_ERROR_DOM_MEDIA_END_OF_STREAM:
+                mStateObj->HandleEndOfAudio();
+                break;
+              default:
+                DecodeError(aError);
+            }
+          })
       ->Track(mAudioDataRequest);
 }
 
 void MediaDecoderStateMachine::RequestVideoData(
     const media::TimeUnit& aCurrentTime) {
   MOZ_ASSERT(OnTaskQueue());
   MOZ_ASSERT(IsVideoDecoding());
   MOZ_ASSERT(!IsRequestingVideoData());
@@ -3107,78 +3113,81 @@ void MediaDecoderStateMachine::RequestVi
       "Queueing video task - queued=%zu, decoder-queued=%zo"
       ", stime=%" PRId64,
       VideoQueue().GetSize(), mReader->SizeOfVideoQueueInFrames(),
       aCurrentTime.ToMicroseconds());
 
   TimeStamp videoDecodeStartTime = TimeStamp::Now();
   RefPtr<MediaDecoderStateMachine> self = this;
   mReader->RequestVideoData(aCurrentTime)
-      ->Then(OwnerThread(), __func__,
-             [this, self, videoDecodeStartTime](RefPtr<VideoData> aVideo) {
-               MOZ_ASSERT(aVideo);
-               mVideoDataRequest.Complete();
-               // Handle abnormal or negative timestamps.
-               mDecodedVideoEndTime =
-                   std::max(mDecodedVideoEndTime, aVideo->GetEndTime());
-               LOGV("OnVideoDecoded [%" PRId64 ",%" PRId64 "]",
-                    aVideo->mTime.ToMicroseconds(),
-                    aVideo->GetEndTime().ToMicroseconds());
-               mStateObj->HandleVideoDecoded(aVideo, videoDecodeStartTime);
-             },
-             [this, self](const MediaResult& aError) {
-               LOGV("OnVideoNotDecoded aError=%s", aError.ErrorName().get());
-               mVideoDataRequest.Complete();
-               switch (aError.Code()) {
-                 case NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA:
-                   mStateObj->HandleWaitingForVideo();
-                   break;
-                 case NS_ERROR_DOM_MEDIA_CANCELED:
-                   mStateObj->HandleVideoCanceled();
-                   break;
-                 case NS_ERROR_DOM_MEDIA_END_OF_STREAM:
-                   mStateObj->HandleEndOfVideo();
-                   break;
-                 default:
-                   DecodeError(aError);
-               }
-             })
+      ->Then(
+          OwnerThread(), __func__,
+          [this, self, videoDecodeStartTime](RefPtr<VideoData> aVideo) {
+            MOZ_ASSERT(aVideo);
+            mVideoDataRequest.Complete();
+            // Handle abnormal or negative timestamps.
+            mDecodedVideoEndTime =
+                std::max(mDecodedVideoEndTime, aVideo->GetEndTime());
+            LOGV("OnVideoDecoded [%" PRId64 ",%" PRId64 "]",
+                 aVideo->mTime.ToMicroseconds(),
+                 aVideo->GetEndTime().ToMicroseconds());
+            mStateObj->HandleVideoDecoded(aVideo, videoDecodeStartTime);
+          },
+          [this, self](const MediaResult& aError) {
+            LOGV("OnVideoNotDecoded aError=%s", aError.ErrorName().get());
+            mVideoDataRequest.Complete();
+            switch (aError.Code()) {
+              case NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA:
+                mStateObj->HandleWaitingForVideo();
+                break;
+              case NS_ERROR_DOM_MEDIA_CANCELED:
+                mStateObj->HandleVideoCanceled();
+                break;
+              case NS_ERROR_DOM_MEDIA_END_OF_STREAM:
+                mStateObj->HandleEndOfVideo();
+                break;
+              default:
+                DecodeError(aError);
+            }
+          })
       ->Track(mVideoDataRequest);
 }
 
 void MediaDecoderStateMachine::WaitForData(MediaData::Type aType) {
   MOZ_ASSERT(OnTaskQueue());
   MOZ_ASSERT(aType == MediaData::Type::AUDIO_DATA ||
              aType == MediaData::Type::VIDEO_DATA);
   RefPtr<MediaDecoderStateMachine> self = this;
   if (aType == MediaData::Type::AUDIO_DATA) {
     mReader->WaitForData(MediaData::Type::AUDIO_DATA)
-        ->Then(OwnerThread(), __func__,
-               [self](MediaData::Type aType) {
-                 self->mAudioWaitRequest.Complete();
-                 MOZ_ASSERT(aType == MediaData::Type::AUDIO_DATA);
-                 self->mStateObj->HandleAudioWaited(aType);
-               },
-               [self](const WaitForDataRejectValue& aRejection) {
-                 self->mAudioWaitRequest.Complete();
-                 self->DecodeError(NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA);
-               })
+        ->Then(
+            OwnerThread(), __func__,
+            [self](MediaData::Type aType) {
+              self->mAudioWaitRequest.Complete();
+              MOZ_ASSERT(aType == MediaData::Type::AUDIO_DATA);
+              self->mStateObj->HandleAudioWaited(aType);
+            },
+            [self](const WaitForDataRejectValue& aRejection) {
+              self->mAudioWaitRequest.Complete();
+              self->DecodeError(NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA);
+            })
         ->Track(mAudioWaitRequest);
   } else {
     mReader->WaitForData(MediaData::Type::VIDEO_DATA)
-        ->Then(OwnerThread(), __func__,
-               [self](MediaData::Type aType) {
-                 self->mVideoWaitRequest.Complete();
-                 MOZ_ASSERT(aType == MediaData::Type::VIDEO_DATA);
-                 self->mStateObj->HandleVideoWaited(aType);
-               },
-               [self](const WaitForDataRejectValue& aRejection) {
-                 self->mVideoWaitRequest.Complete();
-                 self->DecodeError(NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA);
-               })
+        ->Then(
+            OwnerThread(), __func__,
+            [self](MediaData::Type aType) {
+              self->mVideoWaitRequest.Complete();
+              MOZ_ASSERT(aType == MediaData::Type::VIDEO_DATA);
+              self->mStateObj->HandleVideoWaited(aType);
+            },
+            [self](const WaitForDataRejectValue& aRejection) {
+              self->mVideoWaitRequest.Complete();
+              self->DecodeError(NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA);
+            })
         ->Track(mVideoWaitRequest);
   }
 }
 
 nsresult MediaDecoderStateMachine::StartMediaSink() {
   MOZ_ASSERT(OnTaskQueue());
 
   if (mMediaSink->IsStarted()) {
@@ -3459,22 +3468,23 @@ void MediaDecoderStateMachine::ScheduleS
     return;
   }
 
   TimeStamp target = TimeStamp::Now() + aTime.ToTimeDuration();
 
   // It is OK to capture 'this' without causing UAF because the callback
   // always happens before shutdown.
   RefPtr<MediaDecoderStateMachine> self = this;
-  mDelayedScheduler.Ensure(target,
-                           [self]() {
-                             self->mDelayedScheduler.CompleteRequest();
-                             self->RunStateMachine();
-                           },
-                           []() { MOZ_DIAGNOSTIC_ASSERT(false); });
+  mDelayedScheduler.Ensure(
+      target,
+      [self]() {
+        self->mDelayedScheduler.CompleteRequest();
+        self->RunStateMachine();
+      },
+      []() { MOZ_DIAGNOSTIC_ASSERT(false); });
 }
 
 bool MediaDecoderStateMachine::OnTaskQueue() const {
   return OwnerThread()->IsCurrentThreadIn();
 }
 
 bool MediaDecoderStateMachine::IsStateMachineScheduled() const {
   MOZ_ASSERT(OnTaskQueue());
--- a/dom/media/MediaDevices.cpp
+++ b/dom/media/MediaDevices.cpp
@@ -60,104 +60,107 @@ already_AddRefed<Promise> MediaDevices::
     ErrorResult& aRv) {
   RefPtr<Promise> p = Promise::Create(GetParentObject(), aRv);
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
   }
   RefPtr<MediaDevices> self(this);
   MediaManager::Get()
       ->GetUserMedia(GetOwner(), aConstraints, aCallerType)
-      ->Then(GetCurrentThreadSerialEventTarget(), __func__,
-             [this, self, p](RefPtr<DOMMediaStream>&& aStream) {
-               if (!GetWindowIfCurrent()) {
-                 return;  // Leave Promise pending after navigation by design.
-               }
-               p->MaybeResolve(std::move(aStream));
-             },
-             [this, self, p](const RefPtr<MediaMgrError>& error) {
-               nsPIDOMWindowInner* window = GetWindowIfCurrent();
-               if (!window) {
-                 return;  // Leave Promise pending after navigation by design.
-               }
-               p->MaybeReject(MakeRefPtr<MediaStreamError>(window, *error));
-             });
+      ->Then(
+          GetCurrentThreadSerialEventTarget(), __func__,
+          [this, self, p](RefPtr<DOMMediaStream>&& aStream) {
+            if (!GetWindowIfCurrent()) {
+              return;  // Leave Promise pending after navigation by design.
+            }
+            p->MaybeResolve(std::move(aStream));
+          },
+          [this, self, p](const RefPtr<MediaMgrError>& error) {
+            nsPIDOMWindowInner* window = GetWindowIfCurrent();
+            if (!window) {
+              return;  // Leave Promise pending after navigation by design.
+            }
+            p->MaybeReject(MakeRefPtr<MediaStreamError>(window, *error));
+          });
   return p.forget();
 }
 
 already_AddRefed<Promise> MediaDevices::EnumerateDevices(CallerType aCallerType,
                                                          ErrorResult& aRv) {
   MOZ_ASSERT(NS_IsMainThread());
   RefPtr<Promise> p = Promise::Create(GetParentObject(), aRv);
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
   }
   RefPtr<MediaDevices> self(this);
   MediaManager::Get()
       ->EnumerateDevices(GetOwner(), aCallerType)
-      ->Then(GetCurrentThreadSerialEventTarget(), __func__,
-             [this, self,
-              p](RefPtr<MediaManager::MediaDeviceSetRefCnt>&& aDevices) {
-               nsPIDOMWindowInner* window = GetWindowIfCurrent();
-               if (!window) {
-                 return;  // Leave Promise pending after navigation by design.
-               }
-               auto windowId = window->WindowID();
-               nsTArray<RefPtr<MediaDeviceInfo>> infos;
-               for (auto& device : *aDevices) {
-                 MOZ_ASSERT(device->mKind == dom::MediaDeviceKind::Audioinput ||
-                            device->mKind == dom::MediaDeviceKind::Videoinput ||
-                            device->mKind == dom::MediaDeviceKind::Audiooutput);
-                 // Include name only if page currently has a gUM stream active
-                 // or persistent permissions (audio or video) have been granted
-                 nsString label;
-                 if (MediaManager::Get()->IsActivelyCapturingOrHasAPermission(
-                         windowId) ||
-                     Preferences::GetBool("media.navigator.permission.disabled",
-                                          false)) {
-                   label = device->mName;
-                 }
-                 infos.AppendElement(MakeRefPtr<MediaDeviceInfo>(
-                     device->mID, device->mKind, label, device->mGroupID));
-               }
-               p->MaybeResolve(std::move(infos));
-             },
-             [this, self, p](const RefPtr<MediaMgrError>& error) {
-               nsPIDOMWindowInner* window = GetWindowIfCurrent();
-               if (!window) {
-                 return;  // Leave Promise pending after navigation by design.
-               }
-               p->MaybeReject(MakeRefPtr<MediaStreamError>(window, *error));
-             });
+      ->Then(
+          GetCurrentThreadSerialEventTarget(), __func__,
+          [this, self,
+           p](RefPtr<MediaManager::MediaDeviceSetRefCnt>&& aDevices) {
+            nsPIDOMWindowInner* window = GetWindowIfCurrent();
+            if (!window) {
+              return;  // Leave Promise pending after navigation by design.
+            }
+            auto windowId = window->WindowID();
+            nsTArray<RefPtr<MediaDeviceInfo>> infos;
+            for (auto& device : *aDevices) {
+              MOZ_ASSERT(device->mKind == dom::MediaDeviceKind::Audioinput ||
+                         device->mKind == dom::MediaDeviceKind::Videoinput ||
+                         device->mKind == dom::MediaDeviceKind::Audiooutput);
+              // Include name only if page currently has a gUM stream active
+              // or persistent permissions (audio or video) have been granted
+              nsString label;
+              if (MediaManager::Get()->IsActivelyCapturingOrHasAPermission(
+                      windowId) ||
+                  Preferences::GetBool("media.navigator.permission.disabled",
+                                       false)) {
+                label = device->mName;
+              }
+              infos.AppendElement(MakeRefPtr<MediaDeviceInfo>(
+                  device->mID, device->mKind, label, device->mGroupID));
+            }
+            p->MaybeResolve(std::move(infos));
+          },
+          [this, self, p](const RefPtr<MediaMgrError>& error) {
+            nsPIDOMWindowInner* window = GetWindowIfCurrent();
+            if (!window) {
+              return;  // Leave Promise pending after navigation by design.
+            }
+            p->MaybeReject(MakeRefPtr<MediaStreamError>(window, *error));
+          });
   return p.forget();
 }
 
 already_AddRefed<Promise> MediaDevices::GetDisplayMedia(
     const DisplayMediaStreamConstraints& aConstraints, CallerType aCallerType,
     ErrorResult& aRv) {
   RefPtr<Promise> p = Promise::Create(GetParentObject(), aRv);
   if (NS_WARN_IF(aRv.Failed())) {
     return nullptr;
   }
   RefPtr<MediaDevices> self(this);
   MediaManager::Get()
       ->GetDisplayMedia(GetOwner(), aConstraints, aCallerType)
-      ->Then(GetCurrentThreadSerialEventTarget(), __func__,
-             [this, self, p](RefPtr<DOMMediaStream>&& aStream) {
-               if (!GetWindowIfCurrent()) {
-                 return;  // leave promise pending after navigation.
-               }
-               p->MaybeResolve(std::move(aStream));
-             },
-             [this, self, p](RefPtr<MediaMgrError>&& error) {
-               nsPIDOMWindowInner* window = GetWindowIfCurrent();
-               if (!window) {
-                 return;  // leave promise pending after navigation.
-               }
-               p->MaybeReject(MakeRefPtr<MediaStreamError>(window, *error));
-             });
+      ->Then(
+          GetCurrentThreadSerialEventTarget(), __func__,
+          [this, self, p](RefPtr<DOMMediaStream>&& aStream) {
+            if (!GetWindowIfCurrent()) {
+              return;  // leave promise pending after navigation.
+            }
+            p->MaybeResolve(std::move(aStream));
+          },
+          [this, self, p](RefPtr<MediaMgrError>&& error) {
+            nsPIDOMWindowInner* window = GetWindowIfCurrent();
+            if (!window) {
+              return;  // leave promise pending after navigation.
+            }
+            p->MaybeReject(MakeRefPtr<MediaStreamError>(window, *error));
+          });
   return p.forget();
 }
 
 NS_IMPL_ADDREF_INHERITED(MediaDevices, DOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(MediaDevices, DOMEventTargetHelper)
 NS_INTERFACE_MAP_BEGIN(MediaDevices)
   NS_INTERFACE_MAP_ENTRY(MediaDevices)
 NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -331,27 +331,28 @@ void MediaFormatReader::DecoderFactory::
   RunStage(aTrack == TrackInfo::kAudioTrack ? mAudio : mVideo);
 }
 
 void MediaFormatReader::DecoderFactory::RunStage(Data& aData) {
   switch (aData.mStage) {
     case Stage::None: {
       MOZ_ASSERT(!aData.mToken);
       aData.mPolicy->Alloc()
-          ->Then(mOwner->OwnerThread(), __func__,
-                 [this, &aData](RefPtr<Token> aToken) {
-                   aData.mTokenRequest.Complete();
-                   aData.mToken = aToken.forget();
-                   aData.mStage = Stage::CreateDecoder;
-                   RunStage(aData);
-                 },
-                 [&aData]() {
-                   aData.mTokenRequest.Complete();
-                   aData.mStage = Stage::None;
-                 })
+          ->Then(
+              mOwner->OwnerThread(), __func__,
+              [this, &aData](RefPtr<Token> aToken) {
+                aData.mTokenRequest.Complete();
+                aData.mToken = aToken.forget();
+                aData.mStage = Stage::CreateDecoder;
+                RunStage(aData);
+              },
+              [&aData]() {
+                aData.mTokenRequest.Complete();
+                aData.mStage = Stage::None;
+              })
           ->Track(aData.mTokenRequest);
       aData.mStage = Stage::WaitForToken;
       break;
     }
 
     case Stage::WaitForToken: {
       MOZ_ASSERT(!aData.mToken);
       MOZ_ASSERT(aData.mTokenRequest.Exists());
@@ -470,43 +471,43 @@ MediaResult MediaFormatReader::DecoderFa
 }
 
 void MediaFormatReader::DecoderFactory::DoInitDecoder(Data& aData) {
   auto& ownerData = aData.mOwnerData;
 
   DDLOGEX2("MediaFormatReader::DecoderFactory", this, DDLogCategory::Log,
            "initialize_decoder", DDNoValue{});
   aData.mDecoder->Init()
-      ->Then(mOwner->OwnerThread(), __func__,
-             [this, &aData, &ownerData](TrackType aTrack) {
-               aData.mInitRequest.Complete();
-               aData.mStage = Stage::None;
-               MutexAutoLock lock(ownerData.mMutex);
-               ownerData.mDecoder = aData.mDecoder.forget();
-               ownerData.mDescription =
-                   ownerData.mDecoder->GetDescriptionName();
-               DDLOGEX2("MediaFormatReader::DecoderFactory", this,
-                        DDLogCategory::Log, "decoder_initialized", DDNoValue{});
-               DecoderDoctorLogger::LinkParentAndChild(
-                   "MediaFormatReader::DecoderData", &ownerData, "decoder",
-                   ownerData.mDecoder.get());
-               mOwner->SetVideoDecodeThreshold();
-               mOwner->ScheduleUpdate(aTrack);
-             },
-             [this, &aData, &ownerData](const MediaResult& aError) {
-               aData.mInitRequest.Complete();
-               MOZ_RELEASE_ASSERT(!ownerData.mDecoder,
-                                  "Can't have a decoder already set");
-               aData.mStage = Stage::None;
-               mOwner->mShutdownPromisePool->ShutdownDecoder(
-                   aData.mDecoder.forget());
-               DDLOGEX2("MediaFormatReader::DecoderFactory", this,
-                        DDLogCategory::Log, "initialize_decoder_error", aError);
-               mOwner->NotifyError(aData.mTrack, aError);
-             })
+      ->Then(
+          mOwner->OwnerThread(), __func__,
+          [this, &aData, &ownerData](TrackType aTrack) {
+            aData.mInitRequest.Complete();
+            aData.mStage = Stage::None;
+            MutexAutoLock lock(ownerData.mMutex);
+            ownerData.mDecoder = aData.mDecoder.forget();
+            ownerData.mDescription = ownerData.mDecoder->GetDescriptionName();
+            DDLOGEX2("MediaFormatReader::DecoderFactory", this,
+                     DDLogCategory::Log, "decoder_initialized", DDNoValue{});
+            DecoderDoctorLogger::LinkParentAndChild(
+                "MediaFormatReader::DecoderData", &ownerData, "decoder",
+                ownerData.mDecoder.get());
+            mOwner->SetVideoDecodeThreshold();
+            mOwner->ScheduleUpdate(aTrack);
+          },
+          [this, &aData, &ownerData](const MediaResult& aError) {
+            aData.mInitRequest.Complete();
+            MOZ_RELEASE_ASSERT(!ownerData.mDecoder,
+                               "Can't have a decoder already set");
+            aData.mStage = Stage::None;
+            mOwner->mShutdownPromisePool->ShutdownDecoder(
+                aData.mDecoder.forget());
+            DDLOGEX2("MediaFormatReader::DecoderFactory", this,
+                     DDLogCategory::Log, "initialize_decoder_error", aError);
+            mOwner->NotifyError(aData.mTrack, aError);
+          })
       ->Track(aData.mInitRequest);
 }
 
 // DemuxerProxy ensures that the original main demuxer is only ever accessed
 // via its own dedicated task queue.
 // This ensure that the reader's taskqueue will never blocked while a demuxer
 // is itself blocked attempting to access the MediaCache or the MediaResource.
 class MediaFormatReader::DemuxerProxy {
@@ -648,43 +649,45 @@ class MediaFormatReader::DemuxerProxy::W
     return mInfo->Clone();
   }
 
   RefPtr<SeekPromise> Seek(const TimeUnit& aTime) override {
     RefPtr<Wrapper> self = this;
     return InvokeAsync(
                mTaskQueue, __func__,
                [self, aTime]() { return self->mTrackDemuxer->Seek(aTime); })
-        ->Then(mTaskQueue, __func__,
-               [self](const TimeUnit& aTime) {
-                 self->UpdateRandomAccessPoint();
-                 return SeekPromise::CreateAndResolve(aTime, __func__);
-               },
-               [self](const MediaResult& aError) {
-                 self->UpdateRandomAccessPoint();
-                 return SeekPromise::CreateAndReject(aError, __func__);
-               });
+        ->Then(
+            mTaskQueue, __func__,
+            [self](const TimeUnit& aTime) {
+              self->UpdateRandomAccessPoint();
+              return SeekPromise::CreateAndResolve(aTime, __func__);
+            },
+            [self](const MediaResult& aError) {
+              self->UpdateRandomAccessPoint();
+              return SeekPromise::CreateAndReject(aError, __func__);
+            });
   }
 
   RefPtr<SamplesPromise> GetSamples(int32_t aNumSamples) override {
     RefPtr<Wrapper> self = this;
     return InvokeAsync(mTaskQueue, __func__,
                        [self, aNumSamples]() {
                          return self->mTrackDemuxer->GetSamples(aNumSamples);
                        })
-        ->Then(mTaskQueue, __func__,
-               [self](RefPtr<SamplesHolder> aSamples) {
-                 self->UpdateRandomAccessPoint();
-                 return SamplesPromise::CreateAndResolve(aSamples.forget(),
-                                                         __func__);
-               },
-               [self](const MediaResult& aError) {
-                 self->UpdateRandomAccessPoint();
-                 return SamplesPromise::CreateAndReject(aError, __func__);
-               });
+        ->Then(
+            mTaskQueue, __func__,
+            [self](RefPtr<SamplesHolder> aSamples) {
+              self->UpdateRandomAccessPoint();
+              return SamplesPromise::CreateAndResolve(aSamples.forget(),
+                                                      __func__);
+            },
+            [self](const MediaResult& aError) {
+              self->UpdateRandomAccessPoint();
+              return SamplesPromise::CreateAndReject(aError, __func__);
+            });
   }
 
   bool GetSamplesMayBlock() const override { return mGetSamplesMayBlock; }
 
   void Reset() override {
     RefPtr<Wrapper> self = this;
     nsresult rv = mTaskQueue->Dispatch(NS_NewRunnableFunction(
         "MediaFormatReader::DemuxerProxy::Wrapper::Reset",
@@ -783,66 +786,67 @@ RefPtr<MediaDataDemuxer::InitPromise> Me
   return InvokeAsync(mTaskQueue, __func__,
                      [data, taskQueue]() {
                        if (!data->mDemuxer) {
                          return InitPromise::CreateAndReject(
                              NS_ERROR_DOM_MEDIA_CANCELED, __func__);
                        }
                        return data->mDemuxer->Init();
                      })
-      ->Then(taskQueue, __func__,
-             [data, taskQueue]() {
-               if (!data->mDemuxer) {  // Was shutdown.
-                 return InitPromise::CreateAndReject(
-                     NS_ERROR_DOM_MEDIA_CANCELED, __func__);
-               }
-               data->mNumAudioTrack =
-                   data->mDemuxer->GetNumberTracks(TrackInfo::kAudioTrack);
-               if (data->mNumAudioTrack) {
-                 RefPtr<MediaTrackDemuxer> d =
-                     data->mDemuxer->GetTrackDemuxer(TrackInfo::kAudioTrack, 0);
-                 if (d) {
-                   RefPtr<Wrapper> wrapper =
-                       new DemuxerProxy::Wrapper(d, taskQueue);
-                   wrapper->UpdateBuffered();
-                   data->mAudioDemuxer = wrapper;
-                   DecoderDoctorLogger::LinkParentAndChild(
-                       data->mDemuxer.get(), "decoder factory wrapper",
-                       "MediaFormatReader::DecoderFactory::Wrapper",
-                       wrapper.get());
-                 }
-               }
-               data->mNumVideoTrack =
-                   data->mDemuxer->GetNumberTracks(TrackInfo::kVideoTrack);
-               if (data->mNumVideoTrack) {
-                 RefPtr<MediaTrackDemuxer> d =
-                     data->mDemuxer->GetTrackDemuxer(TrackInfo::kVideoTrack, 0);
-                 if (d) {
-                   RefPtr<Wrapper> wrapper =
-                       new DemuxerProxy::Wrapper(d, taskQueue);
-                   wrapper->UpdateBuffered();
-                   data->mVideoDemuxer = wrapper;
-                   DecoderDoctorLogger::LinkParentAndChild(
-                       data->mDemuxer.get(), "decoder factory wrapper",
-                       "MediaFormatReader::DecoderFactory::Wrapper",
-                       wrapper.get());
-                 }
-               }
-               data->mCrypto = data->mDemuxer->GetCrypto();
-               data->mSeekable = data->mDemuxer->IsSeekable();
-               data->mSeekableOnlyInBufferedRange =
-                   data->mDemuxer->IsSeekableOnlyInBufferedRanges();
-               data->mShouldComputeStartTime =
-                   data->mDemuxer->ShouldComputeStartTime();
-               data->mInitDone = true;
-               return InitPromise::CreateAndResolve(NS_OK, __func__);
-             },
-             [](const MediaResult& aError) {
-               return InitPromise::CreateAndReject(aError, __func__);
-             });
+      ->Then(
+          taskQueue, __func__,
+          [data, taskQueue]() {
+            if (!data->mDemuxer) {  // Was shutdown.
+              return InitPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_CANCELED,
+                                                  __func__);
+            }
+            data->mNumAudioTrack =
+                data->mDemuxer->GetNumberTracks(TrackInfo::kAudioTrack);
+            if (data->mNumAudioTrack) {
+              RefPtr<MediaTrackDemuxer> d =
+                  data->mDemuxer->GetTrackDemuxer(TrackInfo::kAudioTrack, 0);
+              if (d) {
+                RefPtr<Wrapper> wrapper =
+                    new DemuxerProxy::Wrapper(d, taskQueue);
+                wrapper->UpdateBuffered();
+                data->mAudioDemuxer = wrapper;
+                DecoderDoctorLogger::LinkParentAndChild(
+                    data->mDemuxer.get(), "decoder factory wrapper",
+                    "MediaFormatReader::DecoderFactory::Wrapper",
+                    wrapper.get());
+              }
+            }
+            data->mNumVideoTrack =
+                data->mDemuxer->GetNumberTracks(TrackInfo::kVideoTrack);
+            if (data->mNumVideoTrack) {
+              RefPtr<MediaTrackDemuxer> d =
+                  data->mDemuxer->GetTrackDemuxer(TrackInfo::kVideoTrack, 0);
+              if (d) {
+                RefPtr<Wrapper> wrapper =
+                    new DemuxerProxy::Wrapper(d, taskQueue);
+                wrapper->UpdateBuffered();
+                data->mVideoDemuxer = wrapper;
+                DecoderDoctorLogger::LinkParentAndChild(
+                    data->mDemuxer.get(), "decoder factory wrapper",
+                    "MediaFormatReader::DecoderFactory::Wrapper",
+                    wrapper.get());
+              }
+            }
+            data->mCrypto = data->mDemuxer->GetCrypto();
+            data->mSeekable = data->mDemuxer->IsSeekable();
+            data->mSeekableOnlyInBufferedRange =
+                data->mDemuxer->IsSeekableOnlyInBufferedRanges();
+            data->mShouldComputeStartTime =
+                data->mDemuxer->ShouldComputeStartTime();
+            data->mInitDone = true;
+            return InitPromise::CreateAndResolve(NS_OK, __func__);
+          },
+          [](const MediaResult& aError) {
+            return InitPromise::CreateAndReject(aError, __func__);
+          });
 }
 
 RefPtr<MediaFormatReader::NotifyDataArrivedPromise>
 MediaFormatReader::DemuxerProxy::NotifyDataArrived() {
   RefPtr<Data> data = mData;
   return InvokeAsync(mTaskQueue, __func__, [data]() {
     if (!data->mDemuxer) {
       // Was shutdown.
@@ -1439,30 +1443,30 @@ void MediaFormatReader::OnDemuxFailed(Tr
 void MediaFormatReader::DoDemuxVideo() {
   using SamplesPromise = MediaTrackDemuxer::SamplesPromise;
 
   DDLOG(DDLogCategory::Log, "video_demuxing", DDNoValue{});
   auto p = mVideo.mTrackDemuxer->GetSamples(1);
 
   if (mVideo.mFirstDemuxedSampleTime.isNothing()) {
     RefPtr<MediaFormatReader> self = this;
-    p = p->Then(OwnerThread(), __func__,
-                [self](RefPtr<MediaTrackDemuxer::SamplesHolder> aSamples) {
-                  DDLOGEX(self.get(), DDLogCategory::Log, "video_first_demuxed",
-                          DDNoValue{});
-                  self->OnFirstDemuxCompleted(TrackInfo::kVideoTrack, aSamples);
-                  return SamplesPromise::CreateAndResolve(aSamples.forget(),
-                                                          __func__);
-                },
-                [self](const MediaResult& aError) {
-                  DDLOGEX(self.get(), DDLogCategory::Log,
-                          "video_first_demuxing_error", aError);
-                  self->OnFirstDemuxFailed(TrackInfo::kVideoTrack, aError);
-                  return SamplesPromise::CreateAndReject(aError, __func__);
-                });
+    p = p->Then(
+        OwnerThread(), __func__,
+        [self](RefPtr<MediaTrackDemuxer::SamplesHolder> aSamples) {
+          DDLOGEX(self.get(), DDLogCategory::Log, "video_first_demuxed",
+                  DDNoValue{});
+          self->OnFirstDemuxCompleted(TrackInfo::kVideoTrack, aSamples);
+          return SamplesPromise::CreateAndResolve(aSamples.forget(), __func__);
+        },
+        [self](const MediaResult& aError) {
+          DDLOGEX(self.get(), DDLogCategory::Log, "video_first_demuxing_error",
+                  aError);
+          self->OnFirstDemuxFailed(TrackInfo::kVideoTrack, aError);
+          return SamplesPromise::CreateAndReject(aError, __func__);
+        });
   }
 
   p->Then(OwnerThread(), __func__, this,
           &MediaFormatReader::OnVideoDemuxCompleted,
           &MediaFormatReader::OnVideoDemuxFailed)
       ->Track(mVideo.mDemuxRequest);
 }
 
@@ -1517,30 +1521,30 @@ MediaFormatReader::RequestAudioData() {
 void MediaFormatReader::DoDemuxAudio() {
   using SamplesPromise = MediaTrackDemuxer::SamplesPromise;
 
   DDLOG(DDLogCategory::Log, "audio_demuxing", DDNoValue{});
   auto p = mAudio.mTrackDemuxer->GetSamples(1);
 
   if (mAudio.mFirstDemuxedSampleTime.isNothing()) {
     RefPtr<MediaFormatReader> self = this;
-    p = p->Then(OwnerThread(), __func__,
-                [self](RefPtr<MediaTrackDemuxer::SamplesHolder> aSamples) {
-                  DDLOGEX(self.get(), DDLogCategory::Log, "audio_first_demuxed",
-                          DDNoValue{});
-                  self->OnFirstDemuxCompleted(TrackInfo::kAudioTrack, aSamples);
-                  return SamplesPromise::CreateAndResolve(aSamples.forget(),
-                                                          __func__);
-                },
-                [self](const MediaResult& aError) {
-                  DDLOGEX(self.get(), DDLogCategory::Log,
-                          "audio_first_demuxing_error", aError);
-                  self->OnFirstDemuxFailed(TrackInfo::kAudioTrack, aError);
-                  return SamplesPromise::CreateAndReject(aError, __func__);
-                });
+    p = p->Then(
+        OwnerThread(), __func__,
+        [self](RefPtr<MediaTrackDemuxer::SamplesHolder> aSamples) {
+          DDLOGEX(self.get(), DDLogCategory::Log, "audio_first_demuxed",
+                  DDNoValue{});
+          self->OnFirstDemuxCompleted(TrackInfo::kAudioTrack, aSamples);
+          return SamplesPromise::CreateAndResolve(aSamples.forget(), __func__);
+        },
+        [self](const MediaResult& aError) {
+          DDLOGEX(self.get(), DDLogCategory::Log, "audio_first_demuxing_error",
+                  aError);
+          self->OnFirstDemuxFailed(TrackInfo::kAudioTrack, aError);
+          return SamplesPromise::CreateAndReject(aError, __func__);
+        });
   }
 
   p->Then(OwnerThread(), __func__, this,
           &MediaFormatReader::OnAudioDemuxCompleted,
           &MediaFormatReader::OnAudioDemuxFailed)
       ->Track(mAudio.mDemuxRequest);
 }
 
@@ -1988,56 +1992,57 @@ void MediaFormatReader::InternalSeek(Tra
 
   auto& decoder = GetDecoderData(aTrack);
   decoder.Flush();
   decoder.ResetDemuxer();
   decoder.mTimeThreshold = Some(aTarget);
   DDLOG(DDLogCategory::Log, "seeking", DDNoValue{});
   RefPtr<MediaFormatReader> self = this;
   decoder.mTrackDemuxer->Seek(decoder.mTimeThreshold.ref().Time())
-      ->Then(OwnerThread(), __func__,
-             [self, aTrack](TimeUnit aTime) {
-               DDLOGEX(self.get(), DDLogCategory::Log, "seeked", DDNoValue{});
-               auto& decoder = self->GetDecoderData(aTrack);
-               decoder.mSeekRequest.Complete();
-               MOZ_ASSERT(decoder.mTimeThreshold,
-                          "Seek promise must be disconnected when "
-                          "timethreshold is reset");
-               decoder.mTimeThreshold.ref().mHasSeeked = true;
-               self->SetVideoDecodeThreshold();
-               self->ScheduleUpdate(aTrack);
-             },
-             [self, aTrack](const MediaResult& aError) {
-               auto& decoder = self->GetDecoderData(aTrack);
-               decoder.mSeekRequest.Complete();
-               switch (aError.Code()) {
-                 case NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA:
-                   DDLOGEX(self.get(), DDLogCategory::Log,
-                           "seeking_interrupted", aError);
-                   self->NotifyWaitingForData(aTrack);
-                   break;
-                 case NS_ERROR_DOM_MEDIA_END_OF_STREAM:
-                   DDLOGEX(self.get(), DDLogCategory::Log,
-                           "seeking_interrupted", aError);
-                   decoder.mTimeThreshold.reset();
-                   self->NotifyEndOfStream(aTrack);
-                   break;
-                 case NS_ERROR_DOM_MEDIA_CANCELED:
-                   DDLOGEX(self.get(), DDLogCategory::Log,
-                           "seeking_interrupted", aError);
-                   decoder.mTimeThreshold.reset();
-                   break;
-                 default:
-                   DDLOGEX(self.get(), DDLogCategory::Log, "seeking_error",
-                           aError);
-                   decoder.mTimeThreshold.reset();
-                   self->NotifyError(aTrack, aError);
-                   break;
-               }
-             })
+      ->Then(
+          OwnerThread(), __func__,
+          [self, aTrack](TimeUnit aTime) {
+            DDLOGEX(self.get(), DDLogCategory::Log, "seeked", DDNoValue{});
+            auto& decoder = self->GetDecoderData(aTrack);
+            decoder.mSeekRequest.Complete();
+            MOZ_ASSERT(decoder.mTimeThreshold,
+                       "Seek promise must be disconnected when "
+                       "timethreshold is reset");
+            decoder.mTimeThreshold.ref().mHasSeeked = true;
+            self->SetVideoDecodeThreshold();
+            self->ScheduleUpdate(aTrack);
+          },
+          [self, aTrack](const MediaResult& aError) {
+            auto& decoder = self->GetDecoderData(aTrack);
+            decoder.mSeekRequest.Complete();
+            switch (aError.Code()) {
+              case NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA:
+                DDLOGEX(self.get(), DDLogCategory::Log, "seeking_interrupted",
+                        aError);
+                self->NotifyWaitingForData(aTrack);
+                break;
+              case NS_ERROR_DOM_MEDIA_END_OF_STREAM:
+                DDLOGEX(self.get(), DDLogCategory::Log, "seeking_interrupted",
+                        aError);
+                decoder.mTimeThreshold.reset();
+                self->NotifyEndOfStream(aTrack);
+                break;
+              case NS_ERROR_DOM_MEDIA_CANCELED:
+                DDLOGEX(self.get(), DDLogCategory::Log, "seeking_interrupted",
+                        aError);
+                decoder.mTimeThreshold.reset();
+                break;
+              default:
+                DDLOGEX(self.get(), DDLogCategory::Log, "seeking_error",
+                        aError);
+                decoder.mTimeThreshold.reset();
+                self->NotifyError(aTrack, aError);
+                break;
+            }
+          })
       ->Track(decoder.mSeekRequest);
 }
 
 void MediaFormatReader::DrainDecoder(TrackType aTrack) {
   MOZ_ASSERT(OnTaskQueue());
 
   auto& decoder = GetDecoderData(aTrack);
   if (decoder.mDrainState == DrainState::Draining) {
@@ -2864,27 +2869,28 @@ void MediaFormatReader::NotifyDataArrive
   if (mNotifyDataArrivedPromise.Exists()) {
     // Already one in progress. Set the dirty flag so we can process it later.
     mPendingNotifyDataArrived = true;
     return;
   }
 
   RefPtr<MediaFormatReader> self = this;
   mDemuxer->NotifyDataArrived()
-      ->Then(OwnerThread(), __func__,
-             [self]() {
-               self->mNotifyDataArrivedPromise.Complete();
-               self->UpdateBuffered();
-               self->NotifyTrackDemuxers();
-               if (self->mPendingNotifyDataArrived) {
-                 self->mPendingNotifyDataArrived = false;
-                 self->NotifyDataArrived();
-               }
-             },
-             [self]() { self->mNotifyDataArrivedPromise.Complete(); })
+      ->Then(
+          OwnerThread(), __func__,
+          [self]() {
+            self->mNotifyDataArrivedPromise.Complete();
+            self->UpdateBuffered();
+            self->NotifyTrackDemuxers();
+            if (self->mPendingNotifyDataArrived) {
+              self->mPendingNotifyDataArrived = false;
+              self->NotifyDataArrived();
+            }
+          },
+          [self]() { self->mNotifyDataArrivedPromise.Complete(); })
       ->Track(mNotifyDataArrivedPromise);
 }
 
 void MediaFormatReader::UpdateBuffered() {
   MOZ_ASSERT(OnTaskQueue());
 
   if (mShutdown) {
     return;
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -3134,56 +3134,56 @@ RefPtr<MediaManager::MgrPromise> MediaMa
           [](nsresult rs) {
             NS_WARNING(
                 "EnumerateDevicesImpl failed to get Principal Key. Enumeration "
                 "will not continue.");
             return MgrPromise::CreateAndReject(
                 MakeRefPtr<MediaMgrError>(MediaMgrError::Name::AbortError),
                 __func__);
           })
-      ->Then(GetMainThreadSerialEventTarget(), __func__,
-             [aWindowId, originKey, aVideoInputEnumType, aAudioInputEnumType,
-              aVideoInputType, aAudioInputType, aOutDevices](bool) {
-               // Only run if window is still on our active list.
-               MediaManager* mgr = MediaManager::GetIfExists();
-               if (!mgr || !mgr->IsWindowStillActive(aWindowId)) {
-                 return MgrPromise::CreateAndReject(
-                     MakeRefPtr<MediaMgrError>(MediaMgrError::Name::AbortError),
-                     __func__);
-               }
-
-               // If we fetched any real cameras or mics, remove the
-               // "default" part of their IDs.
-               if (aVideoInputType == MediaSourceEnum::Camera &&
-                   aAudioInputType == MediaSourceEnum::Microphone &&
-                   (aVideoInputEnumType != DeviceEnumerationType::Fake ||
-                    aAudioInputEnumType != DeviceEnumerationType::Fake)) {
-                 mgr->mDeviceIDs.Clear();
-                 for (auto& device : *aOutDevices) {
-                   nsString id;
-                   device->GetId(id);
-                   id.ReplaceSubstring(NS_LITERAL_STRING("default: "),
-                                       NS_LITERAL_STRING(""));
-                   if (!mgr->mDeviceIDs.Contains(id)) {
-                     mgr->mDeviceIDs.AppendElement(id);
-                   }
-                 }
-               }
-               if (!mgr->IsWindowStillActive(aWindowId)) {
-                 return MgrPromise::CreateAndReject(
-                     MakeRefPtr<MediaMgrError>(MediaMgrError::Name::AbortError),
-                     __func__);
-               }
-               MediaManager::AnonymizeDevices(*aOutDevices, *originKey,
-                                              aWindowId);
-               return MgrPromise::CreateAndResolve(false, __func__);
-             },
-             [](RefPtr<MediaMgrError>&& aError) {
-               return MgrPromise::CreateAndReject(std::move(aError), __func__);
-             });
+      ->Then(
+          GetMainThreadSerialEventTarget(), __func__,
+          [aWindowId, originKey, aVideoInputEnumType, aAudioInputEnumType,
+           aVideoInputType, aAudioInputType, aOutDevices](bool) {
+            // Only run if window is still on our active list.
+            MediaManager* mgr = MediaManager::GetIfExists();
+            if (!mgr || !mgr->IsWindowStillActive(aWindowId)) {
+              return MgrPromise::CreateAndReject(
+                  MakeRefPtr<MediaMgrError>(MediaMgrError::Name::AbortError),
+                  __func__);
+            }
+
+            // If we fetched any real cameras or mics, remove the
+            // "default" part of their IDs.
+            if (aVideoInputType == MediaSourceEnum::Camera &&
+                aAudioInputType == MediaSourceEnum::Microphone &&
+                (aVideoInputEnumType != DeviceEnumerationType::Fake ||
+                 aAudioInputEnumType != DeviceEnumerationType::Fake)) {
+              mgr->mDeviceIDs.Clear();
+              for (auto& device : *aOutDevices) {
+                nsString id;
+                device->GetId(id);
+                id.ReplaceSubstring(NS_LITERAL_STRING("default: "),
+                                    NS_LITERAL_STRING(""));
+                if (!mgr->mDeviceIDs.Contains(id)) {
+                  mgr->mDeviceIDs.AppendElement(id);
+                }
+              }
+            }
+            if (!mgr->IsWindowStillActive(aWindowId)) {
+              return MgrPromise::CreateAndReject(
+                  MakeRefPtr<MediaMgrError>(MediaMgrError::Name::AbortError),
+                  __func__);
+            }
+            MediaManager::AnonymizeDevices(*aOutDevices, *originKey, aWindowId);
+            return MgrPromise::CreateAndResolve(false, __func__);
+          },
+          [](RefPtr<MediaMgrError>&& aError) {
+            return MgrPromise::CreateAndReject(std::move(aError), __func__);
+          });
 }
 
 RefPtr<MediaManager::DevicesPromise> MediaManager::EnumerateDevices(
     nsPIDOMWindowInner* aWindow, dom::CallerType aCallerType) {
   MOZ_ASSERT(NS_IsMainThread());
   if (sHasShutdown) {
     return DevicesPromise::CreateAndReject(
         MakeRefPtr<MediaMgrError>(MediaMgrError::Name::AbortError,
@@ -3245,31 +3245,31 @@ RefPtr<MediaManager::DevicesPromise> Med
   if (Preferences::GetBool("media.setsinkid.enabled")) {
     audioOutputType = MediaSinkEnum::Speaker;
   }
   auto devices = MakeRefPtr<MediaDeviceSetRefCnt>();
   return EnumerateDevicesImpl(windowId, MediaSourceEnum::Camera,
                               MediaSourceEnum::Microphone, audioOutputType,
                               videoEnumerationType, audioEnumerationType, false,
                               devices)
-      ->Then(GetCurrentThreadSerialEventTarget(), __func__,
-             [windowListener, sourceListener, devices](bool) {
-               DebugOnly<bool> rv = windowListener->Remove(sourceListener);
-               MOZ_ASSERT(rv);
-               return DevicesPromise::CreateAndResolve(devices, __func__);
-             },
-             [windowListener, sourceListener](RefPtr<MediaMgrError>&& aError) {
-               // This may fail, if a new doc has been set the OnNavigation
-               // method should have removed all previous active listeners.
-               // Attempt to clean it here, just in case, but ignore the return
-               // value.
-               Unused << windowListener->Remove(sourceListener);
-               return DevicesPromise::CreateAndReject(std::move(aError),
-                                                      __func__);
-             });
+      ->Then(
+          GetCurrentThreadSerialEventTarget(), __func__,
+          [windowListener, sourceListener, devices](bool) {
+            DebugOnly<bool> rv = windowListener->Remove(sourceListener);
+            MOZ_ASSERT(rv);
+            return DevicesPromise::CreateAndResolve(devices, __func__);
+          },
+          [windowListener, sourceListener](RefPtr<MediaMgrError>&& aError) {
+            // This may fail, if a new doc has been set the OnNavigation
+            // method should have removed all previous active listeners.
+            // Attempt to clean it here, just in case, but ignore the return
+            // value.
+            Unused << windowListener->Remove(sourceListener);
+            return DevicesPromise::CreateAndReject(std::move(aError), __func__);
+          });
 }
 
 RefPtr<SinkInfoPromise> MediaManager::GetSinkDevice(nsPIDOMWindowInner* aWindow,
                                                     const nsString& aDeviceId) {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(aWindow);
 
   // We have to add the window id here because enumerate methods
@@ -3293,41 +3293,42 @@ RefPtr<SinkInfoPromise> MediaManager::Ge
   windowListener->Register(sourceListener);
 
   bool isSecure = aWindow->IsSecureContext();
   auto devices = MakeRefPtr<MediaDeviceSetRefCnt>();
   return EnumerateDevicesImpl(aWindow->WindowID(), MediaSourceEnum::Other,
                               MediaSourceEnum::Other, MediaSinkEnum::Speaker,
                               DeviceEnumerationType::Normal,
                               DeviceEnumerationType::Normal, true, devices)
-      ->Then(GetCurrentThreadSerialEventTarget(), __func__,
-             [aDeviceId, isSecure, devices](bool) {
-               for (RefPtr<MediaDevice>& device : *devices) {
-                 if (aDeviceId.IsEmpty() && device->mSinkInfo->Preferred()) {
-                   return SinkInfoPromise::CreateAndResolve(device->mSinkInfo,
-                                                            __func__);
-                 }
-                 if (device->mID.Equals(aDeviceId)) {
-                   // TODO: Check if the application is authorized to play audio
-                   // through this device (Bug 1493982).
-                   if (isSecure || device->mSinkInfo->Preferred()) {
-                     return SinkInfoPromise::CreateAndResolve(device->mSinkInfo,
-                                                              __func__);
-                   }
-                   return SinkInfoPromise::CreateAndReject(
-                       NS_ERROR_DOM_MEDIA_NOT_ALLOWED_ERR, __func__);
-                 }
-               }
-               return SinkInfoPromise::CreateAndReject(NS_ERROR_NOT_AVAILABLE,
-                                                       __func__);
-             },
-             [](RefPtr<MediaMgrError>&& aError) {
-               return SinkInfoPromise::CreateAndReject(NS_ERROR_NOT_AVAILABLE,
-                                                       __func__);
-             });
+      ->Then(
+          GetCurrentThreadSerialEventTarget(), __func__,
+          [aDeviceId, isSecure, devices](bool) {
+            for (RefPtr<MediaDevice>& device : *devices) {
+              if (aDeviceId.IsEmpty() && device->mSinkInfo->Preferred()) {
+                return SinkInfoPromise::CreateAndResolve(device->mSinkInfo,
+                                                         __func__);
+              }
+              if (device->mID.Equals(aDeviceId)) {
+                // TODO: Check if the application is authorized to play audio
+                // through this device (Bug 1493982).
+                if (isSecure || device->mSinkInfo->Preferred()) {
+                  return SinkInfoPromise::CreateAndResolve(device->mSinkInfo,
+                                                           __func__);
+                }
+                return SinkInfoPromise::CreateAndReject(
+                    NS_ERROR_DOM_MEDIA_NOT_ALLOWED_ERR, __func__);
+              }
+            }
+            return SinkInfoPromise::CreateAndReject(NS_ERROR_NOT_AVAILABLE,
+                                                    __func__);
+          },
+          [](RefPtr<MediaMgrError>&& aError) {
+            return SinkInfoPromise::CreateAndReject(NS_ERROR_NOT_AVAILABLE,
+                                                    __func__);
+          });
 }
 
 /*
  * GetUserMediaDevices - called by the UI-part of getUserMedia from chrome JS.
  */
 
 nsresult MediaManager::GetUserMediaDevices(
     nsPIDOMWindowInner* aWindow, const MediaStreamConstraints& aConstraints,
@@ -4169,59 +4170,60 @@ SourceListener::InitializeAsync() {
                                   __func__);
                    return;
                  }
                }
 
                LOG("started all sources");
                aHolder.Resolve(true, __func__);
              })
-      ->Then(GetMainThreadSerialEventTarget(), __func__,
-             [self = RefPtr<SourceListener>(this), this]() {
-               if (mStopped) {
-                 // We were shut down during the async init
-                 return SourceListenerPromise::CreateAndResolve(true, __func__);
-               }
-
-               for (DeviceState* state :
-                    {mAudioDeviceState.get(), mVideoDeviceState.get()}) {
-                 if (!state) {
-                   continue;
-                 }
-                 MOZ_DIAGNOSTIC_ASSERT(!state->mTrackEnabled);
-                 MOZ_DIAGNOSTIC_ASSERT(!state->mDeviceEnabled);
-                 MOZ_DIAGNOSTIC_ASSERT(!state->mStopped);
-
-                 state->mDeviceEnabled = true;
-                 state->mTrackEnabled = true;
-                 state->mTrackEnabledTime = TimeStamp::Now();
-               }
-               return SourceListenerPromise::CreateAndResolve(true, __func__);
-             },
-             [self = RefPtr<SourceListener>(this),
-              this](RefPtr<MediaMgrError>&& aResult) {
-               if (mStopped) {
-                 return SourceListenerPromise::CreateAndReject(
-                     std::move(aResult), __func__);
-               }
-
-               for (DeviceState* state :
-                    {mAudioDeviceState.get(), mVideoDeviceState.get()}) {
-                 if (!state) {
-                   continue;
-                 }
-                 MOZ_DIAGNOSTIC_ASSERT(!state->mTrackEnabled);
-                 MOZ_DIAGNOSTIC_ASSERT(!state->mDeviceEnabled);
-                 MOZ_DIAGNOSTIC_ASSERT(!state->mStopped);
-
-                 state->mStopped = true;
-               }
-               return SourceListenerPromise::CreateAndReject(std::move(aResult),
-                                                             __func__);
-             });
+      ->Then(
+          GetMainThreadSerialEventTarget(), __func__,
+          [self = RefPtr<SourceListener>(this), this]() {
+            if (mStopped) {
+              // We were shut down during the async init
+              return SourceListenerPromise::CreateAndResolve(true, __func__);
+            }
+
+            for (DeviceState* state :
+                 {mAudioDeviceState.get(), mVideoDeviceState.get()}) {
+              if (!state) {
+                continue;
+              }
+              MOZ_DIAGNOSTIC_ASSERT(!state->mTrackEnabled);
+              MOZ_DIAGNOSTIC_ASSERT(!state->mDeviceEnabled);
+              MOZ_DIAGNOSTIC_ASSERT(!state->mStopped);
+
+              state->mDeviceEnabled = true;
+              state->mTrackEnabled = true;
+              state->mTrackEnabledTime = TimeStamp::Now();
+            }
+            return SourceListenerPromise::CreateAndResolve(true, __func__);
+          },
+          [self = RefPtr<SourceListener>(this),
+           this](RefPtr<MediaMgrError>&& aResult) {
+            if (mStopped) {
+              return SourceListenerPromise::CreateAndReject(std::move(aResult),
+                                                            __func__);
+            }
+
+            for (DeviceState* state :
+                 {mAudioDeviceState.get(), mVideoDeviceState.get()}) {
+              if (!state) {
+                continue;
+              }
+              MOZ_DIAGNOSTIC_ASSERT(!state->mTrackEnabled);
+              MOZ_DIAGNOSTIC_ASSERT(!state->mDeviceEnabled);
+              MOZ_DIAGNOSTIC_ASSERT(!state->mStopped);
+
+              state->mStopped = true;
+            }
+            return SourceListenerPromise::CreateAndReject(std::move(aResult),
+                                                          __func__);
+          });
 }
 
 void SourceListener::Stop() {
   MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread");
 
   // StopSharing() has some special logic, at least for audio capture.
   // It must be called when all tracks have stopped, before setting mStopped.
   StopSharing();
--- a/dom/media/MediaRecorder.cpp
+++ b/dom/media/MediaRecorder.cpp
@@ -879,23 +879,24 @@ class MediaRecorder::Session : public Pr
           gMediaRecorderShutdownBlocker = nullptr;
 
           nsTArray<RefPtr<ShutdownPromise>> promises(gSessions.Count());
           for (auto iter = gSessions.Iter(); !iter.Done(); iter.Next()) {
             promises.AppendElement(iter.Get()->GetKey()->Shutdown());
           }
           gSessions.Clear();
           ShutdownPromise::All(GetCurrentThreadSerialEventTarget(), promises)
-              ->Then(GetCurrentThreadSerialEventTarget(), __func__,
-                     [ticket]() mutable {
-                       MOZ_ASSERT(gSessions.Count() == 0);
-                       // Unblock shutdown
-                       ticket = nullptr;
-                     },
-                     []() { MOZ_CRASH("Not reached"); });
+              ->Then(
+                  GetCurrentThreadSerialEventTarget(), __func__,
+                  [ticket]() mutable {
+                    MOZ_ASSERT(gSessions.Count() == 0);
+                    // Unblock shutdown
+                    ticket = nullptr;
+                  },
+                  []() { MOZ_CRASH("Not reached"); });
           return NS_OK;
         }
       };
 
       gMediaRecorderShutdownBlocker = MakeAndAddRef<Blocker>();
       RefPtr<nsIAsyncShutdownClient> barrier = GetShutdownBarrier();
       nsresult rv = barrier->AddBlocker(
           gMediaRecorderShutdownBlocker, NS_LITERAL_STRING(__FILE__), __LINE__,
@@ -1709,25 +1710,26 @@ RefPtr<MediaRecorder::SizeOfPromise> Med
   RefPtr<SizeOfPromise> promise = holder->Ensure(__func__);
 
   nsTArray<RefPtr<SizeOfPromise>> promises(mSessions.Length());
   for (const RefPtr<Session>& session : mSessions) {
     promises.AppendElement(session->SizeOfExcludingThis(aMallocSizeOf));
   }
 
   SizeOfPromise::All(GetCurrentThreadSerialEventTarget(), promises)
-      ->Then(GetCurrentThreadSerialEventTarget(), __func__,
-             [holder](const nsTArray<size_t>& sizes) {
-               size_t total = 0;
-               for (const size_t& size : sizes) {
-                 total += size;
-               }
-               holder->Resolve(total, __func__);
-             },
-             []() { MOZ_CRASH("Unexpected reject"); });
+      ->Then(
+          GetCurrentThreadSerialEventTarget(), __func__,
+          [holder](const nsTArray<size_t>& sizes) {
+            size_t total = 0;
+            for (const size_t& size : sizes) {
+              total += size;
+            }
+            holder->Resolve(total, __func__);
+          },
+          []() { MOZ_CRASH("Unexpected reject"); });
 
   return promise;
 }
 
 StaticRefPtr<MediaRecorderReporter> MediaRecorderReporter::sUniqueInstance;
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/media/ReaderProxy.cpp
+++ b/dom/media/ReaderProxy.cpp
@@ -75,28 +75,29 @@ RefPtr<ReaderProxy::VideoDataPromise> Re
 
   const auto threshold = aTimeThreshold > media::TimeUnit::Zero()
                              ? aTimeThreshold + StartTime()
                              : aTimeThreshold;
 
   int64_t startTime = StartTime().ToMicroseconds();
   return InvokeAsync(mReader->OwnerThread(), mReader.get(), __func__,
                      &MediaFormatReader::RequestVideoData, threshold)
-      ->Then(mOwnerThread, __func__,
-             [startTime](RefPtr<VideoData> aVideo) {
-               aVideo->AdjustForStartTime(startTime);
-               return aVideo->mTime.IsValid()
-                          ? VideoDataPromise::CreateAndResolve(aVideo.forget(),
-                                                               __func__)
-                          : VideoDataPromise::CreateAndReject(
-                                NS_ERROR_DOM_MEDIA_OVERFLOW_ERR, __func__);
-             },
-             [](const MediaResult& aError) {
-               return VideoDataPromise::CreateAndReject(aError, __func__);
-             });
+      ->Then(
+          mOwnerThread, __func__,
+          [startTime](RefPtr<VideoData> aVideo) {
+            aVideo->AdjustForStartTime(startTime);
+            return aVideo->mTime.IsValid()
+                       ? VideoDataPromise::CreateAndResolve(aVideo.forget(),
+                                                            __func__)
+                       : VideoDataPromise::CreateAndReject(
+                             NS_ERROR_DOM_MEDIA_OVERFLOW_ERR, __func__);
+          },
+          [](const MediaResult& aError) {
+            return VideoDataPromise::CreateAndReject(aError, __func__);
+          });
 }
 
 RefPtr<ReaderProxy::SeekPromise> ReaderProxy::Seek(const SeekTarget& aTarget) {
   MOZ_ASSERT(mOwnerThread->IsCurrentThreadIn());
   return SeekInternal(aTarget);
 }
 
 RefPtr<ReaderProxy::SeekPromise> ReaderProxy::SeekInternal(
--- a/dom/media/VideoFrameConverter.h
+++ b/dom/media/VideoFrameConverter.h
@@ -88,23 +88,24 @@ class VideoFrameConverter {
               ("Clearing pacer because of source reset (%.3f)",
                (mLastFrameQueuedForPacing - t).ToSeconds()));
       mPacingTimer->Cancel();
     }
 
     mLastFrameQueuedForPacing = t;
 
     mPacingTimer->WaitUntil(t, __func__)
-        ->Then(mTaskQueue, __func__,
-               [self = RefPtr<VideoFrameConverter>(this), this,
-                image = RefPtr<layers::Image>(aChunk.mFrame.GetImage()), t,
-                size, aForceBlack]() mutable {
-                 QueueForProcessing(std::move(image), t, size, aForceBlack);
-               },
-               [] {});
+        ->Then(
+            mTaskQueue, __func__,
+            [self = RefPtr<VideoFrameConverter>(this), this,
+             image = RefPtr<layers::Image>(aChunk.mFrame.GetImage()), t, size,
+             aForceBlack]() mutable {
+              QueueForProcessing(std::move(image), t, size, aForceBlack);
+            },
+            [] {});
   }
 
   void SetTrackEnabled(bool aEnabled) {
     nsresult rv = mTaskQueue->Dispatch(NS_NewRunnableFunction(
         __func__, [self = RefPtr<VideoFrameConverter>(this), this, aEnabled] {
           MOZ_LOG(gVideoFrameConverterLog, LogLevel::Debug,
                   ("VideoFrameConverter Track is now %s",
                    aEnabled ? "enabled" : "disabled"));
--- a/dom/media/eme/MediaKeySystemAccess.cpp
+++ b/dom/media/eme/MediaKeySystemAccess.cpp
@@ -788,17 +788,19 @@ static bool CheckRequirement(const Media
     case MediaKeysRequirement::Not_allowed: {
       // If the implementation requires use of feature in combination with
       // accumulated configuration and restrictions, return NotSupported.
       if (aFeatureSupport == KeySystemFeatureSupport::Required) {
         return false;
       }
       break;
     }
-    default: { return false; }
+    default: {
+      return false;
+    }
   }
 
   // Set the requirement member of accumulated configuration to equal
   // calculated requirement.
   aOutRequirement = requirement;
 
   return true;
 }
--- a/dom/media/encoder/VP8TrackEncoder.cpp
+++ b/dom/media/encoder/VP8TrackEncoder.cpp
@@ -228,17 +228,19 @@ nsresult VP8TrackEncoder::GetEncodedPart
   while ((pkt = vpx_codec_get_cx_data(mVPXContext, &iter)) != nullptr) {
     switch (pkt->kind) {
       case VPX_CODEC_CX_FRAME_PKT: {
         // Copy the encoded data from libvpx to frameData
         frameData.AppendElements((uint8_t*)pkt->data.frame.buf,
                                  pkt->data.frame.sz);
         break;
       }
-      default: { break; }
+      default: {
+        break;
+      }
     }
     // End of frame
     if ((pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT) == 0) {
       if (pkt->data.frame.flags & VPX_FRAME_IS_KEY) {
         frameType = EncodedFrame::VP8_I_FRAME;
       }
       break;
     }
--- a/dom/media/gmp/ChromiumCDMChild.cpp
+++ b/dom/media/gmp/ChromiumCDMChild.cpp
@@ -387,25 +387,26 @@ mozilla::ipc::IPCResult ChromiumCDMChild
     InitResolver&& aResolver) {
   MOZ_ASSERT(IsOnMessageLoopThread());
   GMP_LOG("ChromiumCDMChild::RecvInit(distinctiveId=%s, persistentState=%s)",
           aAllowDistinctiveIdentifier ? "true" : "false",
           aAllowPersistentState ? "true" : "false");
   mPersistentStateAllowed = aAllowPersistentState;
 
   RefPtr<ChromiumCDMChild::InitPromise> promise = mInitPromise.Ensure(__func__);
-  promise->Then(mPlugin->GMPMessageLoop()->SerialEventTarget(), __func__,
-                [aResolver](bool /* unused */) { aResolver(true); },
-                [aResolver](nsresult rv) {
-                  GMP_LOG(
-                      "ChromiumCDMChild::RecvInit() init promise rejected with "
-                      "rv=%" PRIu32,
-                      static_cast<uint32_t>(rv));
-                  aResolver(false);
-                });
+  promise->Then(
+      mPlugin->GMPMessageLoop()->SerialEventTarget(), __func__,
+      [aResolver](bool /* unused */) { aResolver(true); },
+      [aResolver](nsresult rv) {
+        GMP_LOG(
+            "ChromiumCDMChild::RecvInit() init promise rejected with "
+            "rv=%" PRIu32,
+            static_cast<uint32_t>(rv));
+        aResolver(false);
+      });
 
   if (mCDM) {
     // Once the CDM is initialized we expect it to resolve mInitPromise via
     // ChromiumCDMChild::OnInitialized
     mCDM->Initialize(aAllowDistinctiveIdentifier, aAllowPersistentState,
                      // We do not yet support hardware secure codecs
                      false);
   } else {
--- a/dom/media/gmp/ChromiumCDMProxy.cpp
+++ b/dom/media/gmp/ChromiumCDMProxy.cpp
@@ -88,30 +88,31 @@ void ChromiumCDMProxy::Init(PromiseId aP
             thread, __func__,
             [self, aPromiseId, thread](RefPtr<gmp::ChromiumCDMParent> cdm) {
               // service->GetCDM succeeded
               self->mCallback =
                   MakeUnique<ChromiumCDMCallbackProxy>(self, self->mMainThread);
               cdm->Init(self->mCallback.get(),
                         self->mDistinctiveIdentifierRequired,
                         self->mPersistentStateRequired, self->mMainThread)
-                  ->Then(thread, __func__,
-                         [self, aPromiseId, cdm](bool /* unused */) {
-                           // CDM init succeeded
-                           {
-                             MutexAutoLock lock(self->mCDMMutex);
-                             self->mCDM = cdm;
-                           }
-                           self->OnCDMCreated(aPromiseId);
-                         },
-                         [self, aPromiseId](MediaResult aResult) {
-                           // CDM init failed
-                           self->RejectPromise(aPromiseId, aResult.Code(),
-                                               aResult.Message());
-                         });
+                  ->Then(
+                      thread, __func__,
+                      [self, aPromiseId, cdm](bool /* unused */) {
+                        // CDM init succeeded
+                        {
+                          MutexAutoLock lock(self->mCDMMutex);
+                          self->mCDM = cdm;
+                        }
+                        self->OnCDMCreated(aPromiseId);
+                      },
+                      [self, aPromiseId](MediaResult aResult) {
+                        // CDM init failed
+                        self->RejectPromise(aPromiseId, aResult.Code(),
+                                            aResult.Message());
+                      });
             },
             [self, aPromiseId](MediaResult rv) {
               // service->GetCDM failed
               self->RejectPromise(aPromiseId, rv.Code(), rv.Description());
             });
       }));
 
   mGMPThread->Dispatch(task.forget());
--- a/dom/media/gmp/GMPService.cpp
+++ b/dom/media/gmp/GMPService.cpp
@@ -350,34 +350,35 @@ GeckoMediaPluginService::GetDecryptingGM
     return NS_ERROR_FAILURE;
   }
 
   GetGMPVideoDecoderCallback* rawCallback = aCallback.release();
   RefPtr<AbstractThread> thread(GetAbstractGMPThread());
   RefPtr<GMPCrashHelper> helper(aHelper);
   GetContentParent(aHelper, aNodeId, NS_LITERAL_CSTRING(GMP_API_VIDEO_DECODER),
                    *aTags)
-      ->Then(thread, __func__,
-             [rawCallback, helper,
-              aDecryptorId](RefPtr<GMPContentParent::CloseBlocker> wrapper) {
-               RefPtr<GMPContentParent> parent = wrapper->mParent;
-               UniquePtr<GetGMPVideoDecoderCallback> callback(rawCallback);
-               GMPVideoDecoderParent* actor = nullptr;
-               GMPVideoHostImpl* host = nullptr;
-               if (parent && NS_SUCCEEDED(parent->GetGMPVideoDecoder(
-                                 &actor, aDecryptorId))) {
-                 host = &(actor->Host());
-                 actor->SetCrashHelper(helper);
-               }
-               callback->Done(actor, host);
-             },
-             [rawCallback] {
-               UniquePtr<GetGMPVideoDecoderCallback> callback(rawCallback);
-               callback->Done(nullptr, nullptr);
-             });
+      ->Then(
+          thread, __func__,
+          [rawCallback, helper,
+           aDecryptorId](RefPtr<GMPContentParent::CloseBlocker> wrapper) {
+            RefPtr<GMPContentParent> parent = wrapper->mParent;
+            UniquePtr<GetGMPVideoDecoderCallback> callback(rawCallback);
+            GMPVideoDecoderParent* actor = nullptr;
+            GMPVideoHostImpl* host = nullptr;
+            if (parent && NS_SUCCEEDED(parent->GetGMPVideoDecoder(
+                              &actor, aDecryptorId))) {
+              host = &(actor->Host());
+              actor->SetCrashHelper(helper);
+            }
+            callback->Done(actor, host);
+          },
+          [rawCallback] {
+            UniquePtr<GetGMPVideoDecoderCallback> callback(rawCallback);
+            callback->Done(nullptr, nullptr);
+          });
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 GeckoMediaPluginService::GetGMPVideoEncoder(
     GMPCrashHelper* aHelper, nsTArray<nsCString>* aTags,
     const nsACString& aNodeId,
@@ -390,33 +391,34 @@ GeckoMediaPluginService::GetGMPVideoEnco
     return NS_ERROR_FAILURE;
   }
 
   GetGMPVideoEncoderCallback* rawCallback = aCallback.release();
   RefPtr<AbstractThread> thread(GetAbstractGMPThread());
   RefPtr<GMPCrashHelper> helper(aHelper);
   GetContentParent(aHelper, aNodeId, NS_LITERAL_CSTRING(GMP_API_VIDEO_ENCODER),
                    *aTags)
-      ->Then(thread, __func__,
-             [rawCallback,
-              helper](RefPtr<GMPContentParent::CloseBlocker> wrapper) {
-               RefPtr<GMPContentParent> parent = wrapper->mParent;
-               UniquePtr<GetGMPVideoEncoderCallback> callback(rawCallback);
-               GMPVideoEncoderParent* actor = nullptr;
-               GMPVideoHostImpl* host = nullptr;
-               if (parent && NS_SUCCEEDED(parent->GetGMPVideoEncoder(&actor))) {
-                 host = &(actor->Host());
-                 actor->SetCrashHelper(helper);
-               }
-               callback->Done(actor, host);
-             },
-             [rawCallback] {
-               UniquePtr<GetGMPVideoEncoderCallback> callback(rawCallback);
-               callback->Done(nullptr, nullptr);
-             });
+      ->Then(
+          thread, __func__,
+          [rawCallback,
+           helper](RefPtr<GMPContentParent::CloseBlocker> wrapper) {
+            RefPtr<GMPContentParent> parent = wrapper->mParent;
+            UniquePtr<GetGMPVideoEncoderCallback> callback(rawCallback);
+            GMPVideoEncoderParent* actor = nullptr;
+            GMPVideoHostImpl* host = nullptr;
+            if (parent && NS_SUCCEEDED(parent->GetGMPVideoEncoder(&actor))) {
+              host = &(actor->Host());
+              actor->SetCrashHelper(helper);
+            }
+            callback->Done(actor, host);
+          },
+          [rawCallback] {
+            UniquePtr<GetGMPVideoEncoderCallback> callback(rawCallback);
+            callback->Done(nullptr, nullptr);
+          });
 
   return NS_OK;
 }
 
 void GeckoMediaPluginService::ConnectCrashHelper(uint32_t aPluginId,
                                                  GMPCrashHelper* aHelper) {
   if (!aHelper) {
     return;
--- a/dom/media/gmp/GMPServiceParent.cpp
+++ b/dom/media/gmp/GMPServiceParent.cpp
@@ -396,27 +396,28 @@ void GeckoMediaPluginServiceParent::Init
   if (mLoadPluginsFromDiskComplete) {
     return;
   }
 
   RefPtr<GeckoMediaPluginServiceParent> self(this);
   RefPtr<GenericPromise> p = mInitPromise.Ensure(__func__);
   InvokeAsync(aAbstractGMPThread, this, __func__,
               &GeckoMediaPluginServiceParent::LoadFromEnvironment)
-      ->Then(aAbstractGMPThread, __func__,
-             [self]() -> void {
-               MonitorAutoLock lock(self->mInitPromiseMonitor);
-               self->mLoadPluginsFromDiskComplete = true;
-               self->mInitPromise.Resolve(true, __func__);
-             },
-             [self]() -> void {
-               MonitorAutoLock lock(self->mInitPromiseMonitor);
-               self->mLoadPluginsFromDiskComplete = true;
-               self->mInitPromise.Reject(NS_ERROR_FAILURE, __func__);
-             });
+      ->Then(
+          aAbstractGMPThread, __func__,
+          [self]() -> void {
+            MonitorAutoLock lock(self->mInitPromiseMonitor);
+            self->mLoadPluginsFromDiskComplete = true;
+            self->mInitPromise.Resolve(true, __func__);
+          },
+          [self]() -> void {
+            MonitorAutoLock lock(self->mInitPromiseMonitor);
+            self->mLoadPluginsFromDiskComplete = true;
+            self->mInitPromise.Reject(NS_ERROR_FAILURE, __func__);
+          });
 }
 
 void GeckoMediaPluginServiceParent::NotifySyncShutdownComplete() {
   MOZ_ASSERT(NS_IsMainThread());
   mWaitingForPluginsSyncShutdown = false;
 }
 
 bool GeckoMediaPluginServiceParent::IsShuttingDown() {
@@ -502,22 +503,22 @@ RefPtr<GenericPromise> GeckoMediaPluginS
       promises.AppendElement(
           AddOnGMPThread(nsString(Substring(allpaths, pos, next - pos))));
       pos = next + 1;
     }
   }
 
   mScannedPluginOnDisk = true;
   return GenericPromise::All(thread, promises)
-      ->Then(thread, __func__,
-             []() { return GenericPromise::CreateAndResolve(true, __func__); },
-             []() {
-               return GenericPromise::CreateAndReject(NS_ERROR_FAILURE,
-                                                      __func__);
-             });
+      ->Then(
+          thread, __func__,
+          []() { return GenericPromise::CreateAndResolve(true, __func__); },
+          []() {
+            return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
+          });
 }
 
 class NotifyObserversTask final : public mozilla::Runnable {
  public:
   explicit NotifyObserversTask(const char* aTopic,
                                nsString aData = EmptyString())
       : Runnable(aTopic), mTopic(aTopic), mData(aData) {}
   NS_IMETHOD Run() override {
@@ -607,33 +608,34 @@ RefPtr<GenericPromise> GeckoMediaPluginS
   if (!thread) {
     return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
   }
 
   nsString dir(aDirectory);
   RefPtr<GeckoMediaPluginServiceParent> self = this;
   return InvokeAsync(thread, this, __func__,
                      &GeckoMediaPluginServiceParent::AddOnGMPThread, dir)
-      ->Then(mMainThread, __func__,
-             [dir, self](bool aVal) {
-               LOGD(
-                   ("GeckoMediaPluginServiceParent::AsyncAddPluginDirectory %s "
-                    "succeeded",
-                    NS_ConvertUTF16toUTF8(dir).get()));
-               MOZ_ASSERT(NS_IsMainThread());
-               self->UpdateContentProcessGMPCapabilities();
-               return GenericPromise::CreateAndResolve(aVal, __func__);
-             },
-             [dir](nsresult aResult) {
-               LOGD(
-                   ("GeckoMediaPluginServiceParent::AsyncAddPluginDirectory %s "
-                    "failed",
-                    NS_ConvertUTF16toUTF8(dir).get()));
-               return GenericPromise::CreateAndReject(aResult, __func__);
-             });
+      ->Then(
+          mMainThread, __func__,
+          [dir, self](bool aVal) {
+            LOGD(
+                ("GeckoMediaPluginServiceParent::AsyncAddPluginDirectory %s "
+                 "succeeded",
+                 NS_ConvertUTF16toUTF8(dir).get()));
+            MOZ_ASSERT(NS_IsMainThread());
+            self->UpdateContentProcessGMPCapabilities();
+            return GenericPromise::CreateAndResolve(aVal, __func__);
+          },
+          [dir](nsresult aResult) {
+            LOGD(
+                ("GeckoMediaPluginServiceParent::AsyncAddPluginDirectory %s "
+                 "failed",
+                 NS_ConvertUTF16toUTF8(dir).get()));
+            return GenericPromise::CreateAndReject(aResult, __func__);
+          });
 }
 
 NS_IMETHODIMP
 GeckoMediaPluginServiceParent::AddPluginDirectory(const nsAString& aDirectory) {
   MOZ_ASSERT(NS_IsMainThread());
   RefPtr<GenericPromise> p = AsyncAddPluginDirectory(aDirectory);
   Unused << p;
   return NS_OK;
--- a/dom/media/gtest/TestCDMStorage.cpp
+++ b/dom/media/gtest/TestCDMStorage.cpp
@@ -394,34 +394,36 @@ class CDMStorageTest {
 
     nsTArray<nsCString> tags;
     tags.AppendElement(NS_LITERAL_CSTRING("fake"));
 
     RefPtr<CDMStorageTest> self = this;
     RefPtr<gmp::GetCDMParentPromise> promise =
         service->GetCDM(aNodeId, std::move(tags), nullptr);
     auto thread = GetAbstractGMPThread();
-    promise->Then(thread, __func__,
-                  [self, aUpdates, thread](RefPtr<gmp::ChromiumCDMParent> cdm) {
-                    self->mCDM = cdm;
-                    EXPECT_TRUE(!!self->mCDM);
-                    self->mCallback.reset(new CallbackProxy(self));
-                    nsCString failureReason;
-                    self->mCDM
-                        ->Init(self->mCallback.get(), false, true,
-                               GetMainThreadEventTarget())
-                        ->Then(thread, __func__,
-                               [self, aUpdates] {
-                                 for (auto& update : aUpdates) {
-                                   self->Update(update);
-                                 }
-                               },
-                               [](MediaResult rv) { EXPECT_TRUE(false); });
+    promise->Then(
+        thread, __func__,
+        [self, aUpdates, thread](RefPtr<gmp::ChromiumCDMParent> cdm) {
+          self->mCDM = cdm;
+          EXPECT_TRUE(!!self->mCDM);
+          self->mCallback.reset(new CallbackProxy(self));
+          nsCString failureReason;
+          self->mCDM
+              ->Init(self->mCallback.get(), false, true,
+                     GetMainThreadEventTarget())
+              ->Then(
+                  thread, __func__,
+                  [self, aUpdates] {
+                    for (auto& update : aUpdates) {
+                      self->Update(update);
+                    }
                   },
                   [](MediaResult rv) { EXPECT_TRUE(false); });
+        },
+        [](MediaResult rv) { EXPECT_TRUE(false); });
   }
 
   void TestBasicStorage() {
     AssertIsOnGMPThread();
     EXPECT_TRUE(IsCDMStorageIsEmpty());
 
     RefPtr<GeckoMediaPluginService> service =
         GeckoMediaPluginService::GetGeckoMediaPluginService();
--- a/dom/media/gtest/TestMP4Demuxer.cpp
+++ b/dom/media/gtest/TestMP4Demuxer.cpp
@@ -148,25 +148,26 @@ class MP4DemuxerBinding {
 
 TEST(MP4Demuxer, Seek) {
   RefPtr<MP4DemuxerBinding> binding = new MP4DemuxerBinding();
 
   binding->RunTestAndWait([binding]() {
     binding->mVideoTrack =
         binding->mDemuxer->GetTrackDemuxer(TrackInfo::kVideoTrack, 0);
     binding->CheckTrackSamples(binding->mVideoTrack)
-        ->Then(binding->mTaskQueue, __func__,
-               [binding]() {
-                 binding->CheckTrackKeyFrame(binding->mVideoTrack)
-                     ->Then(
-                         binding->mTaskQueue, __func__,
-                         [binding]() { binding->mTaskQueue->BeginShutdown(); },
-                         DO_FAIL);
-               },
-               DO_FAIL);
+        ->Then(
+            binding->mTaskQueue, __func__,
+            [binding]() {
+              binding->CheckTrackKeyFrame(binding->mVideoTrack)
+                  ->Then(
+                      binding->mTaskQueue, __func__,
+                      [binding]() { binding->mTaskQueue->BeginShutdown(); },
+                      DO_FAIL);
+            },
+            DO_FAIL);
   });
 }
 
 static nsCString ToCryptoString(const CryptoSample& aCrypto) {
   nsCString res;
   if (aCrypto.IsEncrypted()) {
     res.AppendPrintf("%d ", aCrypto.mIVSize);
     for (size_t i = 0; i < aCrypto.mKeyId.Length(); i++) {
@@ -313,27 +314,27 @@ TEST(MP4Demuxer, CENCFragVideo) {
 
   RefPtr<MP4DemuxerBinding> binding = new MP4DemuxerBinding("gizmo-frag.mp4");
 
   binding->RunTestAndWait([binding, video]() {
     // grab all video samples.
     binding->mVideoTrack =
         binding->mDemuxer->GetTrackDemuxer(TrackInfo::kVideoTrack, 0);
     binding->CheckTrackSamples(binding->mVideoTrack)
-        ->Then(binding->mTaskQueue, __func__,
-               [binding, video]() {
-                 for (uint32_t i = 0; i < binding->mSamples.Length(); i++) {
-                   nsCString text =
-                       ToCryptoString(binding->mSamples[i]->mCrypto);
-                   EXPECT_STREQ(video[i++], text.get());
-                 }
-                 EXPECT_EQ(ArrayLength(video), binding->mSamples.Length());
-                 binding->mTaskQueue->BeginShutdown();
-               },
-               DO_FAIL);
+        ->Then(
+            binding->mTaskQueue, __func__,
+            [binding, video]() {
+              for (uint32_t i = 0; i < binding->mSamples.Length(); i++) {
+                nsCString text = ToCryptoString(binding->mSamples[i]->mCrypto);
+                EXPECT_STREQ(video[i++], text.get());
+              }
+              EXPECT_EQ(ArrayLength(video), binding->mSamples.Length());
+              binding->mTaskQueue->BeginShutdown();
+            },
+            DO_FAIL);
   });
 }
 
 TEST(MP4Demuxer, CENCFragAudio) {
   const char* audio[] = {
       "16 7e571d047e571d047e571d047e571d04 00000000000000000000000000000000 "
       "0,281",
       "16 7e571d047e571d047e571d047e571d04 00000000000000000000000000000012 "
@@ -526,28 +527,28 @@ TEST(MP4Demuxer, CENCFragAudio) {
 
   RefPtr<MP4DemuxerBinding> binding = new MP4DemuxerBinding("gizmo-frag.mp4");
 
   binding->RunTestAndWait([binding, audio]() {
     // grab all audio samples.
     binding->mAudioTrack =
         binding->mDemuxer->GetTrackDemuxer(TrackInfo::kAudioTrack, 0);
     binding->CheckTrackSamples(binding->mAudioTrack)
-        ->Then(binding->mTaskQueue, __func__,
-               [binding, audio]() {
-                 EXPECT_TRUE(binding->mSamples.Length() > 1);
-                 for (uint32_t i = 0; i < binding->mSamples.Length(); i++) {
-                   nsCString text =
-                       ToCryptoString(binding->mSamples[i]->mCrypto);
-                   EXPECT_STREQ(audio[i++], text.get());
-                 }
-                 EXPECT_EQ(ArrayLength(audio), binding->mSamples.Length());
-                 binding->mTaskQueue->BeginShutdown();
-               },
-               DO_FAIL);
+        ->Then(
+            binding->mTaskQueue, __func__,
+            [binding, audio]() {
+              EXPECT_TRUE(binding->mSamples.Length() > 1);
+              for (uint32_t i = 0; i < binding->mSamples.Length(); i++) {
+                nsCString text = ToCryptoString(binding->mSamples[i]->mCrypto);
+                EXPECT_STREQ(audio[i++], text.get());
+              }
+              EXPECT_EQ(ArrayLength(audio), binding->mSamples.Length());
+              binding->mTaskQueue->BeginShutdown();
+            },
+            DO_FAIL);
   });
 }
 
 TEST(MP4Demuxer, GetNextKeyframe) {
   RefPtr<MP4DemuxerBinding> binding = new MP4DemuxerBinding("gizmo-frag.mp4");
 
   binding->RunTestAndWait([binding]() {
     // Insert a [0,end] buffered range, to simulate Moof's being buffered
--- a/dom/media/gtest/TestMediaDataEncoder.cpp
+++ b/dom/media/gtest/TestMediaDataEncoder.cpp
@@ -80,25 +80,26 @@ static already_AddRefed<MediaDataEncoder
 }
 
 void WaitForShutdown(RefPtr<MediaDataEncoder> aEncoder) {
   MOZ_ASSERT(aEncoder);
 
   Maybe<bool> result;
   // media::Await() supports exclusive promises only, but ShutdownPromise is
   // not.
-  aEncoder->Shutdown()->Then(AbstractThread::MainThread(), __func__,
-                             [&result](bool rv) {
-                               EXPECT_TRUE(rv);
-                               result = Some(true);
-                             },
-                             [&result]() {
-                               FAIL() << "Shutdown should never be rejected";
-                               result = Some(false);
-                             });
+  aEncoder->Shutdown()->Then(
+      AbstractThread::MainThread(), __func__,
+      [&result](bool rv) {
+        EXPECT_TRUE(rv);
+        result = Some(true);
+      },
+      [&result]() {
+        FAIL() << "Shutdown should never be rejected";
+        result = Some(false);
+      });
   SpinEventLoopUntil([&result]() { return result; });
 }
 
 TEST_F(MediaDataEncoderTest, H264Create) {
   SKIP_IF_NOT_SUPPORTED(VIDEO_MP4);
 
   RefPtr<MediaDataEncoder> e =
       CreateH264Encoder(MediaDataEncoder::Usage::Realtime,
@@ -110,22 +111,23 @@ TEST_F(MediaDataEncoderTest, H264Create)
 }
 
 static bool EnsureInit(RefPtr<MediaDataEncoder> aEncoder) {
   if (!aEncoder) {
     return false;
   }
 
   bool succeeded;
-  media::Await(GetMediaThreadPool(MediaThreadType::PLAYBACK), aEncoder->Init(),
-               [&succeeded](TrackInfo::TrackType t) {
-                 EXPECT_EQ(TrackInfo::TrackType::kVideoTrack, t);
-                 succeeded = true;
-               },
-               [&succeeded](MediaResult r) { succeeded = false; });
+  media::Await(
+      GetMediaThreadPool(MediaThreadType::PLAYBACK), aEncoder->Init(),
+      [&succeeded](TrackInfo::TrackType t) {
+        EXPECT_EQ(TrackInfo::TrackType::kVideoTrack, t);
+        succeeded = true;
+      },
+      [&succeeded](MediaResult r) { succeeded = false; });
   return succeeded;
 }
 
 TEST_F(MediaDataEncoderTest, H264Init) {
   SKIP_IF_NOT_SUPPORTED(VIDEO_MP4);
 
   RefPtr<MediaDataEncoder> e =
       CreateH264Encoder(MediaDataEncoder::Usage::Realtime,
@@ -144,23 +146,23 @@ static MediaDataEncoder::EncodedData Enc
   for (size_t i = 0; i < aNumFrames; i++) {
     RefPtr<layers::PlanarYCbCrImage> img =
         new layers::RecyclingPlanarYCbCrImage(new layers::BufferRecycleBin());
     img->AdoptData(aYCbCrData);
     RefPtr<MediaData> frame = VideoData::CreateFromImage(
         kImageSize, 0, TimeUnit::FromMicroseconds(i * 30000),
         TimeUnit::FromMicroseconds(30000), img, (i & 0xF) == 0,
         TimeUnit::FromMicroseconds(i * 30000));
-    media::Await(GetMediaThreadPool(MediaThreadType::PLAYBACK),
-                 aEncoder->Encode(frame),
-                 [&output, &succeeded](MediaDataEncoder::EncodedData encoded) {
-                   output.AppendElements(std::move(encoded));
-                   succeeded = true;
-                 },
-                 [&succeeded](MediaResult r) { succeeded = false; });
+    media::Await(
+        GetMediaThreadPool(MediaThreadType::PLAYBACK), aEncoder->Encode(frame),
+        [&output, &succeeded](MediaDataEncoder::EncodedData encoded) {
+          output.AppendElements(std::move(encoded));
+          succeeded = true;
+        },
+        [&succeeded](MediaResult r) { succeeded = false; });
     EXPECT_TRUE(succeeded);
     if (!succeeded) {
       return output;
     }
   }
 
   size_t pending = 0;
   media::Await(
@@ -172,23 +174,23 @@ static MediaDataEncoder::EncodedData Enc
       },
       [&succeeded](MediaResult r) { succeeded = false; });
   EXPECT_TRUE(succeeded);
   if (!succeeded) {
     return output;
   }
 
   if (pending > 0) {
-    media::Await(GetMediaThreadPool(MediaThreadType::PLAYBACK),
-                 aEncoder->Drain(),
-                 [&succeeded](MediaDataEncoder::EncodedData encoded) {
-                   EXPECT_EQ(encoded.Length(), 0UL);
-                   succeeded = true;
-                 },
-                 [&succeeded](MediaResult r) { succeeded = false; });
+    media::Await(
+        GetMediaThreadPool(MediaThreadType::PLAYBACK), aEncoder->Drain(),
+        [&succeeded](MediaDataEncoder::EncodedData encoded) {
+          EXPECT_EQ(encoded.Length(), 0UL);
+          succeeded = true;
+        },
+        [&succeeded](MediaResult r) { succeeded = false; });
     EXPECT_TRUE(succeeded);
   }
 
   return output;
 }
 
 TEST_F(MediaDataEncoderTest, H264EncodeOneFrameAsAnnexB) {
   SKIP_IF_NOT_SUPPORTED(VIDEO_MP4);
--- a/dom/media/ipc/RemoteDecoderModule.cpp
+++ b/dom/media/ipc/RemoteDecoderModule.cpp
@@ -60,18 +60,17 @@ already_AddRefed<MediaDataDecoder> Remot
   RefPtr<RemoteAudioDecoderChild> child = new RemoteAudioDecoderChild();
   RefPtr<RemoteMediaDataDecoder> object = new RemoteMediaDataDecoder(
       child, RemoteDecoderManagerChild::GetManagerThread(),
       RemoteDecoderManagerChild::GetManagerAbstractThread());
 
   MediaResult result(NS_OK);
   RefPtr<Runnable> task = NS_NewRunnableFunction(
       "RemoteDecoderModule::CreateAudioDecoder", [&, child]() {
-        result = child->InitIPDL(aParams.AudioConfig(),
-                                 aParams.mOptions);
+        result = child->InitIPDL(aParams.AudioConfig(), aParams.mOptions);
       });
   SyncRunnable::DispatchToThread(RemoteDecoderManagerChild::GetManagerThread(),
                                  task);
 
   if (NS_FAILED(result)) {
     if (aParams.mError) {
       *aParams.mError = result;
     }
@@ -95,18 +94,17 @@ already_AddRefed<MediaDataDecoder> Remot
   RefPtr<RemoteVideoDecoderChild> child = new RemoteVideoDecoderChild();
   RefPtr<RemoteMediaDataDecoder> object = new RemoteMediaDataDecoder(
       child, RemoteDecoderManagerChild::GetManagerThread(),
       RemoteDecoderManagerChild::GetManagerAbstractThread());
 
   MediaResult result(NS_OK);
   RefPtr<Runnable> task = NS_NewRunnableFunction(
       "RemoteDecoderModule::CreateVideoDecoder", [&, child]() {
-        result = child->InitIPDL(aParams.VideoConfig(),
-                                 aParams.mRate.mValue,
+        result = child->InitIPDL(aParams.VideoConfig(), aParams.mRate.mValue,
                                  aParams.mOptions);
       });
   SyncRunnable::DispatchToThread(RemoteDecoderManagerChild::GetManagerThread(),
                                  task);
 
   if (NS_FAILED(result)) {
     if (aParams.mError) {
       *aParams.mError = result;
--- a/dom/media/ipc/RemoteDecoderParent.cpp
+++ b/dom/media/ipc/RemoteDecoderParent.cpp
@@ -36,31 +36,32 @@ void RemoteDecoderParent::Destroy() {
   MOZ_ASSERT(OnManagerThread());
   mDestroyed = true;
   mIPDLSelfRef = nullptr;
 }
 
 mozilla::ipc::IPCResult RemoteDecoderParent::RecvInit() {
   MOZ_ASSERT(OnManagerThread());
   RefPtr<RemoteDecoderParent> self = this;
-  mDecoder->Init()->Then(mManagerTaskQueue, __func__,
-                         [self](TrackInfo::TrackType aTrack) {
-                           MOZ_ASSERT(aTrack == TrackInfo::kAudioTrack ||
-                                      aTrack == TrackInfo::kVideoTrack);
-                           if (self->mDecoder) {
-                             Unused << self->SendInitComplete(
-                                 aTrack, self->mDecoder->GetDescriptionName(),
-                                 self->mDecoder->NeedsConversion());
-                           }
-                         },
-                         [self](MediaResult aReason) {
-                           if (!self->mDestroyed) {
-                             Unused << self->SendInitFailed(aReason);
-                           }
-                         });
+  mDecoder->Init()->Then(
+      mManagerTaskQueue, __func__,
+      [self](TrackInfo::TrackType aTrack) {
+        MOZ_ASSERT(aTrack == TrackInfo::kAudioTrack ||
+                   aTrack == TrackInfo::kVideoTrack);
+        if (self->mDecoder) {
+          Unused << self->SendInitComplete(aTrack,
+                                           self->mDecoder->GetDescriptionName(),
+                                           self->mDecoder->NeedsConversion());
+        }
+      },
+      [self](MediaResult aReason) {
+        if (!self->mDestroyed) {
+          Unused << self->SendInitFailed(aReason);
+        }
+      });
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult RemoteDecoderParent::RecvInput(
     const MediaRawDataIPDL& aData) {
   MOZ_ASSERT(OnManagerThread());
   // XXX: This copies the data into a buffer owned by the MediaRawData. Ideally
   // we'd just take ownership of the shmem.
--- a/dom/media/ipc/RemoteMediaDataDecoder.cpp
+++ b/dom/media/ipc/RemoteMediaDataDecoder.cpp
@@ -39,28 +39,29 @@ RemoteMediaDataDecoder::~RemoteMediaData
 
   mManagerThread->Dispatch(task.forget(), NS_DISPATCH_NORMAL);
 }
 
 RefPtr<MediaDataDecoder::InitPromise> RemoteMediaDataDecoder::Init() {
   RefPtr<RemoteMediaDataDecoder> self = this;
   return InvokeAsync(mAbstractManagerThread, __func__,
                      [self]() { return self->mChild->Init(); })
-      ->Then(mAbstractManagerThread, __func__,
-             [self, this](TrackType aTrack) {
-               mDescription = mChild->GetDescriptionName() +
-                              NS_LITERAL_CSTRING(" (remote)");
-               mIsHardwareAccelerated =
-                   mChild->IsHardwareAccelerated(mHardwareAcceleratedReason);
-               mConversion = mChild->NeedsConversion();
-               return InitPromise::CreateAndResolve(aTrack, __func__);
-             },
-             [self](const MediaResult& aError) {
-               return InitPromise::CreateAndReject(aError, __func__);
-             });
+      ->Then(
+          mAbstractManagerThread, __func__,
+          [self, this](TrackType aTrack) {
+            mDescription =
+                mChild->GetDescriptionName() + NS_LITERAL_CSTRING(" (remote)");
+            mIsHardwareAccelerated =
+                mChild->IsHardwareAccelerated(mHardwareAcceleratedReason);
+            mConversion = mChild->NeedsConversion();
+            return InitPromise::CreateAndResolve(aTrack, __func__);
+          },
+          [self](const MediaResult& aError) {
+            return InitPromise::CreateAndReject(aError, __func__);
+          });
 }
 
 RefPtr<MediaDataDecoder::DecodePromise> RemoteMediaDataDecoder::Decode(
     MediaRawData* aSample) {
   RefPtr<RemoteMediaDataDecoder> self = this;
   RefPtr<MediaRawData> sample = aSample;
   return InvokeAsync(mAbstractManagerThread, __func__,
                      [self, sample]() { return self->mChild->Decode(sample); });
--- a/dom/media/mediasink/VideoSink.cpp
+++ b/dom/media/mediasink/VideoSink.cpp
@@ -257,31 +257,32 @@ nsresult VideoSink::Start(const TimeUnit
     // If the underlying MediaSink has an end promise for the video track (which
     // happens when mAudioSink refers to a DecodedStream), we must wait for it
     // to complete before resolving our own end promise. Otherwise, MDSM might
     // stop playback before DecodedStream plays to the end and cause
     // test_streams_element_capture.html to time out.
     RefPtr<EndedPromise> p = mAudioSink->OnEnded(TrackInfo::kVideoTrack);
     if (p) {
       RefPtr<VideoSink> self = this;
-      p->Then(mOwnerThread, __func__,
-              [self]() {
-                self->mVideoSinkEndRequest.Complete();
-                self->TryUpdateRenderedVideoFrames();
-                // It is possible the video queue size is 0 and we have no
-                // frames to render. However, we need to call
-                // MaybeResolveEndPromise() to ensure mEndPromiseHolder is
-                // resolved.
-                self->MaybeResolveEndPromise();
-              },
-              [self]() {
-                self->mVideoSinkEndRequest.Complete();
-                self->TryUpdateRenderedVideoFrames();
-                self->MaybeResolveEndPromise();
-              })
+      p->Then(
+           mOwnerThread, __func__,
+           [self]() {
+             self->mVideoSinkEndRequest.Complete();
+             self->TryUpdateRenderedVideoFrames();
+             // It is possible the video queue size is 0 and we have no
+             // frames to render. However, we need to call
+             // MaybeResolveEndPromise() to ensure mEndPromiseHolder is
+             // resolved.
+             self->MaybeResolveEndPromise();
+           },
+           [self]() {
+             self->mVideoSinkEndRequest.Complete();
+             self->TryUpdateRenderedVideoFrames();
+             self->MaybeResolveEndPromise();
+           })
           ->Track(mVideoSinkEndRequest);
     }
 
     ConnectListener();
     // Run the render loop at least once so we can resolve the end promise
     // when video duration is 0.
     UpdateRenderedVideoFrames();
   }
--- a/dom/media/mediasource/SourceBuffer.cpp
+++ b/dom/media/mediasource/SourceBuffer.cpp
@@ -323,22 +323,23 @@ void SourceBuffer::PrepareRemove(double 
 }
 
 void SourceBuffer::RangeRemoval(double aStart, double aEnd) {
   StartUpdating();
 
   RefPtr<SourceBuffer> self = this;
   mTrackBuffersManager
       ->RangeRemoval(TimeUnit::FromSeconds(aStart), TimeUnit::FromSeconds(aEnd))
-      ->Then(mAbstractMainThread, __func__,
-             [self](bool) {
-               self->mPendingRemoval.Complete();
-               self->StopUpdating();
-             },
-             []() { MOZ_ASSERT(false); })
+      ->Then(
+          mAbstractMainThread, __func__,
+          [self](bool) {
+            self->mPendingRemoval.Complete();
+            self->StopUpdating();
+          },
+          []() { MOZ_ASSERT(false); })
       ->Track(mPendingRemoval);
 }
 
 void SourceBuffer::ChangeType(const nsAString& aType, ErrorResult& aRv) {
   MOZ_ASSERT(NS_IsMainThread());
 
   // 1. If type is an empty string then throw a TypeError exception and abort
   //    these steps.
--- a/dom/media/mediasource/TrackBuffersManager.cpp
+++ b/dom/media/mediasource/TrackBuffersManager.cpp
@@ -806,29 +806,30 @@ void TrackBuffersManager::SegmentParserL
           return;
         }
       }
 
       // 3. If the input buffer contains one or more complete coded frames, then
       // run the coded frame processing algorithm.
       RefPtr<TrackBuffersManager> self = this;
       CodedFrameProcessing()
-          ->Then(TaskQueueFromTaskQueue(), __func__,
-                 [self](bool aNeedMoreData) {
-                   self->mProcessingRequest.Complete();
-                   if (aNeedMoreData) {
-                     self->NeedMoreData();
-                   } else {
-                     self->ScheduleSegmentParserLoop();
-                   }
-                 },
-                 [self](const MediaResult& aRejectValue) {
-                   self->mProcessingRequest.Complete();
-                   self->RejectAppend(aRejectValue, __func__);
-                 })
+          ->Then(
+              TaskQueueFromTaskQueue(), __func__,
+              [self](bool aNeedMoreData) {
+                self->mProcessingRequest.Complete();
+                if (aNeedMoreData) {
+                  self->NeedMoreData();
+                } else {
+                  self->ScheduleSegmentParserLoop();
+                }
+              },
+              [self](const MediaResult& aRejectValue) {
+                self->mProcessingRequest.Complete();
+                self->RejectAppend(aRejectValue, __func__);
+              })
           ->Track(mProcessingRequest);
       return;
     }
   }
 }
 
 void TrackBuffersManager::NeedMoreData() {
   MSE_DEBUG("");
--- a/dom/media/platforms/AllocationPolicy.cpp
+++ b/dom/media/platforms/AllocationPolicy.cpp
@@ -135,28 +135,29 @@ auto SingleAllocPolicy::Alloc() -> RefPt
   RefPtr<SingleAllocPolicy> self = this;
   return AllocPolicyImpl::Alloc()->Then(
       mOwnerThread, __func__,
       [self](RefPtr<Token> aToken) {
         RefPtr<Token> localToken = aToken.forget();
         RefPtr<Promise> p = self->mPendingPromise.Ensure(__func__);
         GlobalAllocPolicy::Instance(self->mTrack)
             ->Alloc()
-            ->Then(self->mOwnerThread, __func__,
-                   [self, localToken = std::move(localToken)](
-                       RefPtr<Token> aToken) mutable {
-                     self->mTokenRequest.Complete();
-                     RefPtr<Token> combinedToken = new AutoDeallocCombinedToken(
-                         localToken.forget(), aToken.forget());
-                     self->mPendingPromise.Resolve(combinedToken, __func__);
-                   },
-                   [self]() {
-                     self->mTokenRequest.Complete();
-                     self->mPendingPromise.Reject(true, __func__);
-                   })
+            ->Then(
+                self->mOwnerThread, __func__,
+                [self, localToken = std::move(localToken)](
+                    RefPtr<Token> aToken) mutable {
+                  self->mTokenRequest.Complete();
+                  RefPtr<Token> combinedToken = new AutoDeallocCombinedToken(
+                      localToken.forget(), aToken.forget());
+                  self->mPendingPromise.Resolve(combinedToken, __func__);
+                },
+                [self]() {
+                  self->mTokenRequest.Complete();
+                  self->mPendingPromise.Reject(true, __func__);
+                })
             ->Track(self->mTokenRequest);
         return p;
       },
       []() { return Promise::CreateAndReject(true, __func__); });
 }
 
 SingleAllocPolicy::~SingleAllocPolicy() {
   mPendingPromise.RejectIfExists(true, __func__);
@@ -207,53 +208,53 @@ AllocationWrapper::CreateDecoder(const C
   MediaEventProducer<TrackInfo::TrackType>* onWaitingForKeyEvent =
       aParams.mOnWaitingForKeyEvent;
   CreateDecoderParams::OptionSet options = aParams.mOptions;
   CreateDecoderParams::VideoFrameRate rate = aParams.mRate;
 
   RefPtr<AllocateDecoderPromise> p =
       (aPolicy ? aPolicy : GlobalAllocPolicy::Instance(aParams.mType))
           ->Alloc()
-          ->Then(AbstractThread::GetCurrent(), __func__,
-                 [=](RefPtr<Token> aToken) {
-                   // result may not always be updated by
-                   // PDMFactory::CreateDecoder either when the creation
-                   // succeeded or failed, 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(type)));
-                   RefPtr<PDMFactory> pdm = new PDMFactory();
-                   CreateDecoderParams params{*config,
-                                              taskQueue,
-                                              diagnostics,
-                                              imageContainer,
-                                              &result,
-                                              knowsCompositor,
-                                              crashHelper,
-                                              useNullDecoder,
-                                              noWrapper,
-                                              type,
-                                              onWaitingForKeyEvent,
-                                              options,
-                                              rate};
-                   RefPtr<MediaDataDecoder> decoder =
-                       pdm->CreateDecoder(params);
-                   if (decoder) {
-                     RefPtr<AllocationWrapper> wrapper = new AllocationWrapper(
-                         decoder.forget(), aToken.forget());
-                     return AllocateDecoderPromise::CreateAndResolve(wrapper,
-                                                                     __func__);
-                   }
-                   return AllocateDecoderPromise::CreateAndReject(result,
+          ->Then(
+              AbstractThread::GetCurrent(), __func__,
+              [=](RefPtr<Token> aToken) {
+                // result may not always be updated by
+                // PDMFactory::CreateDecoder either when the creation
+                // succeeded or failed, 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(type)));
+                RefPtr<PDMFactory> pdm = new PDMFactory();
+                CreateDecoderParams params{*config,
+                                           taskQueue,
+                                           diagnostics,
+                                           imageContainer,
+                                           &result,
+                                           knowsCompositor,
+                                           crashHelper,
+                                           useNullDecoder,
+                                           noWrapper,
+                                           type,
+                                           onWaitingForKeyEvent,
+                                           options,
+                                           rate};
+                RefPtr<MediaDataDecoder> decoder = pdm->CreateDecoder(params);
+                if (decoder) {
+                  RefPtr<AllocationWrapper> wrapper =
+                      new AllocationWrapper(decoder.forget(), aToken.forget());
+                  return AllocateDecoderPromise::CreateAndResolve(wrapper,
                                                                   __func__);
-                 },
-                 []() {
-                   return AllocateDecoderPromise::CreateAndReject(
-                       MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
-                                   "Allocation policy expired"),
-                       __func__);
-                 });
+                }
+                return AllocateDecoderPromise::CreateAndReject(result,
+                                                               __func__);
+              },
+              []() {
+                return AllocateDecoderPromise::CreateAndReject(
+                    MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
+                                "Allocation policy expired"),
+                    __func__);
+              });
   return p;
 }
 
 }  // namespace mozilla
--- a/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp
+++ b/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp
@@ -96,39 +96,41 @@ class EMEDecryptor : public MediaDataDec
     RefPtr<EMEDecryptor> self = this;
     RefPtr<MediaRawData> sample = aSample;
     return InvokeAsync(mTaskQueue, __func__, [self, this, sample]() {
       MOZ_RELEASE_ASSERT(mDecrypts.Count() == 0,
                          "Can only process one sample at a time");
       RefPtr<DecodePromise> p = mDecodePromise.Ensure(__func__);
 
       mSamplesWaitingForKey->WaitIfKeyNotUsable(sample)
-          ->Then(mTaskQueue, __func__,
-                 [self](const RefPtr<MediaRawData>& aSample) {
-                   self->mKeyRequest.Complete();
-                   self->ThrottleDecode(aSample);
-                 },
-                 [self]() { self->mKeyRequest.Complete(); })
+          ->Then(
+              mTaskQueue, __func__,
+              [self](const RefPtr<MediaRawData>& aSample) {
+                self->mKeyRequest.Complete();
+                self->ThrottleDecode(aSample);
+              },
+              [self]() { self->mKeyRequest.Complete(); })
           ->Track(mKeyRequest);
 
       return p;
     });
   }
 
   void ThrottleDecode(MediaRawData* aSample) {
     MOZ_ASSERT(mTaskQueue->IsCurrentThreadIn());
 
     RefPtr<EMEDecryptor> self = this;
     mThroughputLimiter.Throttle(aSample)
-        ->Then(mTaskQueue, __func__,
-               [self](RefPtr<MediaRawData> aSample) {
-                 self->mThrottleRequest.Complete();
-                 self->AttemptDecode(aSample);
-               },
-               [self]() { self->mThrottleRequest.Complete(); })
+        ->Then(
+            mTaskQueue, __func__,
+            [self](RefPtr<MediaRawData> aSample) {
+              self->mThrottleRequest.Complete();
+              self->AttemptDecode(aSample);
+            },
+            [self]() { self->mThrottleRequest.Complete(); })
         ->Track(mThrottleRequest);
   }
 
   void AttemptDecode(MediaRawData* aSample) {
     MOZ_ASSERT(mTaskQueue->IsCurrentThreadIn());
     if (mIsShutdown) {
       NS_WARNING("EME encrypted sample arrived after shutdown");
       mDecodePromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__);
@@ -306,34 +308,35 @@ EMEMediaDataDecoderProxy::EMEMediaDataDe
 
 RefPtr<MediaDataDecoder::DecodePromise> EMEMediaDataDecoderProxy::Decode(
     MediaRawData* aSample) {
   RefPtr<EMEMediaDataDecoderProxy> self = this;
   RefPtr<MediaRawData> sample = aSample;
   return InvokeAsync(mThread, __func__, [self, this, sample]() {
     RefPtr<DecodePromise> p = mDecodePromise.Ensure(__func__);
     mSamplesWaitingForKey->WaitIfKeyNotUsable(sample)
-        ->Then(mThread, __func__,
-               [self, this](RefPtr<MediaRawData> aSample) {
-                 mKeyRequest.Complete();
+        ->Then(
+            mThread, __func__,
+            [self, this](RefPtr<MediaRawData> aSample) {
+              mKeyRequest.Complete();
 
-                 MediaDataDecoderProxy::Decode(aSample)
-                     ->Then(mThread, __func__,
-                            [self, this](
-                                DecodePromise::ResolveOrRejectValue&& aValue) {
-                              mDecodeRequest.Complete();
-                              mDecodePromise.ResolveOrReject(std::move(aValue),
-                                                             __func__);
-                            })
-                     ->Track(mDecodeRequest);
-               },
-               [self]() {
-                 self->mKeyRequest.Complete();
-                 MOZ_CRASH("Should never get here");
-               })
+              MediaDataDecoderProxy::Decode(aSample)
+                  ->Then(mThread, __func__,
+                         [self,
+                          this](DecodePromise::ResolveOrRejectValue&& aValue) {
+                           mDecodeRequest.Complete();
+                           mDecodePromise.ResolveOrReject(std::move(aValue),
+                                                          __func__);
+                         })
+                  ->Track(mDecodeRequest);
+            },
+            [self]() {
+              self->mKeyRequest.Complete();
+              MOZ_CRASH("Should never get here");
+            })
         ->Track(mKeyRequest);
 
     return p;
   });
 }
 
 RefPtr<MediaDataDecoder::FlushPromise> EMEMediaDataDecoderProxy::Flush() {
   RefPtr<EMEMediaDataDecoderProxy> self = this;
--- a/dom/media/platforms/omx/OmxDataDecoder.cpp
+++ b/dom/media/platforms/omx/OmxDataDecoder.cpp
@@ -134,25 +134,26 @@ RefPtr<MediaDataDecoder::InitPromise> Om
   LOG("");
 
   RefPtr<OmxDataDecoder> self = this;
   return InvokeAsync(mOmxTaskQueue, __func__, [self, this]() {
     InitializationTask();
 
     RefPtr<InitPromise> p = mInitPromise.Ensure(__func__);
     mOmxLayer->Init(mTrackInfo.get())
-        ->Then(mOmxTaskQueue, __func__,
-               [self, this]() {
-                 // Omx state should be OMX_StateIdle.
-                 mOmxState = mOmxLayer->GetState();
-                 MOZ_ASSERT(mOmxState != OMX_StateIdle);
-               },
-               [self, this]() {
-                 RejectInitPromise(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__);
-               });
+        ->Then(
+            mOmxTaskQueue, __func__,
+            [self, this]() {
+              // Omx state should be OMX_StateIdle.
+              mOmxState = mOmxLayer->GetState();
+              MOZ_ASSERT(mOmxState != OMX_StateIdle);
+            },
+            [self, this]() {
+              RejectInitPromise(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__);
+            });
     return p;
   });
 }
 
 RefPtr<MediaDataDecoder::DecodePromise> OmxDataDecoder::Decode(
     MediaRawData* aSample) {
   LOG("sample %p", aSample);
   MOZ_ASSERT(mInitPromise.IsEmpty());
@@ -206,49 +207,51 @@ RefPtr<ShutdownPromise> OmxDataDecoder::
 
   mWatchManager.Unwatch(mOmxState, &OmxDataDecoder::OmxStateRunner);
   mWatchManager.Unwatch(mPortSettingsChanged,
                         &OmxDataDecoder::PortSettingsChanged);
 
   // Flush to all ports, so all buffers can be returned from component.
   RefPtr<OmxDataDecoder> self = this;
   mOmxLayer->SendCommand(OMX_CommandFlush, OMX_ALL, nullptr)
-      ->Then(mOmxTaskQueue, __func__,
-             [self]() -> RefPtr<OmxCommandPromise> {
-               LOGL("DoAsyncShutdown: flush complete");
-               return self->mOmxLayer->SendCommand(OMX_CommandStateSet,
-                                                   OMX_StateIdle, nullptr);
-             },
-             [self](const OmxCommandFailureHolder& aError) {
-               self->mOmxLayer->Shutdown();
-               return OmxCommandPromise::CreateAndReject(aError, __func__);
-             })
-      ->Then(mOmxTaskQueue, __func__,
-             [self]() -> RefPtr<OmxCommandPromise> {
-               RefPtr<OmxCommandPromise> p = self->mOmxLayer->SendCommand(
-                   OMX_CommandStateSet, OMX_StateLoaded, nullptr);
+      ->Then(
+          mOmxTaskQueue, __func__,
+          [self]() -> RefPtr<OmxCommandPromise> {
+            LOGL("DoAsyncShutdown: flush complete");
+            return self->mOmxLayer->SendCommand(OMX_CommandStateSet,
+                                                OMX_StateIdle, nullptr);
+          },
+          [self](const OmxCommandFailureHolder& aError) {
+            self->mOmxLayer->Shutdown();
+            return OmxCommandPromise::CreateAndReject(aError, __func__);
+          })
+      ->Then(
+          mOmxTaskQueue, __func__,
+          [self]() -> RefPtr<OmxCommandPromise> {
+            RefPtr<OmxCommandPromise> p = self->mOmxLayer->SendCommand(
+                OMX_CommandStateSet, OMX_StateLoaded, nullptr);
 
-               // According to spec 3.1.1.2.2.1:
-               // OMX_StateLoaded needs to be sent before releasing buffers.
-               // And state transition from OMX_StateIdle to OMX_StateLoaded
-               // is completed when all of the buffers have been removed
-               // from the component.
-               // Here the buffer promises are not resolved due to displaying
-               // in layer, it needs to wait before the layer returns the
-               // buffers.
-               LOGL("DoAsyncShutdown: releasing buffers...");
-               self->ReleaseBuffers(OMX_DirInput);
-               self->ReleaseBuffers(OMX_DirOutput);
+            // According to spec 3.1.1.2.2.1:
+            // OMX_StateLoaded needs to be sent before releasing buffers.
+            // And state transition from OMX_StateIdle to OMX_StateLoaded
+            // is completed when all of the buffers have been removed
+            // from the component.
+            // Here the buffer promises are not resolved due to displaying
+            // in layer, it needs to wait before the layer returns the
+            // buffers.
+            LOGL("DoAsyncShutdown: releasing buffers...");
+            self->ReleaseBuffers(OMX_DirInput);
+            self->ReleaseBuffers(OMX_DirOutput);
 
-               return p;
-             },
-             [self](const OmxCommandFailureHolder& aError) {
-               self->mOmxLayer->Shutdown();
-               return OmxCommandPromise::CreateAndReject(aError, __func__);
-             })
+            return p;
+          },
+          [self](const OmxCommandFailureHolder& aError) {
+            self->mOmxLayer->Shutdown();
+            return OmxCommandPromise::CreateAndReject(aError, __func__);
+          })
       ->Then(
           mOmxTaskQueue, __func__,
           [self]() -> RefPtr<ShutdownPromise> {
             LOGL(
                 "DoAsyncShutdown: OMX_StateLoaded, it is safe to shutdown omx");
             self->mOmxLayer->Shutdown();
             self->mWatchManager.Shutdown();
             self->mOmxLayer = nullptr;
@@ -258,27 +261,28 @@ RefPtr<ShutdownPromise> OmxDataDecoder::
           },
           [self]() -> RefPtr<ShutdownPromise> {
             self->mOmxLayer->Shutdown();
             self->mWatchManager.Shutdown();
             self->mOmxLayer = nullptr;
             self->mMediaDataHelper = nullptr;
             return ShutdownPromise::CreateAndReject(false, __func__);
           })
-      ->Then(mTaskQueue, __func__,
-             [self]() {
-               self->mOmxTaskQueue->BeginShutdown();
-               self->mOmxTaskQueue->AwaitShutdownAndIdle();
-               self->mShutdownPromise.Resolve(true, __func__);
-             },
-             [self]() {
-               self->mOmxTaskQueue->BeginShutdown();
-               self->mOmxTaskQueue->AwaitShutdownAndIdle();
-               self->mShutdownPromise.Resolve(true, __func__);
-             });
+      ->Then(
+          mTaskQueue, __func__,
+          [self]() {
+            self->mOmxTaskQueue->BeginShutdown();
+            self->mOmxTaskQueue->AwaitShutdownAndIdle();
+            self->mShutdownPromise.Resolve(true, __func__);
+          },
+          [self]() {
+            self->mOmxTaskQueue->BeginShutdown();
+            self->mOmxTaskQueue->AwaitShutdownAndIdle();
+            self->mShutdownPromise.Resolve(true, __func__);
+          });
   return mShutdownPromise.Ensure(__func__);
 }
 
 void OmxDataDecoder::FillBufferDone(BufferData* aData) {
   MOZ_ASSERT(!aData || aData->mStatus == BufferData::BufferStatus::OMX_CLIENT);
 
   // Don't output sample when flush or shutting down, especially for video
   // decoded frame. Because video decoded frame can have a promise in
@@ -320,28 +324,29 @@ void OmxDataDecoder::Output(BufferData* 
     // limited resource, so we use promise to notify when the resource is free.
     aData->mStatus = BufferData::BufferStatus::OMX_CLIENT_OUTPUT;
 
     MOZ_RELEASE_ASSERT(aData->mPromise.IsEmpty());
     RefPtr<OmxBufferPromise> p = aData->mPromise.Ensure(__func__);
 
     RefPtr<OmxDataDecoder> self = this;
     RefPtr<BufferData> buffer = aData;
-    p->Then(mOmxTaskQueue, __func__,
-            [self, buffer]() {
-              MOZ_RELEASE_ASSERT(buffer->mStatus ==
-                                 BufferData::BufferStatus::OMX_CLIENT_OUTPUT);
-              buffer->mStatus = BufferData::BufferStatus::FREE;
-              self->FillAndEmptyBuffers();
-            },
-            [buffer]() {
-              MOZ_RELEASE_ASSERT(buffer->mStatus ==
-                                 BufferData::BufferStatus::OMX_CLIENT_OUTPUT);
-              buffer->mStatus = BufferData::BufferStatus::FREE;
-            });
+    p->Then(
+        mOmxTaskQueue, __func__,
+        [self, buffer]() {
+          MOZ_RELEASE_ASSERT(buffer->mStatus ==
+                             BufferData::BufferStatus::OMX_CLIENT_OUTPUT);
+          buffer->mStatus = BufferData::BufferStatus::FREE;
+          self->FillAndEmptyBuffers();
+        },
+        [buffer]() {
+          MOZ_RELEASE_ASSERT(buffer->mStatus ==
+                             BufferData::BufferStatus::OMX_CLIENT_OUTPUT);
+          buffer->mStatus = BufferData::BufferStatus::FREE;
+        });
   } else {
     aData->mStatus = BufferData::BufferStatus::FREE;
   }
 
   mDecodedData.AppendElement(std::move(data));
 }
 
 void OmxDataDecoder::FillBufferFailure(OmxBufferFailureHolder aFailureHolder) {
@@ -509,51 +514,51 @@ void OmxDataDecoder::OmxStateRunner() {
   // TODO: maybe it'd be better to use promise CompletionPromise() to replace
   //       this state machine.
   if (mOmxState == OMX_StateLoaded) {
     ConfigCodec();
 
     // Send OpenMax state command to OMX_StateIdle.
     RefPtr<OmxDataDecoder> self = this;
     mOmxLayer->SendCommand(OMX_CommandStateSet, OMX_StateIdle, nullptr)
-        ->Then(mOmxTaskQueue, __func__,
-               [self]() {
-                 // Current state should be OMX_StateIdle.
-                 self->mOmxState = self->mOmxLayer->GetState();
-                 MOZ_ASSERT(self->mOmxState == OMX_StateIdle);
-               },
-               [self]() {
-                 self->RejectInitPromise(NS_ERROR_DOM_MEDIA_FATAL_ERR,
-                                         __func__);
-               });
+        ->Then(
+            mOmxTaskQueue, __func__,
+            [self]() {
+              // Current state should be OMX_StateIdle.
+              self->mOmxState = self->mOmxLayer->GetState();
+              MOZ_ASSERT(self->mOmxState == OMX_StateIdle);
+            },
+            [self]() {
+              self->RejectInitPromise(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__);
+            });
 
     // Allocate input and output buffers.
     OMX_DIRTYPE types[] = {OMX_DIRTYPE::OMX_DirInput,
                            OMX_DIRTYPE::OMX_DirOutput};
     for (const auto id : types) {
       if (NS_FAILED(AllocateBuffers(id))) {
         LOG("Failed to allocate buffer on port %d", id);
         RejectInitPromise(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__);
         break;
       }
     }
   } else if (mOmxState == OMX_StateIdle) {
     RefPtr<OmxDataDecoder> self = this;
     mOmxLayer->SendCommand(OMX_CommandStateSet, OMX_StateExecuting, nullptr)
-        ->Then(mOmxTaskQueue, __func__,
-               [self]() {
-                 self->mOmxState = self->mOmxLayer->GetState();
-                 MOZ_ASSERT(self->mOmxState == OMX_StateExecuting);
+        ->Then(
+            mOmxTaskQueue, __func__,
+            [self]() {
+              self->mOmxState = self->mOmxLayer->GetState();
+              MOZ_ASSERT(self->mOmxState == OMX_StateExecuting);
 
-                 self->ResolveInitPromise(__func__);
-               },
-               [self]() {
-                 self->RejectInitPromise(NS_ERROR_DOM_MEDIA_FATAL_ERR,
-                                         __func__);
-               });
+              self->ResolveInitPromise(__func__);
+            },
+            [self]() {
+              self->RejectInitPromise(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__);
+            });
   } else if (mOmxState == OMX_StateExecuting) {
     // Configure codec once it gets OMX_StateExecuting state.
     FillCodecConfigDataToOmx();
   } else {
     MOZ_ASSERT(0);
   }
 }
 
@@ -723,45 +728,46 @@ void OmxDataDecoder::PortSettingsChanged
   CHECK_OMX_ERR(err);
 
   RefPtr<OmxDataDecoder> self = this;
   if (def.bEnabled) {
     // 1. disable port.
     LOG("PortSettingsChanged: disable port %lu", def.nPortIndex);
     mOmxLayer
         ->SendCommand(OMX_CommandPortDisable, mPortSettingsChanged, nullptr)
-        ->Then(mOmxTaskQueue, __func__,
-               [self, def]() -> RefPtr<OmxCommandPromise> {
-                 // 3. enable port.
-                 // Send enable port command.
-                 RefPtr<OmxCommandPromise> p = self->mOmxLayer->SendCommand(
-                     OMX_CommandPortEnable, self->mPortSettingsChanged,
-                     nullptr);
+        ->Then(
+            mOmxTaskQueue, __func__,
+            [self, def]() -> RefPtr<OmxCommandPromise> {
+              // 3. enable port.
+              // Send enable port command.
+              RefPtr<OmxCommandPromise> p = self->mOmxLayer->SendCommand(
+                  OMX_CommandPortEnable, self->mPortSettingsChanged, nullptr);
 
-                 // 4. allocate port buffers.
-                 // Allocate new port buffers.
-                 nsresult rv = self->AllocateBuffers(def.eDir);
-                 if (NS_FAILED(rv)) {
-                   self->NotifyError(OMX_ErrorUndefined, __func__);
-                 }
+              // 4. allocate port buffers.
+              // Allocate new port buffers.
+              nsresult rv = self->AllocateBuffers(def.eDir);
+              if (NS_FAILED(rv)) {
+                self->NotifyError(OMX_ErrorUndefined, __func__);
+              }
 
-                 return p;
-               },
-               [self](const OmxCommandFailureHolder& aError) {
-                 self->NotifyError(OMX_ErrorUndefined, __func__);
-                 return OmxCommandPromise::CreateAndReject(aError, __func__);
-               })
-        ->Then(mOmxTaskQueue, __func__,
-               [self]() {
-                 LOGL("PortSettingsChanged: port settings changed complete");
-                 // finish port setting changed.
-                 self->mPortSettingsChanged = -1;
-                 self->FillAndEmptyBuffers();
-               },
-               [self]() { self->NotifyError(OMX_ErrorUndefined, __func__); });
+              return p;
+            },
+            [self](const OmxCommandFailureHolder& aError) {
+              self->NotifyError(OMX_ErrorUndefined, __func__);
+              return OmxCommandPromise::CreateAndReject(aError, __func__);
+            })
+        ->Then(
+            mOmxTaskQueue, __func__,
+            [self]() {
+              LOGL("PortSettingsChanged: port settings changed complete");
+              // finish port setting changed.
+              self->mPortSettingsChanged = -1;
+              self->FillAndEmptyBuffers();
+            },
+            [self]() { self->NotifyError(OMX_ErrorUndefined, __func__); });
 
     // 2. wait for port buffers return to client and then release these buffers.
     //
     // Port buffers will be returned to client soon once OMX_CommandPortDisable
     // command is sent. Then releasing these buffers.
     CollectBufferPromises(def.eDir)->Then(
         mOmxTaskQueue, __func__,
         [self, def]() {
--- a/dom/media/platforms/omx/OmxPromiseLayer.cpp
+++ b/dom/media/platforms/omx/OmxPromiseLayer.cpp
@@ -293,17 +293,19 @@ bool OmxPromiseLayer::Event(OMX_EVENTTYP
         OmxCommandFailureHolder failure(OMX_ErrorUndefined,
                                         OMX_CommandPortEnable);
         mPortEnablePromise.Reject(failure, __func__);
       } else {
         return false;
       }
       break;
     }
-    default: { return false; }
+    default: {
+      return false;
+    }
   }
   return true;
 }
 
 nsresult OmxPromiseLayer::AllocateOmxBuffer(OMX_DIRTYPE aType,
                                             BUFFERLIST* aBuffers) {
   return mPlatformLayer->AllocateOmxBuffer(aType, aBuffers);
 }
--- a/dom/media/platforms/wmf/MFTDecoder.h
+++ b/dom/media/platforms/wmf/MFTDecoder.h
@@ -31,19 +31,20 @@ class MFTDecoder final {
 
   // Sets the input and output media types. Call after Init().
   //
   // Params:
   //  - aInputType needs at least major and minor types set.
   //  - aOutputType needs at least major and minor types set.
   //    This is used to select the matching output type out
   //    of all the available output types of the MFT.
-  HRESULT SetMediaTypes(IMFMediaType* aInputType, IMFMediaType* aOutputType,
-                        std::function<HRESULT(IMFMediaType*)>&& aCallback =
-                            [](IMFMediaType* aOutput) { return S_OK; });
+  HRESULT SetMediaTypes(
+      IMFMediaType* aInputType, IMFMediaType* aOutputType,
+      std::function<HRESULT(IMFMediaType*)>&& aCallback =
+          [](IMFMediaType* aOutput) { return S_OK; });
 
   // Returns the MFT's IMFAttributes object.
   already_AddRefed<IMFAttributes> GetAttributes();
 
   // Retrieves the media type being output. This may not be valid until
   //  the first sample is decoded.
   HRESULT GetOutputMediaType(RefPtr<IMFMediaType>& aMediaType);
   const GUID& GetOutputMediaSubType() const { return mOutputSubType; }
--- a/dom/media/platforms/wrappers/MediaChangeMonitor.cpp
+++ b/dom/media/platforms/wrappers/MediaChangeMonitor.cpp
@@ -470,45 +470,46 @@ MediaResult MediaChangeMonitor::CreateDe
   }
 
   rv = CreateDecoder(/* DecoderDoctorDiagnostics* */ nullptr);
 
   if (NS_SUCCEEDED(rv)) {
     RefPtr<MediaChangeMonitor> self = this;
     RefPtr<MediaRawData> sample = aSample;
     mDecoder->Init()
-        ->Then(mTaskQueue, __func__,
-               [self, sample, this](const TrackType aTrackType) {
-                 mInitPromiseRequest.Complete();
-                 mConversionRequired = Some(mDecoder->NeedsConversion());
-                 mCanRecycleDecoder = Some(CanRecycleDecoder());
+        ->Then(
+            mTaskQueue, __func__,
+            [self, sample, this](const TrackType aTrackType) {
+              mInitPromiseRequest.Complete();
+              mConversionRequired = Some(mDecoder->NeedsConversion());
+              mCanRecycleDecoder = Some(CanRecycleDecoder());
 
-                 if (!mFlushPromise.IsEmpty()) {
-                   // A Flush is pending, abort the current operation.
-                   mFlushPromise.Resolve(true, __func__);
-                   return;
-                 }
+              if (!mFlushPromise.IsEmpty()) {
+                // A Flush is pending, abort the current operation.
+                mFlushPromise.Resolve(true, __func__);
+                return;
+              }
 
-                 DecodeFirstSample(sample);
-               },
-               [self, this](const MediaResult& aError) {
-                 mInitPromiseRequest.Complete();
+              DecodeFirstSample(sample);
+            },
+            [self, this](const MediaResult& aError) {
+              mInitPromiseRequest.Complete();
 
-                 if (!mFlushPromise.IsEmpty()) {
-                   // A Flush is pending, abort the current operation.
-                   mFlushPromise.Reject(aError, __func__);
-                   return;
-                 }
+              if (!mFlushPromise.IsEmpty()) {
+                // A Flush is pending, abort the current operation.
+                mFlushPromise.Reject(aError, __func__);
+                return;
+              }
 
-                 mDecodePromise.Reject(
-                     MediaResult(
-                         NS_ERROR_DOM_MEDIA_FATAL_ERR,
-                         RESULT_DETAIL("Unable to initialize H264 decoder")),
-                     __func__);
-               })
+              mDecodePromise.Reject(
+                  MediaResult(
+                      NS_ERROR_DOM_MEDIA_FATAL_ERR,
+                      RESULT_DETAIL("Unable to initialize H264 decoder")),
+                  __func__);
+            })
         ->Track(mInitPromiseRequest);
     return NS_ERROR_DOM_MEDIA_INITIALIZING_DECODER;
   }
   return rv;
 }
 
 bool MediaChangeMonitor::CanRecycleDecoder() const {
   AssertOnTaskQueue();
@@ -539,27 +540,28 @@ void MediaChangeMonitor::DecodeFirstSamp
   }
 
   if (aSample->mKeyframe) {
     mNeedKeyframe = false;
   }
 
   RefPtr<MediaChangeMonitor> self = this;
   mDecoder->Decode(aSample)
-      ->Then(mTaskQueue, __func__,
-             [self, this](MediaDataDecoder::DecodedData&& aResults) {
-               mDecodePromiseRequest.Complete();
-               mPendingFrames.AppendElements(std::move(aResults));
-               mDecodePromise.Resolve(std::move(mPendingFrames), __func__);
-               mPendingFrames = DecodedData();
-             },
-             [self, this](const MediaResult& aError) {
-               mDecodePromiseRequest.Complete();
-               mDecodePromise.Reject(aError, __func__);
-             })
+      ->Then(
+          mTaskQueue, __func__,
+          [self, this](MediaDataDecoder::DecodedData&& aResults) {
+            mDecodePromiseRequest.Complete();
+            mPendingFrames.AppendElements(std::move(aResults));
+            mDecodePromise.Resolve(std::move(mPendingFrames), __func__);
+            mPendingFrames = DecodedData();
+          },
+          [self, this](const MediaResult& aError) {
+            mDecodePromiseRequest.Complete();
+            mDecodePromise.Reject(aError, __func__);
+          })
       ->Track(mDecodePromiseRequest);
 }
 
 MediaResult MediaChangeMonitor::CheckForChange(MediaRawData* aSample) {
   AssertOnTaskQueue();
 
   if (!mDecoder) {
     return CreateDecoderAndInit(aSample);
@@ -584,93 +586,96 @@ MediaResult MediaChangeMonitor::CheckFor
 }
 
 void MediaChangeMonitor::DrainThenFlushDecoder(MediaRawData* aPendingSample) {
   AssertOnTaskQueue();
 
   RefPtr<MediaRawData> sample = aPendingSample;
   RefPtr<MediaChangeMonitor> self = this;
   mDecoder->Drain()
-      ->Then(mTaskQueue, __func__,
-             [self, sample, this](MediaDataDecoder::DecodedData&& aResults) {
-               mDrainRequest.Complete();
-               if (!mFlushPromise.IsEmpty()) {
-                 // A Flush is pending, abort the current operation.
-                 mFlushPromise.Resolve(true, __func__);
-                 return;
-               }
-               if (aResults.Length() > 0) {
-                 mPendingFrames.AppendElements(std::move(aResults));
-                 DrainThenFlushDecoder(sample);
-                 return;
-               }
-               // We've completed the draining operation, we can now flush the
-               // decoder.
-               FlushThenShutdownDecoder(sample);
-             },
-             [self, this](const MediaResult& aError) {
-               mDrainRequest.Complete();
-               if (!mFlushPromise.IsEmpty()) {
-                 // A Flush is pending, abort the current operation.
-                 mFlushPromise.Reject(aError, __func__);
-                 return;
-               }
-               mDecodePromise.Reject(aError, __func__);
-             })
+      ->Then(
+          mTaskQueue, __func__,
+          [self, sample, this](MediaDataDecoder::DecodedData&& aResults) {
+            mDrainRequest.Complete();
+            if (!mFlushPromise.IsEmpty()) {
+              // A Flush is pending, abort the current operation.
+              mFlushPromise.Resolve(true, __func__);
+              return;
+            }
+            if (aResults.Length() > 0) {
+              mPendingFrames.AppendElements(std::move(aResults));
+              DrainThenFlushDecoder(sample);
+              return;
+            }
+            // We've completed the draining operation, we can now flush the
+            // decoder.
+            FlushThenShutdownDecoder(sample);
+          },
+          [self, this](const MediaResult& aError) {
+            mDrainRequest.Complete();
+            if (!mFlushPromise.IsEmpty()) {
+              // A Flush is pending, abort the current operation.
+              mFlushPromise.Reject(aError, __func__);
+              return;
+            }
+            mDecodePromise.Reject(aError, __func__);
+          })
       ->Track(mDrainRequest);
 }
 
 void MediaChangeMonitor::FlushThenShutdownDecoder(
     MediaRawData* aPendingSample) {
   AssertOnTaskQueue();
 
   RefPtr<MediaRawData> sample = aPendingSample;
   RefPtr<MediaChangeMonitor> self = this;
   mDecoder->Flush()
-      ->Then(mTaskQueue, __func__,
-             [self, sample, this]() {
-               mFlushRequest.Complete();
+      ->Then(
+          mTaskQueue, __func__,
+          [self, sample, this]() {
+            mFlushRequest.Complete();
 
-               if (!mFlushPromise.IsEmpty()) {
-                 // A Flush is pending, abort the current operation.
-                 mFlushPromise.Resolve(true, __func__);
-                 return;
-               }
+            if (!mFlushPromise.IsEmpty()) {
+              // A Flush is pending, abort the current operation.
+              mFlushPromise.Resolve(true, __func__);
+              return;
+            }
 
-               mShutdownPromise = ShutdownDecoder();
-               mShutdownPromise
-                   ->Then(mTaskQueue, __func__,
-                          [self, sample, this]() {
-                            mShutdownRequest.Complete();
-                            mShutdownPromise = nullptr;
+            mShutdownPromise = ShutdownDecoder();
+            mShutdownPromise
+                ->Then(
+                    mTaskQueue, __func__,
+                    [self, sample, this]() {
+                      mShutdownRequest.Complete();
+                      mShutdownPromise = nullptr;
 
-                            if (!mFlushPromise.IsEmpty()) {
-                              // A Flush is pending, abort the current
-                              // operation.
-                              mFlushPromise.Resolve(true, __func__);
-                              return;
-                            }
+                      if (!mFlushPromise.IsEmpty()) {
+                        // A Flush is pending, abort the current
+                        // operation.
+                        mFlushPromise.Resolve(true, __func__);
+                        return;
+                      }
 
-                            MediaResult rv = CreateDecoderAndInit(sample);
-                            if (rv == NS_ERROR_DOM_MEDIA_INITIALIZING_DECODER) {
-                              // All good so far, will continue later.
-                              return;
-                            }
-                            MOZ_ASSERT(NS_FAILED(rv));
-                            mDecodePromise.Reject(rv, __func__);
-                            return;
-                          },
-                          [] { MOZ_CRASH("Can't reach here'"); })
-                   ->Track(mShutdownRequest);
-             },
-             [self, this](const MediaResult& aError) {
-               mFlushRequest.Complete();
-               if (!mFlushPromise.IsEmpty()) {
-                 // A Flush is pending, abort the current operation.
-                 mFlushPromise.Reject(aError, __func__);
-                 return;
-               }
-               mDecodePromise.Reject(aError, __func__);
-             })
+                      MediaResult rv = CreateDecoderAndInit(sample);
+                      if (rv == NS_ERROR_DOM_MEDIA_INITIALIZING_DECODER) {
+                        // All good so far, will continue later.
+                        return;
+                      }
+                      MOZ_ASSERT(NS_FAILED(rv));
+                      mDecodePromise.Reject(rv, __func__);
+                      return;
+                    },
+                    [] { MOZ_CRASH("Can't reach here'"); })
+                ->Track(mShutdownRequest);
+          },
+          [self, this](const MediaResult& aError) {
+            mFlushRequest.Complete();
+            if (!mFlushPromise.IsEmpty()) {
+              // A Flush is pending, abort the current operation.
+              mFlushPromise.Reject(aError, __func__);
+              return;
+            }
+            mDecodePromise.Reject(aError, __func__);
+          })
       ->Track(mFlushRequest);
 }
 
 }  // namespace mozilla
--- a/dom/media/systemservices/MediaUtils.h
+++ b/dom/media/systemservices/MediaUtils.h
@@ -219,29 +219,30 @@ Await(already_AddRefed<nsIEventTarget> a
       RefPtr<MozPromise<ResolveValueType, RejectValueType, Excl>> aPromise) {
   RefPtr<TaskQueue> taskQueue =
       new TaskQueue(std::move(aPool), "MozPromiseAwait");
   Monitor mon(__func__);
   bool done = false;
 
   typename MozPromise<ResolveValueType, RejectValueType,
                       Excl>::ResolveOrRejectValue val;
-  aPromise->Then(taskQueue, __func__,
-                 [&](ResolveValueType aResolveValue) {
-                   val.SetResolve(std::move(aResolveValue));
-                   MonitorAutoLock lock(mon);
-                   done = true;
-                   mon.Notify();
-                 },
-                 [&](RejectValueType aRejectValue) {
-                   val.SetReject(std::move(aRejectValue));
-                   MonitorAutoLock lock(mon);
-                   done = true;
-                   mon.Notify();
-                 });
+  aPromise->Then(
+      taskQueue, __func__,
+      [&](ResolveValueType aResolveValue) {
+        val.SetResolve(std::move(aResolveValue));
+        MonitorAutoLock lock(mon);
+        done = true;
+        mon.Notify();
+      },
+      [&](RejectValueType aRejectValue) {
+        val.SetReject(std::move(aRejectValue));
+        MonitorAutoLock lock(mon);
+        done = true;
+        mon.Notify();
+      });
 
   MonitorAutoLock lock(mon);
   while (!done) {
     mon.Wait();
   }
 
   return val;
 }
--- a/dom/media/webaudio/blink/DenormalDisabler.h
+++ b/dom/media/webaudio/blink/DenormalDisabler.h
@@ -102,28 +102,28 @@ class DenormalDisabler {
     setStatusWord(m_savedCSR | (1 << 24));
   }
 
   inline void restoreState() { setStatusWord(m_savedCSR); }
 
   inline int getStatusWord() {
     int result;
 #    if defined(__aarch64__)
-    asm volatile("mrs %x[result], FPCR" : [result] "=r"(result));
+    asm volatile("mrs %x[result], FPCR" : [ result ] "=r"(result));
 #    else
-    asm volatile("vmrs %[result], FPSCR" : [result] "=r"(result));
+    asm volatile("vmrs %[result], FPSCR" : [ result ] "=r"(result));
 #    endif
     return result;
   }
 
   inline void setStatusWord(int a) {
 #    if defined(__aarch64__)
-    asm volatile("msr FPCR, %x[src]" : : [src] "r"(a));
+    asm volatile("msr FPCR, %x[src]" : : [ src ] "r"(a));
 #    else
-    asm volatile("vmsr FPSCR, %[src]" : : [src] "r"(a));
+    asm volatile("vmsr FPSCR, %[src]" : : [ src ] "r"(a));
 #    endif
   }
 
 #  endif
 };
 
 #else
 // FIXME: add implementations for other architectures and compilers
--- a/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
+++ b/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
@@ -533,17 +533,19 @@ int MediaEngineRemoteVideoSource::Delive
         scale_width = (float)dst_max_width / (float)dst_width;
         scale_height = (float)dst_max_height / (float)dst_height;
         scale = std::min(scale_width, scale_height);
         dst_width = (int32_t)(scale * dst_width);
         dst_height = (int32_t)(scale * dst_height);
       }
       break;
     }
-    default: { break; }
+    default: {
+      break;
+    }
   }
 
   rtc::Callback0<void> callback_unused;
   rtc::scoped_refptr<webrtc::I420BufferInterface> buffer =
       new rtc::RefCountedObject<webrtc::WrappedI420Buffer>(
           aProps.width(), aProps.height(), aBuffer, aProps.yStride(),
           aBuffer + aProps.yAllocatedSize(), aProps.uStride(),
           aBuffer + aProps.yAllocatedSize() + aProps.uAllocatedSize(),
--- a/dom/media/webspeech/recognition/SpeechRecognition.cpp
+++ b/dom/media/webspeech/recognition/SpeechRecognition.cpp
@@ -674,39 +674,40 @@ void SpeechRecognition::Start(const Opti
         break;
       }
     }
   } else {
     AutoNoJSAPI nojsapi;
     RefPtr<SpeechRecognition> self(this);
     MediaManager::Get()
         ->GetUserMedia(GetOwner(), constraints, aCallerType)
-        ->Then(GetCurrentThreadSerialEventTarget(), __func__,
-               [this, self](RefPtr<DOMMediaStream>&& aStream) {
-                 mStream = std::move(aStream);
-                 mStream->RegisterTrackListener(this);
-                 nsTArray<RefPtr<AudioStreamTrack>> tracks;
-                 mStream->GetAudioTracks(tracks);
-                 for (const RefPtr<AudioStreamTrack>& track : tracks) {
-                   if (!track->Ended()) {
-                     NotifyTrackAdded(track);
-                   }
-                 }
-               },
-               [this, self](RefPtr<MediaMgrError>&& error) {
-                 SpeechRecognitionErrorCode errorCode;
+        ->Then(
+            GetCurrentThreadSerialEventTarget(), __func__,
+            [this, self](RefPtr<DOMMediaStream>&& aStream) {
+              mStream = std::move(aStream);
+              mStream->RegisterTrackListener(this);
+              nsTArray<RefPtr<AudioStreamTrack>> tracks;
+              mStream->GetAudioTracks(tracks);
+              for (const RefPtr<AudioStreamTrack>& track : tracks) {
+                if (!track->Ended()) {
+                  NotifyTrackAdded(track);
+                }
+              }
+            },
+            [this, self](RefPtr<MediaMgrError>&& error) {
+              SpeechRecognitionErrorCode errorCode;
 
-                 if (error->mName == MediaMgrError::Name::NotAllowedError) {
-                   errorCode = SpeechRecognitionErrorCode::Not_allowed;
-                 } else {
-                   errorCode = SpeechRecognitionErrorCode::Audio_capture;
-                 }
-                 DispatchError(SpeechRecognition::EVENT_AUDIO_ERROR, errorCode,
-                               error->mMessage);
-               });
+              if (error->mName == MediaMgrError::Name::NotAllowedError) {
+                errorCode = SpeechRecognitionErrorCode::Not_allowed;
+              } else {
+                errorCode = SpeechRecognitionErrorCode::Audio_capture;
+              }
+              DispatchError(SpeechRecognition::EVENT_AUDIO_ERROR, errorCode,
+                            error->mMessage);
+            });
   }
 
   RefPtr<SpeechEvent> event = new SpeechEvent(this, EVENT_START);
   NS_DispatchToMainThread(event);
 }
 
 bool SpeechRecognition::SetRecognitionService(ErrorResult& aRv) {
   // See:
--- a/dom/payments/PaymentActionResponse.cpp
+++ b/dom/payments/PaymentActionResponse.cpp
@@ -263,17 +263,19 @@ PaymentShowActionResponse::Init(const ns
         break;
       }
       case nsIPaymentResponseData::BASICCARD_RESPONSE: {
         if (!isBasicCardPayment) {
           return NS_ERROR_FAILURE;
         }
         break;
       }
-      default: { return NS_ERROR_FAILURE; }
+      default: {
+        return NS_ERROR_FAILURE;
+      }
     }
   }
   mData = aData;
   mPayerName = aPayerName;
   mPayerEmail = aPayerEmail;
   mPayerPhone = aPayerPhone;
   return NS_OK;
 }
--- a/dom/payments/PaymentMethodChangeEvent.cpp
+++ b/dom/payments/PaymentMethodChangeEvent.cpp
@@ -138,17 +138,19 @@ void PaymentMethodChangeEvent::GetMethod
       MOZ_ASSERT(aCx);
       JS::RootedValue value(aCx);
       if (NS_WARN_IF(!basicCardDetails.ToObjectInternal(aCx, &value))) {
         return;
       }
       aRetVal.set(&value.toObject());
       break;
     }
-    default: { break; }
+    default: {
+      break;
+    }
   }
 }
 
 void PaymentMethodChangeEvent::SetMethodDetails(
     const ChangeDetails& aMethodDetails) {
   mInternalDetails = aMethodDetails;
 }
 
--- a/dom/payments/PaymentRequestManager.cpp
+++ b/dom/payments/PaymentRequestManager.cpp
@@ -259,17 +259,19 @@ void ConvertResponseData(const IPCPaymen
       bData.billingAddress.postalCode = data.billingAddress().postalCode();
       bData.billingAddress.sortingCode = data.billingAddress().sortingCode();
       bData.billingAddress.organization = data.billingAddress().organization();
       bData.billingAddress.recipient = data.billingAddress().recipient();
       bData.billingAddress.phone = data.billingAddress().phone();
       aData = bData;
       break;
     }
-    default: { break; }
+    default: {
+      break;
+    }
   }
 }
 
 void ConvertMethodChangeDetails(const IPCMethodChangeDetails& aIPCDetails,
                                 ChangeDetails& aDetails) {
   switch (aIPCDetails.type()) {
     case IPCMethodChangeDetails::TIPCGeneralChangeDetails: {
       const IPCGeneralChangeDetails& details = aIPCDetails;
@@ -296,17 +298,19 @@ void ConvertMethodChangeDetails(const IP
           details.billingAddress().sortingCode();
       bDetails.billingAddress.organization =
           details.billingAddress().organization();
       bDetails.billingAddress.recipient = details.billingAddress().recipient();
       bDetails.billingAddress.phone = details.billingAddress().phone();
       aDetails = bDetails;
       break;
     }
-    default: { break; }
+    default: {
+      break;
+    }
   }
 }
 }  // end of namespace
 
 /* PaymentRequestManager */
 
 StaticRefPtr<PaymentRequestManager> gPaymentManager;
 const char kSupportedRegionsPref[] = "dom.payments.request.supportedRegions";
@@ -676,17 +680,19 @@ nsresult PaymentRequestManager::RespondP
       NotifyRequestDone(aRequest);
       break;
     }
     case IPCPaymentActionResponse::TIPCPaymentCompleteActionResponse: {
       aRequest->RespondComplete();
       NotifyRequestDone(aRequest);
       break;
     }
-    default: { return NS_ERROR_FAILURE; }
+    default: {
+      return NS_ERROR_FAILURE;
+    }
   }
   return NS_OK;
 }
 
 nsresult PaymentRequestManager::ChangeShippingAddress(
     PaymentRequest* aRequest, const IPCPaymentAddress& aAddress) {
   return aRequest->UpdateShippingAddress(
       aAddress.country(), aAddress.addressLine(), aAddress.region(),
--- a/dom/payments/PaymentRequestService.cpp
+++ b/dom/payments/PaymentRequestService.cpp
@@ -173,17 +173,19 @@ nsresult PaymentRequestService::LaunchUI
     case IPCPaymentActionRequest::TIPCPaymentUpdateActionRequest: {
       rv = uiService->UpdatePayment(aRequestId);
       break;
     }
     case IPCPaymentActionRequest::TIPCPaymentCloseActionRequest: {
       rv = uiService->ClosePayment(aRequestId);
       break;
     }
-    default: { return NS_ERROR_FAILURE; }
+    default: {
+      return NS_ERROR_FAILURE;
+    }
   }
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
   return NS_OK;
 }
 
 nsresult PaymentRequestService::RequestPayment(
@@ -327,17 +329,19 @@ nsresult PaymentRequestService::RequestP
                             action.paymentMethodErrors(),
                             action.shippingAddressErrors());
       request->SetState(payments::PaymentRequest::eInteractive);
       MOZ_ASSERT(mShowingRequest == request);
       rv = LaunchUIAction(
           aRequestId, IPCPaymentActionRequest::TIPCPaymentUpdateActionRequest);
       break;
     }
-    default: { return NS_ERROR_FAILURE; }
+    default: {
+      return NS_ERROR_FAILURE;
+    }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 PaymentRequestService::RespondPayment(nsIPaymentActionResponse* aResponse) {
   NS_ENSURE_ARG_POINTER(aResponse);
   nsAutoString requestId;
@@ -413,17 +417,19 @@ PaymentRequestService::RespondPayment(ns
       }
       break;
     }
     case nsIPaymentActionResponse::COMPLETE_ACTION: {
       mShowingRequest = nullptr;
       mRequestQueue.RemoveElement(request);
       break;
     }
-    default: { break; }
+    default: {
+      break;
+    }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 PaymentRequestService::ChangeShippingAddress(const nsAString& aRequestId,
                                              nsIPaymentAddress* aAddress) {
   RefPtr<payments::PaymentRequest> request;
--- a/dom/payments/ipc/PaymentRequestParent.cpp
+++ b/dom/payments/ipc/PaymentRequestParent.cpp
@@ -61,17 +61,19 @@ mozilla::ipc::IPCResult PaymentRequestPa
       mRequestId = request.requestId();
       break;
     }
     case IPCPaymentActionRequest::TIPCPaymentRetryActionRequest: {
       const IPCPaymentRetryActionRequest& request = aRequest;
       mRequestId = request.requestId();
       break;
     }
-    default: { return IPC_FAIL(this, "Unknown PaymentRequest action type"); }
+    default: {
+      return IPC_FAIL(this, "Unknown PaymentRequest action type");
+    }
   }
   nsCOMPtr<nsIPaymentRequestService> service =
       do_GetService(NS_PAYMENT_REQUEST_SERVICE_CONTRACT_ID);
   MOZ_ASSERT(service);
   PaymentRequestService* rowService =
       static_cast<PaymentRequestService*>(service.get());
   MOZ_ASSERT(rowService);
   nsresult rv = rowService->RequestPayment(mRequestId, aRequest, this);
@@ -171,17 +173,19 @@ nsresult PaymentRequestParent::RespondPa
       rv = response->IsCompleted(&isCompleted);
       NS_ENSURE_SUCCESS(rv, rv);
       IPCPaymentCompleteActionResponse actionResponse(requestId, isCompleted);
       if (!SendRespondPayment(actionResponse)) {
         return NS_ERROR_FAILURE;
       }
       break;
     }
-    default: { return NS_ERROR_FAILURE; }
+    default: {
+      return NS_ERROR_FAILURE;
+    }
   }
   return NS_OK;
 }
 
 nsresult PaymentRequestParent::ChangeShippingAddress(
     const nsAString& aRequestId, nsIPaymentAddress* aAddress) {
   if (!NS_IsMainThread()) {
     RefPtr<PaymentRequestParent> self = this;
@@ -305,17 +309,19 @@ nsresult PaymentRequestParent::ChangePay
                           NS_ERROR_FAILURE);
         IPCPaymentAddress ipcAddress;
         NS_ENSURE_SUCCESS(SerializeAddress(ipcAddress, address),
                           NS_ERROR_FAILURE);
         ipcBasicCardDetails.billingAddress() = ipcAddress;
         ipcChangeDetails = ipcBasicCardDetails;
         break;
       }
-      default: { return NS_ERROR_FAILURE; }
+      default: {
+        return NS_ERROR_FAILURE;
+      }
     }
   }
   if (!SendChangePaymentMethod(requestId, methodName, ipcChangeDetails)) {
     return NS_ERROR_FAILURE;
   }
   return NS_OK;
 }
 
@@ -449,14 +455,16 @@ nsresult PaymentRequestParent::Serialize
                         NS_ERROR_FAILURE);
       IPCPaymentAddress ipcAddress;
       NS_ENSURE_SUCCESS(SerializeAddress(ipcAddress, address),
                         NS_ERROR_FAILURE);
       data.billingAddress() = ipcAddress;
       aIPCData = data;
       break;
     }
-    default: { return NS_ERROR_FAILURE; }
+    default: {
+      return NS_ERROR_FAILURE;
+    }
   }
   return NS_OK;
 }
 }  // end of namespace dom
 }  // end of namespace mozilla
--- a/dom/quota/ActorsParent.cpp
+++ b/dom/quota/ActorsParent.cpp
@@ -5597,17 +5597,19 @@ bool QuotaManager::IsPrincipalInfoValid(
         QM_WARNING("baseDomain (%s) doesn't match passed one (%s)!",
                    baseDomain.get(), info.baseDomain().get());
         return false;
       }
 
       return true;
     }
 
-    default: { break; }
+    default: {
+      break;
+    }
   }
 
   // Null and expanded principals are not acceptable.
   return false;
 }
 
 // static
 void QuotaManager::GetInfoFromValidatedPrincipalInfo(
@@ -5638,17 +5640,19 @@ void QuotaManager::GetInfoFromValidatedP
 
       if (aOrigin) {
         aOrigin->Assign(info.originNoSuffix() + suffix);
       }
 
       return;
     }
 
-    default: { break; }
+    default: {
+      break;
+    }
   }
 
   MOZ_CRASH("Should never get here!");
 }
 
 // static
 nsresult QuotaManager::GetInfoFromPrincipal(nsIPrincipal* aPrincipal,
                                             nsACString* aSuffix,
@@ -8232,17 +8236,19 @@ bool PrincipalVerifier::IsPrincipalInfoV
         QM_WARNING("baseDomain (%s) doesn't match passed one (%s)!",
                    baseDomain.get(), info.baseDomain().get());
         return false;
       }
 
       return true;
     }
 
-    default: { break; }
+    default: {
+      break;
+    }
   }
 
   // Null and expanded principals are not acceptable.
   return false;
 }
 
 NS_IMETHODIMP
 PrincipalVerifier::Run() {
--- a/dom/serviceworkers/ServiceWorkerContainerImpl.cpp
+++ b/dom/serviceworkers/ServiceWorkerContainerImpl.cpp
@@ -49,27 +49,28 @@ void ServiceWorkerContainerImpl::Registe
     return;
   }
 
   auto holder =
       MakeRefPtr<DOMMozPromiseRequestHolder<ServiceWorkerRegistrationPromise>>(
           global);
 
   swm->Register(aClientInfo, aScopeURL, aScriptURL, aUpdateViaCache)
-      ->Then(global->EventTargetFor(TaskCategory::Other), __func__,
-             [successCB = std::move(aSuccessCB),
-              holder](const ServiceWorkerRegistrationDescriptor& aDescriptor) {
-               holder->Complete();
-               successCB(aDescriptor);
-             },
-             [failureCB = std::move(aFailureCB),
-              holder](const CopyableErrorResult& aResult) {
-               holder->Complete();
-               failureCB(CopyableErrorResult(aResult));
-             })
+      ->Then(
+          global->EventTargetFor(TaskCategory::Other), __func__,
+          [successCB = std::move(aSuccessCB),
+           holder](const ServiceWorkerRegistrationDescriptor& aDescriptor) {
+            holder->Complete();
+            successCB(aDescriptor);
+          },
+          [failureCB = std::move(aFailureCB),
+           holder](const CopyableErrorResult& aResult) {
+            holder->Complete();
+            failureCB(CopyableErrorResult(aResult));
+          })
       ->Track(*holder);
 }
 
 void ServiceWorkerContainerImpl::GetRegistration(
     const ClientInfo& aClientInfo, const nsACString& aURL,
     ServiceWorkerRegistrationCallback&& aSuccessCB,
     ServiceWorkerFailureCallback&& aFailureCB) const {
   MOZ_DIAGNOSTIC_ASSERT(mOuter);
@@ -86,27 +87,28 @@ void ServiceWorkerContainerImpl::GetRegi
     return;
   }
 
   auto holder =
       MakeRefPtr<DOMMozPromiseRequestHolder<ServiceWorkerRegistrationPromise>>(
           global);
 
   swm->GetRegistration(aClientInfo, aURL)
-      ->Then(global->EventTargetFor(TaskCategory::Other), __func__,
-             [successCB = std::move(aSuccessCB),
-              holder](const ServiceWorkerRegistrationDescriptor& aDescriptor) {
-               holder->Complete();
-               successCB(aDescriptor);
-             },
-             [failureCB = std::move(aFailureCB),
-              holder](const CopyableErrorResult& aResult) {
-               holder->Complete();
-               failureCB(CopyableErrorResult(aResult));
-             })
+      ->Then(
+          global->EventTargetFor(TaskCategory::Other), __func__,
+          [successCB = std::move(aSuccessCB),
+           holder](const ServiceWorkerRegistrationDescriptor& aDescriptor) {
+            holder->Complete();
+            successCB(aDescriptor);
+          },
+          [failureCB = std::move(aFailureCB),
+           holder](const CopyableErrorResult& aResult) {
+            holder->Complete();
+            failureCB(CopyableErrorResult(aResult));
+          })
       ->Track(*holder);
 }
 
 void ServiceWorkerContainerImpl::GetRegistrations(
     const ClientInfo& aClientInfo,
     ServiceWorkerRegistrationListCallback&& aSuccessCB,
     ServiceWorkerFailureCallback&& aFailureCB) const {
   MOZ_DIAGNOSTIC_ASSERT(mOuter);
@@ -122,27 +124,28 @@ void ServiceWorkerContainerImpl::GetRegi
     aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
     return;
   }
 
   auto holder = MakeRefPtr<
       DOMMozPromiseRequestHolder<ServiceWorkerRegistrationListPromise>>(global);
 
   swm->GetRegistrations(aClientInfo)
-      ->Then(global->EventTargetFor(TaskCategory::Other), __func__,
-             [successCB = std::move(aSuccessCB), holder](
-                 const nsTArray<ServiceWorkerRegistrationDescriptor>& aList) {
-               holder->Complete();
-               successCB(aList);
-             },
-             [failureCB = std::move(aFailureCB),
-              holder](const CopyableErrorResult& aResult) {
-               holder->Complete();
-               failureCB(CopyableErrorResult(aResult));
-             })
+      ->Then(
+          global->EventTargetFor(TaskCategory::Other), __func__,
+          [successCB = std::move(aSuccessCB),
+           holder](const nsTArray<ServiceWorkerRegistrationDescriptor>& aList) {
+            holder->Complete();
+            successCB(aList);
+          },
+          [failureCB = std::move(aFailureCB),
+           holder](const CopyableErrorResult& aResult) {
+            holder->Complete();
+            failureCB(CopyableErrorResult(aResult));
+          })
       ->Track(*holder);
 }
 
 void ServiceWorkerContainerImpl::GetReady(
     const ClientInfo& aClientInfo,
     ServiceWorkerRegistrationCallback&& aSuccessCB,
     ServiceWorkerFailureCallback&& aFailureCB) const {
   MOZ_DIAGNOSTIC_ASSERT(mOuter);
@@ -159,24 +162,25 @@ void ServiceWorkerContainerImpl::GetRead
     return;
   }
 
   auto holder =
       MakeRefPtr<DOMMozPromiseRequestHolder<ServiceWorkerRegistrationPromise>>(
           global);
 
   swm->WhenReady(aClientInfo)
-      ->Then(global->EventTargetFor(TaskCategory::Other), __func__,
-             [successCB = std::move(aSuccessCB),
-              holder](const ServiceWorkerRegistrationDescriptor& aDescriptor) {
-               holder->Complete();
-               successCB(aDescriptor);
-             },
-             [failureCB = std::move(aFailureCB),
-              holder](const CopyableErrorResult& aResult) {
-               holder->Complete();
-               failureCB(CopyableErrorResult(aResult));
-             })
+      ->Then(
+          global->EventTargetFor(TaskCategory::Other), __func__,
+          [successCB = std::move(aSuccessCB),
+           holder](const ServiceWorkerRegistrationDescriptor& aDescriptor) {
+            holder->Complete();
+            successCB(aDescriptor);
+          },
+          [failureCB = std::move(aFailureCB),
+           holder](const CopyableErrorResult& aResult) {
+            holder->Complete();
+            failureCB(CopyableErrorResult(aResult));
+          })
       ->Track(*holder);
 }
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/serviceworkers/ServiceWorkerContainerParent.cpp
+++ b/dom/serviceworkers/ServiceWorkerContainerParent.cpp
@@ -74,28 +74,29 @@ IPCResult ServiceWorkerContainerParent::
 IPCResult ServiceWorkerContainerParent::RecvGetRegistrations(
     const IPCClientInfo& aClientInfo, GetRegistrationsResolver&& aResolver) {
   if (!mProxy) {
     aResolver(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
     return IPC_OK();
   }
 
   mProxy->GetRegistrations(ClientInfo(aClientInfo))
-      ->Then(GetCurrentThreadSerialEventTarget(), __func__,
-             [aResolver](
-                 const nsTArray<ServiceWorkerRegistrationDescriptor>& aList) {
-               IPCServiceWorkerRegistrationDescriptorList ipcList;
-               for (auto& desc : aList) {
-                 ipcList.values().AppendElement(desc.ToIPC());
-               }
-               aResolver(std::move(ipcList));
-             },
-             [aResolver](const CopyableErrorResult& aResult) {
-               aResolver(aResult);
-             });
+      ->Then(
+          GetCurrentThreadSerialEventTarget(), __func__,
+          [aResolver](
+              const nsTArray<ServiceWorkerRegistrationDescriptor>& aList) {
+            IPCServiceWorkerRegistrationDescriptorList ipcList;
+            for (auto& desc : aList) {
+              ipcList.values().AppendElement(desc.ToIPC());
+            }
+            aResolver(std::move(ipcList));
+          },
+          [aResolver](const CopyableErrorResult& aResult) {
+            aResolver(aResult);
+          });
 
   return IPC_OK();
 }
 
 IPCResult ServiceWorkerContainerParent::RecvGetReady(
     const IPCClientInfo& aClientInfo, GetReadyResolver&& aResolver) {
   if (!mProxy) {
     aResolver(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
--- a/dom/serviceworkers/ServiceWorkerManager.cpp
+++ b/dom/serviceworkers/ServiceWorkerManager.cpp
@@ -2447,24 +2447,25 @@ void ServiceWorkerManager::UpdateClientC
   // modification by reentering from the event handlers during iteration.
   for (auto& handle : handleList) {
     RefPtr<GenericPromise> p = handle->Control(activeWorker->Descriptor());
 
     RefPtr<ServiceWorkerManager> self = this;
 
     // If we fail to control the client, then automatically remove it
     // from our list of controlled clients.
-    p->Then(SystemGroup::EventTargetFor(TaskCategory::Other), __func__,
-            [](bool) {
-              // do nothing on success
-            },
-            [self, clientInfo = handle->Info()](nsresult aRv) {
-              // failed to control, forget about this client
-              self->StopControllingClient(clientInfo);
-            });
+    p->Then(
+        SystemGroup::EventTargetFor(TaskCategory::Other), __func__,
+        [](bool) {
+          // do nothing on success
+        },
+        [self, clientInfo = handle->Info()](nsresult aRv) {
+          // failed to control, forget about this client
+          self->StopControllingClient(clientInfo);
+        });
   }
 }
 
 already_AddRefed<ServiceWorkerRegistrationInfo>
 ServiceWorkerManager::GetRegistration(nsIPrincipal* aPrincipal,
                                       const nsACString& aScope) const {
   MOZ_ASSERT(aPrincipal);
 
--- a/dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp
+++ b/dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp
@@ -499,27 +499,28 @@ void ServiceWorkerRegistrationMainThread
   RefPtr<MainThreadUpdateCallback> cb = new MainThreadUpdateCallback();
   UpdateInternal(principal, NS_ConvertUTF16toUTF8(mScope), cb);
 
   auto holder =
       MakeRefPtr<DOMMozPromiseRequestHolder<ServiceWorkerRegistrationPromise>>(
           global);
 
   cb->Promise()
-      ->Then(global->EventTargetFor(TaskCategory::Other), __func__,
-             [successCB = std::move(aSuccessCB),
-              holder](const ServiceWorkerRegistrationDescriptor& aDescriptor) {
-               holder->Complete();
-               successCB(aDescriptor);
-             },
-             [failureCB = std::move(aFailureCB),
-              holder](const CopyableErrorResult& aRv) {
-               holder->Complete();
-               failureCB(CopyableErrorResult(aRv));
-             })
+      ->Then(
+          global->EventTargetFor(TaskCategory::Other), __func__,
+          [successCB = std::move(aSuccessCB),
+           holder](const ServiceWorkerRegistrationDescriptor& aDescriptor) {
+            holder->Complete();
+            successCB(aDescriptor);
+          },
+          [failureCB = std::move(aFailureCB),
+           holder](const CopyableErrorResult& aRv) {
+            holder->Complete();
+            failureCB(CopyableErrorResult(aRv));
+          })
       ->Track(*holder);
 }
 
 void ServiceWorkerRegistrationMainThread::Unregister(
     ServiceWorkerBoolCallback&& aSuccessCB,
     ServiceWorkerFailureCallback&& aFailureCB) {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_DIAGNOSTIC_ASSERT(mOuter);
@@ -550,25 +551,26 @@ void ServiceWorkerRegistrationMainThread
   if (NS_FAILED(rv)) {
     aFailureCB(CopyableErrorResult(rv));
     return;
   }
 
   auto holder = MakeRefPtr<DOMMozPromiseRequestHolder<GenericPromise>>(global);
 
   cb->Promise()
-      ->Then(global->EventTargetFor(TaskCategory::Other), __func__,
-             [successCB = std::move(aSuccessCB), holder](bool aResult) {
-               holder->Complete();
-               successCB(aResult);
-             },
-             [failureCB = std::move(aFailureCB), holder](nsresult aRv) {
-               holder->Complete();
-               failureCB(CopyableErrorResult(aRv));
-             })
+      ->Then(
+          global->EventTargetFor(TaskCategory::Other), __func__,
+          [successCB = std::move(aSuccessCB), holder](bool aResult) {
+            holder->Complete();
+            successCB(aResult);
+          },
+          [failureCB = std::move(aFailureCB), holder](nsresult aRv) {
+            holder->Complete();
+            failureCB(CopyableErrorResult(aRv));
+          })
       ->Track(*holder);
 }
 
 ////////////////////////////////////////////////////
 // Worker Thread implementation
 
 class WorkerListener final : public ServiceWorkerRegistrationListener {
   ServiceWorkerRegistrationDescriptor mDescriptor;
@@ -764,27 +766,28 @@ void ServiceWorkerRegistrationWorkerThre
 
   auto promise =
       MakeRefPtr<ServiceWorkerRegistrationPromise::Private>(__func__);
   auto holder =
       MakeRefPtr<DOMMozPromiseRequestHolder<ServiceWorkerRegistrationPromise>>(
           global);
 
   promise
-      ->Then(global->EventTargetFor(TaskCategory::Other), __func__,
-             [successCB = std::move(aSuccessCB),
-              holder](const ServiceWorkerRegistrationDescriptor& aDescriptor) {
-               holder->Complete();
-               successCB(aDescriptor);
-             },
-             [failureCB = std::move(aFailureCB),
-              holder](const CopyableErrorResult& aRv) {
-               holder->Complete();
-               failureCB(CopyableErrorResult(aRv));
-             })
+      ->Then(
+          global->EventTargetFor(TaskCategory::Other), __func__,
+          [successCB = std::move(aSuccessCB),
+           holder](const ServiceWorkerRegistrationDescriptor& aDescriptor) {
+            holder->Complete();
+            successCB(aDescriptor);
+          },
+          [failureCB = std::move(aFailureCB),
+           holder](const CopyableErrorResult& aRv) {
+            holder->Complete();
+            failureCB(CopyableErrorResult(aRv));
+          })
       ->Track(*holder);
 
   RefPtr<SWRUpdateRunnable> r = new SWRUpdateRunnable(
       workerRef, promise, workerRef->Private()->GetServiceWorkerDescriptor());
 
   nsresult rv = workerRef->Private()->DispatchToMainThread(r.forget());
   if (NS_FAILED(rv)) {
     promise->Reject(NS_ERROR_DOM_INVALID_STATE_ERR, __func__);
@@ -819,25 +822,26 @@ void ServiceWorkerRegistrationWorkerThre
     aFailureCB(CopyableErrorResult(NS_ERROR_DOM_INVALID_STATE_ERR));
     return;
   }
 
   auto promise = MakeRefPtr<GenericPromise::Private>(__func__);
   auto holder = MakeRefPtr<DOMMozPromiseRequestHolder<GenericPromise>>(global);
 
   promise
-      ->Then(global->EventTargetFor(TaskCategory::Other), __func__,
-             [successCB = std::move(aSuccessCB), holder](bool aResult) {
-               holder->Complete();
-               successCB(aResult);
-             },
-             [failureCB = std::move(aFailureCB), holder](nsresult aRv) {
-               holder->Complete();
-               failureCB(CopyableErrorResult(aRv));
-             })
+      ->Then(
+          global->EventTargetFor(TaskCategory::Other), __func__,
+          [successCB = std::move(aSuccessCB), holder](bool aResult) {
+            holder->Complete();
+            successCB(aResult);
+          },
+          [failureCB = std::move(aFailureCB), holder](nsresult aRv) {
+            holder->Complete();
+            failureCB(CopyableErrorResult(aRv));
+          })
       ->Track(*holder);
 
   RefPtr<StartUnregisterRunnable> r =
       new StartUnregisterRunnable(workerRef, promise, mDescriptor);
 
   nsresult rv = workerRef->Private()->DispatchToMainThread(r);
   if (NS_FAILED(rv)) {
     promise->Reject(NS_ERROR_DOM_INVALID_STATE_ERR, __func__);
--- a/dom/webauthn/U2FTokenManager.cpp
+++ b/dom/webauthn/U2FTokenManager.cpp
@@ -328,32 +328,33 @@ void U2FTokenManager::DoRegister(const W
   NS_ConvertUTF16toUTF8 origin(aInfo.Origin());
   SendPromptNotification(kRegisterPromptNotifcation, mLastTransactionId,
                          origin.get());
 
   uint64_t tid = mLastTransactionId;
   mozilla::TimeStamp startTime = mozilla::TimeStamp::Now();
 
   mTokenManagerImpl->Register(aInfo, aForceNoneAttestation)
-      ->Then(GetCurrentThreadSerialEventTarget(), __func__,
-             [tid, startTime](WebAuthnMakeCredentialResult&& aResult) {
-               U2FTokenManager* mgr = U2FTokenManager::Get();
-               mgr->MaybeConfirmRegister(tid, aResult);
-               Telemetry::ScalarAdd(Telemetry::ScalarID::SECURITY_WEBAUTHN_USED,
-                                    NS_LITERAL_STRING("U2FRegisterFinish"), 1);
-               Telemetry::AccumulateTimeDelta(
-                   Telemetry::WEBAUTHN_CREATE_CREDENTIAL_MS, startTime);
-             },
-             [tid](nsresult rv) {
-               MOZ_ASSERT(NS_FAILED(rv));
-               U2FTokenManager* mgr = U2FTokenManager::Get();
-               mgr->MaybeAbortRegister(tid, rv);
-               Telemetry::ScalarAdd(Telemetry::ScalarID::SECURITY_WEBAUTHN_USED,
-                                    NS_LITERAL_STRING("U2FRegisterAbort"), 1);
-             })
+      ->Then(
+          GetCurrentThreadSerialEventTarget(), __func__,
+          [tid, startTime](WebAuthnMakeCredentialResult&& aResult) {
+            U2FTokenManager* mgr = U2FTokenManager::Get();
+            mgr->MaybeConfirmRegister(tid, aResult);
+            Telemetry::ScalarAdd(Telemetry::ScalarID::SECURITY_WEBAUTHN_USED,
+                                 NS_LITERAL_STRING("U2FRegisterFinish"), 1);
+            Telemetry::AccumulateTimeDelta(
+                Telemetry::WEBAUTHN_CREATE_CREDENTIAL_MS, startTime);
+          },
+          [tid](nsresult rv) {
+            MOZ_ASSERT(NS_FAILED(rv));
+            U2FTokenManager* mgr = U2FTokenManager::Get();
+            mgr->MaybeAbortRegister(tid, rv);
+            Telemetry::ScalarAdd(Telemetry::ScalarID::SECURITY_WEBAUTHN_USED,
+                                 NS_LITERAL_STRING("U2FRegisterAbort"), 1);
+          })
       ->Track(mRegisterPromise);
 }
 
 void U2FTokenManager::MaybeConfirmRegister(
     const uint64_t& aTransactionId,
     const WebAuthnMakeCredentialResult& aResult) {
   MOZ_ASSERT(mLastTransactionId == aTransactionId);
   mRegisterPromise.Complete();
@@ -386,32 +387,33 @@ void U2FTokenManager::Sign(PWebAuthnTran
   // Show a prompt that lets the user cancel the ongoing transaction.
   NS_ConvertUTF16toUTF8 origin(aTransactionInfo.Origin());
   SendPromptNotification(kSignPromptNotifcation, aTransactionId, origin.get());
 
   uint64_t tid = mLastTransactionId = aTransactionId;
   mozilla::TimeStamp startTime = mozilla::TimeStamp::Now();
 
   mTokenManagerImpl->Sign(aTransactionInfo)
-      ->Then(GetCurrentThreadSerialEventTarget(), __func__,
-             [tid, startTime](WebAuthnGetAssertionResult&& aResult) {
-               U2FTokenManager* mgr = U2FTokenManager::Get();
-               mgr->MaybeConfirmSign(tid, aResult);
-               Telemetry::ScalarAdd(Telemetry::ScalarID::SECURITY_WEBAUTHN_USED,
-                                    NS_LITERAL_STRING("U2FSignFinish"), 1);
-               Telemetry::AccumulateTimeDelta(
-                   Telemetry::WEBAUTHN_GET_ASSERTION_MS, startTime);
-             },
-             [tid](nsresult rv) {
-               MOZ_ASSERT(NS_FAILED(rv));
-               U2FTokenManager* mgr = U2FTokenManager::Get();
-               mgr->MaybeAbortSign(tid, rv);
-               Telemetry::ScalarAdd(Telemetry::ScalarID::SECURITY_WEBAUTHN_USED,
-                                    NS_LITERAL_STRING("U2FSignAbort"), 1);
-             })
+      ->Then(
+          GetCurrentThreadSerialEventTarget(), __func__,
+          [tid, startTime](WebAuthnGetAssertionResult&& aResult) {
+            U2FTokenManager* mgr = U2FTokenManager::Get();
+            mgr->MaybeConfirmSign(tid, aResult);
+            Telemetry::ScalarAdd(Telemetry::ScalarID::SECURITY_WEBAUTHN_USED,
+                                 NS_LITERAL_STRING("U2FSignFinish"), 1);
+            Telemetry::AccumulateTimeDelta(Telemetry::WEBAUTHN_GET_ASSERTION_MS,
+                                           startTime);
+          },
+          [tid](nsresult rv) {
+            MOZ_ASSERT(NS_FAILED(rv));
+            U2FTokenManager* mgr = U2FTokenManager::Get();
+            mgr->MaybeAbortSign(tid, rv);
+            Telemetry::ScalarAdd(Telemetry::ScalarID::SECURITY_WEBAUTHN_USED,
+                                 NS_LITERAL_STRING("U2FSignAbort"), 1);
+          })
       ->Track(mSignPromise);
 }
 
 void U2FTokenManager::MaybeConfirmSign(
     const uint64_t& aTransactionId, const WebAuthnGetAssertionResult& aResult) {
   MOZ_ASSERT(mLastTransactionId == aTransactionId);
   mSignPromise.Complete();
 
--- a/dom/workers/WorkerDebugger.cpp
+++ b/dom/workers/WorkerDebugger.cpp
@@ -512,24 +512,25 @@ RefPtr<PerformanceInfoPromise> WorkerDeb
 
   // We need to keep a ref on workerPrivate, passed to the promise,
   // to make sure it's still aloive when collecting the info.
   RefPtr<WorkerPrivate> workerRef = mWorkerPrivate;
   RefPtr<AbstractThread> mainThread =
       SystemGroup::AbstractMainThreadFor(TaskCategory::Performance);
 
   return CollectMemoryInfo(top, mainThread)
-      ->Then(mainThread, __func__,
-             [workerRef, url, pid, perfId, windowID, duration, isTopLevel,
-              items](const PerformanceMemoryInfo& aMemoryInfo) {
-               return PerformanceInfoPromise::CreateAndResolve(
-                   PerformanceInfo(url, pid, windowID, duration, perfId, true,
-                                   isTopLevel, aMemoryInfo, items),
-                   __func__);
-             },
-             [workerRef]() {
-               return PerformanceInfoPromise::CreateAndReject(NS_ERROR_FAILURE,
-                                                              __func__);
-             });
+      ->Then(
+          mainThread, __func__,
+          [workerRef, url, pid, perfId, windowID, duration, isTopLevel,
+           items](const PerformanceMemoryInfo& aMemoryInfo) {
+            return PerformanceInfoPromise::CreateAndResolve(
+                PerformanceInfo(url, pid, windowID, duration, perfId, true,
+                                isTopLevel, aMemoryInfo, items),
+                __func__);
+          },
+          [workerRef]() {
+            return PerformanceInfoPromise::CreateAndReject(NS_ERROR_FAILURE,
+                                                           __func__);
+          });
 }
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/xhr/XMLHttpRequestMainThread.cpp
+++ b/dom/xhr/XMLHttpRequestMainThread.cpp
@@ -1486,18 +1486,18 @@ nsresult XMLHttpRequestMainThread::Strea
   }
 
   nsresult rv = NS_OK;
 
   if (xmlHttpRequest->mResponseType == XMLHttpRequestResponseType::Blob) {
     xmlHttpRequest->MaybeCreateBlobStorage();
     rv = xmlHttpRequest->mBlobStorage->Append(fromRawSegment, count);
   } else if (xmlHttpRequest->mResponseType ==
-                  XMLHttpRequestResponseType::Arraybuffer &&
-              !xmlHttpRequest->mIsMappedArrayBuffer) {
+                 XMLHttpRequestResponseType::Arraybuffer &&
+             !xmlHttpRequest->mIsMappedArrayBuffer) {
     // get the initial capacity to something reasonable to avoid a bunch of
     // reallocs right at the start
     if (xmlHttpRequest->mArrayBufferBuilder.capacity() == 0)
       xmlHttpRequest->mArrayBufferBuilder.setCapacity(
           std::max(count, XML_HTTP_REQUEST_ARRAYBUFFER_MIN_SIZE));
 
     if (NS_WARN_IF(!xmlHttpRequest->mArrayBufferBuilder.append(
             reinterpret_cast<const uint8_t*>(fromRawSegment), count,
--- a/dom/xslt/xml/txXMLUtils.cpp
+++ b/dom/xslt/xml/txXMLUtils.cpp
@@ -125,17 +125,19 @@ void XMLUtils::normalizePIValue(nsAStrin
     char16_t ch = origValue.CharAt(conversionLoop);
     switch (ch) {
       case '>': {
         if (prevCh == '?') {
           piValue.Append(char16_t(' '));
         }
         break;
       }
-      default: { break; }
+      default: {
+        break;
+      }
     }
     piValue.Append(ch);
     prevCh = ch;
     ++conversionLoop;
   }
 }
 
 // static
--- a/dom/xslt/xpath/XPathResult.cpp
+++ b/dom/xslt/xpath/XPathResult.cpp
@@ -160,17 +160,19 @@ nsresult XPathResult::SetExprResult(txAE
     case NUMBER_TYPE: {
       mNumberResult = mResult->numberValue();
       break;
     }
     case STRING_TYPE: {
       mResult->stringValue(mStringResult);
       break;
     }
-    default: { MOZ_ASSERT(isNode() || isIterator() || isSnapshot()); }
+    default: {
+      MOZ_ASSERT(isNode() || isIterator() || isSnapshot());
+    }
   }
 
   if (aExprResult->getResultType() == txAExprResult::NODESET) {
     txNodeSet* nodeSet = static_cast<txNodeSet*>(aExprResult);
     int32_t i, count = nodeSet->size();
     for (i = 0; i < count; ++i) {
       nsINode* node = txXPathNativeNode::getNode(nodeSet->get(i));
       mResultNodes.AppendObject(node);
--- a/dom/xslt/xpath/txCoreFunctionCall.cpp
+++ b/dom/xslt/xpath/txCoreFunctionCall.cpp
@@ -182,17 +182,19 @@ nsresult txCoreFunctionCall::evaluate(tx
             *aResult = strRes;
             txXPathNodeUtils::getNodeName(node, strRes->mValue);
           } else {
             aContext->recycler()->getEmptyStringResult(aResult);
           }
 
           return NS_OK;
         }
-        default: { MOZ_CRASH("Unexpected mType?!"); }
+        default: {
+          MOZ_CRASH("Unexpected mType?!");
+        }
       }
       MOZ_CRASH("Inner mType switch should have returned!");
     }
     case POSITION: {
       return aContext->recycler()->getNumberResult(aContext->position(),
                                                    aResult);
     }
 
--- a/dom/xslt/xpath/txRelationalExpr.cpp
+++ b/dom/xslt/xpath/txRelationalExpr.cpp
@@ -117,17 +117,19 @@ bool RelationalExpr::compareResults(txIE
       return (leftDbl <= rightDbl);
     }
     case GREATER_THAN: {
       return (leftDbl > rightDbl);
     }
     case GREATER_OR_EQUAL: {
       return (leftDbl >= rightDbl);
     }
-    default: { MOZ_ASSERT_UNREACHABLE("We should have caught all cases"); }
+    default: {
+      MOZ_ASSERT_UNREACHABLE("We should have caught all cases");
+    }
   }
 
   return false;
 }
 
 nsresult RelationalExpr::evaluate(txIEvalContext* aContext,
                                   txAExprResult** aResult) {
   *aResult = nullptr;
--- a/dom/xslt/xpath/txResultRecycler.cpp
+++ b/dom/xslt/xpath/txResultRecycler.cpp
@@ -51,17 +51,19 @@ void txResultRecycler::recycle(txAExprRe
     }
     case txAExprResult::NUMBER: {
       rv = mNumberResults.push(static_cast<NumberResult*>(aResult));
       if (NS_FAILED(rv)) {
         delete aResult;
       }
       return;
     }
-    default: { delete aResult; }
+    default: {
+      delete aResult;
+    }
   }
 }
 
 nsresult txResultRecycler::getStringResult(StringResult** aResult) {
   if (mStringResults.isEmpty()) {
     *aResult = new StringResult(this);
   } else {
     *aResult = static_cast<StringResult*>(mStringResults.pop());
--- a/dom/xslt/xslt/txBufferingHandler.cpp
+++ b/dom/xslt/xslt/txBufferingHandler.cpp
@@ -349,17 +349,19 @@ static nsresult flushTransaction(txOutpu
           transaction->mLowercaseLocalName, transaction->mNsID);
     }
     case txOutputTransaction::eStartElementTransaction: {
       txStartElementTransaction* transaction =
           static_cast<txStartElementTransaction*>(aTransaction);
       return aHandler->startElement(
           transaction->mPrefix, transaction->mLocalName, transaction->mNsID);
     }
-    default: { MOZ_ASSERT_UNREACHABLE("Unexpected transaction type"); }
+    default: {
+      MOZ_ASSERT_UNREACHABLE("Unexpected transaction type");
+    }
   }
 
   return NS_ERROR_UNEXPECTED;
 }
 
 nsresult txResultBuffer::flushToHandler(txAXMLEventHandler* aHandler) {
   nsString::const_char_iterator iter;
   mStringValue.BeginReading(iter);
--- a/dom/xslt/xslt/txMozillaXSLTProcessor.cpp
+++ b/dom/xslt/xslt/txMozillaXSLTProcessor.cpp
@@ -803,17 +803,19 @@ nsresult txMozillaXSLTProcessor::SetPara
         NS_RELEASE(supports);
       }
 
       free(array);
 
       break;
     }
 
-    default: { return NS_ERROR_FAILURE; }
+    default: {
+      return NS_ERROR_FAILURE;
+    }
   }
 
   int32_t nsId = kNameSpaceID_Unknown;
   nsresult rv = nsContentUtils::NameSpaceManager()->RegisterNameSpace(
       aNamespaceURI, nsId);
   NS_ENSURE_SUCCESS(rv, rv);
   RefPtr<nsAtom> localName = NS_Atomize(aLocalName);
   txExpandedName varName(nsId, localName);
--- a/editor/spellchecker/EditorSpellCheck.cpp
+++ b/editor/spellchecker/EditorSpellCheck.cpp
@@ -801,42 +801,43 @@ nsresult EditorSpellCheck::DictionaryFet
     dictName.Assign(aFetcher->mDictionary);
     if (!dictName.IsEmpty()) {
       AutoTArray<nsString, 1> tryDictList;
       BuildDictionaryList(dictName, dictList, DICT_NORMAL_COMPARE, tryDictList);
 
       RefPtr<EditorSpellCheck> self = this;
       RefPtr<DictionaryFetcher> fetcher = aFetcher;
       mSpellChecker->SetCurrentDictionaryFromList(tryDictList)
-          ->Then(GetMainThreadSerialEventTarget(), __func__,
-                 [self, fetcher]() {
+          ->Then(
+              GetMainThreadSerialEventTarget(), __func__,
+              [self, fetcher]() {
 #ifdef DEBUG_DICT
-                   printf("***** Assigned from content preferences |%s|\n",
-                          NS_ConvertUTF16toUTF8(dictName).get());
+                printf("***** Assigned from content preferences |%s|\n",
+                       NS_ConvertUTF16toUTF8(dictName).get());
 #endif
-                   // We take an early exit here, so let's not forget to clear
-                   // the word list.
-                   self->DeleteSuggestedWordList();
+                // We take an early exit here, so let's not forget to clear
+                // the word list.
+                self->DeleteSuggestedWordList();
 
-                   self->EndUpdateDictionary();
-                   if (fetcher->mCallback) {
-                     fetcher->mCallback->EditorSpellCheckDone();
-                   }
-                 },
-                 [self, fetcher](nsresult aError) {
-                   if (aError == NS_ERROR_ABORT) {
-                     return;
-                   }
-                   // May be dictionary was uninstalled ?
-                   // Clear the content preference and continue.
-                   ClearCurrentDictionary(self->mEditor);
+                self->EndUpdateDictionary();
+                if (fetcher->mCallback) {
+                  fetcher->mCallback->EditorSpellCheckDone();
+                }
+              },
+              [self, fetcher](nsresult aError) {
+                if (aError == NS_ERROR_ABORT) {
+                  return;
+                }
+                // May be dictionary was uninstalled ?
+                // Clear the content preference and continue.
+                ClearCurrentDictionary(self->mEditor);
 
-                   // Priority 2 or later will handled by the following
-                   self->SetFallbackDictionary(fetcher);
-                 });
+                // Priority 2 or later will handled by the following
+                self->SetFallbackDictionary(fetcher);
+              });
       return NS_OK;
     }
   }
   SetFallbackDictionary(aFetcher);
   return NS_OK;
 }
 
 void EditorSpellCheck::SetFallbackDictionary(DictionaryFetcher* aFetcher) {
--- a/extensions/cookie/nsPermissionManager.cpp
+++ b/extensions/cookie/nsPermissionManager.cpp
@@ -3425,22 +3425,23 @@ nsPermissionManager::WhenPermissionsAvai
     aRunnable->Run();
     return NS_OK;
   }
 
   auto* thread = SystemGroup::AbstractMainThreadFor(TaskCategory::Other);
 
   RefPtr<nsIRunnable> runnable = aRunnable;
   GenericPromise::All(thread, promises)
-      ->Then(thread, __func__, [runnable]() { runnable->Run(); },
-             []() {
-               NS_WARNING(
-                   "nsPermissionManager permission promise rejected. We're "
-                   "probably shutting down.");
-             });
+      ->Then(
+          thread, __func__, [runnable]() { runnable->Run(); },
+          []() {
+            NS_WARNING(
+                "nsPermissionManager permission promise rejected. We're "
+                "probably shutting down.");
+          });
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsPermissionManager::GetHasPreloadPermissions(bool* aResult) {
   *aResult = sPreloadPermissionCount > 0;
   return NS_OK;
 }
--- a/gfx/2d/BlurLS3.cpp
+++ b/gfx/2d/BlurLS3.cpp
@@ -27,18 +27,18 @@ MOZ_ALWAYS_INLINE
   asm volatile(
       ".set push \n\t"
       ".set arch=loongson3a \n\t"
       "gsldlc1 %[vh], 0xf(%[p]) \n\t"
       "gsldrc1 %[vh], 0x8(%[p]) \n\t"
       "gsldlc1 %[vl], 0x7(%[p]) \n\t"
       "gsldrc1 %[vl], 0x0(%[p]) \n\t"
       ".set pop \n\t"
-      : [vh] "=f"(v.h), [vl] "=f"(v.l)
-      : [p] "r"(p)
+      : [ vh ] "=f"(v.h), [ vl ] "=f"(v.l)
+      : [ p ] "r"(p)
       : "memory");
 
   return v;
 }
 
 MOZ_ALWAYS_INLINE
 __m128i Divide(__m128i aValues, __m128i aDivisor) {
   uint64_t tmp;
@@ -51,54 +51,54 @@ MOZ_ALWAYS_INLINE
       "li %[tmp], 0x80000000 \n\t"
       "mtc1 %[tmp], %[ral] \n\t"
       "xor %[maskl], %[maskl], %[maskl] \n\t"
       "mov.d %[rah], %[ral] \n\t"
       "li %[tmp], 0xffffffff \n\t"
       "mthc1 %[tmp], %[maskl] \n\t"
       "mov.d %[maskh], %[maskl] \n\t"
       ".set pop \n\t"
-      : [rah] "=f"(ra.h), [ral] "=f"(ra.l), [maskh] "=f"(mask.h),
-        [maskl] "=f"(mask.l), [tmp] "=&r"(tmp));
+      : [ rah ] "=f"(ra.h), [ ral ] "=f"(ra.l), [ maskh ] "=f"(mask.h),
+        [ maskl ] "=f"(mask.l), [ tmp ] "=&r"(tmp));
 
   asm volatile(
       ".set push \n\t"
       ".set arch=loongson3a \n\t"
       "ori %[tmp], $0, 32 \n\t"
       "mtc1 %[tmp], %[srl32] \n\t" _mm_pmuluw(t1, av, ad)
           _mm_psrld(t2, av, srl32) _mm_pmuluw(t2, t2, ad)
       // Add 1 << 31 before shifting or masking the lower 32 bits away, so that
       // the result is rounded.
       _mm_paddd(t1, t1, ra) _mm_psrld(t1, t1, srl32) _mm_paddd(t2, t2, ra)
           _mm_and(t2, t2, mask) _mm_or(p4321, t1, t2) ".set pop \n\t"
-      : [p4321h] "=&f"(p4321.h), [p4321l] "=&f"(p4321.l), [t1h] "=&f"(t1.h),
-        [t1l] "=&f"(t1.l), [t2h] "=&f"(t2.h), [t2l] "=&f"(t2.l),
-        [srl32] "=&f"(srl32), [tmp] "=&r"(tmp)
-      : [rah] "f"(ra.h), [ral] "f"(ra.l), [maskh] "f"(mask.h),
-        [maskl] "f"(mask.l), [avh] "f"(aValues.h), [avl] "f"(aValues.l),
-        [adh] "f"(aDivisor.h), [adl] "f"(aDivisor.l));
+      : [ p4321h ] "=&f"(p4321.h), [ p4321l ] "=&f"(p4321.l),
+        [ t1h ] "=&f"(t1.h), [ t1l ] "=&f"(t1.l), [ t2h ] "=&f"(t2.h),
+        [ t2l ] "=&f"(t2.l), [ srl32 ] "=&f"(srl32), [ tmp ] "=&r"(tmp)
+      : [ rah ] "f"(ra.h), [ ral ] "f"(ra.l), [ maskh ] "f"(mask.h),
+        [ maskl ] "f"(mask.l), [ avh ] "f"(aValues.h), [ avl ] "f"(aValues.l),
+        [ adh ] "f"(aDivisor.h), [ adl ] "f"(aDivisor.l));
 
   return p4321;
 }
 
 MOZ_ALWAYS_INLINE
 __m128i BlurFourPixels(const __m128i &aTopLeft, const __m128i &aTopRight,
                        const __m128i &aBottomRight, const __m128i &aBottomLeft,
                        const __m128i &aDivisor) {
   __m128i values;
 
   asm volatile(
       ".set push \n\t"
       ".set arch=loongson3a \n\t" _mm_psubw(val, abr, atr)
           _mm_psubw(val, val, abl) _mm_paddw(val, val, atl) ".set pop \n\t"
-      : [valh] "=&f"(values.h), [vall] "=&f"(values.l)
-      : [abrh] "f"(aBottomRight.h), [abrl] "f"(aBottomRight.l),
-        [atrh] "f"(aTopRight.h), [atrl] "f"(aTopRight.l),
-        [ablh] "f"(aBottomLeft.h), [abll] "f"(aBottomLeft.l),
-        [atlh] "f"(aTopLeft.h), [atll] "f"(aTopLeft.l));
+      : [ valh ] "=&f"(values.h), [ vall ] "=&f"(values.l)
+      : [ abrh ] "f"(aBottomRight.h), [ abrl ] "f"(aBottomRight.l),
+        [ atrh ] "f"(aTopRight.h), [ atrl ] "f"(aTopRight.l),
+        [ ablh ] "f"(aBottomLeft.h), [ abll ] "f"(aBottomLeft.l),
+        [ atlh ] "f"(aTopLeft.h), [ atll ] "f"(aTopLeft.l));
 
   return Divide(values, aDivisor);
 }
 
 MOZ_ALWAYS_INLINE
 void LoadIntegralRowFromRow(uint32_t *aDest, const uint8_t *aSource,
                             int32_t aSourceWidth, int32_t aLeftInflation,
                             int32_t aRightInflation) {
@@ -198,42 +198,42 @@ void GenerateIntegralImage_LS3(int32_t a
   __m128i zero;
   asm volatile(
       ".set push \n\t"
       ".set arch=loongson3a \n\t"
       "li %[tmp], 0xee \n\t"
       "mtc1 %[tmp], %[see] \n\t"
       "li %[tmp], 0x44 \n\t"
       "mtc1 %[tmp], %[s44] \n\t" _mm_xor(zero, zero, zero) ".set pop \n\t"
-      : [tmp] "=&r"(tmp), [s44] "=f"(s44), [see] "=f"(see),
-        [zeroh] "=f"(zero.h), [zerol] "=f"(zero.l));
+      : [ tmp ] "=&r"(tmp), [ s44 ] "=f"(s44), [ see ] "=f"(see),
+        [ zeroh ] "=f"(zero.h), [ zerol ] "=f"(zero.l));
   for (int y = aTopInflation + 1; y < (aSize.height + aTopInflation); y++) {
     __m128i currentRowSum;
     uint32_t *intRow = aIntegralImage + (y * stride32bit);
     uint32_t *intPrevRow = aIntegralImage + (y - 1) * stride32bit;
     uint8_t *sourceRow = aSource + aSourceStride * (y - aTopInflation);
     uint32_t pixel = sourceRow[0];
 
     asm volatile(
         ".set push \n\t"
         ".set arch=loongson3a \n\t" _mm_xor(cr, cr, cr) ".set pop \n\t"
-        : [crh] "=f"(currentRowSum.h), [crl] "=f"(currentRowSum.l));
+        : [ crh ] "=f"(currentRowSum.h), [ crl ] "=f"(currentRowSum.l));
     for (int x = 0; x < aLeftInflation; x += 4) {
       __m128i sumPixels, t;
       asm volatile(
           ".set push \n\t"
           ".set arch=loongson3a \n\t"
           "mtc1 %[pix], %[spl] \n\t"
           "punpcklwd %[spl], %[spl], %[spl] \n\t"
           "mov.d %[sph], %[spl] \n\t"
           "pshufh %[sph], %[spl], %[s44] \n\t"
           "pshufh %[spl], %[spl], %[s44] \n\t"
           ".set pop \n\t"
-          : [sph] "=&f"(sumPixels.h), [spl] "=&f"(sumPixels.l)
-          : [pix] "r"(pixel), [s44] "f"(s44));
+          : [ sph ] "=&f"(sumPixels.h), [ spl ] "=&f"(sumPixels.l)
+          : [ pix ] "r"(pixel), [ s44 ] "f"(s44));
       sumPixels = AccumulatePixelSums(sumPixels);
       asm volatile (
         ".set push \n\t"
         ".set arch=loongson3a \n\t"
         _mm_paddw(sp, sp, cr)
         "pshufh %[crh], %[sph], %[see] \n\t"
         "pshufh %[crl], %[sph], %[see] \n\t"
         "gslqc1 %[th], %[tl], (%[pr]) \n\t"
@@ -259,20 +259,20 @@ void GenerateIntegralImage_LS3(int32_t a
           ".set push \n\t"
           ".set arch=loongson3a \n\t"
           "pshufh %[crl], %[crh], %[see] \n\t"
           "pshufh %[crh], %[crh], %[see] \n\t"
           "mtc1 %[pix], %[spl] \n\t"
           "punpcklwd %[spl], %[spl], %[spl] \n\t"
           "mov.d %[sph], %[spl] \n\t" _mm_punpcklbh(sp, sp, zero)
               _mm_punpcklhw(sp, sp, zero) ".set pop \n\t"
-          : [sph] "=&f"(sumPixels.h), [spl] "=&f"(sumPixels.l),
-            [crh] "+f"(currentRowSum.h), [crl] "+f"(currentRowSum.l)
-          : [pix] "r"(pixels), [see] "f"(see), [zeroh] "f"(zero.h),
-            [zerol] "f"(zero.l));
+          : [ sph ] "=&f"(sumPixels.h), [ spl ] "=&f"(sumPixels.l),
+            [ crh ] "+f"(currentRowSum.h), [ crl ] "+f"(currentRowSum.l)
+          : [ pix ] "r"(pixels), [ see ] "f"(see), [ zeroh ] "f"(zero.h),
+            [ zerol ] "f"(zero.l));
       sumPixels = AccumulatePixelSums(sumPixels);
       asm volatile (
         ".set push \n\t"
         ".set arch=loongson3a \n\t"
         _mm_paddw(sp, sp, cr)
         "mov.d %[crh], %[sph] \n\t"
         "mov.d %[crl], %[spl] \n\t"
         "gslqc1 %[th], %[tl], (%[pr]) \n\t"
@@ -300,44 +300,44 @@ void GenerateIntegralImage_LS3(int32_t a
           // aligned!
           asm volatile(
               ".set push \n\t"
               ".set arch=loongson3a \n\t"
               "mtc1 %[cr], %[crl] \n\t"
               "punpcklwd %[crl], %[crl], %[crl] \n\t"
               "mov.d %[crh], %[crl] \n\t"
               ".set pop \n\t"
-              : [crh] "=f"(currentRowSum.h), [crl] "=f"(currentRowSum.l)
-              : [cr] "r"(intCurrentRowSum));
+              : [ crh ] "=f"(currentRowSum.h), [ crl ] "=f"(currentRowSum.l)
+              : [ cr ] "r"(intCurrentRowSum));
           break;
         }
         intCurrentRowSum += pixel;
         intRow[x] = intPrevRow[x] + intCurrentRowSum;
       }
     } else {
       asm volatile(
           ".set push \n\t"
           ".set arch=loongson3a \n\t"
           "pshufh %[crl], %[crh], %[see] \n\t"
           "pshufh %[crh], %[crh], %[see] \n\t"
           ".set pop \n\t"
-          : [crh] "+f"(currentRowSum.h), [crl] "+f"(currentRowSum.l)
-          : [see] "f"(see));
+          : [ crh ] "+f"(currentRowSum.h), [ crl ] "+f"(currentRowSum.l)
+          : [ see ] "f"(see));
     }
     for (; x < integralImageSize.width; x += 4) {
       __m128i sumPixels, t;
       asm volatile(
           ".set push \n\t"
           ".set arch=loongson3a \n\t"
           "mtc1 %[pix], %[spl] \n\t"
           "punpcklwd %[spl], %[spl], %[spl] \n\t"
           "mov.d %[sph], %[spl] \n\t"
           ".set pop \n\t"
-          : [sph] "=f"(sumPixels.h), [spl] "=f"(sumPixels.l)
-          : [pix] "r"(pixel));
+          : [ sph ] "=f"(sumPixels.h), [ spl ] "=f"(sumPixels.l)
+          : [ pix ] "r"(pixel));
       sumPixels = AccumulatePixelSums(sumPixels);
       asm volatile (
         ".set push \n\t"
         ".set arch=loongson3a \n\t"
         _mm_paddw(sp, sp, cr)
         "pshufh %[crh], %[sph], %[see] \n\t"
         "pshufh %[crl], %[sph], %[see] \n\t"
         "gslqc1 %[th], %[tl], (%[pr]) \n\t"
@@ -427,19 +427,19 @@ void AlphaBoxBlur::BoxBlur_LS3(uint8_t *
 
   __m128i divisor, zero;
   asm volatile(
       ".set push \n\t"
       ".set arch=loongson3a \n\t"
       "mtc1 %[rec], %[divl] \n\t"
       "punpcklwd %[divl], %[divl], %[divl] \n\t"
       "mov.d %[divh], %[divl] \n\t" _mm_xor(zero, zero, zero) ".set pop \n\t"
-      : [divh] "=f"(divisor.h), [divl] "=f"(divisor.l), [zeroh] "=f"(zero.h),
-        [zerol] "=f"(zero.l)
-      : [rec] "r"(reciprocal));
+      : [ divh ] "=f"(divisor.h), [ divl ] "=f"(divisor.l),
+        [ zeroh ] "=f"(zero.h), [ zerol ] "=f"(zero.l)
+      : [ rec ] "r"(reciprocal));
 
   // This points to the start of the rectangle within the IntegralImage that
   // overlaps the surface being blurred.
   uint32_t *innerIntegral =
       aIntegralImage + (aTopLobe * stride32bit) + leftInflation;
 
   IntRect skipRect = mSkipRect;
   int32_t stride = mStride;
--- a/gfx/gl/GLReadTexImageHelper.cpp
+++ b/gfx/gl/GLReadTexImageHelper.cpp
@@ -323,17 +323,19 @@ void ReadPixelsIntoDataSurface(GLContext
         break;
       }
       case LOCAL_GL_RGB: {
         MOZ_ASSERT(destPixelSize == 2);
         MOZ_ASSERT(readType == LOCAL_GL_UNSIGNED_SHORT_5_6_5_REV);
         readFormatGFX = SurfaceFormat::R5G6B5_UINT16;
         break;
       }
-      default: { MOZ_CRASH("GFX: Bad read format, read format."); }
+      default: {
+        MOZ_CRASH("GFX: Bad read format, read format.");
+      }
     }
 
     switch (readType) {
       case LOCAL_GL_UNSIGNED_BYTE: {
         MOZ_ASSERT(readFormat == LOCAL_GL_RGBA);
         readAlignment = 1;
         break;
       }
@@ -342,17 +344,19 @@ void ReadPixelsIntoDataSurface(GLContext
         readAlignment = 4;
         break;
       }
       case LOCAL_GL_UNSIGNED_SHORT_5_6_5_REV: {
         MOZ_ASSERT(readFormat == LOCAL_GL_RGB);
         readAlignment = 2;
         break;
       }
-      default: { MOZ_CRASH("GFX: Bad read type, read type."); }
+      default: {
+        MOZ_CRASH("GFX: Bad read type, read type.");
+      }
     }
 
     int32_t stride = dest->GetSize().width * BytesPerPixel(readFormatGFX);
     tempSurf = Factory::CreateDataSourceSurfaceWithStride(
         dest->GetSize(), readFormatGFX, stride);
     if (NS_WARN_IF(!tempSurf)) {
       return;
     }
--- a/gfx/layers/ScrollableLayerGuid.h
+++ b/gfx/layers/ScrollableLayerGuid.h
@@ -103,15 +103,17 @@ struct ScrollableLayerGuid {
     }
   };
 };
 
 template <int LogLevel>
 gfx::Log<LogLevel>& operator<<(gfx::Log<LogLevel>& log,
                                const ScrollableLayerGuid& aGuid) {
   return log << nsPrintfCString("(0x%" PRIx64 ", %u, %" PRIu64 ")",
-          uint64_t(aGuid.mLayersId), aGuid.mPresShellId, aGuid.mScrollId).get();
+                                uint64_t(aGuid.mLayersId), aGuid.mPresShellId,
+                                aGuid.mScrollId)
+                    .get();
 }
 
 }  // namespace layers
 }  // namespace mozilla
 
 #endif /* GFX_SCROLLABLELAYERGUID_H */
--- a/gfx/layers/TreeTraversal.h
+++ b/gfx/layers/TreeTraversal.h
@@ -180,17 +180,18 @@ auto ForEachNodePostOrder(Node aRoot, co
 
 /*
  * ForEachNode post-order, not using TraversalFlag.
  */
 template <typename Iterator, typename Node, typename PostAction>
 auto ForEachNodePostOrder(Node aRoot, const PostAction& aPostAction) ->
     typename EnableIf<IsSame<decltype(aPostAction(aRoot)), void>::value,
                       void>::Type {
-  ForEachNode<Iterator>(aRoot, [](Node aNode) {}, aPostAction);
+  ForEachNode<Iterator>(
+      aRoot, [](Node aNode) {}, aPostAction);
 }
 
 /*
  * Do a breadth-first search of the tree rooted at |aRoot|, and return the
  * first visited node that satisfies |aCondition|, or nullptr if no such node
  * was found.
  *
  * |Iterator| and |Node| have all the same requirements seen in ForEachNode()'s
--- a/gfx/layers/composite/TextureHost.cpp
+++ b/gfx/layers/composite/TextureHost.cpp
@@ -735,17 +735,19 @@ static bool IsCompatibleTextureSource(Te
 
       return true;
     }
     case BufferDescriptor::TRGBDescriptor: {
       const RGBDescriptor& rgb = aDescriptor.get_RGBDescriptor();
       return aTexture->GetFormat() == rgb.format() &&
              aTexture->GetSize() == rgb.size();
     }
-    default: { return false; }
+    default: {
+      return false;
+    }
   }
 }
 
 void BufferTextureHost::PrepareTextureSource(
     CompositableTextureSourceRef& aTexture) {
   // Reuse WrappingTextureSourceYCbCrBasic to reduce memory consumption.
   if (mFormat == gfx::SurfaceFormat::YUV && !mHasIntermediateBuffer &&
       aTexture.get() && aTexture->AsWrappingTextureSourceYCbCrBasic() &&
--- a/gfx/layers/d3d11/TextureD3D11.cpp
+++ b/gfx/layers/d3d11/TextureD3D11.cpp
@@ -723,17 +723,19 @@ already_AddRefed<TextureHost> CreateText
           new DXGITextureHostD3D11(aFlags, aDesc.get_SurfaceDescriptorD3D10());
       break;
     }
     case SurfaceDescriptor::TSurfaceDescriptorDXGIYCbCr: {
       result = new DXGIYCbCrTextureHostD3D11(
           aFlags, aDesc.get_SurfaceDescriptorDXGIYCbCr());
       break;
     }
-    default: { MOZ_ASSERT_UNREACHABLE("Unsupported SurfaceDescriptor type"); }
+    default: {
+      MOZ_ASSERT_UNREACHABLE("Unsupported SurfaceDescriptor type");
+    }
   }
   return result.forget();
 }
 
 already_AddRefed<DrawTarget> D3D11TextureData::BorrowDrawTarget() {
   MOZ_ASSERT(NS_IsMainThread() || PaintThread::IsOnPaintThread());
 
   if (!mDrawTarget && mTexture) {
@@ -1039,17 +1041,19 @@ void DXGITextureHostD3D11::PushResourceU
       // So forcing A8 is okay.
       wr::ImageDescriptor descriptor0(mSize, gfx::SurfaceFormat::A8);
       wr::ImageDescriptor descriptor1(mSize / 2, gfx::SurfaceFormat::R8G8);
       auto bufferType = wr::WrExternalImageBufferType::TextureExternalHandle;
       (aResources.*method)(aImageKeys[0], descriptor0, aExtID, bufferType, 0);
       (aResources.*method)(aImageKeys[1], descriptor1, aExtID, bufferType, 1);
       break;
     }
-    default: { MOZ_ASSERT_UNREACHABLE("unexpected to be called"); }
+    default: {
+      MOZ_ASSERT_UNREACHABLE("unexpected to be called");
+    }
   }
 }
 
 void DXGITextureHostD3D11::PushDisplayItems(
     wr::DisplayListBuilder& aBuilder, const wr::LayoutRect& aBounds,
     const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
     const Range<wr::ImageKey>& aImageKeys) {
   switch (GetFormat()) {
@@ -1074,17 +1078,19 @@ void DXGITextureHostD3D11::PushDisplayIt
     case gfx::SurfaceFormat::P016: {
       MOZ_ASSERT(aImageKeys.length() == 2);
       aBuilder.PushNV12Image(aBounds, aClip, true, aImageKeys[0], aImageKeys[1],
                              wr::ColorDepth::Color16,
                              wr::ToWrYuvColorSpace(YUVColorSpace::BT601),
                              aFilter);
       break;
     }
-    default: { MOZ_ASSERT_UNREACHABLE("unexpected to be called"); }
+    default: {
+      MOZ_ASSERT_UNREACHABLE("unexpected to be called");
+    }
   }
 }
 
 DXGIYCbCrTextureHostD3D11::DXGIYCbCrTextureHostD3D11(
     TextureFlags aFlags, const SurfaceDescriptorDXGIYCbCr& aDescriptor)
     : TextureHost(aFlags),
       mSize(aDescriptor.size()),
       mSizeCbCr(aDescriptor.sizeCbCr()),
--- a/gfx/layers/ipc/CompositableTransactionParent.cpp
+++ b/gfx/layers/ipc/CompositableTransactionParent.cpp
@@ -225,34 +225,38 @@ bool CompositableParentManager::ReceiveC
         MOZ_ASSERT(texOnWhite->NumCompositableRefs() > 0);
       }
 
       if (UsesImageBridge()) {
         ScheduleComposition(aCompositable);
       }
       break;
     }
-    default: { MOZ_ASSERT(false, "bad type"); }
+    default: {
+      MOZ_ASSERT(false, "bad type");
+    }
   }
 
   return true;
 }
 
 void CompositableParentManager::DestroyActor(const OpDestroy& aOp) {
   switch (aOp.type()) {
     case OpDestroy::TPTextureParent: {
       auto actor = aOp.get_PTextureParent();
       TextureHost::ReceivedDestroy(actor);
       break;
     }
     case OpDestroy::TCompositableHandle: {
       ReleaseCompositable(aOp.get_CompositableHandle());
       break;
     }
-    default: { MOZ_ASSERT(false, "unsupported type"); }
+    default: {
+      MOZ_ASSERT(false, "unsupported type");
+    }
   }
 }
 
 RefPtr<CompositableHost> CompositableParentManager::AddCompositable(
     const CompositableHandle& aHandle, const TextureInfo& aInfo,
     bool aUseWebRender) {
   if (mCompositables.find(aHandle.Value()) != mCompositables.end()) {
     NS_ERROR("Client should not allocate duplicate handles");
--- a/gfx/layers/mlgpu/LayerManagerMLGPU.cpp
+++ b/gfx/layers/mlgpu/LayerManagerMLGPU.cpp
@@ -199,19 +199,17 @@ TextureFactoryIdentifier LayerManagerMLG
 }
 
 LayersBackend LayerManagerMLGPU::GetBackendType() {
   return mDevice ? mDevice->GetLayersBackend() : LayersBackend::LAYERS_NONE;
 }
 
 void LayerManagerMLGPU::SetRoot(Layer* aLayer) { mRoot = aLayer; }
 
-bool LayerManagerMLGPU::BeginTransaction(const nsCString& aURL) {
-  return true;
-}
+bool LayerManagerMLGPU::BeginTransaction(const nsCString& aURL) { return true; }
 
 void LayerManagerMLGPU::BeginTransactionWithDrawTarget(
     gfx::DrawTarget* aTarget, const gfx::IntRect& aRect) {
   MOZ_ASSERT(!mTarget);
 
   mTarget = aTarget;
   mTargetRect = aRect;
   return;
--- a/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp
+++ b/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp
@@ -188,17 +188,19 @@ void MacIOSurfaceTextureHostOGL::PushRes
       wr::ImageDescriptor descriptor1(
           gfx::IntSize(mSurface->GetDevicePixelWidth(1),
                        mSurface->GetDevicePixelHeight(1)),
           gfx::SurfaceFormat::R8G8);
       (aResources.*method)(aImageKeys[0], descriptor0, aExtID, bufferType, 0);
       (aResources.*method)(aImageKeys[1], descriptor1, aExtID, bufferType, 1);
       break;
     }
-    default: { MOZ_ASSERT_UNREACHABLE("unexpected to be called"); }
+    default: {
+      MOZ_ASSERT_UNREACHABLE("unexpected to be called");
+    }
   }
 }
 
 void MacIOSurfaceTextureHostOGL::PushDisplayItems(
     wr::DisplayListBuilder& aBuilder, const wr::LayoutRect& aBounds,
     const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
     const Range<wr::ImageKey>& aImageKeys) {
   switch (GetFormat()) {
@@ -228,14 +230,16 @@ void MacIOSurfaceTextureHostOGL::PushDis
       // Those images can only be generated at present by the Apple H264 decoder
       // which only supports 8 bits color depth.
       aBuilder.PushNV12Image(aBounds, aClip, true, aImageKeys[0], aImageKeys[1],
                              wr::ColorDepth::Color8,
                              wr::ToWrYuvColorSpace(YUVColorSpace::BT601),
                              aFilter);
       break;
     }
-    default: { MOZ_ASSERT_UNREACHABLE("unexpected to be called"); }
+    default: {
+      MOZ_ASSERT_UNREACHABLE("unexpected to be called");
+    }
   }
 }
 
 }  // namespace layers
 }  // namespace mozilla
--- a/gfx/layers/opengl/TextureHostOGL.cpp
+++ b/gfx/layers/opengl/TextureHostOGL.cpp
@@ -650,17 +650,19 @@ void SurfaceTextureHost::PushResourceUpd
       // With BGRA format setting, rendering works without problem.
       auto format = GetFormat() == gfx::SurfaceFormat::R8G8B8A8
                         ? gfx::SurfaceFormat::B8G8R8A8
                         : gfx::SurfaceFormat::B8G8R8X8;
       wr::ImageDescriptor descriptor(GetSize(), format);
       (aResources.*method)(aImageKeys[0], descriptor, aExtID, bufferType, 0);
       break;
     }
-    default: { MOZ_ASSERT_UNREACHABLE("unexpected to be called"); }
+    default: {
+      MOZ_ASSERT_UNREACHABLE("unexpected to be called");
+    }
   }
 }
 
 void SurfaceTextureHost::PushDisplayItems(
     wr::DisplayListBuilder& aBuilder, const wr::LayoutRect& aBounds,
     const wr::LayoutRect& aClip, wr::ImageRendering aFilter,
     const Range<wr::ImageKey>& aImageKeys) {
   switch (GetFormat()) {
@@ -668,17 +670,19 @@ void SurfaceTextureHost::PushDisplayItem
     case gfx::SurfaceFormat::R8G8B8A8:
     case gfx::SurfaceFormat::B8G8R8A8:
     case gfx::SurfaceFormat::B8G8R8X8: {
       MOZ_ASSERT(aImageKeys.length() == 1);
       aBuilder.PushImage(aBounds, aClip, true, aFilter, aImageKeys[0],
                          !(mFlags & TextureFlags::NON_PREMULTIPLIED));
       break;
     }
-    default: { MOZ_ASSERT_UNREACHABLE("unexpected to be called"); }
+    default: {
+      MOZ_ASSERT_UNREACHABLE("unexpected to be called");
+    }
   }
 }
 
 #endif  // MOZ_WIDGET_ANDROID
 
 ////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////
 // EGLImage
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -240,17 +240,19 @@ static bool IsContainerLayerItem(nsDispl
     case DisplayItemType::TYPE_OPACITY:
     case DisplayItemType::TYPE_FILTER:
     case DisplayItemType::TYPE_BLEND_CONTAINER:
     case DisplayItemType::TYPE_BLEND_MODE:
     case DisplayItemType::TYPE_MASK:
     case DisplayItemType::TYPE_PERSPECTIVE: {
       return true;
     }
-    default: { return false; }
+    default: {
+      return false;
+    }
   }
 }
 
 #include <sstream>
 
 static bool DetectContainerLayerPropertiesBoundsChange(
     nsDisplayItem* aItem, BlobItemData* aData,
     nsDisplayItemGeometry& aGeometry) {
--- a/gfx/src/FilterSupport.cpp
+++ b/gfx/src/FilterSupport.cpp
@@ -481,17 +481,19 @@ bool ComputeColorMatrix(const ColorMatri
       if (amount < 0 || amount > 1) {
         return false;
       }
 
       InterpolateFromIdentityMatrix(sepiaMatrix, amount, aOutMatrix);
       break;
     }
 
-    default: { return false; }
+    default: {
+      return false;
+    }
   }
 
   return !ArrayEqual(aOutMatrix, identityMatrix, 20);
 }
 
 static void DisableAllTransfers(FilterNode* aTransferFilterNode) {
   aTransferFilterNode->SetAttribute(ATT_TRANSFER_DISABLE_R, true);
   aTransferFilterNode->SetAttribute(ATT_TRANSFER_DISABLE_G, true);
--- a/gfx/thebes/gfxFontUtils.h
+++ b/gfx/thebes/gfxFontUtils.h
@@ -407,17 +407,19 @@ class SharedBitSet {
     }
     return true;
   }
 
  private:
   SharedBitSet() = delete;
 
   explicit SharedBitSet(const gfxSparseBitSet& aBitset)
-      : mBlockIndexCount(mozilla::AssertedCast<uint16_t>(aBitset.mBlockIndex.Length())), mBlockCount(0) {
+      : mBlockIndexCount(
+            mozilla::AssertedCast<uint16_t>(aBitset.mBlockIndex.Length())),
+        mBlockCount(0) {
     uint16_t* blockIndex = reinterpret_cast<uint16_t*>(this + 1);
     Block* blocks = reinterpret_cast<Block*>(blockIndex + mBlockIndexCount);
     for (uint16_t i = 0; i < mBlockIndexCount; i++) {
       if (aBitset.mBlockIndex[i] != NO_BLOCK) {
         const Block& srcBlock = aBitset.mBlocks[aBitset.mBlockIndex[i]];
         std::memcpy(&blocks[mBlockCount], &srcBlock, sizeof(Block));
         blockIndex[i] = mBlockCount;
         mBlockCount++;
--- a/gfx/thebes/gfxTypes.h
+++ b/gfx/thebes/gfxTypes.h
@@ -8,17 +8,17 @@
 
 #include <stdint.h>
 #include "mozilla/TypedEnumBits.h"
 #include "nsStyleConsts.h"
 
 typedef struct _cairo_surface cairo_surface_t;
 typedef struct _cairo_user_data_key cairo_user_data_key_t;
 
-typedef void (*thebes_destroy_func_t)(void *data);
+typedef void (*thebes_destroy_func_t)(void* data);
 
 /**
  * Currently needs to be 'double' for Cairo compatibility. Could
  * become 'float', perhaps, in some configurations.
  */
 typedef double gfxFloat;
 
 /**
--- a/gfx/vr/VRDisplayClient.cpp
+++ b/gfx/vr/VRDisplayClient.cpp
@@ -153,20 +153,20 @@ void VRDisplayClient::FireGamepadEvents(
 
     // Send events to notify that new controllers are added
     RefPtr<dom::Gamepad> existing =
         gamepadManager->GetGamepad(gamepadId, dom::GamepadServiceType::VR);
     // ControllerState in OpenVR action-based API gets delay to query btn and
     // axis count. So, we need to check if they are more than zero.
     if ((lastState.controllerName[0] == '\0' || !existing) &&
         (state.numButtons > 0 || state.numAxes > 0)) {
-      dom::GamepadAdded info(
-          NS_ConvertUTF8toUTF16(state.controllerName),
-          dom::GamepadMappingType::_empty, state.hand, mDisplayInfo.mDisplayID,
-          state.numButtons, state.numAxes, state.numHaptics);
+      dom::GamepadAdded info(NS_ConvertUTF8toUTF16(state.controllerName),
+                             dom::GamepadMappingType::_empty, state.hand,
+                             mDisplayInfo.mDisplayID, state.numButtons,
+                             state.numAxes, state.numHaptics);
       dom::GamepadChangeEventBody body(info);
       dom::GamepadChangeEvent event(gamepadId, dom::GamepadServiceType::VR,
                                     body);
       gamepadManager->Update(event);
       bIsNew = true;
     }
 
     // Send events for handedness changes
--- a/gfx/vr/ipc/VRChild.cpp
+++ b/gfx/vr/ipc/VRChild.cpp
@@ -62,19 +62,17 @@ class OpenVRControllerManifestManager {
 
   nsCString mAction;
   nsDataHashtable<nsUint32HashKey, nsCString> mManifest;
   DISALLOW_COPY_AND_ASSIGN(OpenVRControllerManifestManager);
 };
 
 StaticRefPtr<OpenVRControllerManifestManager> sOpenVRControllerManifestManager;
 
-VRChild::VRChild(VRProcessParent* aHost)
-  : mHost(aHost),
-    mVRReady(false) {
+VRChild::VRChild(VRProcessParent* aHost) : mHost(aHost), mVRReady(false) {
   MOZ_ASSERT(XRE_IsParentProcess());
 }
 
 mozilla::ipc::IPCResult VRChild::RecvAddMemoryReport(
     const MemoryReport& aReport) {
   if (mMemoryReportRequest) {
     mMemoryReportRequest->RecvReport(aReport);
   }
@@ -195,19 +193,19 @@ mozilla::ipc::IPCResult VRChild::RecvIni
     Shmem&& aShmem, const NativeThreadId& aThreadId) {
   mCrashReporter = MakeUnique<ipc::CrashReporterHost>(GeckoProcessType_VR,
                                                       aShmem, aThreadId);
 
   return IPC_OK();
 }
 
 bool VRChild::SendRequestMemoryReport(const uint32_t& aGeneration,
-                                       const bool& aAnonymize,
-                                       const bool& aMinimizeMemoryUsage,
-                                       const Maybe<FileDescriptor>& aDMDFile) {
+                                      const bool& aAnonymize,
+                                      const bool& aMinimizeMemoryUsage,
+                                      const Maybe<FileDescriptor>& aDMDFile) {
   mMemoryReportRequest = MakeUnique<MemoryReportRequestHost>(aGeneration);
   Unused << PVRChild::SendRequestMemoryReport(aGeneration, aAnonymize,
                                               aMinimizeMemoryUsage, aDMDFile);
   return true;
 }
 
 void VRChild::OnVarChanged(const GfxVarUpdate& aVar) { SendUpdateVar(aVar); }
 
--- a/intl/locale/nsLanguageAtomService.cpp
+++ b/intl/locale/nsLanguageAtomService.cpp
@@ -178,21 +178,22 @@ nsStaticAtom* nsLanguageAtomService::Get
       if (loc.GetScript().EqualsLiteral("Hant")) {
         if (loc.GetRegion().EqualsLiteral("HK")) {
           return nsGkAtoms::HongKongChinese;
         }
         return nsGkAtoms::Taiwanese;
       } else {
         size_t foundIndex;
         const nsCString& script = loc.GetScript();
-        if (BinarySearchIf(kScriptLangGroup, 0, ArrayLength(kScriptLangGroup),
-                           [script](const auto& entry) -> int {
-                             return script.Compare(entry.mTag);
-                           },
-                           &foundIndex)) {
+        if (BinarySearchIf(
+                kScriptLangGroup, 0, ArrayLength(kScriptLangGroup),
+                [script](const auto& entry) -> int {
+                  return script.Compare(entry.mTag);
+                },
+                &foundIndex)) {
           return kScriptLangGroup[foundIndex].mAtom;
         }
       }
     }
   }
 
   // Fall back to x-unicode if no match was found
   return nsGkAtoms::Unicode;
--- a/intl/strres/nsStringBundle.cpp
+++ b/intl/strres/nsStringBundle.cpp
@@ -80,19 +80,19 @@ static const char kContentBundles[][52] 
     "chrome://global/locale/svg/svg.properties",
     "chrome://global/locale/xbl.properties",
     "chrome://global/locale/xul.properties",
     "chrome://necko/locale/necko.properties",
 };
 
 static bool IsContentBundle(const nsCString& aUrl) {
   size_t index;
-  return BinarySearchIf(kContentBundles, 0, MOZ_ARRAY_LENGTH(kContentBundles),
-                        [&](const char* aElem) { return aUrl.Compare(aElem); },
-                        &index);
+  return BinarySearchIf(
+      kContentBundles, 0, MOZ_ARRAY_LENGTH(kContentBundles),
+      [&](const char* aElem) { return aUrl.Compare(aElem); }, &index);
 }
 
 namespace {
 
 #define STRINGBUNDLEPROXY_IID                        \
   {                                                  \
     0x537cf21b, 0x99fc, 0x4002, {                    \
       0x9e, 0xec, 0x97, 0xbe, 0x4d, 0xe0, 0xb3, 0xdc \
--- a/intl/uconv/nsTextToSubURI.cpp
+++ b/intl/uconv/nsTextToSubURI.cpp
@@ -123,22 +123,22 @@ NS_IMETHODIMP nsTextToSubURI::UnEscapeUR
     // we allow SPACE and IDEOGRAPHIC SPACE in this method
     mozilla::net::RemoveCharFromBlocklist(u' ', mIDNBlocklist);
     mozilla::net::RemoveCharFromBlocklist(0x3000, mIDNBlocklist);
   }
 
   MOZ_ASSERT(!mIDNBlocklist.IsEmpty());
   const nsPromiseFlatString& unescapedResult = PromiseFlatString(_retval);
   nsString reescapedSpec;
-  _retval =
-      NS_EscapeURL(unescapedResult,
-                   [&](char16_t aChar) -> bool {
-                     return mozilla::net::CharInBlocklist(aChar, mIDNBlocklist);
-                   },
-                   reescapedSpec);
+  _retval = NS_EscapeURL(
+      unescapedResult,
+      [&](char16_t aChar) -> bool {
+        return mozilla::net::CharInBlocklist(aChar, mIDNBlocklist);
+      },
+      reescapedSpec);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsTextToSubURI::UnEscapeNonAsciiURI(const nsACString& aCharset,
                                     const nsACString& aURIFragment,
                                     nsAString& _retval) {
--- a/ipc/glue/WindowsMessageLoop.cpp
+++ b/ipc/glue/WindowsMessageLoop.cpp
@@ -143,17 +143,19 @@ void CALLBACK WinEventHook(HWINEVENTHOOK
     }
     case EVENT_OBJECT_DESTROY: {
       if (aHwnd == gCOMWindow && aIdObject == OBJID_WINDOW) {
         MOZ_ASSERT(aIdChild == CHILDID_SELF);
         gCOMWindow = 0;
       }
       break;
     }
-    default: { return; }
+    default: {
+      return;
+    }
   }
 }
 
 LRESULT CALLBACK DeferredMessageHook(int nCode, WPARAM wParam, LPARAM lParam) {
   // XXX This function is called for *both* the WH_CALLWNDPROC hook and the
   //     WH_GETMESSAGE hook, but they have different parameters. We don't
   //     use any of them except nCode which has the same meaning.
 
@@ -789,18 +791,17 @@ static void StopNeutering() {
   // someone else calls GetMessage, PeekMessage, or runs code that generates
   // a "nonqueued" message.
   ::ScheduleDeferredMessageRun();
   MessageChannel::SetIsPumpingMessages(false);
 }
 
 NeuteredWindowRegion::NeuteredWindowRegion(
     bool aDoNeuter MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
-    : mNeuteredByThis(!gWindowHook &&
-                      aDoNeuter &&
+    : mNeuteredByThis(!gWindowHook && aDoNeuter &&
                       XRE_UseNativeEventProcessing()) {
   MOZ_GUARD_OBJECT_NOTIFIER_INIT;
   if (mNeuteredByThis) {
     StartNeutering();
   }
 }
 
 NeuteredWindowRegion::~NeuteredWindowRegion() {
--- a/ipc/mscom/AgileReference.cpp
+++ b/ipc/mscom/AgileReference.cpp
@@ -8,18 +8,18 @@
 
 #include "mozilla/Assertions.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/DynamicallyLinkedFunctionPtr.h"
 #include "mozilla/Move.h"
 #include "mozilla/mscom/Utils.h"
 
 #if defined(MOZILLA_INTERNAL_API)
-#include "nsDebug.h"
-#include "nsPrintfCString.h"
+#  include "nsDebug.h"
+#  include "nsPrintfCString.h"
 #endif  // defined(MOZILLA_INTERNAL_API)
 
 #if NTDDI_VERSION < NTDDI_WINBLUE
 
 // Declarations from Windows SDK specific to Windows 8.1
 
 enum AgileReferenceOptions {
   AGILEREFERENCE_DEFAULT = 0,
@@ -101,19 +101,23 @@ void AgileReference::Clear() {
   IGlobalInterfaceTable* git = ObtainGit();
   MOZ_ASSERT(git);
   if (!git) {
     return;
   }
 
   DebugOnly<HRESULT> hr = git->RevokeInterfaceFromGlobal(mGitCookie);
 #if defined(MOZILLA_INTERNAL_API)
-  NS_WARNING_ASSERTION(SUCCEEDED(hr), nsPrintfCString(
-      "IGlobalInterfaceTable::RevokeInterfaceFromGlobal failed with HRESULT "
-      "0x%08lX", ((HRESULT)hr)).get());
+  NS_WARNING_ASSERTION(
+      SUCCEEDED(hr),
+      nsPrintfCString("IGlobalInterfaceTable::RevokeInterfaceFromGlobal failed "
+                      "with HRESULT "
+                      "0x%08lX",
+                      ((HRESULT)hr))
+          .get());
 #else
   MOZ_ASSERT(SUCCEEDED(hr));
 #endif  // defined(MOZILLA_INTERNAL_API)
   mGitCookie = 0;
 }
 
 AgileReference& AgileReference::operator=(AgileReference&& aOther) {
   Clear();
--- a/js/public/Conversions.h
+++ b/js/public/Conversions.h
@@ -343,17 +343,18 @@ inline UnsignedInteger ToUnsignedInteger
   //   bogus bits in |result|.  This implies |exponent < ResultWidth|.  Any
   //   right-shift less than |ResultWidth| does too, which implies
   //   |DoubleExponentShift - ResultWidth < exponent|.  By assumption, then,
   //   |exponent| is negative, but we excluded that above.  So bogus bits
   //   need only |exponent < ResultWidth|.
   //   The implicit leading bit matters identically to the other case, so
   //   again, |exponent < ResultWidth|.
   if (exponent < ResultWidth) {
-    const auto implicitOne = static_cast<UnsignedInteger>(UnsignedInteger{1} << exponent);
+    const auto implicitOne =
+        static_cast<UnsignedInteger>(UnsignedInteger{1} << exponent);
     result &= implicitOne - 1;  // remove bogus bits
     result += implicitOne;      // add the implicit bit
   }
 
   // Compute the congruent value in the signed range.
   return (bits & mozilla::FloatingPoint<double>::kSignBit) ? ~result + 1
                                                            : result;
 }
--- a/js/public/RegExp.h
+++ b/js/public/RegExp.h
@@ -9,18 +9,18 @@
 #ifndef js_RegExp_h
 #define js_RegExp_h
 
 #include <stddef.h>  // size_t
 
 #include "jstypes.h"  // JS_PUBLIC_API
 
 #include "js/RegExpFlags.h"  // JS::RegExpFlags
-#include "js/RootingAPI.h"  // JS::{,Mutable}Handle
-#include "js/Value.h"       // JS::Value
+#include "js/RootingAPI.h"   // JS::{,Mutable}Handle
+#include "js/Value.h"        // JS::Value
 
 struct JSContext;
 class JSString;
 
 namespace JS {
 
 /**
  * Create a new RegExp for the given Latin-1-encoded bytes and flags.
--- a/js/src/builtin/String.cpp
+++ b/js/src/builtin/String.cpp
@@ -1571,29 +1571,29 @@ bool js::str_normalize(JSContext* cx, un
     return false;
   }
 
   // Copy the already normalized prefix.
   if (spanLength > 0) {
     PodCopy(chars.begin(), srcChars.begin().get(), spanLength);
   }
 
-  int32_t size =
-      intl::CallICU(cx,
-                    [normalizer, &srcChars, spanLength](
-                        UChar* chars, uint32_t size, UErrorCode* status) {
-                      mozilla::RangedPtr<const char16_t> remainingStart =
-                          srcChars.begin() + spanLength;
-                      size_t remainingLength = srcChars.length() - spanLength;
-
-                      return unorm2_normalizeSecondAndAppend(
-                          normalizer, chars, spanLength, size,
-                          remainingStart.get(), remainingLength, status);
-                    },
-                    chars);
+  int32_t size = intl::CallICU(
+      cx,
+      [normalizer, &srcChars, spanLength](UChar* chars, uint32_t size,
+                                          UErrorCode* status) {
+        mozilla::RangedPtr<const char16_t> remainingStart =
+            srcChars.begin() + spanLength;
+        size_t remainingLength = srcChars.length() - spanLength;
+
+        return unorm2_normalizeSecondAndAppend(normalizer, chars, spanLength,
+                                               size, remainingStart.get(),
+                                               remainingLength, status);
+      },
+      chars);
   if (size < 0) {
     return false;
   }
 
   JSString* ns = NewStringCopyN<CanGC>(cx, chars.begin(), size);
   if (!ns) {
     return false;
   }
--- a/js/src/gc/Barrier.h
+++ b/js/src/gc/Barrier.h
@@ -972,17 +972,16 @@ struct DefaultHasher<js::PreBarriered<T>
 /* Specialized hashing policy for ReadBarriereds. */
 template <class T>
 struct DefaultHasher<js::ReadBarriered<T>> : js::ReadBarrieredHasher<T> {};
 
 }  // namespace mozilla
 
 namespace js {
 
-
 class ArrayObject;
 class DebugEnvironmentProxy;
 class GlobalObject;
 class ObjectGroup;
 class PropertyName;
 class Scope;
 class ScriptSourceObject;
 class Shape;
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -7865,17 +7865,18 @@ JS::AutoDisableGenerationalGC::AutoDisab
   if (!cx->generationalDisabled) {
     cx->runtime()->gc.evictNursery(JS::GCReason::DISABLE_GENERATIONAL_GC);
     cx->nursery().disable();
   }
   ++cx->generationalDisabled;
 }
 
 JS::AutoDisableGenerationalGC::~AutoDisableGenerationalGC() {
-  if (--cx->generationalDisabled == 0 && cx->runtime()->gc.tunables.gcMaxNurseryBytes() > 0) {
+  if (--cx->generationalDisabled == 0 &&
+      cx->runtime()->gc.tunables.gcMaxNurseryBytes() > 0) {
     cx->nursery().enable();
   }
 }
 
 JS_PUBLIC_API bool JS::IsGenerationalGCEnabled(JSRuntime* rt) {
   return !rt->mainContextFromOwnThread()->generationalDisabled;
 }
 
--- a/js/src/jit/BaselineJIT.cpp
+++ b/js/src/jit/BaselineJIT.cpp
@@ -520,53 +520,55 @@ struct RetAddrEntries {
 };
 
 RetAddrEntry& BaselineScript::retAddrEntryFromReturnOffset(
     CodeOffset returnOffset) {
   size_t loc;
 #ifdef DEBUG
   bool found =
 #endif
-      BinarySearchIf(RetAddrEntries(this), 0, numRetAddrEntries(),
-                     [&returnOffset](const RetAddrEntry& entry) {
-                       size_t roffset = returnOffset.offset();
-                       size_t entryRoffset = entry.returnOffset().offset();
-                       if (roffset < entryRoffset) {
-                         return -1;
-                       }
-                       if (entryRoffset < roffset) {
-                         return 1;
-                       }
-                       return 0;
-                     },
-                     &loc);
+      BinarySearchIf(
+          RetAddrEntries(this), 0, numRetAddrEntries(),
+          [&returnOffset](const RetAddrEntry& entry) {
+            size_t roffset = returnOffset.offset();
+            size_t entryRoffset = entry.returnOffset().offset();
+            if (roffset < entryRoffset) {
+              return -1;
+            }
+            if (entryRoffset < roffset) {
+              return 1;
+            }
+            return 0;
+          },
+          &loc);
 
   MOZ_ASSERT(found);
   MOZ_ASSERT(loc < numRetAddrEntries());
   MOZ_ASSERT(retAddrEntry(loc).returnOffset().offset() ==
              returnOffset.offset());
   return retAddrEntry(loc);
 }
 
 template <typename Entries, typename ScriptT>
 static inline bool ComputeBinarySearchMid(ScriptT* script, uint32_t pcOffset,
                                           size_t* loc) {
   Entries entries(script);
-  return BinarySearchIf(entries, 0, entries.numEntries(),
-                        [pcOffset](typename Entries::EntryT& entry) {
-                          uint32_t entryOffset = entry.pcOffset();
-                          if (pcOffset < entryOffset) {
-                            return -1;
-                          }
-                          if (entryOffset < pcOffset) {
-                            return 1;
-                          }
-                          return 0;
-                        },
-                        loc);
+  return BinarySearchIf(
+      entries, 0, entries.numEntries(),
+      [pcOffset](typename Entries::EntryT& entry) {
+        uint32_t entryOffset = entry.pcOffset();
+        if (pcOffset < entryOffset) {
+          return -1;
+        }
+        if (entryOffset < pcOffset) {
+          return 1;
+        }
+        return 0;
+      },
+      loc);
 }
 
 uint8_t* BaselineScript::returnAddressForEntry(const RetAddrEntry& ent) {
   return method()->raw() + ent.returnOffset().offset();
 }
 
 ICEntry* ICScript::maybeICEntryFromPCOffset(uint32_t pcOffset) {
   // Multiple IC entries can have the same PC offset, but this method only looks
--- a/js/src/jit/ExecutableAllocator.h
+++ b/js/src/jit/ExecutableAllocator.h
@@ -234,17 +234,17 @@ class ExecutableAllocator {
         ".set   noreorder \n"
         "move   %[tmp], $ra \n"
         "bal    1f \n"
         "daddiu $ra, 8 \n"
         "1: \n"
         "jr.hb  $ra \n"
         "move   $ra, %[tmp] \n"
         ".set   pop\n"
-        : [tmp] "=&r"(tmp));
+        : [ tmp ] "=&r"(tmp));
 #  elif defined(__GNUC__)
     intptr_t end = reinterpret_cast<intptr_t>(code) + size;
     __builtin___clear_cache(reinterpret_cast<char*>(code),
                             reinterpret_cast<char*>(end));
 #  else
     _flush_cache(reinterpret_cast<char*>(code), size, BCACHE);
 #  endif
   }
--- a/js/src/jit/arm/MacroAssembler-arm.cpp
+++ b/js/src/jit/arm/MacroAssembler-arm.cpp
@@ -6107,17 +6107,19 @@ void MacroAssemblerARM::wasmUnalignedLoa
         }
       } else {
         emitUnalignedLoad(&access, isSigned, byteSize, ptr, tmp, outAny.gpr());
       }
       break;
     }
     case Scalar::Int8:
     case Scalar::Uint8:
-    default: { MOZ_CRASH("Bad type"); }
+    default: {
+      MOZ_CRASH("Bad type");
+    }
   }
 
   asMasm().memoryBarrierAfter(access.sync());
 }
 
 void MacroAssemblerARM::wasmUnalignedStoreImpl(
     const wasm::MemoryAccessDesc& access, FloatRegister floatValue,
     Register64 val64, Register memoryBase, Register ptr, Register ptrScratch,
--- a/js/src/jit/arm64/MacroAssembler-arm64.cpp
+++ b/js/src/jit/arm64/MacroAssembler-arm64.cpp
@@ -1568,17 +1568,19 @@ static void LoadExclusive(MacroAssembler
                             /* max number of instructions in scope = */ 1);
         if (access) {
           masm.append(*access, masm.currentOffset());
         }
         masm.Ldxr(X(dest), ptr);
       }
       break;
     }
-    default: { MOZ_CRASH(); }
+    default: {
+      MOZ_CRASH();
+    }
   }
 }
 
 static void StoreExclusive(MacroAssembler& masm, Scalar::Type type,
                            Register status, Register src, MemOperand ptr) {
   switch (Scalar::byteSize(type)) {
     case 1:
       masm.Stxrb(W(status), W(src), ptr);
--- a/js/src/jit/none/MacroAssembler-none.h
+++ b/js/src/jit/none/MacroAssembler-none.h
@@ -39,18 +39,18 @@ static constexpr Register OsrFrameReg{Re
 static constexpr Register PreBarrierReg{Registers::invalid_reg};
 static constexpr Register CallTempReg0{Registers::invalid_reg};
 static constexpr Register CallTempReg1{Registers::invalid_reg};
 static constexpr Register CallTempReg2{Registers::invalid_reg};
 static constexpr Register CallTempReg3{Registers::invalid_reg};
 static constexpr Register CallTempReg4{Registers::invalid_reg};
 static constexpr Register CallTempReg5{Registers::invalid_reg};
 static constexpr Register InvalidReg{Registers::invalid_reg};
-  static constexpr Register CallTempNonArgRegs[] = {InvalidReg, InvalidReg};
-  static const uint32_t NumCallTempNonArgRegs =
+static constexpr Register CallTempNonArgRegs[] = {InvalidReg, InvalidReg};
+static const uint32_t NumCallTempNonArgRegs =
     mozilla::ArrayLength(CallTempNonArgRegs);
 
 static constexpr Register IntArgReg0{Registers::invalid_reg};
 static constexpr Register IntArgReg1{Registers::invalid_reg};
 static constexpr Register IntArgReg2{Registers::invalid_reg};
 static constexpr Register IntArgReg3{Registers::invalid_reg};
 static constexpr Register HeapReg{Registers::invalid_reg};
 
--- a/js/src/jit/shared/AtomicOperations-shared-jit.cpp
+++ b/js/src/jit/shared/AtomicOperations-shared-jit.cpp
@@ -193,17 +193,19 @@ static void GenGprArg(MacroAssembler& ma
       break;
     }
     case ABIArg::Stack: {
       Address src(masm.getStackPointer(),
                   iter->argBase + arg.offsetFromArgBase());
       masm.loadPtr(src, reg);
       break;
     }
-    default: { MOZ_CRASH("Not possible"); }
+    default: {
+      MOZ_CRASH("Not possible");
+    }
   }
 }
 
 static void GenGpr64Arg(MacroAssembler& masm, ArgIterator* iter,
                         Register64 reg) {
   ABIArg arg = iter->abi.next(MIRType::Int64);
   switch (arg.kind()) {
     case ABIArg::GPR: {
@@ -227,17 +229,19 @@ static void GenGpr64Arg(MacroAssembler& 
     case ABIArg::GPR_PAIR: {
       if (arg.gpr64() != reg) {
         masm.move32(arg.oddGpr(), reg.high);
         masm.move32(arg.evenGpr(), reg.low);
       }
       break;
     }
 #endif
-    default: { MOZ_CRASH("Not possible"); }
+    default: {
+      MOZ_CRASH("Not possible");
+    }
   }
 }
 
 static uint32_t GenPrologue(MacroAssembler& masm, ArgIterator* iter) {
   masm.assumeUnreachable("Shouldn't get here");
   masm.flushBuffer();
   masm.haltingAlign(CodeAlignment);
   masm.setFramePushed(0);
--- a/js/src/jsapi-tests/testChromeBuffer.cpp
+++ b/js/src/jsapi-tests/testChromeBuffer.cpp
@@ -5,19 +5,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "js/CompilationAndEvaluation.h"
 #include "js/ContextOptions.h"
 #include "jsapi-tests/tests.h"
 
 static TestJSPrincipals system_principals(1);
 
-static const JSClass global_class = {
-    "global", JSCLASS_IS_GLOBAL | JSCLASS_GLOBAL_FLAGS,
-    &JS::DefaultGlobalClassOps};
+static const JSClass global_class = {"global",
+                                     JSCLASS_IS_GLOBAL | JSCLASS_GLOBAL_FLAGS,
+                                     &JS::DefaultGlobalClassOps};
 
 static JS::PersistentRootedObject trusted_glob;
 static JS::PersistentRootedObject trusted_fun;
 
 static bool CallTrusted(JSContext* cx, unsigned argc, JS::Value* vp) {
   JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
 
   bool ok = false;
--- a/js/src/jsapi-tests/testCompileUtf8.cpp
+++ b/js/src/jsapi-tests/testCompileUtf8.cpp
@@ -18,108 +18,116 @@
 
 using mozilla::ArrayEqual;
 using mozilla::ArrayLength;
 using mozilla::IsAsciiHexDigit;
 using mozilla::Utf8Unit;
 
 BEGIN_TEST(testUtf8BadBytes) {
   static const char badLeadingUnit[] = "var x = \x80";
-  CHECK(testBadUtf8(badLeadingUnit, JSMSG_BAD_LEADING_UTF8_UNIT,
-                    [this](JS::ConstUTF8CharsZ message) {
-                      const char* chars = message.c_str();
-                      CHECK(startsWith(chars, "0x80"));
-                      CHECK(isBadLeadUnitMessage(chars));
-                      return true;
-                    },
-                    "0x80"));
+  CHECK(testBadUtf8(
+      badLeadingUnit, JSMSG_BAD_LEADING_UTF8_UNIT,
+      [this](JS::ConstUTF8CharsZ message) {
+        const char* chars = message.c_str();
+        CHECK(startsWith(chars, "0x80"));
+        CHECK(isBadLeadUnitMessage(chars));
+        return true;
+      },
+      "0x80"));
 
   static const char badSecondInTwoByte[] = "var x = \xDF\x20";
-  CHECK(testBadUtf8(badSecondInTwoByte, JSMSG_BAD_TRAILING_UTF8_UNIT,
-                    [this](JS::ConstUTF8CharsZ message) {
-                      const char* chars = message.c_str();
-                      CHECK(isBadTrailingBytesMessage(chars));
-                      CHECK(contains(chars, "0x20"));
-                      return true;
-                    },
-                    "0xDF 0x20"));
+  CHECK(testBadUtf8(
+      badSecondInTwoByte, JSMSG_BAD_TRAILING_UTF8_UNIT,
+      [this](JS::ConstUTF8CharsZ message) {
+        const char* chars = message.c_str();
+        CHECK(isBadTrailingBytesMessage(chars));
+        CHECK(contains(chars, "0x20"));
+        return true;
+      },
+      "0xDF 0x20"));
 
   static const char badSecondInThreeByte[] = "var x = \xEF\x17\xA7";
-  CHECK(testBadUtf8(badSecondInThreeByte, JSMSG_BAD_TRAILING_UTF8_UNIT,
-                    [this](JS::ConstUTF8CharsZ message) {
-                      const char* chars = message.c_str();
-                      CHECK(isBadTrailingBytesMessage(chars));
-                      CHECK(contains(chars, "0x17"));
-                      return true;
-                    },
-                    // Validating stops with the first invalid code unit and
-                    // shouldn't go beyond that.
-                    "0xEF 0x17"));
+  CHECK(testBadUtf8(
+      badSecondInThreeByte, JSMSG_BAD_TRAILING_UTF8_UNIT,
+      [this](JS::ConstUTF8CharsZ message) {
+        const char* chars = message.c_str();
+        CHECK(isBadTrailingBytesMessage(chars));
+        CHECK(contains(chars, "0x17"));
+        return true;
+      },
+      // Validating stops with the first invalid code unit and
+      // shouldn't go beyond that.
+      "0xEF 0x17"));
 
   static const char lengthTwoTooShort[] = "var x = \xDF";
-  CHECK(testBadUtf8(lengthTwoTooShort, JSMSG_NOT_ENOUGH_CODE_UNITS,
-                    [this](JS::ConstUTF8CharsZ message) {
-                      const char* chars = message.c_str();
-                      CHECK(isNotEnoughUnitsMessage(chars));
-                      CHECK(contains(chars, "0xDF"));
-                      CHECK(
-                          contains(chars, " 1 byte, but 0 bytes were present"));
-                      return true;
-                    },
-                    "0xDF"));
+  CHECK(testBadUtf8(
+      lengthTwoTooShort, JSMSG_NOT_ENOUGH_CODE_UNITS,
+      [this](JS::ConstUTF8CharsZ message) {
+        const char* chars = message.c_str();
+        CHECK(isNotEnoughUnitsMessage(chars));
+        CHECK(contains(chars, "0xDF"));
+        CHECK(contains(chars, " 1 byte, but 0 bytes were present"));
+        return true;
+      },
+      "0xDF"));
 
   static const char forbiddenHighSurrogate[] = "var x = \xED\xA2\x87";
-  CHECK(testBadUtf8(forbiddenHighSurrogate, JSMSG_FORBIDDEN_UTF8_CODE_POINT,
-                    [this](JS::ConstUTF8CharsZ message) {
-                      const char* chars = message.c_str();
-                      CHECK(isSurrogateMessage(chars));
-                      CHECK(contains(chars, "0xD887"));
-                      return true;
-                    },
-                    "0xED 0xA2 0x87"));
+  CHECK(testBadUtf8(
+      forbiddenHighSurrogate, JSMSG_FORBIDDEN_UTF8_CODE_POINT,
+      [this](JS::ConstUTF8CharsZ message) {
+        const char* chars = message.c_str();
+        CHECK(isSurrogateMessage(chars));
+        CHECK(contains(chars, "0xD887"));
+        return true;
+      },
+      "0xED 0xA2 0x87"));
 
   static const char forbiddenLowSurrogate[] = "var x = \xED\xB7\xAF";
-  CHECK(testBadUtf8(forbiddenLowSurrogate, JSMSG_FORBIDDEN_UTF8_CODE_POINT,
-                    [this](JS::ConstUTF8CharsZ message) {
-                      const char* chars = message.c_str();
-                      CHECK(isSurrogateMessage(chars));
-                      CHECK(contains(chars, "0xDDEF"));
-                      return true;
-                    },
-                    "0xED 0xB7 0xAF"));
+  CHECK(testBadUtf8(
+      forbiddenLowSurrogate, JSMSG_FORBIDDEN_UTF8_CODE_POINT,
+      [this](JS::ConstUTF8CharsZ message) {
+        const char* chars = message.c_str();
+        CHECK(isSurrogateMessage(chars));
+        CHECK(contains(chars, "0xDDEF"));
+        return true;
+      },
+      "0xED 0xB7 0xAF"));
 
   static const char oneTooBig[] = "var x = \xF4\x90\x80\x80";
-  CHECK(testBadUtf8(oneTooBig, JSMSG_FORBIDDEN_UTF8_CODE_POINT,
-                    [this](JS::ConstUTF8CharsZ message) {
-                      const char* chars = message.c_str();
-