Backed out changeset 389b6bbd76db (bug 1519636) for bustages on MarkupMap.h . CLOSED TREE
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Fri, 05 Apr 2019 00:27:56 +0300
changeset 1947634 9e48fefcf1aca74fd97036121180907de52756e8
parent 1947633 39e6ec535eb4662b07694a337406de47125acb94
child 1947635 aa4c97d22712b946f70a4b88f9ea927ce969d611
child 1964532 8ba031cde0c02c70f92aee61def4863b1f51311a
push id347869
push userrthijssen@mozilla.com
push dateFri, 05 Apr 2019 03:24:39 +0000
treeherdertry@aa4c97d22712 [default view] [failures only]
bugs1519636
milestone68.0a1
backs out389b6bbd76dbdf3357453f0989bbe9595751b7ae
Backed out changeset 389b6bbd76db (bug 1519636) for bustages on MarkupMap.h . CLOSED TREE
accessible/base/MarkupMap.h
caps/tests/gtest/TestOriginAttributes.cpp
dom/base/AnonymousContent.cpp
dom/base/DocGroup.cpp
dom/base/Document.cpp
dom/base/TreeOrderedArrayInlines.h
dom/base/UIDirectionManager.cpp
dom/base/nsAttrValue.cpp
dom/base/nsAttrValueInlines.h
dom/base/nsCCUncollectableMarker.cpp
dom/base/test/gtest/TestContentUtils.cpp
dom/base/test/gtest/TestMimeType.cpp
dom/base/test/gtest/TestPlainTextSerializer.cpp
dom/base/test/gtest/TestXPathGenerator.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/canvas/gtest/TestImageBitmapColorUtils.cpp
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/localstorage/test/gtest/TestLocalStorage.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/doctor/gtest/TestMultiWriterQueue.cpp
dom/media/doctor/gtest/TestRollingNumber.cpp
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/TestAudioBuffers.cpp
dom/media/gtest/TestAudioCompactor.cpp
dom/media/gtest/TestAudioDeviceEnumerator.cpp
dom/media/gtest/TestAudioMixer.cpp
dom/media/gtest/TestAudioPacketizer.cpp
dom/media/gtest/TestAudioSegment.cpp
dom/media/gtest/TestAudioTrackEncoder.cpp
dom/media/gtest/TestBitWriter.cpp
dom/media/gtest/TestBlankVideoDataCreator.cpp
dom/media/gtest/TestBufferReader.cpp
dom/media/gtest/TestCDMStorage.cpp
dom/media/gtest/TestDataMutex.cpp
dom/media/gtest/TestGMPCrossOrigin.cpp
dom/media/gtest/TestGMPRemoveAndDelete.cpp
dom/media/gtest/TestGMPUtils.cpp
dom/media/gtest/TestGroupId.cpp
dom/media/gtest/TestIntervalSet.cpp
dom/media/gtest/TestMP4Demuxer.cpp
dom/media/gtest/TestMediaDataDecoder.cpp
dom/media/gtest/TestMediaDataEncoder.cpp
dom/media/gtest/TestMediaEventSource.cpp
dom/media/gtest/TestMediaMIMETypes.cpp
dom/media/gtest/TestOpusParser.cpp
dom/media/gtest/TestRust.cpp
dom/media/gtest/TestTimeUnit.cpp
dom/media/gtest/TestVPXDecoding.cpp
dom/media/gtest/TestVideoSegment.cpp
dom/media/gtest/TestVideoTrackEncoder.cpp
dom/media/gtest/TestVideoUtils.cpp
dom/media/gtest/TestWebMBuffered.cpp
dom/media/gtest/TestWebMWriter.cpp
dom/media/gtest/mp4_demuxer/TestInterval.cpp
dom/media/gtest/mp4_demuxer/TestMP4.cpp
dom/media/gtest/mp4_demuxer/TestParser.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/mediasource/gtest/TestContainerParser.cpp
dom/media/mediasource/gtest/TestExtractVPXCodecDetails.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/prio/test/gtest/TestPrioEncoder.cpp
dom/quota/ActorsParent.cpp
dom/quota/test/gtest/TestQuotaManager.cpp
dom/reporting/tests/gtest/TestReportToParser.cpp
dom/security/featurepolicy/test/gtest/TestFeaturePolicyParser.cpp
dom/security/test/gtest/TestCSPParser.cpp
dom/security/test/gtest/TestSecureContext.cpp
dom/serviceworkers/ServiceWorkerContainerImpl.cpp
dom/serviceworkers/ServiceWorkerContainerParent.cpp
dom/serviceworkers/ServiceWorkerManager.cpp
dom/serviceworkers/ServiceWorkerRegistrationImpl.cpp
dom/serviceworkers/test/gtest/TestReadWrite.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
editor/txmgr/tests/TestTXMgr.cpp
extensions/cookie/nsPermissionManager.cpp
gfx/2d/BlurLS3.cpp
gfx/2d/unittest/TestCairo.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/tests/gtest/PolygonTestUtils.cpp
gfx/tests/gtest/TestArena.cpp
gfx/tests/gtest/TestArrayView.cpp
gfx/tests/gtest/TestBSPTree.cpp
gfx/tests/gtest/TestBufferRotation.cpp
gfx/tests/gtest/TestColorNames.cpp
gfx/tests/gtest/TestCompositor.cpp
gfx/tests/gtest/TestGfxPrefs.cpp
gfx/tests/gtest/TestGfxWidgets.cpp
gfx/tests/gtest/TestJobScheduler.cpp
gfx/tests/gtest/TestLayers.cpp
gfx/tests/gtest/TestMoz2D.cpp
gfx/tests/gtest/TestPolygon.cpp
gfx/tests/gtest/TestQcms.cpp
gfx/tests/gtest/TestRect.cpp
gfx/tests/gtest/TestRegion.cpp
gfx/tests/gtest/TestSkipChars.cpp
gfx/tests/gtest/TestSwizzle.cpp
gfx/tests/gtest/TestTextureCompatibility.cpp
gfx/tests/gtest/TestTextures.cpp
gfx/tests/gtest/TestTreeTraversal.cpp
gfx/tests/gtest/gfxSurfaceRefCountTest.cpp
gfx/thebes/gfxFontUtils.h
gfx/thebes/gfxTypes.h
gfx/vr/VRDisplayClient.cpp
gfx/vr/ipc/VRChild.cpp
image/test/gtest/TestADAM7InterpolatingFilter.cpp
image/test/gtest/TestBlendAnimationFilter.cpp
image/test/gtest/TestCopyOnWrite.cpp
image/test/gtest/TestDownscalingFilter.cpp
image/test/gtest/TestDownscalingFilterNoSkia.cpp
image/test/gtest/TestRemoveFrameRectFilter.cpp
image/test/gtest/TestSurfaceSink.cpp
intl/locale/nsLanguageAtomService.cpp
intl/locale/tests/gtest/TestCollation.cpp
intl/locale/tests/gtest/TestDateTimeFormat.cpp
intl/locale/tests/gtest/TestLocaleService.cpp
intl/locale/tests/gtest/TestLocaleServiceNegotiate.cpp
intl/locale/tests/gtest/TestMozLocale.cpp
intl/locale/tests/gtest/TestOSPreferences.cpp
intl/lwbrk/gtest/TestLineBreak.cpp
intl/strres/nsStringBundle.cpp
intl/uconv/nsTextToSubURI.cpp
ipc/chromium/src/base/thread_local_win.cc
ipc/chromium/src/base/waitable_event_win.cc
ipc/chromium/src/chrome/common/ipc_channel_posix.cc
ipc/glue/WindowsMessageLoop.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/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
media/gmp-clearkey/0.1/gtest/TestClearKeyUtils.cpp
media/mtransport/test/ice_unittest.cpp
media/mtransport/test/simpletokenbucket_unittest.cpp
media/mtransport/test/test_nr_socket_unittest.cpp
media/psshparser/gtest/TestPsshParser.cpp
media/webrtc/signaling/gtest/jsep_session_unittest.cpp
media/webrtc/signaling/gtest/sdp_unittests.cpp
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
memory/gtest/TestJemalloc.cpp
memory/volatile/tests/TestVolatileBuffer.cpp
mfbt/Variant.h
mfbt/tests/gtest/TestBuffer.cpp
mfbt/tests/gtest/TestLinkedList.cpp
mfbt/tests/gtest/TestMozDbg.cpp
modules/libpref/SharedPrefMap.cpp
modules/libpref/test/gtest/Basics.cpp
modules/libpref/test/gtest/CallbackAndVarCacheOrder.cpp
modules/libpref/test/gtest/Parser.cpp
mozglue/tests/gtest/TestDLLBlocklist.cpp
mozglue/tests/gtest/TestDLLEject.cpp
netwerk/base/ProxyAutoConfig.cpp
netwerk/base/nsBaseChannel.cpp
netwerk/protocol/http/HttpChannelParent.cpp
netwerk/test/TestBind.cpp
netwerk/test/TestCookie.cpp
netwerk/test/TestNamedPipeService.cpp
netwerk/test/TestUDPSocket.cpp
netwerk/test/gtest/TestBufferedInputStream.cpp
netwerk/test/gtest/TestHeaders.cpp
netwerk/test/gtest/TestHttpAuthUtils.cpp
netwerk/test/gtest/TestIsValidIp.cpp
netwerk/test/gtest/TestMIMEInputStream.cpp
netwerk/test/gtest/TestMozURL.cpp
netwerk/test/gtest/TestPartiallySeekableInputStream.cpp
netwerk/test/gtest/TestProtocolProxyService.cpp
netwerk/test/gtest/TestReadStreamToString.cpp
netwerk/test/gtest/TestServerTimingHeader.cpp
netwerk/test/gtest/TestStandardURL.cpp
netwerk/test/gtest/TestURIMutator.cpp
netwerk/test/gtest/parse-ftp/TestParseFTPList.cpp
parser/html/nsHtml5MetaScanner.cpp
parser/html/nsHtml5Tokenizer.cpp
parser/html/nsHtml5TreeBuilder.cpp
parser/html/nsHtml5TreeOperation.cpp
security/certverifier/tests/gtest/TrustOverrideTest.cpp
security/manager/ssl/tests/gtest/CertDBTest.cpp
security/manager/ssl/tests/gtest/CertListTest.cpp
security/manager/ssl/tests/gtest/DeserializeCertTest.cpp
security/sandbox/linux/gtest/TestBroker.cpp
security/sandbox/linux/gtest/TestBrokerPolicy.cpp
security/sandbox/mac/Sandbox.mm
storage/test/gtest/test_AsXXX_helpers.cpp
storage/test/gtest/test_asyncStatementExecution_transaction.cpp
storage/test/gtest/test_async_callbacks_with_spun_event_loops.cpp
storage/test/gtest/test_binding_params.cpp
storage/test/gtest/test_file_perms.cpp
storage/test/gtest/test_mutex.cpp
storage/test/gtest/test_service_init_background_thread.cpp
storage/test/gtest/test_spinningSynchronousClose.cpp
storage/test/gtest/test_statement_scoper.cpp
storage/test/gtest/test_transaction_helper.cpp
storage/test/gtest/test_true_async.cpp
storage/test/gtest/test_unlock_notify.cpp
testing/gtest/mozilla/MozGTestBench.h
testing/gtest/mozilla/SanityTest.cpp
toolkit/components/extensions/webrequest/StreamFilter.cpp
toolkit/components/perfmonitoring/PerformanceMetricsCollector.cpp
toolkit/components/places/tests/gtest/places_test_harness_tail.h
toolkit/components/places/tests/gtest/test_casing.cpp
toolkit/components/reputationservice/test/gtest/TestExecutableLists.cpp
toolkit/components/resistfingerprinting/tests/test_reduceprecision.cpp
toolkit/components/telemetry/geckoview/gtest/TestGeckoView.cpp
toolkit/components/telemetry/tests/gtest/TelemetryTestHelpers.cpp
toolkit/components/telemetry/tests/gtest/TestCombinedStacks.cpp
toolkit/components/telemetry/tests/gtest/TestEvents.cpp
toolkit/components/telemetry/tests/gtest/TestHistograms.cpp
toolkit/components/telemetry/tests/gtest/TestOrigins.cpp
toolkit/components/telemetry/tests/gtest/TestScalars.cpp
toolkit/components/url-classifier/tests/gtest/TestCaching.cpp
toolkit/components/url-classifier/tests/gtest/TestChunkSet.cpp
toolkit/components/url-classifier/tests/gtest/TestClassifier.cpp
toolkit/components/url-classifier/tests/gtest/TestFailUpdate.cpp
toolkit/components/url-classifier/tests/gtest/TestFindFullHash.cpp
toolkit/components/url-classifier/tests/gtest/TestLookupCacheV4.cpp
toolkit/components/url-classifier/tests/gtest/TestPerProviderDirectory.cpp
toolkit/components/url-classifier/tests/gtest/TestProtocolParser.cpp
toolkit/components/url-classifier/tests/gtest/TestRiceDeltaDecoder.cpp
toolkit/components/url-classifier/tests/gtest/TestSafeBrowsingProtobuf.cpp
toolkit/components/url-classifier/tests/gtest/TestSafebrowsingHash.cpp
toolkit/components/url-classifier/tests/gtest/TestTable.cpp
toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp
toolkit/components/url-classifier/tests/gtest/TestUrlClassifierUtils.cpp
toolkit/components/url-classifier/tests/gtest/TestVariableLengthPrefixSet.cpp
toolkit/crashreporter/minidump-analyzer/Win64ModuleUnwindMetadata.cpp
toolkit/crashreporter/test/gtest/TestCrashThreadAnnotation.cpp
toolkit/profile/gtest/TestProfileLock.cpp
toolkit/profile/gtest/TestProfileLockRetry.cpp
toolkit/recordreplay/HashTable.cpp
toolkit/system/osxproxy/tests/gtest/TestProxyBypassRules.cpp
toolkit/system/windowsproxy/tests/gtest/TestProxyBypassRules.cpp
tools/fuzzing/interface/FuzzingInterfaceStream.h
tools/profiler/gecko/nsProfiler.cpp
tools/profiler/tests/gtest/GeckoProfiler.cpp
tools/profiler/tests/gtest/LulTest.cpp
tools/profiler/tests/gtest/ThreadProfileTest.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/rust/gtest/nsstring/Test.cpp
xpcom/rust/gtest/xpcom/Test.cpp
xpcom/tests/gtest/TestAllocReplacement.cpp
xpcom/tests/gtest/TestArenaAllocator.cpp
xpcom/tests/gtest/TestAtoms.cpp
xpcom/tests/gtest/TestAutoPtr.cpp
xpcom/tests/gtest/TestAutoRef.cpp
xpcom/tests/gtest/TestAutoRefCnt.cpp
xpcom/tests/gtest/TestBase64.cpp
xpcom/tests/gtest/TestCOMArray.cpp
xpcom/tests/gtest/TestCOMPtr.cpp
xpcom/tests/gtest/TestCOMPtrEq.cpp
xpcom/tests/gtest/TestCRT.cpp
xpcom/tests/gtest/TestCloneInputStream.cpp
xpcom/tests/gtest/TestDafsa.cpp
xpcom/tests/gtest/TestDeadlockDetectorScalability.cpp
xpcom/tests/gtest/TestEncoding.cpp
xpcom/tests/gtest/TestEscape.cpp
xpcom/tests/gtest/TestEventPriorities.cpp
xpcom/tests/gtest/TestEventTargetQI.cpp
xpcom/tests/gtest/TestExpirationTracker.cpp
xpcom/tests/gtest/TestFile.cpp
xpcom/tests/gtest/TestFilePreferencesUnix.cpp
xpcom/tests/gtest/TestFilePreferencesWin.cpp
xpcom/tests/gtest/TestGCPostBarriers.cpp
xpcom/tests/gtest/TestHashtables.cpp
xpcom/tests/gtest/TestID.cpp
xpcom/tests/gtest/TestInputStreamLengthHelper.cpp
xpcom/tests/gtest/TestLogCommandLineHandler.cpp
xpcom/tests/gtest/TestMoveString.cpp
xpcom/tests/gtest/TestMozPromise.cpp
xpcom/tests/gtest/TestMruCache.cpp
xpcom/tests/gtest/TestMultiplexInputStream.cpp
xpcom/tests/gtest/TestNSPRLogModulesParser.cpp
xpcom/tests/gtest/TestNonBlockingAsyncInputStream.cpp
xpcom/tests/gtest/TestNsDeque.cpp
xpcom/tests/gtest/TestNsRefPtr.cpp
xpcom/tests/gtest/TestObserverArray.cpp
xpcom/tests/gtest/TestObserverService.cpp
xpcom/tests/gtest/TestPLDHash.cpp
xpcom/tests/gtest/TestPipes.cpp
xpcom/tests/gtest/TestPriorityQueue.cpp
xpcom/tests/gtest/TestRWLock.cpp
xpcom/tests/gtest/TestRacingServiceManager.cpp
xpcom/tests/gtest/TestRecursiveMutex.cpp
xpcom/tests/gtest/TestSlicedInputStream.cpp
xpcom/tests/gtest/TestSnappyStreams.cpp
xpcom/tests/gtest/TestStateWatching.cpp
xpcom/tests/gtest/TestStorageStream.cpp
xpcom/tests/gtest/TestStringStream.cpp
xpcom/tests/gtest/TestStrings.cpp
xpcom/tests/gtest/TestSynchronization.cpp
xpcom/tests/gtest/TestTArray.cpp
xpcom/tests/gtest/TestTArray2.cpp
xpcom/tests/gtest/TestTaskQueue.cpp
xpcom/tests/gtest/TestTextFormatter.cpp
xpcom/tests/gtest/TestThreadManager.cpp
xpcom/tests/gtest/TestThreadPool.cpp
xpcom/tests/gtest/TestThreadPoolListener.cpp
xpcom/tests/gtest/TestThreadUtils.cpp
xpcom/tests/gtest/TestThreads.cpp
xpcom/tests/gtest/TestThrottledEventQueue.cpp
xpcom/tests/gtest/TestTimeStamp.cpp
xpcom/tests/gtest/TestTimers.cpp
xpcom/tests/gtest/TestTokenizer.cpp
xpcom/tests/gtest/TestUTF.cpp
xpcom/tests/windows/TestCOM.cpp
xpcom/tests/windows/TestNtPathToDosPath.cpp
xpcom/threads/MozPromise.h
xpcom/threads/nsThreadUtils.cpp
--- a/accessible/base/MarkupMap.h
+++ b/accessible/base/MarkupMap.h
@@ -1,61 +1,60 @@
 /* -*- 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(
@@ -116,148 +115,139 @@ 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)
@@ -306,44 +296,41 @@ 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,
@@ -364,188 +351,178 @@ 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/caps/tests/gtest/TestOriginAttributes.cpp
+++ b/caps/tests/gtest/TestOriginAttributes.cpp
@@ -12,25 +12,22 @@ static void TestSuffix(const OriginAttri
 
   OriginAttributes attrsFromSuffix;
   bool success = attrsFromSuffix.PopulateFromSuffix(suffix);
   EXPECT_TRUE(success);
 
   EXPECT_EQ(attrs, attrsFromSuffix);
 }
 
-TEST(OriginAttributes, Suffix_default)
-{
+TEST(OriginAttributes, Suffix_default) {
   OriginAttributes attrs;
   TestSuffix(attrs);
 }
 
-TEST(OriginAttributes, Suffix_appId_inIsolatedMozBrowser)
-{
+TEST(OriginAttributes, Suffix_appId_inIsolatedMozBrowser) {
   OriginAttributes attrs(1, true);
   TestSuffix(attrs);
 }
 
-TEST(OriginAttributes, Suffix_maxAppId_inIsolatedMozBrowser)
-{
+TEST(OriginAttributes, Suffix_maxAppId_inIsolatedMozBrowser) {
   OriginAttributes attrs(4294967295, true);
   TestSuffix(attrs);
 }
--- a/dom/base/AnonymousContent.cpp
+++ b/dom/base/AnonymousContent.cpp
@@ -192,17 +192,18 @@ 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,31 +138,30 @@ 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/Document.cpp
+++ b/dom/base/Document.cpp
@@ -12616,30 +12616,29 @@ already_AddRefed<mozilla::dom::Promise> 
         sapr->RequestDelayedTask(
             inner->EventTargetFor(TaskCategory::Other),
             ContentPermissionRequestBase::DelayedTaskType::Request);
         return p.forget();
       };
       AntiTrackingCommon::AddFirstPartyStorageAccessGrantedFor(
           NodePrincipal(), inner, AntiTrackingCommon::eStorageAccessAPI,
           performFinalChecks)
-          ->Then(
-              GetCurrentThreadSerialEventTarget(), __func__,
-              [outer, promise] {
-                // Step 10. Grant the document access to cookies and store
-                // that fact for
-                //          the purposes of future calls to
-                //          hasStorageAccess() and requestStorageAccess().
-                outer->SetHasStorageAccess(true);
-                promise->MaybeResolveWithUndefined();
-              },
-              [outer, promise] {
-                outer->SetHasStorageAccess(false);
-                promise->MaybeRejectWithUndefined();
-              });
+          ->Then(GetCurrentThreadSerialEventTarget(), __func__,
+                 [outer, promise] {
+                   // Step 10. Grant the document access to cookies and store
+                   // that fact for
+                   //          the purposes of future calls to
+                   //          hasStorageAccess() and requestStorageAccess().
+                   outer->SetHasStorageAccess(true);
+                   promise->MaybeResolveWithUndefined();
+                 },
+                 [outer, promise] {
+                   outer->SetHasStorageAccess(false);
+                   promise->MaybeRejectWithUndefined();
+                 });
 
       return promise.forget();
     }
   }
 
   outer->SetHasStorageAccess(true);
   promise->MaybeResolveWithUndefined();
   return promise.forget();
--- a/dom/base/TreeOrderedArrayInlines.h
+++ b/dom/base/TreeOrderedArrayInlines.h
@@ -42,16 +42,17 @@ 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,17 +46,18 @@ 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
@@ -1640,19 +1640,17 @@ 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
@@ -237,15 +237,13 @@ 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,19 +421,17 @@ 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/base/test/gtest/TestContentUtils.cpp
+++ b/dom/base/test/gtest/TestContentUtils.cpp
@@ -6,33 +6,31 @@
 
 #include "gtest/gtest.h"
 
 #include "jsapi.h"
 #include "nsContentUtils.h"
 #include "mozilla/CycleCollectedJSContext.h"
 #include "mozilla/dom/SimpleGlobalObject.h"
 
-TEST(DOM_Base_ContentUtils, StringifyJSON_EmptyValue)
-{
+TEST(DOM_Base_ContentUtils, StringifyJSON_EmptyValue) {
   JSObject* globalObject = mozilla::dom::SimpleGlobalObject::Create(
       mozilla::dom::SimpleGlobalObject::GlobalType::BindingDetail);
   mozilla::dom::AutoJSAPI jsAPI;
   ASSERT_TRUE(jsAPI.Init(globalObject));
   JSContext* cx = jsAPI.cx();
   nsAutoString serializedValue;
 
   JS::RootedValue jsValue(cx);
   ASSERT_TRUE(nsContentUtils::StringifyJSON(cx, &jsValue, serializedValue));
 
   ASSERT_TRUE(serializedValue.EqualsLiteral("null"));
 }
 
-TEST(DOM_Base_ContentUtils, StringifyJSON_Object)
-{
+TEST(DOM_Base_ContentUtils, StringifyJSON_Object) {
   JSObject* globalObject = mozilla::dom::SimpleGlobalObject::Create(
       mozilla::dom::SimpleGlobalObject::GlobalType::BindingDetail);
   mozilla::dom::AutoJSAPI jsAPI;
   ASSERT_TRUE(jsAPI.Init(globalObject));
   JSContext* cx = jsAPI.cx();
   nsAutoString serializedValue;
 
   JS::RootedObject jsObj(cx, JS_NewPlainObject(cx));
--- a/dom/base/test/gtest/TestMimeType.cpp
+++ b/dom/base/test/gtest/TestMimeType.cpp
@@ -6,715 +6,600 @@
 
 #include "gtest/gtest.h"
 
 #include "MimeType.h"
 #include "nsString.h"
 
 using mozilla::UniquePtr;
 
-TEST(MimeType, EmptyString)
-{
+TEST(MimeType, EmptyString) {
   const auto in = NS_LITERAL_STRING("");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Empty string";
 }
 
-TEST(MimeType, JustWhitespace)
-{
+TEST(MimeType, JustWhitespace) {
   const auto in = NS_LITERAL_STRING(" \t\r\n ");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Just whitespace";
 }
 
-TEST(MimeType, JustBackslash)
-{
+TEST(MimeType, JustBackslash) {
   const auto in = NS_LITERAL_STRING("\\");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Just backslash";
 }
 
-TEST(MimeType, JustForwardslash)
-{
+TEST(MimeType, JustForwardslash) {
   const auto in = NS_LITERAL_STRING("/");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Just forward slash";
 }
 
-TEST(MimeType, MissingType1)
-{
+TEST(MimeType, MissingType1) {
   const auto in = NS_LITERAL_STRING("/bogus");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Missing type #1";
 }
 
-TEST(MimeType, MissingType2)
-{
+TEST(MimeType, MissingType2) {
   const auto in = NS_LITERAL_STRING(" \r\n\t/bogus");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Missing type #2";
 }
 
-TEST(MimeType, MissingSubtype1)
-{
+TEST(MimeType, MissingSubtype1) {
   const auto in = NS_LITERAL_STRING("bogus");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Missing subtype #1";
 }
 
-TEST(MimeType, MissingSubType2)
-{
+TEST(MimeType, MissingSubType2) {
   const auto in = NS_LITERAL_STRING("bogus/");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Missing subtype #2";
 }
 
-TEST(MimeType, MissingSubType3)
-{
+TEST(MimeType, MissingSubType3) {
   const auto in = NS_LITERAL_STRING("bogus;");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Missing subtype #3";
 }
 
-TEST(MimeType, MissingSubType4)
-{
+TEST(MimeType, MissingSubType4) {
   const auto in = NS_LITERAL_STRING("bogus; \r\n\t");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Missing subtype #3";
 }
 
-TEST(MimeType, ExtraForwardSlash)
-{
+TEST(MimeType, ExtraForwardSlash) {
   const auto in = NS_LITERAL_STRING("bogus/bogus/;");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Extra forward slash";
 }
 
-TEST(MimeType, WhitespaceInType)
-{
+TEST(MimeType, WhitespaceInType) {
   const auto in = NS_LITERAL_STRING("t\re\nx\tt /html");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Type with whitespace";
 }
 
-TEST(MimeType, WhitespaceInSubtype)
-{
+TEST(MimeType, WhitespaceInSubtype) {
   const auto in = NS_LITERAL_STRING("text/ h\rt\nm\tl");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Subtype with whitespace";
 }
 
-TEST(MimeType, NonAlphanumericMediaType1)
-{
+TEST(MimeType, NonAlphanumericMediaType1) {
   const auto in = NS_LITERAL_STRING("</>");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Non-alphanumeric media type #1";
 }
 
-TEST(MimeType, NonAlphanumericMediaType2)
-{
+TEST(MimeType, NonAlphanumericMediaType2) {
   const auto in = NS_LITERAL_STRING("(/)");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Non-alphanumeric media type #2";
 }
 
-TEST(MimeType, NonAlphanumericMediaType3)
-{
+TEST(MimeType, NonAlphanumericMediaType3) {
   const auto in = NS_LITERAL_STRING("{/}");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Non-alphanumeric media type #3";
 }
 
-TEST(MimeType, NonAlphanumericMediaType4)
-{
+TEST(MimeType, NonAlphanumericMediaType4) {
   const auto in = NS_LITERAL_STRING("\"/\"");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Non-alphanumeric media type #4";
 }
 
-TEST(MimeType, NonAlphanumericMediaType5)
-{
+TEST(MimeType, NonAlphanumericMediaType5) {
   const auto in = NS_LITERAL_STRING("\0/\0");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Non-alphanumeric media type #5";
 }
 
-TEST(MimeType, NonAlphanumericMediaType6)
-{
+TEST(MimeType, NonAlphanumericMediaType6) {
   const auto in = NS_LITERAL_STRING("text/html(;doesnot=matter");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Non-alphanumeric media type #6";
 }
 
-TEST(MimeType, NonLatin1MediaType1)
-{
+TEST(MimeType, NonLatin1MediaType1) {
   const auto in = NS_LITERAL_STRING("ÿ/ÿ");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Non-latin1 media type #1";
 }
 
-TEST(MimeType, NonLatin1MediaType2)
-{
+TEST(MimeType, NonLatin1MediaType2) {
   const auto in = NS_LITERAL_STRING(u"\x0100/\x0100");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
   ASSERT_FALSE(parsed) << "Non-latin1 media type #2";
 }
 
-TEST(MimeType, MultipleParameters)
-{
+TEST(MimeType, MultipleParameters) {
   const auto in =
       NS_LITERAL_STRING("text/html;charset=gbk;no=1;charset_=gbk_;yes=2");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.Equals(
       NS_LITERAL_STRING("text/html;charset=gbk;no=1;charset_=gbk_;yes=2")))
-  << "Multiple parameters";
+      << "Multiple parameters";
 }
 
-TEST(MimeType, DuplicateParameter1)
-{
+TEST(MimeType, DuplicateParameter1) {
   const auto in =
       NS_LITERAL_STRING("text/html;charset=gbk;charset=windows-1255");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.Equals(NS_LITERAL_STRING("text/html;charset=gbk")))
-  << "Duplicate parameter #1";
+      << "Duplicate parameter #1";
 }
 
-TEST(MimeType, DuplicateParameter2)
-{
+TEST(MimeType, DuplicateParameter2) {
   const auto in = NS_LITERAL_STRING("text/html;charset=();charset=GBK");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.Equals(NS_LITERAL_STRING("text/html;charset=\"()\"")))
-  << "Duplicate parameter #2";
+      << "Duplicate parameter #2";
 }
 
-TEST(MimeType, CString)
-{
+TEST(MimeType, CString) {
   const auto in = NS_LITERAL_CSTRING("text/html;charset=();charset=GBK");
   UniquePtr<CMimeType> parsed = CMimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsCString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.Equals(NS_LITERAL_CSTRING("text/html;charset=\"()\"")))
-  << "Duplicate parameter #2";
+      << "Duplicate parameter #2";
 }
 
 #ifdef _MSC_VER
 #  pragma warning(push)
 #  pragma warning(disable : 4819)
 #endif
-TEST(MimeType, NonAlphanumericParametersAreQuoted)
-{
+TEST(MimeType, NonAlphanumericParametersAreQuoted) {
   const auto in = NS_LITERAL_STRING("text/html;test=\x00FF\\;charset=gbk");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.Equals(
       NS_LITERAL_STRING("text/html;test=\"\x00FF\\\\\";charset=gbk")))
-  << "Non-alphanumeric parameters are quoted";
+      << "Non-alphanumeric parameters are quoted";
 }
 #ifdef _MSC_VER
 #  pragma warning(pop)
 #endif
 
-TEST(MimeType, ParameterQuotedIfHasLeadingWhitespace1)
-{
+TEST(MimeType, ParameterQuotedIfHasLeadingWhitespace1) {
   const auto in = NS_LITERAL_STRING("text/html;charset= g\\\"bk");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\" g\\\\\\\"bk\""))
-  << "Parameter is quoted if has leading whitespace #1";
+      << "Parameter is quoted if has leading whitespace #1";
 }
 
-TEST(MimeType, ParameterQuotedIfHasLeadingWhitespace2)
-{
+TEST(MimeType, ParameterQuotedIfHasLeadingWhitespace2) {
   const auto in = NS_LITERAL_STRING("text/html;charset= \"g\\bk\"");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\" \\\"g\\\\bk\\\"\""))
-  << "Parameter is quoted if has leading whitespace #2";
+      << "Parameter is quoted if has leading whitespace #2";
 }
 
-TEST(MimeType, ParameterQuotedIfHasInternalWhitespace)
-{
+TEST(MimeType, ParameterQuotedIfHasInternalWhitespace) {
   const auto in = NS_LITERAL_STRING("text/html;charset=g \\b\"k");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\"g \\\\b\\\"k\""))
-  << "Parameter is quoted if has internal whitespace";
+      << "Parameter is quoted if has internal whitespace";
 }
 
-TEST(MimeType, ImproperlyQuotedParameter1)
-{
+TEST(MimeType, ImproperlyQuotedParameter1) {
   const auto in = NS_LITERAL_STRING("x/x;test=\"");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("x/x;test=\"\""))
-  << "Improperly-quoted parameter is handled properly #1";
+      << "Improperly-quoted parameter is handled properly #1";
 }
 
-TEST(MimeType, ImproperlyQuotedParameter2)
-{
+TEST(MimeType, ImproperlyQuotedParameter2) {
   const auto in = NS_LITERAL_STRING("x/x;test=\"\\");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("x/x;test=\"\\\\\""))
-  << "Improperly-quoted parameter is handled properly #2";
+      << "Improperly-quoted parameter is handled properly #2";
 }
 
-TEST(MimeType, NonLatin1ParameterIgnored)
-{
+TEST(MimeType, NonLatin1ParameterIgnored) {
   const auto in = NS_LITERAL_STRING(u"x/x;test=\xFFFD;x=x");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("x/x;x=x"))
-  << "Non latin-1 parameters are ignored";
+      << "Non latin-1 parameters are ignored";
 }
 
-TEST(MimeType, ParameterIgnoredIfWhitespaceInName1)
-{
+TEST(MimeType, ParameterIgnoredIfWhitespaceInName1) {
   const auto in = NS_LITERAL_STRING("text/html;charset =gbk;charset=123");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=123"))
-  << "Parameter ignored if whitespace in name #1";
+      << "Parameter ignored if whitespace in name #1";
 }
 
-TEST(MimeType, ParameterIgnoredIfWhitespaceInName2)
-{
+TEST(MimeType, ParameterIgnoredIfWhitespaceInName2) {
   const auto in = NS_LITERAL_STRING("text/html;cha rset =gbk;charset=123");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=123"))
-  << "Parameter ignored if whitespace in name #2";
+      << "Parameter ignored if whitespace in name #2";
 }
 
-TEST(MimeType, WhitespaceTrimmed)
-{
+TEST(MimeType, WhitespaceTrimmed) {
   const auto in = NS_LITERAL_STRING(
       "\n\r\t  text/plain\n\r\t  ;\n\r\t  charset=123\n\r\t ");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/plain;charset=123"))
-  << "Whitespace appropriately ignored";
-}
-
-TEST(MimeType, WhitespaceOnlyParameterIgnored)
-{
-  const auto in = NS_LITERAL_STRING("x/x;x= \r\n\t");
-  UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
-  nsAutoString out;
-  parsed->Serialize(out);
-  ASSERT_TRUE(out.EqualsLiteral("x/x"))
-  << "Whitespace-only parameter is ignored";
+      << "Whitespace appropriately ignored";
 }
 
-TEST(MimeType, IncompleteParameterIgnored1)
-{
-  const auto in = NS_LITERAL_STRING("x/x;test");
+TEST(MimeType, WhitespaceOnlyParameterIgnored) {
+  const auto in = NS_LITERAL_STRING("x/x;x= \r\n\t");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
-  nsAutoString out;
-  parsed->Serialize(out);
-  ASSERT_TRUE(out.EqualsLiteral("x/x"))
-  << "Incomplete parameter is ignored #1";
-}
-
-TEST(MimeType, IncompleteParameterIgnored2)
-{
-  const auto in = NS_LITERAL_STRING("x/x;test=");
-  UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
-  nsAutoString out;
-  parsed->Serialize(out);
-  ASSERT_TRUE(out.EqualsLiteral("x/x"))
-  << "Incomplete parameter is ignored #2";
-}
-
-TEST(MimeType, IncompleteParameterIgnored3)
-{
-  const auto in = NS_LITERAL_STRING("x/x;test= \r\n\t");
-  UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("x/x"))
-  << "Incomplete parameter is ignored #3";
+      << "Whitespace-only parameter is ignored";
 }
 
-TEST(MimeType, IncompleteParameterIgnored4)
-{
-  const auto in = NS_LITERAL_STRING("text/html;test;charset=gbk");
+TEST(MimeType, IncompleteParameterIgnored1) {
+  const auto in = NS_LITERAL_STRING("x/x;test");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
-  ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk"))
-  << "Incomplete parameter is ignored #4";
+  ASSERT_TRUE(out.EqualsLiteral("x/x")) << "Incomplete parameter is ignored #1";
+}
+
+TEST(MimeType, IncompleteParameterIgnored2) {
+  const auto in = NS_LITERAL_STRING("x/x;test=");
+  UniquePtr<MimeType> parsed = MimeType::Parse(in);
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
+  nsAutoString out;
+  parsed->Serialize(out);
+  ASSERT_TRUE(out.EqualsLiteral("x/x")) << "Incomplete parameter is ignored #2";
 }
 
-TEST(MimeType, IncompleteParameterIgnored5)
-{
-  const auto in = NS_LITERAL_STRING("text/html;test=;charset=gbk");
+TEST(MimeType, IncompleteParameterIgnored3) {
+  const auto in = NS_LITERAL_STRING("x/x;test= \r\n\t");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
+  nsAutoString out;
+  parsed->Serialize(out);
+  ASSERT_TRUE(out.EqualsLiteral("x/x")) << "Incomplete parameter is ignored #3";
+}
+
+TEST(MimeType, IncompleteParameterIgnored4) {
+  const auto in = NS_LITERAL_STRING("text/html;test;charset=gbk");
+  UniquePtr<MimeType> parsed = MimeType::Parse(in);
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk"))
-  << "Incomplete parameter is ignored #5";
+      << "Incomplete parameter is ignored #4";
 }
 
-TEST(MimeType, EmptyParameterIgnored1)
-{
+TEST(MimeType, IncompleteParameterIgnored5) {
+  const auto in = NS_LITERAL_STRING("text/html;test=;charset=gbk");
+  UniquePtr<MimeType> parsed = MimeType::Parse(in);
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
+  nsAutoString out;
+  parsed->Serialize(out);
+  ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk"))
+      << "Incomplete parameter is ignored #5";
+}
+
+TEST(MimeType, EmptyParameterIgnored1) {
   const auto in = NS_LITERAL_STRING("text/html ; ; charset=gbk");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk"))
-  << "Empty parameter ignored #1";
+      << "Empty parameter ignored #1";
 }
 
-TEST(MimeType, EmptyParameterIgnored2)
-{
+TEST(MimeType, EmptyParameterIgnored2) {
   const auto in = NS_LITERAL_STRING("text/html;;;;charset=gbk");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk"))
-  << "Empty parameter ignored #2";
+      << "Empty parameter ignored #2";
 }
 
-TEST(MimeType, InvalidParameterIgnored1)
-{
+TEST(MimeType, InvalidParameterIgnored1) {
   const auto in = NS_LITERAL_STRING("text/html;';charset=gbk");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
+  nsAutoString out;
+  parsed->Serialize(out);
+  ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk"))
+      << "Invalid parameter ignored #1";
+}
+
+TEST(MimeType, InvalidParameterIgnored2) {
+  const auto in = NS_LITERAL_STRING("text/html;\";charset=gbk;=123; =321");
+  UniquePtr<MimeType> parsed = MimeType::Parse(in);
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk"))
-  << "Invalid parameter ignored #1";
+      << "Invalid parameter ignored #2";
 }
 
-TEST(MimeType, InvalidParameterIgnored2)
-{
-  const auto in = NS_LITERAL_STRING("text/html;\";charset=gbk;=123; =321");
-  UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
-  nsAutoString out;
-  parsed->Serialize(out);
-  ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk"))
-  << "Invalid parameter ignored #2";
-}
-
-TEST(MimeType, InvalidParameterIgnored3)
-{
+TEST(MimeType, InvalidParameterIgnored3) {
   const auto in = NS_LITERAL_STRING("text/html;charset= \"\u007F;charset=GBK");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=GBK"))
-  << "Invalid parameter ignored #3";
+      << "Invalid parameter ignored #3";
 }
 
-TEST(MimeType, InvalidParameterIgnored4)
-{
+TEST(MimeType, InvalidParameterIgnored4) {
   const auto in = NS_LITERAL_STRING(
       "text/html;charset=\"\u007F;charset=foo\";charset=GBK;charset=");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=GBK"))
-  << "Invalid parameter ignored #4";
+      << "Invalid parameter ignored #4";
 }
 
-TEST(MimeType, SingleQuotes1)
-{
+TEST(MimeType, SingleQuotes1) {
   const auto in = NS_LITERAL_STRING("text/html;charset='gbk'");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset='gbk'"))
-  << "Single quotes handled properly #1";
+      << "Single quotes handled properly #1";
 }
 
-TEST(MimeType, SingleQuotes2)
-{
+TEST(MimeType, SingleQuotes2) {
   const auto in = NS_LITERAL_STRING("text/html;charset='gbk");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset='gbk"))
-  << "Single quotes handled properly #2";
+      << "Single quotes handled properly #2";
 }
 
-TEST(MimeType, SingleQuotes3)
-{
+TEST(MimeType, SingleQuotes3) {
   const auto in = NS_LITERAL_STRING("text/html;charset=gbk'");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk'"))
-  << "Single quotes handled properly #3";
+      << "Single quotes handled properly #3";
 }
 
-TEST(MimeType, SingleQuotes4)
-{
+TEST(MimeType, SingleQuotes4) {
   const auto in = NS_LITERAL_STRING("text/html;charset=';charset=GBK");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset='"))
-  << "Single quotes handled properly #4";
+      << "Single quotes handled properly #4";
 }
 
-TEST(MimeType, SingleQuotes5)
-{
+TEST(MimeType, SingleQuotes5) {
   const auto in = NS_LITERAL_STRING("text/html;charset=''';charset=GBK");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset='''"))
-  << "Single quotes handled properly #5";
+      << "Single quotes handled properly #5";
 }
 
-TEST(MimeType, DoubleQuotes1)
-{
+TEST(MimeType, DoubleQuotes1) {
   const auto in = NS_LITERAL_STRING("text/html;charset=\"gbk\"");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
+  nsAutoString out;
+  parsed->Serialize(out);
+  ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk"))
+      << "Double quotes handled properly #1";
+}
+
+TEST(MimeType, DoubleQuotes2) {
+  const auto in = NS_LITERAL_STRING("text/html;charset=\"gbk");
+  UniquePtr<MimeType> parsed = MimeType::Parse(in);
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk"))
-  << "Double quotes handled properly #1";
+      << "Double quotes handled properly #2";
 }
 
-TEST(MimeType, DoubleQuotes2)
-{
-  const auto in = NS_LITERAL_STRING("text/html;charset=\"gbk");
-  UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
-  nsAutoString out;
-  parsed->Serialize(out);
-  ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk"))
-  << "Double quotes handled properly #2";
-}
-
-TEST(MimeType, DoubleQuotes3)
-{
+TEST(MimeType, DoubleQuotes3) {
   const auto in = NS_LITERAL_STRING("text/html;charset=gbk\"");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\"gbk\\\"\""))
-  << "Double quotes handled properly #3";
+      << "Double quotes handled properly #3";
 }
 
-TEST(MimeType, DoubleQuotes4)
-{
+TEST(MimeType, DoubleQuotes4) {
   const auto in = NS_LITERAL_STRING("text/html;charset=\" gbk\"");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\" gbk\""))
-  << "Double quotes handled properly #4";
+      << "Double quotes handled properly #4";
 }
 
-TEST(MimeType, DoubleQuotes5)
-{
+TEST(MimeType, DoubleQuotes5) {
   const auto in = NS_LITERAL_STRING("text/html;charset=\"gbk \"");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\"gbk \""))
-  << "Double quotes handled properly #5";
+      << "Double quotes handled properly #5";
 }
 
-TEST(MimeType, DoubleQuotes6)
-{
+TEST(MimeType, DoubleQuotes6) {
   const auto in = NS_LITERAL_STRING("text/html;charset=\"\\ gbk\"");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\" gbk\""))
-  << "Double quotes handled properly #6";
+      << "Double quotes handled properly #6";
 }
 
-TEST(MimeType, DoubleQuotes7)
-{
+TEST(MimeType, DoubleQuotes7) {
   const auto in = NS_LITERAL_STRING("text/html;charset=\"\\g\\b\\k\"");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk"))
-  << "Double quotes handled properly #7";
+      << "Double quotes handled properly #7";
 }
 
-TEST(MimeType, DoubleQuotes8)
-{
+TEST(MimeType, DoubleQuotes8) {
   const auto in = NS_LITERAL_STRING("text/html;charset=\"gbk\"x");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=gbk"))
-  << "Double quotes handled properly #8";
+      << "Double quotes handled properly #8";
 }
 
-TEST(MimeType, DoubleQuotes9)
-{
+TEST(MimeType, DoubleQuotes9) {
   const auto in = NS_LITERAL_STRING("text/html;charset=\"\";charset=GBK");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\"\""))
-  << "Double quotes handled properly #9";
+      << "Double quotes handled properly #9";
 }
 
-TEST(MimeType, DoubleQuotes10)
-{
+TEST(MimeType, DoubleQuotes10) {
   const auto in = NS_LITERAL_STRING("text/html;charset=\";charset=GBK");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\";charset=GBK\""))
-  << "Double quotes handled properly #10";
+      << "Double quotes handled properly #10";
 }
 
-TEST(MimeType, UnexpectedCodePoints)
-{
+TEST(MimeType, UnexpectedCodePoints) {
   const auto in = NS_LITERAL_STRING("text/html;charset={gbk}");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\"{gbk}\""))
-  << "Unexpected code points handled properly";
+      << "Unexpected code points handled properly";
 }
 
-TEST(MimeType, LongTypesSubtypesAccepted)
-{
+TEST(MimeType, LongTypesSubtypesAccepted) {
   const auto in = NS_LITERAL_STRING(
       "012345678901234567890123456789012345678901234567890123456789012345678901"
       "2345678901234567890123456789012345678901234567890123456789/"
       "012345678901234567890123456789012345678901234567890123456789012345678901"
       "2345678901234567890123456789012345678901234567890123456789");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
-  ASSERT_TRUE(out.Equals(in))
-  << "Long type/subtype accepted";
+  ASSERT_TRUE(out.Equals(in)) << "Long type/subtype accepted";
 }
 
-TEST(MimeType, LongParametersAccepted)
-{
+TEST(MimeType, LongParametersAccepted) {
   const auto in = NS_LITERAL_STRING(
       "text/"
       "html;"
       "012345678901234567890123456789012345678901234567890123456789012345678901"
       "2345678901234567890123456789012345678901234567890123456789=x;charset="
       "gbk");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
-  ASSERT_TRUE(out.Equals(in))
-  << "Long parameters accepted";
+  ASSERT_TRUE(out.Equals(in)) << "Long parameters accepted";
 }
 
-TEST(MimeType, AllValidCharactersAccepted1)
-{
+TEST(MimeType, AllValidCharactersAccepted1) {
   const auto in = NS_LITERAL_STRING(
       u"x/x;x=\"\t "
       u"!\\\"#$%&'()*+,-./"
       u"0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`"
       u"abcdefghijklmnopqrstuvwxyz{|}~"
       u"\u0080\u0081\u0082\u0083\u0084\u0085\u0086\u0087\u0088\u0089\u008A"
       u"\u008B\u008C\u008D\u008E\u008F\u0090\u0091\u0092\u0093\u0094\u0095"
       u"\u0096\u0097\u0098\u0099\u009A\u009B\u009C\u009D\u009E\u009F\u00A0"
@@ -723,77 +608,67 @@ TEST(MimeType, AllValidCharactersAccepte
       u"\u00B7\u00B8\u00B9\u00BA\u00BB\u00BC\u00BD\u00BE\u00BF\u00C0\u00C1"
       u"\u00C2\u00C3\u00C4\u00C5\u00C6\u00C7\u00C8\u00C9\u00CA\u00CB\u00CC"
       u"\u00CD\u00CE\u00CF\u00D0\u00D1\u00D2\u00D3\u00D4\u00D5\u00D6\u00D7"
       u"\u00D8\u00D9\u00DA\u00DB\u00DC\u00DD\u00DE\u00DF\u00E0\u00E1\u00E2"
       u"\u00E3\u00E4\u00E5\u00E6\u00E7\u00E8\u00E9\u00EA\u00EB\u00EC\u00ED"
       u"\u00EE\u00EF\u00F0\u00F1\u00F2\u00F3\u00F4\u00F5\u00F6\u00F7\u00F8"
       u"\u00F9\u00FA\u00FB\u00FC\u00FD\u00FE\u00FF\"");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
-  ASSERT_TRUE(out.Equals(in))
-  << "All valid characters accepted #1";
+  ASSERT_TRUE(out.Equals(in)) << "All valid characters accepted #1";
 }
 
-TEST(MimeType, CaseNormalization1)
-{
+TEST(MimeType, CaseNormalization1) {
   const auto in = NS_LITERAL_STRING("TEXT/PLAIN;CHARSET=TEST");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/plain;charset=TEST"))
-  << "Case normalized properly #1";
+      << "Case normalized properly #1";
 }
 
-TEST(MimeType, CaseNormalization2)
-{
+TEST(MimeType, CaseNormalization2) {
   const auto in = NS_LITERAL_STRING(
       "!#$%&'*+-.^_`|~"
       "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz/"
       "!#$%&'*+-.^_`|~"
       "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz;!#$%&'*+-"
       ".^_`|~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz=!#$"
       "%&'*+-.^_`|~"
       "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral(
       "!#$%&'*+-.^_`|~"
       "0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz/"
       "!#$%&'*+-.^_`|~"
       "0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz;!#$%&'*+-"
       ".^_`|~0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz=!#$"
       "%&'*+-.^_`|~"
       "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"))
-  << "Case normalized properly #2";
+      << "Case normalized properly #2";
 }
 
-TEST(MimeType, LegacyCommentSyntax1)
-{
+TEST(MimeType, LegacyCommentSyntax1) {
   const auto in = NS_LITERAL_STRING("text/html;charset=gbk(");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;charset=\"gbk(\""))
-  << "Legacy comment syntax #1";
+      << "Legacy comment syntax #1";
 }
 
-TEST(MimeType, LegacyCommentSyntax2)
-{
+TEST(MimeType, LegacyCommentSyntax2) {
   const auto in = NS_LITERAL_STRING("text/html;x=(;charset=gbk");
   UniquePtr<MimeType> parsed = MimeType::Parse(in);
-  ASSERT_TRUE(parsed)
-  << "Parsing succeeded";
+  ASSERT_TRUE(parsed) << "Parsing succeeded";
   nsAutoString out;
   parsed->Serialize(out);
   ASSERT_TRUE(out.EqualsLiteral("text/html;x=\"(\";charset=gbk"))
-  << "Legacy comment syntax #2";
+      << "Legacy comment syntax #2";
 }
--- a/dom/base/test/gtest/TestPlainTextSerializer.cpp
+++ b/dom/base/test/gtest/TestPlainTextSerializer.cpp
@@ -13,18 +13,17 @@
 #include "nsIParserUtils.h"
 
 void ConvertBufToPlainText(nsString &aConBuf, int aFlag) {
   nsCOMPtr<nsIParserUtils> utils = do_GetService(NS_PARSERUTILS_CONTRACTID);
   utils->ConvertToPlainText(aConBuf, aFlag, 72, aConBuf);
 }
 
 // Test for ASCII with format=flowed; delsp=yes
-TEST(PlainTextSerializer, ASCIIWithFlowedDelSp)
-{
+TEST(PlainTextSerializer, ASCIIWithFlowedDelSp) {
   nsString test;
   nsString result;
 
   test.AssignLiteral(
       "<html><body>"
       "Firefox Firefox Firefox Firefox "
       "Firefox Firefox Firefox Firefox "
       "Firefox Firefox Firefox Firefox"
@@ -38,22 +37,21 @@ TEST(PlainTextSerializer, ASCIIWithFlowe
 
   // create result case
   result.AssignLiteral(
       "Firefox Firefox Firefox Firefox "
       "Firefox Firefox Firefox Firefox "
       "Firefox  \r\nFirefox Firefox Firefox\r\n");
 
   ASSERT_TRUE(test.Equals(result))
-  << "Wrong HTML to ASCII text serialization with format=flowed; delsp=yes";
+      << "Wrong HTML to ASCII text serialization with format=flowed; delsp=yes";
 }
 
 // Test for CJK with format=flowed; delsp=yes
-TEST(PlainTextSerializer, CJKWithFlowedDelSp)
-{
+TEST(PlainTextSerializer, CJKWithFlowedDelSp) {
   nsString test;
   nsString result;
 
   test.AssignLiteral("<html><body>");
   for (uint32_t i = 0; i < 40; i++) {
     // Insert Kanji (U+5341)
     test.Append(0x5341);
   }
@@ -71,22 +69,21 @@ TEST(PlainTextSerializer, CJKWithFlowedD
   }
   result.AppendLiteral(" \r\n");
   for (uint32_t i = 0; i < 4; i++) {
     result.Append(0x5341);
   }
   result.AppendLiteral("\r\n");
 
   ASSERT_TRUE(test.Equals(result))
-  << "Wrong HTML to CJK text serialization with format=flowed; delsp=yes";
+      << "Wrong HTML to CJK text serialization with format=flowed; delsp=yes";
 }
 
 // Test for CJK with DisallowLineBreaking
-TEST(PlainTextSerializer, CJKWithDisallowLineBreaking)
-{
+TEST(PlainTextSerializer, CJKWithDisallowLineBreaking) {
   nsString test;
   nsString result;
 
   test.AssignLiteral("<html><body>");
   for (uint32_t i = 0; i < 400; i++) {
     // Insert Kanji (U+5341)
     test.Append(0x5341);
   }
@@ -101,22 +98,21 @@ TEST(PlainTextSerializer, CJKWithDisallo
 
   // create result case
   for (uint32_t i = 0; i < 400; i++) {
     result.Append(0x5341);
   }
   result.AppendLiteral("\r\n");
 
   ASSERT_TRUE(test.Equals(result))
-  << "Wrong HTML to CJK text serialization with OutputDisallowLineBreaking";
+      << "Wrong HTML to CJK text serialization with OutputDisallowLineBreaking";
 }
 
 // Test for ASCII with format=flowed; and quoted lines in preformatted span.
-TEST(PlainTextSerializer, PreformatFlowedQuotes)
-{
+TEST(PlainTextSerializer, PreformatFlowedQuotes) {
   nsString test;
   nsString result;
 
   test.AssignLiteral(
       "<html><body>"
       "<span style=\"white-space: pre-wrap;\">"
       "&gt; Firefox Firefox Firefox Firefox <br>"
       "&gt; Firefox Firefox Firefox Firefox<br>"
@@ -133,85 +129,79 @@ TEST(PlainTextSerializer, PreformatFlowe
   // create result case
   result.AssignLiteral(
       "> Firefox Firefox Firefox Firefox \r\n"
       "> Firefox Firefox Firefox Firefox\r\n"
       ">\r\n"
       ">> Firefox Firefox Firefox Firefox \r\n"
       ">> Firefox Firefox Firefox Firefox\r\n");
 
-  ASSERT_TRUE(test.Equals(result))
-  << "Wrong HTML to ASCII text serialization "
-     "with format=flowed; and quoted "
-     "lines";
+  ASSERT_TRUE(test.Equals(result)) << "Wrong HTML to ASCII text serialization "
+                                      "with format=flowed; and quoted "
+                                      "lines";
 }
 
-TEST(PlainTextSerializer, PrettyPrintedHtml)
-{
+TEST(PlainTextSerializer, PrettyPrintedHtml) {
   nsString test;
   test.AppendLiteral("<html>" NS_LINEBREAK "<body>" NS_LINEBREAK
                      "  first<br>" NS_LINEBREAK "  second<br>" NS_LINEBREAK
                      "</body>" NS_LINEBREAK "</html>");
 
   ConvertBufToPlainText(test, 0);
   ASSERT_TRUE(test.EqualsLiteral("first" NS_LINEBREAK "second" NS_LINEBREAK))
-  << "Wrong prettyprinted html to text serialization";
+      << "Wrong prettyprinted html to text serialization";
 }
 
-TEST(PlainTextSerializer, PreElement)
-{
+TEST(PlainTextSerializer, PreElement) {
   nsString test;
   test.AppendLiteral("<html>" NS_LINEBREAK "<body>" NS_LINEBREAK
                      "<pre>" NS_LINEBREAK "  first" NS_LINEBREAK
                      "  second" NS_LINEBREAK "</pre>" NS_LINEBREAK
                      "</body>" NS_LINEBREAK "</html>");
 
   ConvertBufToPlainText(test, 0);
   ASSERT_TRUE(test.EqualsLiteral("  first" NS_LINEBREAK
                                  "  second" NS_LINEBREAK NS_LINEBREAK))
-  << "Wrong prettyprinted html to text serialization";
+      << "Wrong prettyprinted html to text serialization";
 }
 
-TEST(PlainTextSerializer, BlockElement)
-{
+TEST(PlainTextSerializer, BlockElement) {
   nsString test;
   test.AppendLiteral("<html>" NS_LINEBREAK "<body>" NS_LINEBREAK
                      "<div>" NS_LINEBREAK "  first" NS_LINEBREAK
                      "</div>" NS_LINEBREAK "<div>" NS_LINEBREAK
                      "  second" NS_LINEBREAK "</div>" NS_LINEBREAK
                      "</body>" NS_LINEBREAK "</html>");
 
   ConvertBufToPlainText(test, 0);
   ASSERT_TRUE(test.EqualsLiteral("first" NS_LINEBREAK "second" NS_LINEBREAK))
-  << "Wrong prettyprinted html to text serialization";
+      << "Wrong prettyprinted html to text serialization";
 }
 
-TEST(PlainTextSerializer, PreWrapElementForThunderbird)
-{
+TEST(PlainTextSerializer, PreWrapElementForThunderbird) {
   // This test examines the magic pre-wrap setup that Thunderbird relies on.
   nsString test;
   test.AppendLiteral(
       "<html>" NS_LINEBREAK
       "<body style=\"white-space: pre-wrap; width: 10ch;\">" NS_LINEBREAK
       "<pre>" NS_LINEBREAK "  first line is too long" NS_LINEBREAK
       "  second line is even loooonger  " NS_LINEBREAK "</pre>" NS_LINEBREAK
       "</body>" NS_LINEBREAK "</html>");
 
   ConvertBufToPlainText(test, nsIDocumentEncoder::OutputWrap);
   // "\n\n  first\nline is\ntoo long\n  second\nline is\neven\nloooonger\n\n\n"
   ASSERT_TRUE(test.EqualsLiteral(
       NS_LINEBREAK NS_LINEBREAK
       "  first" NS_LINEBREAK "line is" NS_LINEBREAK "too long" NS_LINEBREAK
       "  second" NS_LINEBREAK "line is" NS_LINEBREAK "even" NS_LINEBREAK
       "loooonger" NS_LINEBREAK NS_LINEBREAK NS_LINEBREAK))
-  << "Wrong prettyprinted html to text serialization";
+      << "Wrong prettyprinted html to text serialization";
 }
 
-TEST(PlainTextSerializer, Simple)
-{
+TEST(PlainTextSerializer, Simple) {
   nsString test;
   test.AppendLiteral(
       "<html><base>base</base><head><span>span</span></head>"
       "<body>body</body></html>");
   ConvertBufToPlainText(test, 0);
   ASSERT_TRUE(test.EqualsLiteral("basespanbody"))
-  << "Wrong html to text serialization";
+      << "Wrong html to text serialization";
 }
--- a/dom/base/test/gtest/TestXPathGenerator.cpp
+++ b/dom/base/test/gtest/TestXPathGenerator.cpp
@@ -3,143 +3,134 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "gtest/gtest.h"
 #include "XPathGenerator.h"
 #include "nsString.h"
 
-TEST(TestXPathGenerator, TestQuoteArgumentWithoutQuote)
-{
+TEST(TestXPathGenerator, TestQuoteArgumentWithoutQuote) {
   nsAutoString arg;
   arg.AssignLiteral(u"testing");
 
   nsAutoString expectedResult;
   expectedResult.AssignLiteral(u"\'testing\'");
 
   nsAutoString result;
   XPathGenerator::QuoteArgument(arg, result);
 
   ASSERT_TRUE(expectedResult.Equals(result));
 }
 
-TEST(TestXPathGenerator, TestQuoteArgumentWithSingleQuote)
-{
+TEST(TestXPathGenerator, TestQuoteArgumentWithSingleQuote) {
   nsAutoString arg;
   arg.AssignLiteral(u"\'testing\'");
 
   nsAutoString expectedResult;
   expectedResult.AssignLiteral(u"\"\'testing\'\"");
 
   nsAutoString result;
   XPathGenerator::QuoteArgument(arg, result);
 
   ASSERT_TRUE(expectedResult.Equals(result));
 }
 
-TEST(TestXPathGenerator, TestQuoteArgumentWithDoubleQuote)
-{
+TEST(TestXPathGenerator, TestQuoteArgumentWithDoubleQuote) {
   nsAutoString arg;
   arg.AssignLiteral(u"\"testing\"");
 
   nsAutoString expectedResult;
   expectedResult.AssignLiteral(u"\'\"testing\"\'");
 
   nsAutoString result;
   XPathGenerator::QuoteArgument(arg, result);
 
   ASSERT_TRUE(expectedResult.Equals(result));
 }
 
-TEST(TestXPathGenerator, TestQuoteArgumentWithSingleAndDoubleQuote)
-{
+TEST(TestXPathGenerator, TestQuoteArgumentWithSingleAndDoubleQuote) {
   nsAutoString arg;
   arg.AssignLiteral(u"\'testing\"");
 
   nsAutoString expectedResult;
   expectedResult.AssignLiteral(u"concat(\'\',\"\'\",\'testing\"\')");
 
   nsAutoString result;
   XPathGenerator::QuoteArgument(arg, result);
   printf("Result: %s\nExpected: %s\n", NS_ConvertUTF16toUTF8(result).get(),
          NS_ConvertUTF16toUTF8(expectedResult).get());
 
   ASSERT_TRUE(expectedResult.Equals(result));
 }
 
 TEST(TestXPathGenerator,
-     TestQuoteArgumentWithDoubleQuoteAndASequenceOfSingleQuote)
-{
+     TestQuoteArgumentWithDoubleQuoteAndASequenceOfSingleQuote) {
   nsAutoString arg;
   arg.AssignLiteral(u"\'\'\'\'testing\"");
 
   nsAutoString expectedResult;
   expectedResult.AssignLiteral(u"concat(\'\',\"\'\'\'\'\",\'testing\"\')");
 
   nsAutoString result;
   XPathGenerator::QuoteArgument(arg, result);
   printf("Result: %s\nExpected: %s\n", NS_ConvertUTF16toUTF8(result).get(),
          NS_ConvertUTF16toUTF8(expectedResult).get());
 
   ASSERT_TRUE(expectedResult.Equals(result));
 }
 
 TEST(TestXPathGenerator,
-     TestQuoteArgumentWithDoubleQuoteAndTwoSequencesOfSingleQuote)
-{
+     TestQuoteArgumentWithDoubleQuoteAndTwoSequencesOfSingleQuote) {
   nsAutoString arg;
   arg.AssignLiteral(u"\'\'\'\'testing\'\'\'\'\'\'\"");
 
   nsAutoString expectedResult;
   expectedResult.AssignLiteral(
       u"concat(\'\',\"\'\'\'\'\",\'testing\',\"\'\'\'\'\'\'\",\'\"\')");
 
   nsAutoString result;
   XPathGenerator::QuoteArgument(arg, result);
   printf("Result: %s\nExpected: %s\n", NS_ConvertUTF16toUTF8(result).get(),
          NS_ConvertUTF16toUTF8(expectedResult).get());
 
   ASSERT_TRUE(expectedResult.Equals(result));
 }
 
 TEST(TestXPathGenerator,
-     TestQuoteArgumentWithDoubleQuoteAndTwoSequencesOfSingleQuoteInMiddle)
-{
+     TestQuoteArgumentWithDoubleQuoteAndTwoSequencesOfSingleQuoteInMiddle) {
   nsAutoString arg;
   arg.AssignLiteral(u"t\'\'\'\'estin\'\'\'\'\'\'\"g");
 
   nsAutoString expectedResult;
   expectedResult.AssignLiteral(
       u"concat(\'t\',\"\'\'\'\'\",\'estin\',\"\'\'\'\'\'\'\",\'\"g\')");
 
   nsAutoString result;
   XPathGenerator::QuoteArgument(arg, result);
   printf("Result: %s\nExpected: %s\n", NS_ConvertUTF16toUTF8(result).get(),
          NS_ConvertUTF16toUTF8(expectedResult).get());
 
   ASSERT_TRUE(expectedResult.Equals(result));
 }
 
-TEST(TestXPathGenerator, TestEscapeNameWithNormalCharacters)
-{
+TEST(TestXPathGenerator, TestEscapeNameWithNormalCharacters) {
   nsAutoString arg;
   arg.AssignLiteral(u"testing");
 
   nsAutoString expectedResult;
   expectedResult.AssignLiteral(u"testing");
 
   nsAutoString result;
   XPathGenerator::EscapeName(arg, result);
 
   ASSERT_TRUE(expectedResult.Equals(result));
 }
 
-TEST(TestXPathGenerator, TestEscapeNameWithSpecialCharacters)
-{
+TEST(TestXPathGenerator, TestEscapeNameWithSpecialCharacters) {
   nsAutoString arg;
   arg.AssignLiteral(u"^testing!");
 
   nsAutoString expectedResult;
   expectedResult.AssignLiteral(u"*[local-name()=\'^testing!\']");
 
   nsAutoString result;
   XPathGenerator::EscapeName(arg, result);
--- a/dom/cache/Context.cpp
+++ b/dom/cache/Context.cpp
@@ -432,19 +432,17 @@ 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,44 +957,42 @@ 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];
@@ -1118,80 +1116,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,18 +265,17 @@ 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/canvas/gtest/TestImageBitmapColorUtils.cpp
+++ b/dom/canvas/gtest/TestImageBitmapColorUtils.cpp
@@ -715,18 +715,17 @@ class LabData : public SimpleImage<float
     mData[i + 7] = 0.0f;
     mData[i + 8] = 0.0f;
   }
 };
 
 /*
  * From RGB24.
  */
-TEST(ImageBitmapColorUtils, RGB24ToBGR24_)
-{
+TEST(ImageBitmapColorUtils, RGB24ToBGR24_) {
   const RGB24Data srcData;
   const BGR24Data dstData;
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight,
                                dstData.mChannelCount);
 
   int rv = RGB24ToBGR24(srcData.mData, srcData.mStride, result_.mData,
                         result_.mStride, result_.mWidth, result_.mHeight);
   ASSERT_TRUE(rv == 0);
@@ -741,18 +740,17 @@ TEST(ImageBitmapColorUtils, RGB24ToBGR24
           dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 1]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 2],
           dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, RGB24ToRGBA32)
-{
+TEST(ImageBitmapColorUtils, RGB24ToRGBA32) {
   const RGB24Data srcData;
   const RGBA32Data dstData;
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight,
                                dstData.mChannelCount);
 
   int rv = RGB24ToRGBA32(srcData.mData, srcData.mStride, result_.mData,
                          result_.mStride, result_.mWidth, result_.mHeight);
   ASSERT_TRUE(rv == 0);
@@ -770,18 +768,17 @@ TEST(ImageBitmapColorUtils, RGB24ToRGBA3
           dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 3],
           255);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, RGB24ToBGRA32)
-{
+TEST(ImageBitmapColorUtils, RGB24ToBGRA32) {
   const RGB24Data srcData;
   const BGRA32Data dstData;
 
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight,
                                dstData.mChannelCount);
 
   int rv = RGB24ToBGRA32(srcData.mData, srcData.mStride, result_.mData,
                          result_.mStride, result_.mWidth, result_.mHeight);
@@ -843,18 +840,17 @@ TEST(ImageBitmapColorUtils, RGB24ToBGRA3
 //                              1, 1);
 //
 //  printf_stderr(
 //    "\nlibyuv: (%hhu, %hhu, %hhu) --> (%hhu, %hhu, %hhu, %hhu) \n",
 //    yuvPixel[0], yuvPixel[1], yuvPixel[2],
 //    gbaPixel[0], rgbaPixel[1], rgbaPixel[2], rgbaPixel[3]);
 //}
 
-TEST(ImageBitmapColorUtils, RGB24ToYUV444P)
-{
+TEST(ImageBitmapColorUtils, RGB24ToYUV444P) {
   const RGB24Data srcData;
   const YUV444PData dstData;
 
   YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                    srcData.mWidth, srcData.mHeight, srcData.mStride,
                    srcData.mWidth, srcData.mHeight, srcData.mStride);
 
   int rv = RGB24ToYUV444P(srcData.mData, srcData.mStride, result_.YBuffer(),
@@ -871,18 +867,17 @@ TEST(ImageBitmapColorUtils, RGB24ToYUV44
       EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j],
                 result_.UBuffer()[i * result_.mUStride + j]);
       EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j],
                 result_.VBuffer()[i * result_.mVStride + j]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, RGB24ToYUV422P)
-{
+TEST(ImageBitmapColorUtils, RGB24ToYUV422P) {
   const RGB24Data srcData;
   const YUV422PData dstData;
 
   YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                    srcData.mWidth / 2 + 1, srcData.mHeight, srcData.mStride,
                    srcData.mWidth / 2 + 1, srcData.mHeight, srcData.mStride);
 
   int rv = RGB24ToYUV422P(srcData.mData, srcData.mStride, result_.YBuffer(),
@@ -904,18 +899,17 @@ TEST(ImageBitmapColorUtils, RGB24ToYUV42
       EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j],
                 result_.UBuffer()[i * result_.mUStride + j]);
       EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j],
                 result_.VBuffer()[i * result_.mVStride + j]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, RGB24ToYUV420P)
-{
+TEST(ImageBitmapColorUtils, RGB24ToYUV420P) {
   const RGB24Data srcData;
   const YUV420PData dstData;
 
   YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                    srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1,
                    srcData.mStride, srcData.mWidth / 2 + 1,
                    srcData.mHeight / 2 + 1, srcData.mStride);
 
@@ -938,18 +932,17 @@ TEST(ImageBitmapColorUtils, RGB24ToYUV42
       EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j],
                 result_.UBuffer()[i * result_.mUStride + j]);
       EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j],
                 result_.VBuffer()[i * result_.mVStride + j]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, RGB24ToNV12)
-{
+TEST(ImageBitmapColorUtils, RGB24ToNV12) {
   const RGB24Data srcData;
   const NV12Data dstData;
 
   NVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                   srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1,
                   srcData.mStride + 10);
 
   int rv = RGB24ToNV12(srcData.mData, srcData.mStride, result_.YBuffer(),
@@ -970,18 +963,17 @@ TEST(ImageBitmapColorUtils, RGB24ToNV12)
       EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 0],
                 result_.UVBuffer()[i * result_.mUVStride + j * 2 + 0]);
       EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 1],
                 result_.UVBuffer()[i * result_.mUVStride + j * 2 + 1]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, RGB24ToNV21)
-{
+TEST(ImageBitmapColorUtils, RGB24ToNV21) {
   const RGB24Data srcData;
   const NV21Data dstData;
 
   NVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                   srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1,
                   srcData.mStride + 10);
 
   int rv = RGB24ToNV21(srcData.mData, srcData.mStride, result_.YBuffer(),
@@ -1002,18 +994,17 @@ TEST(ImageBitmapColorUtils, RGB24ToNV21)
       EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 0],
                 result_.UVBuffer()[i * result_.mUVStride + j * 2 + 0]);
       EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 1],
                 result_.UVBuffer()[i * result_.mUVStride + j * 2 + 1]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, RGB24ToHSV)
-{
+TEST(ImageBitmapColorUtils, RGB24ToHSV) {
   const RGB24Data srcData;
   const HSVData dstData;
 
   SimpleImage<float> result_(srcData.mWidth, srcData.mHeight, 3);
 
   int rv = RGB24ToHSV(srcData.mData, srcData.mStride, result_.mData,
                       result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -1026,18 +1017,17 @@ TEST(ImageBitmapColorUtils, RGB24ToHSV)
         const double expectedValue = dstData.GetPixelValue(i, j, c);
         const double diff = std::abs(actualValue - expectedValue);
         EXPECT_LT(diff, 1.0);
       }
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, RGB24ToLab)
-{
+TEST(ImageBitmapColorUtils, RGB24ToLab) {
   const RGB24Data srcData;
   const LabData dstData;
 
   SimpleImage<float> result_(srcData.mWidth, srcData.mHeight, 3);
 
   int rv = RGB24ToLab(srcData.mData, srcData.mStride, result_.mData,
                       result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -1050,18 +1040,17 @@ TEST(ImageBitmapColorUtils, RGB24ToLab)
         const double expectedValue = dstData.GetPixelValue(i, j, c);
         const double diff = std::abs(actualValue - expectedValue);
         EXPECT_LT(diff, 1.0);
       }
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, RGB24ToGray8)
-{
+TEST(ImageBitmapColorUtils, RGB24ToGray8) {
   const RGB24Data srcData;
   const GrayData dstData;
 
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight, 1);
 
   int rv = RGB24ToGray8(srcData.mData, srcData.mStride, result_.mData,
                         result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -1074,18 +1063,17 @@ TEST(ImageBitmapColorUtils, RGB24ToGray8
     }
   }
 }
 
 /*
  * From BGR24.
  */
 
-TEST(ImageBitmapColorUtils, BGR24ToRGB24_)
-{
+TEST(ImageBitmapColorUtils, BGR24ToRGB24_) {
   const BGR24Data srcData;
   const RGB24Data dstData;
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight,
                                dstData.mChannelCount);
 
   int rv = BGR24ToRGB24(srcData.mData, srcData.mStride, result_.mData,
                         result_.mStride, result_.mWidth, result_.mHeight);
   ASSERT_TRUE(rv == 0);
@@ -1100,18 +1088,17 @@ TEST(ImageBitmapColorUtils, BGR24ToRGB24
           dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 1]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 2],
           dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGR24ToRGBA32)
-{
+TEST(ImageBitmapColorUtils, BGR24ToRGBA32) {
   const BGR24Data srcData;
   const RGBA32Data dstData;
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight,
                                dstData.mChannelCount);
 
   int rv = BGR24ToRGBA32(srcData.mData, srcData.mStride, result_.mData,
                          result_.mStride, result_.mWidth, result_.mHeight);
   ASSERT_TRUE(rv == 0);
@@ -1129,18 +1116,17 @@ TEST(ImageBitmapColorUtils, BGR24ToRGBA3
           dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 3],
           255);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGR24ToBGRA32)
-{
+TEST(ImageBitmapColorUtils, BGR24ToBGRA32) {
   const BGR24Data srcData;
   const BGRA32Data dstData;
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight,
                                dstData.mChannelCount);
 
   int rv = BGR24ToBGRA32(srcData.mData, srcData.mStride, result_.mData,
                          result_.mStride, result_.mWidth, result_.mHeight);
   ASSERT_TRUE(rv == 0);
@@ -1158,18 +1144,17 @@ TEST(ImageBitmapColorUtils, BGR24ToBGRA3
           dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 3],
           255);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGR24ToYUV444P)
-{
+TEST(ImageBitmapColorUtils, BGR24ToYUV444P) {
   const BGR24Data srcData;
   const YUV444PData dstData;
 
   YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                    srcData.mWidth, srcData.mHeight, srcData.mStride,
                    srcData.mWidth, srcData.mHeight, srcData.mStride);
 
   int rv = BGR24ToYUV444P(srcData.mData, srcData.mStride, result_.YBuffer(),
@@ -1186,18 +1171,17 @@ TEST(ImageBitmapColorUtils, BGR24ToYUV44
       EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j],
                 result_.UBuffer()[i * result_.mUStride + j]);
       EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j],
                 result_.VBuffer()[i * result_.mVStride + j]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGR24ToYUV422P)
-{
+TEST(ImageBitmapColorUtils, BGR24ToYUV422P) {
   const BGR24Data srcData;
   const YUV422PData dstData;
 
   YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                    srcData.mWidth / 2 + 1, srcData.mHeight, srcData.mStride,
                    srcData.mWidth / 2 + 1, srcData.mHeight, srcData.mStride);
 
   int rv = BGR24ToYUV422P(srcData.mData, srcData.mStride, result_.YBuffer(),
@@ -1219,18 +1203,17 @@ TEST(ImageBitmapColorUtils, BGR24ToYUV42
       EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j],
                 result_.UBuffer()[i * result_.mUStride + j]);
       EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j],
                 result_.VBuffer()[i * result_.mVStride + j]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGR24ToYUV420P)
-{
+TEST(ImageBitmapColorUtils, BGR24ToYUV420P) {
   const BGR24Data srcData;
   const YUV420PData dstData;
 
   YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                    srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1,
                    srcData.mStride, srcData.mWidth / 2 + 1,
                    srcData.mHeight / 2 + 1, srcData.mStride);
 
@@ -1253,18 +1236,17 @@ TEST(ImageBitmapColorUtils, BGR24ToYUV42
       EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j],
                 result_.UBuffer()[i * result_.mUStride + j]);
       EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j],
                 result_.VBuffer()[i * result_.mVStride + j]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGR24ToNV12)
-{
+TEST(ImageBitmapColorUtils, BGR24ToNV12) {
   const BGR24Data srcData;
   const NV12Data dstData;
 
   NVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                   srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1,
                   srcData.mStride + 10);
 
   int rv = BGR24ToNV12(srcData.mData, srcData.mStride, result_.YBuffer(),
@@ -1285,18 +1267,17 @@ TEST(ImageBitmapColorUtils, BGR24ToNV12)
       EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 0],
                 result_.UVBuffer()[i * result_.mUVStride + j * 2 + 0]);
       EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 1],
                 result_.UVBuffer()[i * result_.mUVStride + j * 2 + 1]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGR24ToNV21)
-{
+TEST(ImageBitmapColorUtils, BGR24ToNV21) {
   const BGR24Data srcData;
   const NV21Data dstData;
 
   NVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                   srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1,
                   srcData.mStride + 10);
 
   int rv = BGR24ToNV21(srcData.mData, srcData.mStride, result_.YBuffer(),
@@ -1317,18 +1298,17 @@ TEST(ImageBitmapColorUtils, BGR24ToNV21)
       EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 0],
                 result_.UVBuffer()[i * result_.mUVStride + j * 2 + 0]);
       EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 1],
                 result_.UVBuffer()[i * result_.mUVStride + j * 2 + 1]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGR24ToHSV)
-{
+TEST(ImageBitmapColorUtils, BGR24ToHSV) {
   const BGR24Data srcData;
   const HSVData dstData;
 
   SimpleImage<float> result_(srcData.mWidth, srcData.mHeight, 3);
 
   int rv = BGR24ToHSV(srcData.mData, srcData.mStride, result_.mData,
                       result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -1341,18 +1321,17 @@ TEST(ImageBitmapColorUtils, BGR24ToHSV)
         const double expectedValue = dstData.GetPixelValue(i, j, c);
         const double diff = std::abs(actualValue - expectedValue);
         EXPECT_LT(diff, 1.0);
       }
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGR24ToLab)
-{
+TEST(ImageBitmapColorUtils, BGR24ToLab) {
   const BGR24Data srcData;
   const LabData dstData;
 
   SimpleImage<float> result_(srcData.mWidth, srcData.mHeight, 3);
 
   int rv = BGR24ToLab(srcData.mData, srcData.mStride, result_.mData,
                       result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -1365,18 +1344,17 @@ TEST(ImageBitmapColorUtils, BGR24ToLab)
         const double expectedValue = dstData.GetPixelValue(i, j, c);
         const double diff = std::abs(actualValue - expectedValue);
         EXPECT_LT(diff, 1.0);
       }
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGR24ToGray8)
-{
+TEST(ImageBitmapColorUtils, BGR24ToGray8) {
   const BGR24Data srcData;
   const GrayData dstData;
 
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight, 1);
 
   int rv = BGR24ToGray8(srcData.mData, srcData.mStride, result_.mData,
                         result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -1388,18 +1366,17 @@ TEST(ImageBitmapColorUtils, BGR24ToGray8
                 dstData.mData[i * dstData.mStride + j]);
     }
   }
 }
 
 /*
  * From RGBA32.
  */
-TEST(ImageBitmapColorUtils, RGBA32ToRGB24)
-{
+TEST(ImageBitmapColorUtils, RGBA32ToRGB24) {
   const RGBA32Data srcData;
   const RGB24Data dstData;
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight,
                                dstData.mChannelCount);
 
   int rv = RGBA32ToRGB24(srcData.mData, srcData.mStride, result_.mData,
                          result_.mStride, result_.mWidth, result_.mHeight);
   ASSERT_TRUE(rv == 0);
@@ -1414,18 +1391,17 @@ TEST(ImageBitmapColorUtils, RGBA32ToRGB2
           dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 1]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 2],
           dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, RGBA32ToBGR24)
-{
+TEST(ImageBitmapColorUtils, RGBA32ToBGR24) {
   const RGBA32Data srcData;
   const BGR24Data dstData;
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight,
                                dstData.mChannelCount);
 
   int rv = RGBA32ToBGR24(srcData.mData, srcData.mStride, result_.mData,
                          result_.mStride, result_.mWidth, result_.mHeight);
   ASSERT_TRUE(rv == 0);
@@ -1440,18 +1416,17 @@ TEST(ImageBitmapColorUtils, RGBA32ToBGR2
           dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 1]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 2],
           dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, RGBA32ToYUV444P)
-{
+TEST(ImageBitmapColorUtils, RGBA32ToYUV444P) {
   const RGBA32Data srcData;
   const YUV444PData dstData;
 
   YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                    srcData.mWidth, srcData.mHeight, srcData.mStride,
                    srcData.mWidth, srcData.mHeight, srcData.mStride);
 
   int rv = RGBA32ToYUV444P(srcData.mData, srcData.mStride, result_.YBuffer(),
@@ -1468,18 +1443,17 @@ TEST(ImageBitmapColorUtils, RGBA32ToYUV4
       EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j],
                 result_.UBuffer()[i * result_.mUStride + j]);
       EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j],
                 result_.VBuffer()[i * result_.mVStride + j]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, RGBA32ToYUV422P)
-{
+TEST(ImageBitmapColorUtils, RGBA32ToYUV422P) {
   const RGBA32Data srcData;
   const YUV422PData dstData;
 
   YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                    srcData.mWidth / 2 + 1, srcData.mHeight, srcData.mStride,
                    srcData.mWidth / 2 + 1, srcData.mHeight, srcData.mStride);
 
   int rv = RGBA32ToYUV422P(srcData.mData, srcData.mStride, result_.YBuffer(),
@@ -1501,18 +1475,17 @@ TEST(ImageBitmapColorUtils, RGBA32ToYUV4
       EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j],
                 result_.UBuffer()[i * result_.mUStride + j]);
       EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j],
                 result_.VBuffer()[i * result_.mVStride + j]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, RGBA32ToYUV420P)
-{
+TEST(ImageBitmapColorUtils, RGBA32ToYUV420P) {
   const RGBA32Data srcData;
   const YUV420PData dstData;
 
   YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                    srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1,
                    srcData.mStride, srcData.mWidth / 2 + 1,
                    srcData.mHeight / 2 + 1, srcData.mStride);
 
@@ -1535,18 +1508,17 @@ TEST(ImageBitmapColorUtils, RGBA32ToYUV4
       EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j],
                 result_.UBuffer()[i * result_.mUStride + j]);
       EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j],
                 result_.VBuffer()[i * result_.mVStride + j]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, RGBA32ToNV12)
-{
+TEST(ImageBitmapColorUtils, RGBA32ToNV12) {
   const RGBA32Data srcData;
   const NV12Data dstData;
 
   NVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                   srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1,
                   srcData.mStride + 10);
 
   int rv = RGBA32ToNV12(srcData.mData, srcData.mStride, result_.YBuffer(),
@@ -1567,18 +1539,17 @@ TEST(ImageBitmapColorUtils, RGBA32ToNV12
       EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 0],
                 result_.UVBuffer()[i * result_.mUVStride + j * 2 + 0]);
       EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 1],
                 result_.UVBuffer()[i * result_.mUVStride + j * 2 + 1]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, RGBA32ToNV21)
-{
+TEST(ImageBitmapColorUtils, RGBA32ToNV21) {
   const RGBA32Data srcData;
   const NV21Data dstData;
 
   NVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                   srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1,
                   srcData.mStride + 10);
 
   int rv = RGBA32ToNV21(srcData.mData, srcData.mStride, result_.YBuffer(),
@@ -1599,18 +1570,17 @@ TEST(ImageBitmapColorUtils, RGBA32ToNV21
       EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 0],
                 result_.UVBuffer()[i * result_.mUVStride + j * 2 + 0]);
       EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 1],
                 result_.UVBuffer()[i * result_.mUVStride + j * 2 + 1]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, RGBA32ToHSV)
-{
+TEST(ImageBitmapColorUtils, RGBA32ToHSV) {
   const RGBA32Data srcData;
   const HSVData dstData;
 
   SimpleImage<float> result_(srcData.mWidth, srcData.mHeight, 3);
 
   int rv = RGBA32ToHSV(srcData.mData, srcData.mStride, result_.mData,
                        result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -1623,18 +1593,17 @@ TEST(ImageBitmapColorUtils, RGBA32ToHSV)
         const double expectedValue = dstData.GetPixelValue(i, j, c);
         const double diff = std::abs(actualValue - expectedValue);
         EXPECT_LT(diff, 1.0);
       }
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, RGBA32ToLab)
-{
+TEST(ImageBitmapColorUtils, RGBA32ToLab) {
   const RGBA32Data srcData;
   const LabData dstData;
 
   SimpleImage<float> result_(srcData.mWidth, srcData.mHeight, 3);
 
   int rv = RGBA32ToLab(srcData.mData, srcData.mStride, result_.mData,
                        result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -1647,18 +1616,17 @@ TEST(ImageBitmapColorUtils, RGBA32ToLab)
         const double expectedValue = dstData.GetPixelValue(i, j, c);
         const double diff = std::abs(actualValue - expectedValue);
         EXPECT_LT(diff, 1.0);
       }
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, RGBA32ToGray8)
-{
+TEST(ImageBitmapColorUtils, RGBA32ToGray8) {
   const RGBA32Data srcData;
   const GrayData dstData;
 
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight, 1);
 
   int rv = RGBA32ToGray8(srcData.mData, srcData.mStride, result_.mData,
                          result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -1670,18 +1638,17 @@ TEST(ImageBitmapColorUtils, RGBA32ToGray
                 dstData.mData[i * dstData.mStride + j]);
     }
   }
 }
 
 /*
  * From BGRA32.
  */
-TEST(ImageBitmapColorUtils, BGRA32ToRGB24)
-{
+TEST(ImageBitmapColorUtils, BGRA32ToRGB24) {
   const BGRA32Data srcData;
   const RGB24Data dstData;
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight,
                                dstData.mChannelCount);
 
   int rv = BGRA32ToRGB24(srcData.mData, srcData.mStride, result_.mData,
                          result_.mStride, result_.mWidth, result_.mHeight);
   ASSERT_TRUE(rv == 0);
@@ -1696,18 +1663,17 @@ TEST(ImageBitmapColorUtils, BGRA32ToRGB2
           dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 1]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 2],
           dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGRA32ToBGR24)
-{
+TEST(ImageBitmapColorUtils, BGRA32ToBGR24) {
   const BGRA32Data srcData;
   const BGR24Data dstData;
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight,
                                dstData.mChannelCount);
 
   int rv = BGRA32ToBGR24(srcData.mData, srcData.mStride, result_.mData,
                          result_.mStride, result_.mWidth, result_.mHeight);
   ASSERT_TRUE(rv == 0);
@@ -1722,18 +1688,17 @@ TEST(ImageBitmapColorUtils, BGRA32ToBGR2
           dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 1]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 2],
           dstData.mData[i * dstData.mStride + j * dstData.mChannelCount + 2]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGRA32ToYUV444P)
-{
+TEST(ImageBitmapColorUtils, BGRA32ToYUV444P) {
   const BGRA32Data srcData;
   const YUV444PData dstData;
 
   YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                    srcData.mWidth, srcData.mHeight, srcData.mStride,
                    srcData.mWidth, srcData.mHeight, srcData.mStride);
 
   int rv = BGRA32ToYUV444P(srcData.mData, srcData.mStride, result_.YBuffer(),
@@ -1750,18 +1715,17 @@ TEST(ImageBitmapColorUtils, BGRA32ToYUV4
       EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j],
                 result_.UBuffer()[i * result_.mUStride + j]);
       EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j],
                 result_.VBuffer()[i * result_.mVStride + j]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGRA32ToYUV422P)
-{
+TEST(ImageBitmapColorUtils, BGRA32ToYUV422P) {
   const BGRA32Data srcData;
   const YUV422PData dstData;
 
   YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                    srcData.mWidth / 2 + 1, srcData.mHeight, srcData.mStride,
                    srcData.mWidth / 2 + 1, srcData.mHeight, srcData.mStride);
 
   int rv = BGRA32ToYUV422P(srcData.mData, srcData.mStride, result_.YBuffer(),
@@ -1783,18 +1747,17 @@ TEST(ImageBitmapColorUtils, BGRA32ToYUV4
       EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j],
                 result_.UBuffer()[i * result_.mUStride + j]);
       EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j],
                 result_.VBuffer()[i * result_.mVStride + j]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGRA32ToYUV420P)
-{
+TEST(ImageBitmapColorUtils, BGRA32ToYUV420P) {
   const BGRA32Data srcData;
   const YUV420PData dstData;
 
   YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                    srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1,
                    srcData.mStride, srcData.mWidth / 2 + 1,
                    srcData.mHeight / 2 + 1, srcData.mStride);
 
@@ -1817,18 +1780,17 @@ TEST(ImageBitmapColorUtils, BGRA32ToYUV4
       EXPECT_EQ(dstData.UBuffer()[i * dstData.mUStride + j],
                 result_.UBuffer()[i * result_.mUStride + j]);
       EXPECT_EQ(dstData.VBuffer()[i * dstData.mVStride + j],
                 result_.VBuffer()[i * result_.mVStride + j]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGRA32ToNV12)
-{
+TEST(ImageBitmapColorUtils, BGRA32ToNV12) {
   const BGRA32Data srcData;
   const NV12Data dstData;
 
   NVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                   srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1,
                   srcData.mStride + 10);
 
   int rv = BGRA32ToNV12(srcData.mData, srcData.mStride, result_.YBuffer(),
@@ -1849,18 +1811,17 @@ TEST(ImageBitmapColorUtils, BGRA32ToNV12
       EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 0],
                 result_.UVBuffer()[i * result_.mUVStride + j * 2 + 0]);
       EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 1],
                 result_.UVBuffer()[i * result_.mUVStride + j * 2 + 1]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGRA32ToNV21)
-{
+TEST(ImageBitmapColorUtils, BGRA32ToNV21) {
   const BGRA32Data srcData;
   const NV21Data dstData;
 
   NVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
                   srcData.mWidth / 2 + 1, srcData.mHeight / 2 + 1,
                   srcData.mStride + 10);
 
   int rv = BGRA32ToNV21(srcData.mData, srcData.mStride, result_.YBuffer(),
@@ -1881,18 +1842,17 @@ TEST(ImageBitmapColorUtils, BGRA32ToNV21
       EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 0],
                 result_.UVBuffer()[i * result_.mUVStride + j * 2 + 0]);
       EXPECT_EQ(dstData.UVBuffer()[i * dstData.mUVStride + j * 2 + 1],
                 result_.UVBuffer()[i * result_.mUVStride + j * 2 + 1]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGRA32ToHSV)
-{
+TEST(ImageBitmapColorUtils, BGRA32ToHSV) {
   const BGRA32Data srcData;
   const HSVData dstData;
 
   SimpleImage<float> result_(srcData.mWidth, srcData.mHeight, 3);
 
   int rv = BGRA32ToHSV(srcData.mData, srcData.mStride, result_.mData,
                        result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -1905,18 +1865,17 @@ TEST(ImageBitmapColorUtils, BGRA32ToHSV)
         const double expectedValue = dstData.GetPixelValue(i, j, c);
         const double diff = std::abs(actualValue - expectedValue);
         EXPECT_LT(diff, 1.0);
       }
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGRA32ToLab)
-{
+TEST(ImageBitmapColorUtils, BGRA32ToLab) {
   const BGRA32Data srcData;
   const LabData dstData;
 
   SimpleImage<float> result_(srcData.mWidth, srcData.mHeight, 3);
 
   int rv = BGRA32ToLab(srcData.mData, srcData.mStride, result_.mData,
                        result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -1929,18 +1888,17 @@ TEST(ImageBitmapColorUtils, BGRA32ToLab)
         const double expectedValue = dstData.GetPixelValue(i, j, c);
         const double diff = std::abs(actualValue - expectedValue);
         EXPECT_LT(diff, 1.0);
       }
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, BGRA32ToGray8)
-{
+TEST(ImageBitmapColorUtils, BGRA32ToGray8) {
   const BGRA32Data srcData;
   const GrayData dstData;
 
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight, 1);
 
   int rv = BGRA32ToGray8(srcData.mData, srcData.mStride, result_.mData,
                          result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -1952,18 +1910,17 @@ TEST(ImageBitmapColorUtils, BGRA32ToGray
                 dstData.mData[i * dstData.mStride + j]);
     }
   }
 }
 
 /*
  * From YUV444P.
  */
-TEST(ImageBitmapColorUtils, YUV444PToRGB24)
-{
+TEST(ImageBitmapColorUtils, YUV444PToRGB24) {
   const YUV444PData srcData;
   const RGBA32DataFromYUV444PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight, 3);
 
   int rv = YUV444PToRGB24(srcData.YBuffer(), srcData.mYStride,
                           srcData.UBuffer(), srcData.mUStride,
                           srcData.VBuffer(), srcData.mVStride, result_.mData,
                           result_.mStride, result_.mWidth, result_.mHeight);
@@ -1979,18 +1936,17 @@ TEST(ImageBitmapColorUtils, YUV444PToRGB
           dstData.GetPixel(j, i)[1]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 2],
           dstData.GetPixel(j, i)[2]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, YUV444PToBGR24)
-{
+TEST(ImageBitmapColorUtils, YUV444PToBGR24) {
   const YUV444PData srcData;
   const RGBA32DataFromYUV444PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight, 3);
 
   int rv = YUV444PToBGR24(srcData.YBuffer(), srcData.mYStride,
                           srcData.UBuffer(), srcData.mUStride,
                           srcData.VBuffer(), srcData.mVStride, result_.mData,
                           result_.mStride, result_.mWidth, result_.mHeight);
@@ -2006,18 +1962,17 @@ TEST(ImageBitmapColorUtils, YUV444PToBGR
           dstData.GetPixel(j, i)[1]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 2],
           dstData.GetPixel(j, i)[0]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, YUV444PToRGBA32)
-{
+TEST(ImageBitmapColorUtils, YUV444PToRGBA32) {
   const YUV444PData srcData;
   const RGBA32DataFromYUV444PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight,
                                dstData.mChannelCount);
 
   int rv = YUV444PToRGBA32(srcData.YBuffer(), srcData.mYStride,
                            srcData.UBuffer(), srcData.mUStride,
                            srcData.VBuffer(), srcData.mVStride, result_.mData,
@@ -2037,18 +1992,17 @@ TEST(ImageBitmapColorUtils, YUV444PToRGB
           dstData.GetPixel(j, i)[2]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 3],
           dstData.GetPixel(j, i)[3]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, YUV444PToBGRA32)
-{
+TEST(ImageBitmapColorUtils, YUV444PToBGRA32) {
   const YUV444PData srcData;
   const RGBA32DataFromYUV444PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight,
                                dstData.mChannelCount);
 
   int rv = YUV444PToBGRA32(srcData.YBuffer(), srcData.mYStride,
                            srcData.UBuffer(), srcData.mUStride,
                            srcData.VBuffer(), srcData.mVStride, result_.mData,
@@ -2068,18 +2022,17 @@ TEST(ImageBitmapColorUtils, YUV444PToBGR
           dstData.GetPixel(j, i)[0]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 3],
           dstData.GetPixel(j, i)[3]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, YUV444PToGray8)
-{
+TEST(ImageBitmapColorUtils, YUV444PToGray8) {
   const YUV444PData srcData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight, 1);
 
   int rv = YUV444PToGray8(srcData.YBuffer(), srcData.mYStride,
                           srcData.UBuffer(), srcData.mUStride,
                           srcData.VBuffer(), srcData.mVStride, result_.mData,
                           result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -2091,18 +2044,17 @@ TEST(ImageBitmapColorUtils, YUV444PToGra
                 srcData.YBuffer()[i * srcData.mYStride + j]);
     }
   }
 }
 
 /*
  * From YUV422P.
  */
-TEST(ImageBitmapColorUtils, YUV422PToRGB24)
-{
+TEST(ImageBitmapColorUtils, YUV422PToRGB24) {
   const YUV422PData srcData;
   const RGBA32DataFromYUV422PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight, 3);
 
   int rv = YUV422PToRGB24(srcData.YBuffer(), srcData.mYStride,
                           srcData.UBuffer(), srcData.mUStride,
                           srcData.VBuffer(), srcData.mVStride, result_.mData,
                           result_.mStride, result_.mWidth, result_.mHeight);
@@ -2118,18 +2070,17 @@ TEST(ImageBitmapColorUtils, YUV422PToRGB
           dstData.GetPixel(j, i)[1]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 2],
           dstData.GetPixel(j, i)[2]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, YUV422PToBGR24)
-{
+TEST(ImageBitmapColorUtils, YUV422PToBGR24) {
   const YUV422PData srcData;
   const RGBA32DataFromYUV422PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight, 3);
 
   int rv = YUV422PToBGR24(srcData.YBuffer(), srcData.mYStride,
                           srcData.UBuffer(), srcData.mUStride,
                           srcData.VBuffer(), srcData.mVStride, result_.mData,
                           result_.mStride, result_.mWidth, result_.mHeight);
@@ -2145,18 +2096,17 @@ TEST(ImageBitmapColorUtils, YUV422PToBGR
           dstData.GetPixel(j, i)[1]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 2],
           dstData.GetPixel(j, i)[0]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, YUV422PToRGBA32)
-{
+TEST(ImageBitmapColorUtils, YUV422PToRGBA32) {
   const YUV422PData srcData;
   const RGBA32DataFromYUV422PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight,
                                dstData.mChannelCount);
 
   int rv = YUV422PToRGBA32(srcData.YBuffer(), srcData.mYStride,
                            srcData.UBuffer(), srcData.mUStride,
                            srcData.VBuffer(), srcData.mVStride, result_.mData,
@@ -2176,18 +2126,17 @@ TEST(ImageBitmapColorUtils, YUV422PToRGB
           dstData.GetPixel(j, i)[2]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 3],
           dstData.GetPixel(j, i)[3]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, YUV422PToBGRA32)
-{
+TEST(ImageBitmapColorUtils, YUV422PToBGRA32) {
   const YUV422PData srcData;
   const RGBA32DataFromYUV422PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight,
                                dstData.mChannelCount);
 
   int rv = YUV422PToBGRA32(srcData.YBuffer(), srcData.mYStride,
                            srcData.UBuffer(), srcData.mUStride,
                            srcData.VBuffer(), srcData.mVStride, result_.mData,
@@ -2207,18 +2156,17 @@ TEST(ImageBitmapColorUtils, YUV422PToBGR
           dstData.GetPixel(j, i)[0]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 3],
           dstData.GetPixel(j, i)[3]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, YUV422PToGray8)
-{
+TEST(ImageBitmapColorUtils, YUV422PToGray8) {
   const YUV422PData srcData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight, 1);
 
   int rv = YUV422PToGray8(srcData.YBuffer(), srcData.mYStride,
                           srcData.UBuffer(), srcData.mUStride,
                           srcData.VBuffer(), srcData.mVStride, result_.mData,
                           result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -2230,18 +2178,17 @@ TEST(ImageBitmapColorUtils, YUV422PToGra
                 srcData.YBuffer()[i * srcData.mYStride + j]);
     }
   }
 }
 
 /*
  * From YUV420P.
  */
-TEST(ImageBitmapColorUtils, YUV420PToRGB24)
-{
+TEST(ImageBitmapColorUtils, YUV420PToRGB24) {
   const YUV420PData srcData;
   const RGBA32DataFromYUV420PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight, 3);
 
   int rv = YUV420PToRGB24(srcData.YBuffer(), srcData.mYStride,
                           srcData.UBuffer(), srcData.mUStride,
                           srcData.VBuffer(), srcData.mVStride, result_.mData,
                           result_.mStride, result_.mWidth, result_.mHeight);
@@ -2257,18 +2204,17 @@ TEST(ImageBitmapColorUtils, YUV420PToRGB
           dstData.GetPixel(j, i)[1]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 2],
           dstData.GetPixel(j, i)[2]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, YUV420PToBGR24)
-{
+TEST(ImageBitmapColorUtils, YUV420PToBGR24) {
   const YUV420PData srcData;
   const RGBA32DataFromYUV420PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight, 3);
 
   int rv = YUV420PToBGR24(srcData.YBuffer(), srcData.mYStride,
                           srcData.UBuffer(), srcData.mUStride,
                           srcData.VBuffer(), srcData.mVStride, result_.mData,
                           result_.mStride, result_.mWidth, result_.mHeight);
@@ -2284,18 +2230,17 @@ TEST(ImageBitmapColorUtils, YUV420PToBGR
           dstData.GetPixel(j, i)[1]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 2],
           dstData.GetPixel(j, i)[0]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, YUV420PToRGBA32)
-{
+TEST(ImageBitmapColorUtils, YUV420PToRGBA32) {
   const YUV420PData srcData;
   const RGBA32DataFromYUV420PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight,
                                dstData.mChannelCount);
 
   int rv = YUV420PToRGBA32(srcData.YBuffer(), srcData.mYStride,
                            srcData.UBuffer(), srcData.mUStride,
                            srcData.VBuffer(), srcData.mVStride, result_.mData,
@@ -2315,18 +2260,17 @@ TEST(ImageBitmapColorUtils, YUV420PToRGB
           dstData.GetPixel(j, i)[2]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 3],
           dstData.GetPixel(j, i)[3]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, YUV420PToBGRA32)
-{
+TEST(ImageBitmapColorUtils, YUV420PToBGRA32) {
   const YUV420PData srcData;
   const RGBA32DataFromYUV420PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight,
                                dstData.mChannelCount);
 
   int rv = YUV420PToBGRA32(srcData.YBuffer(), srcData.mYStride,
                            srcData.UBuffer(), srcData.mUStride,
                            srcData.VBuffer(), srcData.mVStride, result_.mData,
@@ -2346,18 +2290,17 @@ TEST(ImageBitmapColorUtils, YUV420PToBGR
           dstData.GetPixel(j, i)[0]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 3],
           dstData.GetPixel(j, i)[3]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, YUV420PToGray8)
-{
+TEST(ImageBitmapColorUtils, YUV420PToGray8) {
   const YUV420PData srcData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight, 1);
 
   int rv = YUV420PToGray8(srcData.YBuffer(), srcData.mYStride,
                           srcData.UBuffer(), srcData.mUStride,
                           srcData.VBuffer(), srcData.mVStride, result_.mData,
                           result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -2369,18 +2312,17 @@ TEST(ImageBitmapColorUtils, YUV420PToGra
                 srcData.YBuffer()[i * srcData.mYStride + j]);
     }
   }
 }
 
 /*
  * From NV12.
  */
-TEST(ImageBitmapColorUtils, NV12ToRGB24)
-{
+TEST(ImageBitmapColorUtils, NV12ToRGB24) {
   const NV12Data srcData;
   const RGBA32DataFromYUV420PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight, 3);
 
   int rv = NV12ToRGB24(srcData.YBuffer(), srcData.mYStride, srcData.UVBuffer(),
                        srcData.mUVStride, result_.mData, result_.mStride,
                        result_.mWidth, result_.mHeight);
   ASSERT_TRUE(rv == 0);
@@ -2395,18 +2337,17 @@ TEST(ImageBitmapColorUtils, NV12ToRGB24)
           dstData.GetPixel(j, i)[1]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 2],
           dstData.GetPixel(j, i)[2]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, NV12ToBGR24)
-{
+TEST(ImageBitmapColorUtils, NV12ToBGR24) {
   const NV12Data srcData;
   const RGBA32DataFromYUV420PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight, 3);
 
   int rv = NV12ToBGR24(srcData.YBuffer(), srcData.mYStride, srcData.UVBuffer(),
                        srcData.mUVStride, result_.mData, result_.mStride,
                        result_.mWidth, result_.mHeight);
   ASSERT_TRUE(rv == 0);
@@ -2421,18 +2362,17 @@ TEST(ImageBitmapColorUtils, NV12ToBGR24)
           dstData.GetPixel(j, i)[1]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 2],
           dstData.GetPixel(j, i)[0]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, NV12ToRGBA32)
-{
+TEST(ImageBitmapColorUtils, NV12ToRGBA32) {
   const NV12Data srcData;
   const RGBA32DataFromYUV420PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight,
                                dstData.mChannelCount);
 
   int rv = NV12ToRGBA32(srcData.YBuffer(), srcData.mYStride, srcData.UVBuffer(),
                         srcData.mUVStride, result_.mData, result_.mStride,
                         result_.mWidth, result_.mHeight);
@@ -2451,18 +2391,17 @@ TEST(ImageBitmapColorUtils, NV12ToRGBA32
           dstData.GetPixel(j, i)[2]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 3],
           dstData.GetPixel(j, i)[3]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, NV12ToBGRA32)
-{
+TEST(ImageBitmapColorUtils, NV12ToBGRA32) {
   const NV12Data srcData;
   const RGBA32DataFromYUV420PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight,
                                dstData.mChannelCount);
 
   int rv = NV12ToBGRA32(srcData.YBuffer(), srcData.mYStride, srcData.UVBuffer(),
                         srcData.mUVStride, result_.mData, result_.mStride,
                         result_.mWidth, result_.mHeight);
@@ -2481,18 +2420,17 @@ TEST(ImageBitmapColorUtils, NV12ToBGRA32
           dstData.GetPixel(j, i)[0]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 3],
           dstData.GetPixel(j, i)[3]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, NV12ToGray8)
-{
+TEST(ImageBitmapColorUtils, NV12ToGray8) {
   const NV12Data srcData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight, 1);
 
   int rv = NV12ToGray8(srcData.YBuffer(), srcData.mYStride, srcData.UVBuffer(),
                        srcData.mUVStride, result_.mData, result_.mStride,
                        result_.mWidth, result_.mHeight);
 
   ASSERT_TRUE(rv == 0);
@@ -2503,18 +2441,17 @@ TEST(ImageBitmapColorUtils, NV12ToGray8)
                 srcData.YBuffer()[i * srcData.mYStride + j]);
     }
   }
 }
 
 /*
  * From NV21.
  */
-TEST(ImageBitmapColorUtils, NV21ToRGB24)
-{
+TEST(ImageBitmapColorUtils, NV21ToRGB24) {
   const NV21Data srcData;
   const RGBA32DataFromYUV420PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight, 3);
 
   int rv = NV21ToRGB24(srcData.YBuffer(), srcData.mYStride, srcData.UVBuffer(),
                        srcData.mUVStride, result_.mData, result_.mStride,
                        result_.mWidth, result_.mHeight);
   ASSERT_TRUE(rv == 0);
@@ -2529,18 +2466,17 @@ TEST(ImageBitmapColorUtils, NV21ToRGB24)
           dstData.GetPixel(j, i)[1]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 2],
           dstData.GetPixel(j, i)[2]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, NV21ToBGR24)
-{
+TEST(ImageBitmapColorUtils, NV21ToBGR24) {
   const NV21Data srcData;
   const RGBA32DataFromYUV420PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight, 3);
 
   int rv = NV21ToBGR24(srcData.YBuffer(), srcData.mYStride, srcData.UVBuffer(),
                        srcData.mUVStride, result_.mData, result_.mStride,
                        result_.mWidth, result_.mHeight);
   ASSERT_TRUE(rv == 0);
@@ -2555,18 +2491,17 @@ TEST(ImageBitmapColorUtils, NV21ToBGR24)
           dstData.GetPixel(j, i)[1]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 2],
           dstData.GetPixel(j, i)[0]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, NV21ToRGBA32)
-{
+TEST(ImageBitmapColorUtils, NV21ToRGBA32) {
   const NV21Data srcData;
   const RGBA32DataFromYUV420PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight,
                                dstData.mChannelCount);
 
   int rv = NV21ToRGBA32(srcData.YBuffer(), srcData.mYStride, srcData.UVBuffer(),
                         srcData.mUVStride, result_.mData, result_.mStride,
                         result_.mWidth, result_.mHeight);
@@ -2585,18 +2520,17 @@ TEST(ImageBitmapColorUtils, NV21ToRGBA32
           dstData.GetPixel(j, i)[2]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 3],
           dstData.GetPixel(j, i)[3]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, NV21ToBGRA32)
-{
+TEST(ImageBitmapColorUtils, NV21ToBGRA32) {
   const NV21Data srcData;
   const RGBA32DataFromYUV420PData dstData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight,
                                dstData.mChannelCount);
 
   int rv = NV21ToBGRA32(srcData.YBuffer(), srcData.mYStride, srcData.UVBuffer(),
                         srcData.mUVStride, result_.mData, result_.mStride,
                         result_.mWidth, result_.mHeight);
@@ -2615,18 +2549,17 @@ TEST(ImageBitmapColorUtils, NV21ToBGRA32
           dstData.GetPixel(j, i)[0]);
       EXPECT_EQ(
           result_.mData[i * result_.mStride + j * result_.mChannelCount + 3],
           dstData.GetPixel(j, i)[3]);
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, NV21ToGray8)
-{
+TEST(ImageBitmapColorUtils, NV21ToGray8) {
   const NV21Data srcData;
   SimpleImage<uint8_t> result_(srcData.mYWidth, srcData.mYHeight, 1);
 
   int rv = NV21ToGray8(srcData.YBuffer(), srcData.mYStride, srcData.UVBuffer(),
                        srcData.mUVStride, result_.mData, result_.mStride,
                        result_.mWidth, result_.mHeight);
 
   ASSERT_TRUE(rv == 0);
@@ -2637,18 +2570,17 @@ TEST(ImageBitmapColorUtils, NV21ToGray8)
                 srcData.YBuffer()[i * srcData.mYStride + j]);
     }
   }
 }
 
 /*
  * From HSV.
  */
-TEST(ImageBitmapColorUtils, HSVToRGB24)
-{
+TEST(ImageBitmapColorUtils, HSVToRGB24) {
   const HSVData srcData;
   const RGB24Data dstData;
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight,
                                dstData.mChannelCount);
 
   int rv = HSVToRGB24(srcData.mData, srcData.mStride, result_.mData,
                       result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -2659,18 +2591,17 @@ TEST(ImageBitmapColorUtils, HSVToRGB24)
       for (int c = 0; c < dstData.mChannelCount; ++c) {
         EXPECT_EQ(result_.GetPixelValue(i, j, c),
                   dstData.GetPixelValue(i, j, c));
       }
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, HSVToBGR24)
-{
+TEST(ImageBitmapColorUtils, HSVToBGR24) {
   const HSVData srcData;
   const BGR24Data dstData;
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight,
                                dstData.mChannelCount);
 
   int rv = HSVToBGR24(srcData.mData, srcData.mStride, result_.mData,
                       result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -2681,18 +2612,17 @@ TEST(ImageBitmapColorUtils, HSVToBGR24)
       for (int c = 0; c < dstData.mChannelCount; ++c) {
         EXPECT_EQ(result_.GetPixelValue(i, j, c),
                   dstData.GetPixelValue(i, j, c));
       }
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, HSVToRGBA32)
-{
+TEST(ImageBitmapColorUtils, HSVToRGBA32) {
   const HSVData srcData;
   const RGBA32Data dstData;
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight,
                                dstData.mChannelCount);
 
   int rv = HSVToRGBA32(srcData.mData, srcData.mStride, result_.mData,
                        result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -2703,18 +2633,17 @@ TEST(ImageBitmapColorUtils, HSVToRGBA32)
       for (int c = 0; c < dstData.mChannelCount; ++c) {
         EXPECT_EQ(result_.GetPixelValue(i, j, c),
                   dstData.GetPixelValue(i, j, c));
       }
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, HSVToBGRA32)
-{
+TEST(ImageBitmapColorUtils, HSVToBGRA32) {
   const HSVData srcData;
   const BGRA32Data dstData;
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight,
                                dstData.mChannelCount);
 
   int rv = HSVToBGRA32(srcData.mData, srcData.mStride, result_.mData,
                        result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -2728,18 +2657,17 @@ TEST(ImageBitmapColorUtils, HSVToBGRA32)
       }
     }
   }
 }
 
 /*
  * From Lab.
  */
-TEST(ImageBitmapColorUtils, LabToRGB24)
-{
+TEST(ImageBitmapColorUtils, LabToRGB24) {
   const LabData srcData;
   const RGB24Data dstData;
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight,
                                dstData.mChannelCount);
 
   int rv = LabToRGB24(srcData.mData, srcData.mStride, result_.mData,
                       result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -2752,18 +2680,17 @@ TEST(ImageBitmapColorUtils, LabToRGB24)
         const uint8_t expectedValue = dstData.GetPixelValue(i, j, c);
         const int diff = std::abs(actualValue - expectedValue);
         EXPECT_LE(diff, 1);
       }
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, LabToBGR24)
-{
+TEST(ImageBitmapColorUtils, LabToBGR24) {
   const LabData srcData;
   const BGR24Data dstData;
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight,
                                dstData.mChannelCount);
 
   int rv = LabToBGR24(srcData.mData, srcData.mStride, result_.mData,
                       result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -2776,18 +2703,17 @@ TEST(ImageBitmapColorUtils, LabToBGR24)
         const uint8_t expectedValue = dstData.GetPixelValue(i, j, c);
         const int diff = std::abs(actualValue - expectedValue);
         EXPECT_LE(diff, 1);
       }
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, LabToRGBA32)
-{
+TEST(ImageBitmapColorUtils, LabToRGBA32) {
   const LabData srcData;
   const RGBA32Data dstData;
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight,
                                dstData.mChannelCount);
 
   int rv = LabToRGBA32(srcData.mData, srcData.mStride, result_.mData,
                        result_.mStride, result_.mWidth, result_.mHeight);
 
@@ -2800,18 +2726,17 @@ TEST(ImageBitmapColorUtils, LabToRGBA32)
         const uint8_t expectedValue = dstData.GetPixelValue(i, j, c);
         const int diff = std::abs(actualValue - expectedValue);
         EXPECT_LE(diff, 1);
       }
     }
   }
 }
 
-TEST(ImageBitmapColorUtils, LabToBGRA32)
-{
+TEST(ImageBitmapColorUtils, LabToBGRA32) {
   const LabData srcData;
   const BGRA32Data dstData;
   SimpleImage<uint8_t> result_(srcData.mWidth, srcData.mHeight,
                                dstData.mChannelCount);
 
   int rv = LabToBGRA32(srcData.mData, srcData.mStride, result_.mData,
                        result_.mStride, result_.mWidth, result_.mHeight);
 
--- a/dom/clients/api/Client.cpp
+++ b/dom/clients/api/Client.cpp
@@ -145,30 +145,29 @@ 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,25 +27,24 @@ 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,41 +75,40 @@ 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,41 +105,39 @@ 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,
@@ -153,24 +151,23 @@ 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,23 +57,22 @@ 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,26 +19,25 @@ 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,23 +282,22 @@ 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,23 +17,22 @@ 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,20 +297,19 @@ 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,19 +30,17 @@ 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,26 +598,25 @@ 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,26 +51,25 @@ 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,19 +53,17 @@ 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) {
@@ -141,19 +139,17 @@ 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,22 +24,21 @@ 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,19 +1291,17 @@ 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,35 +6445,34 @@ 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;
 }
 
@@ -6519,26 +6518,25 @@ 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,24 +1715,23 @@ 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,22 +62,21 @@ 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,19 +214,17 @@ 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,18 +153,17 @@ 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)
@@ -3043,29 +3042,28 @@ 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;
   }
@@ -3155,40 +3153,38 @@ 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/localstorage/test/gtest/TestLocalStorage.cpp
+++ b/dom/localstorage/test/gtest/TestLocalStorage.cpp
@@ -64,35 +64,31 @@ void CheckGeneratedOriginKey(nsIPrincipa
     EXPECT_TRUE(originKey == nsDependentCString(aOriginKey));
   } else {
     ASSERT_NE(rv, NS_OK) << "GenerateOriginKey2 should fail";
   }
 }
 
 }  // namespace
 
-TEST(LocalStorage, OriginKey)
-{
+TEST(LocalStorage, OriginKey) {
   // Check the system principal.
   nsCOMPtr<nsIScriptSecurityManager> secMan =
       nsContentUtils::GetSecurityManager();
-  ASSERT_TRUE(secMan)
-  << "GetSecurityManager() should not fail";
+  ASSERT_TRUE(secMan) << "GetSecurityManager() should not fail";
 
   nsCOMPtr<nsIPrincipal> principal;
   secMan->GetSystemPrincipal(getter_AddRefs(principal));
-  ASSERT_TRUE(principal)
-  << "GetSystemPrincipal() should not fail";
+  ASSERT_TRUE(principal) << "GetSystemPrincipal() should not fail";
 
   CheckGeneratedOriginKey(principal, nullptr);
 
   // Check the null principal.
   principal = NullPrincipal::CreateWithoutOriginAttributes();
-  ASSERT_TRUE(principal)
-  << "CreateWithoutOriginAttributes() should not fail";
+  ASSERT_TRUE(principal) << "CreateWithoutOriginAttributes() should not fail";
 
   CheckGeneratedOriginKey(principal, nullptr);
 
   // Check content principals.
   static const OriginKeyTest tests[] = {
       {"http://www.mozilla.org", "gro.allizom.www.:http:80"},
       {"https://www.mozilla.org", "gro.allizom.www.:https:443"},
       {"http://www.mozilla.org:32400", "gro.allizom.www.:http:32400"},
@@ -105,14 +101,13 @@ TEST(LocalStorage, OriginKey)
       {"moz-extension://53711a8f-65ed-e742-9671-1f02e267c0bc/"
        "_generated_background_page.html",
        "cb0c762e20f1-1769-247e-de56-f8a11735.:moz-extension"},
       {"http://[::1]:8/test.html", "1::.:http:8"},
   };
 
   for (const auto& test : tests) {
     principal = GetCodebasePrincipal(test.mSpec);
-    ASSERT_TRUE(principal)
-    << "GetCodebasePrincipal() should not fail";
+    ASSERT_TRUE(principal) << "GetCodebasePrincipal() should not fail";
 
     CheckGeneratedOriginKey(principal, test.mOriginKey);
   }
 }
--- 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,42 +340,40 @@ 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,30 +382,29 @@ 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,22 +1050,21 @@ 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,22 +311,21 @@ 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 {
@@ -706,23 +705,22 @@ 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
@@ -815,49 +813,48 @@ 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
@@ -1231,28 +1228,27 @@ 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();
       }
@@ -2130,20 +2126,19 @@ 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);
@@ -2968,19 +2963,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();
@@ -3064,47 +3059,46 @@ 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());
@@ -3113,81 +3107,78 @@ 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()) {
@@ -3468,23 +3459,22 @@ 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,107 +60,104 @@ 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,28 +331,27 @@ 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());
@@ -471,43 +470,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 {
@@ -649,45 +648,43 @@ 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",
@@ -786,67 +783,66 @@ 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.
@@ -1443,30 +1439,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);
 }
 
@@ -1521,30 +1517,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);
 }
 
@@ -1992,57 +1988,56 @@ 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) {
@@ -2869,28 +2864,27 @@ 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,42 +3293,41 @@ 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,
@@ -4170,60 +4169,59 @@ 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,24 +879,23 @@ 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__,
@@ -1710,26 +1709,25 @@ 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,29 +75,28 @@ 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,24 +88,23 @@ 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/doctor/gtest/TestMultiWriterQueue.cpp
+++ b/dom/media/doctor/gtest/TestMultiWriterQueue.cpp
@@ -40,18 +40,17 @@ static void TestMultiWriterQueueST(const
     // We should have got all numbers.
     EXPECT_EQ(max, x);
 
     // Nothing left.
     q.PopAll([&](int&) { EXPECT_TRUE(false); });
   }
 }
 
-TEST(MultiWriterQueue, SingleThreaded)
-{
+TEST(MultiWriterQueue, SingleThreaded) {
   TestMultiWriterQueueST<1>(10);
   TestMultiWriterQueueST<2>(10);
   TestMultiWriterQueueST<4>(10);
 
   TestMultiWriterQueueST<10>(9);
   TestMultiWriterQueueST<10>(10);
   TestMultiWriterQueueST<10>(11);
   TestMultiWriterQueueST<10>(19);
@@ -151,18 +150,17 @@ static void TestMultiWriterQueueMT(int a
       "alloc=%d (w %d)\n",
       aPrintPrefix, aWriterThreads, aReaderThreads, loops, pushes, duration,
       pushes / duration, q.LiveBuffersStats().mCount,