From 34acbb653a29f173f8bacab9a468ed210ff3c7b3 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 25 Apr 2020 09:40:08 +0000 Subject: [PATCH] Bug 1619165 - Reformat recent changes to the Google coding style r=andi First reformat with clang-format 10 # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D68802 --- build/unix/elfhack/test.c | 2 + docshell/base/BrowsingContext.h | 3 +- dom/base/ElementInlines.h | 7 +- dom/base/nsContentPolicyUtils.h | 67 +++++++++---------- dom/base/nsJSEnvironment.cpp | 10 +-- dom/html/ImageDocument.cpp | 3 +- dom/html/ImageDocument.h | 3 +- dom/indexedDB/ActorsParent.cpp | 6 +- dom/indexedDB/SafeRefPtr.h | 4 +- dom/media/webaudio/AudioBuffer.cpp | 2 - .../webaudio/MediaElementAudioSourceNode.cpp | 2 +- dom/quota/ActorsParent.cpp | 4 +- dom/security/nsCSPService.cpp | 4 +- dom/svg/SVGTransformableElement.cpp | 2 +- dom/vr/XRInputSourceArray.h | 4 +- dom/vr/XRNativeOriginTracker.cpp | 12 ++-- gfx/layers/apz/src/AndroidVelocityTracker.cpp | 7 +- .../composite/AsyncCompositionManager.cpp | 1 - gfx/layers/ipc/ShadowLayers.cpp | 2 +- gfx/layers/wr/WebRenderBridgeChild.cpp | 4 +- gfx/layers/wr/WebRenderBridgeParent.cpp | 8 +-- gfx/src/gfxCrashReporterUtils.cpp | 18 ++--- gfx/thebes/gfxMacPlatformFontList.mm | 2 +- gfx/thebes/gfxPlatform.cpp | 9 +-- gfx/thebes/gfxPlatformFontList.h | 6 +- gfx/vr/gfxVR.h | 2 +- gfx/vr/service/VRSession.cpp | 28 ++++---- gfx/vr/service/VRSession.h | 3 +- gfx/webrender_bindings/Moz2DImageRenderer.cpp | 2 +- image/imgLoader.h | 3 +- js/src/builtin/Stream.cpp | 2 +- js/src/builtin/intl/ListFormat.cpp | 2 +- .../ReadableStreamDefaultController.cpp | 2 +- .../streams/ReadableStreamInternals.cpp | 2 +- js/src/debugger/Environment.cpp | 4 +- js/src/debugger/Object.cpp | 4 +- js/src/gc/Marking.cpp | 3 +- js/src/vm/Interpreter.cpp | 2 +- js/src/vm/JSObject-inl.h | 9 ++- js/src/vm/PlainObject-inl.h | 2 +- js/src/vm/Shape.h | 6 +- js/src/vm/StringType.h | 2 +- layout/base/nsLayoutUtils.cpp | 3 +- layout/base/nsPresContext.h | 1 - layout/generic/nsGfxScrollFrame.cpp | 6 +- layout/xul/nsMenuPopupFrame.cpp | 1 - memory/mozalloc/cxxalloc.h | 2 +- .../components/antitracking/ContentBlocking.h | 2 +- toolkit/components/find/nsWebBrowserFind.cpp | 3 +- .../places/PageIconProtocolHandler.cpp | 6 +- .../core/ipc/TelemetryIPCAccumulator.cpp | 3 +- widget/windows/TSFTextStore.cpp | 2 +- xpcom/base/CycleCollectedJSRuntime.cpp | 34 +++++----- xpcom/threads/Mutex.h | 4 +- xpcom/threads/SchedulerGroup.h | 2 - 55 files changed, 165 insertions(+), 174 deletions(-) diff --git a/build/unix/elfhack/test.c b/build/unix/elfhack/test.c index 9e412de21e98..11e06bd02472 100644 --- a/build/unix/elfhack/test.c +++ b/build/unix/elfhack/test.c @@ -40,7 +40,9 @@ DEF(data) DEF(relocation) DEF(sections) DEF(are) +// clang-format off DEF(not) +// clang-format on DEF(sufficiently) DEF(large) DEF(and) diff --git a/docshell/base/BrowsingContext.h b/docshell/base/BrowsingContext.h index 6e4cc516d5fe..b418efd72bac 100644 --- a/docshell/base/BrowsingContext.h +++ b/docshell/base/BrowsingContext.h @@ -248,7 +248,8 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache { void PrepareForProcessChange(); // Triggers a load in the process which currently owns this BrowsingContext. - nsresult LoadURI(nsDocShellLoadState* aLoadState, bool aSetNavigating = false); + nsresult LoadURI(nsDocShellLoadState* aLoadState, + bool aSetNavigating = false); nsresult InternalLoad(nsDocShellLoadState* aLoadState, nsIDocShell** aDocShell, nsIRequest** aRequest); diff --git a/dom/base/ElementInlines.h b/dom/base/ElementInlines.h index 09f5673d100f..9cfca5fc85b0 100644 --- a/dom/base/ElementInlines.h +++ b/dom/base/ElementInlines.h @@ -28,10 +28,9 @@ inline void Element::UnregisterActivityObserver() { inline mozilla::dom::Element* nsINode::GetFlattenedTreeParentElement() const { nsINode* parentNode = GetFlattenedTreeParentNode(); - if - MOZ_LIKELY(parentNode && parentNode->IsElement()) { - return parentNode->AsElement(); - } + if MOZ_LIKELY (parentNode && parentNode->IsElement()) { + return parentNode->AsElement(); + } return nullptr; } diff --git a/dom/base/nsContentPolicyUtils.h b/dom/base/nsContentPolicyUtils.h index a3c34e8b2ec5..a6bb0001e8c9 100644 --- a/dom/base/nsContentPolicyUtils.h +++ b/dom/base/nsContentPolicyUtils.h @@ -170,40 +170,39 @@ inline const char* NS_CP_ContentTypeName(uint32_t contentType) { * * Note: requestOrigin is scoped outside the PR_BEGIN_MACRO/PR_END_MACRO on * purpose */ -#define CHECK_PRINCIPAL_CSP_AND_DATA(action) \ - PR_BEGIN_MACRO \ - if (loadingPrincipal && loadingPrincipal->IsSystemPrincipal()) { \ - /* We exempt most loads into any document with the system principal \ - * from content policy (except CSP) checks, mostly as an optimization. \ - * Which means that we need to apply this check to the loading principal, \ - * not the principal that triggered the load. */ \ - /* Check CSP for System Privileged pages */ \ - CSPService::ConsultCSP(contentLocation, loadInfo, mimeType, decision); \ - if (NS_CP_REJECTED(*decision)) { \ - return NS_OK; \ - } \ - if (contentType != nsIContentPolicy::TYPE_DOCUMENT) { \ - *decision = nsIContentPolicy::ACCEPT; \ - nsCOMPtr n = do_QueryInterface(context); \ - if (!n) { \ - nsCOMPtr win = do_QueryInterface(context); \ - n = win ? win->GetExtantDoc() : nullptr; \ - } \ - if (n) { \ - mozilla::dom::Document* d = n->OwnerDoc(); \ - if (d->IsLoadedAsData() || d->IsBeingUsedAsImage() || \ - d->IsResourceDoc()) { \ - nsCOMPtr dataPolicy = \ - do_GetService("@mozilla.org/data-document-content-policy;1"); \ - if (dataPolicy) { \ - dataPolicy->action(contentLocation, loadInfo, mimeType, \ - decision); \ - } \ - } \ - } \ - } \ - return NS_OK; \ - } \ +#define CHECK_PRINCIPAL_CSP_AND_DATA(action) \ + PR_BEGIN_MACRO \ + if (loadingPrincipal && loadingPrincipal->IsSystemPrincipal()) { \ + /* We exempt most loads into any document with the system principal \ + * from content policy (except CSP) checks, mostly as an optimization. \ + * Which means that we need to apply this check to the loading principal, \ + * not the principal that triggered the load. */ \ + /* Check CSP for System Privileged pages */ \ + CSPService::ConsultCSP(contentLocation, loadInfo, mimeType, decision); \ + if (NS_CP_REJECTED(*decision)) { \ + return NS_OK; \ + } \ + if (contentType != nsIContentPolicy::TYPE_DOCUMENT) { \ + *decision = nsIContentPolicy::ACCEPT; \ + nsCOMPtr n = do_QueryInterface(context); \ + if (!n) { \ + nsCOMPtr win = do_QueryInterface(context); \ + n = win ? win->GetExtantDoc() : nullptr; \ + } \ + if (n) { \ + mozilla::dom::Document* d = n->OwnerDoc(); \ + if (d->IsLoadedAsData() || d->IsBeingUsedAsImage() || \ + d->IsResourceDoc()) { \ + nsCOMPtr dataPolicy = \ + do_GetService("@mozilla.org/data-document-content-policy;1"); \ + if (dataPolicy) { \ + dataPolicy->action(contentLocation, loadInfo, mimeType, decision); \ + } \ + } \ + } \ + } \ + return NS_OK; \ + } \ PR_END_MACRO /** diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 6931c1f8c7bd..1ba2c302b1ec 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -2151,11 +2151,11 @@ void nsJSContext::MaybePokeCC() { nsCycleCollector_dispatchDeferredDeletion(); ActivateCCRunner(); - sCCRunner = IdleTaskRunner::Create( - CCRunnerFired, "MaybePokeCC::CCRunnerFired", - kCCSkippableDelay.ToMilliseconds(), - kForgetSkippableSliceDuration.ToMilliseconds(), true, - [] { return sShuttingDown; }); + sCCRunner = + IdleTaskRunner::Create(CCRunnerFired, "MaybePokeCC::CCRunnerFired", + kCCSkippableDelay.ToMilliseconds(), + kForgetSkippableSliceDuration.ToMilliseconds(), + true, [] { return sShuttingDown; }); } } diff --git a/dom/html/ImageDocument.cpp b/dom/html/ImageDocument.cpp index 78d3a89d0144..7b3fdb162bb0 100644 --- a/dom/html/ImageDocument.cpp +++ b/dom/html/ImageDocument.cpp @@ -283,7 +283,8 @@ void ImageDocument::ShrinkToFit() { if (imageHeight > mVisibleHeight) { classList->Add(NS_LITERAL_STRING("overflowingVertical"), IgnoreErrors()); } else { - classList->Remove(NS_LITERAL_STRING("overflowingVertical"), IgnoreErrors()); + classList->Remove(NS_LITERAL_STRING("overflowingVertical"), + IgnoreErrors()); } return; } diff --git a/dom/html/ImageDocument.h b/dom/html/ImageDocument.h index e47fe0a56511..c41b8fca723a 100644 --- a/dom/html/ImageDocument.h +++ b/dom/html/ImageDocument.h @@ -31,8 +31,7 @@ class ImageDocument final : public MediaDocument, nsresult Init() override; nsresult StartDocumentLoad(const char* aCommand, nsIChannel* aChannel, - nsILoadGroup* aLoadGroup, - nsISupports* aContainer, + nsILoadGroup* aLoadGroup, nsISupports* aContainer, nsIStreamListener** aDocListener, bool aReset = true, nsIContentSink* aSink = nullptr) override; diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index 5419c094b9b8..0dcd33afc9bb 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -12659,7 +12659,7 @@ void ConnectionPool::ScheduleQueuedTransactions(ThreadInfo aThreadInfo) { const auto foundIt = std::find_if( mQueuedTransactions.begin(), mQueuedTransactions.end(), - [& me = *this](const auto& queuedTransaction) { + [&me = *this](const auto& queuedTransaction) { return !me.ScheduleTransaction(queuedTransaction, /* aFromQueuedTransactions */ true); }); @@ -12785,7 +12785,7 @@ void ConnectionPool::NoteClosedDatabase(DatabaseInfo* aDatabaseInfo) { // finished. mCompleteCallbacks.RemoveElementsAt( std::remove_if(mCompleteCallbacks.begin(), mCompleteCallbacks.end(), - [& me = *this](const auto& completeCallback) { + [&me = *this](const auto& completeCallback) { return me.MaybeFireCallback(completeCallback.get()); }), mCompleteCallbacks.end()); @@ -25840,7 +25840,7 @@ ObjectStoreGetRequestOp::GetPreprocessParams() { std::make_move_iterator(mResponse.end()), MakeBackInserter(preprocessInfos), [](const auto& info) { return info.HasPreprocessInfo(); }, - [& self = *this](StructuredCloneReadInfoParent&& info) { + [&self = *this](StructuredCloneReadInfoParent&& info) { return self.ConvertResponse(std::move(info)); }); diff --git a/dom/indexedDB/SafeRefPtr.h b/dom/indexedDB/SafeRefPtr.h index 6fac7a341fce..20ae1cd939e8 100644 --- a/dom/indexedDB/SafeRefPtr.h +++ b/dom/indexedDB/SafeRefPtr.h @@ -298,10 +298,10 @@ class MOZ_IS_REFPTR MOZ_TRIVIAL_ABI SafeRefPtr { }; template -SafeRefPtr(RefPtr &&)->SafeRefPtr; +SafeRefPtr(RefPtr &&) -> SafeRefPtr; template -SafeRefPtr(already_AddRefed &&)->SafeRefPtr; +SafeRefPtr(already_AddRefed &&) -> SafeRefPtr; template SafeRefPtr::SafeRefPtr(T* aRawPtr, detail::InitialConstructionTag) diff --git a/dom/media/webaudio/AudioBuffer.cpp b/dom/media/webaudio/AudioBuffer.cpp index eb11120433c3..bdd30ae93b97 100644 --- a/dom/media/webaudio/AudioBuffer.cpp +++ b/dom/media/webaudio/AudioBuffer.cpp @@ -312,7 +312,6 @@ bool AudioBuffer::RestoreJSChannelData(JSContext* aJSContext) { void AudioBuffer::CopyFromChannel(const Float32Array& aDestination, uint32_t aChannelNumber, uint32_t aStartInChannel, ErrorResult& aRv) { - if (aChannelNumber >= NumberOfChannels()) { aRv.ThrowIndexSizeError( nsPrintfCString("Channel number (%u) is out of range", aChannelNumber)); @@ -363,7 +362,6 @@ void AudioBuffer::CopyToChannel(JSContext* aJSContext, const Float32Array& aSource, uint32_t aChannelNumber, uint32_t aStartInChannel, ErrorResult& aRv) { - if (aChannelNumber >= NumberOfChannels()) { aRv.ThrowIndexSizeError( nsPrintfCString("Channel number (%u) is out of range", aChannelNumber)); diff --git a/dom/media/webaudio/MediaElementAudioSourceNode.cpp b/dom/media/webaudio/MediaElementAudioSourceNode.cpp index b2f6e562d1d8..d8596cc8c7b6 100644 --- a/dom/media/webaudio/MediaElementAudioSourceNode.cpp +++ b/dom/media/webaudio/MediaElementAudioSourceNode.cpp @@ -87,7 +87,7 @@ void MediaElementAudioSourceNode::ListenForAllowedToPlay( // static analysis. We capture a non-owning reference so as to allow // cycle collection of the node. The reference is cleared via // DisconnectIfExists() from Destroy() when the node is collected. - [& self = *this]() { + [&self = *this]() { self.Context()->StartBlockedAudioContextIfAllowed(); self.mAllowedToPlayRequest.Complete(); }) diff --git a/dom/quota/ActorsParent.cpp b/dom/quota/ActorsParent.cpp index 3f6b190cf810..13121f1a3e63 100644 --- a/dom/quota/ActorsParent.cpp +++ b/dom/quota/ActorsParent.cpp @@ -6304,7 +6304,7 @@ nsresult QuotaManager::EnsureStorageIsInitialized() { const auto autoRecord = mInitializationInfo.RecordFirstInitializationAttempt( Initialization::Storage, - [& self = *this] { return static_cast(self.mStorageConnection); }); + [&self = *this] { return static_cast(self.mStorageConnection); }); auto storageFileOrErr = QM_NewLocalFile(mBasePath); if (NS_WARN_IF(storageFileOrErr.isErr())) { @@ -7006,7 +7006,7 @@ nsresult QuotaManager::EnsureTemporaryStorageIsInitialized() { const auto autoRecord = mInitializationInfo.RecordFirstInitializationAttempt( Initialization::TemporaryStorage, - [& self = *this] { return self.mTemporaryStorageInitialized; }); + [&self = *this] { return self.mTemporaryStorageInitialized; }); nsresult rv; diff --git a/dom/security/nsCSPService.cpp b/dom/security/nsCSPService.cpp index 7ee2f642993f..6840fdeb0a04 100644 --- a/dom/security/nsCSPService.cpp +++ b/dom/security/nsCSPService.cpp @@ -339,7 +339,7 @@ nsresult CSPService::ConsultCSPForRedirect(nsIURI* aOriginalURI, aOriginalURI, // Original nsIURI true, // aSendViolationReports cspNonce, // nonce - parserCreatedScript, &decision); + parserCreatedScript, &decision); // if the preload policy already denied the load, then there // is no point in checking the real policy @@ -361,7 +361,7 @@ nsresult CSPService::ConsultCSPForRedirect(nsIURI* aOriginalURI, aOriginalURI, // Original nsIURI true, // aSendViolationReports cspNonce, // nonce - parserCreatedScript, &decision); + parserCreatedScript, &decision); if (NS_CP_REJECTED(decision)) { aCancelCode = Some(NS_ERROR_DOM_BAD_URI); return NS_BINDING_FAILED; diff --git a/dom/svg/SVGTransformableElement.cpp b/dom/svg/SVGTransformableElement.cpp index a03f7d56545c..d36137ead4fe 100644 --- a/dom/svg/SVGTransformableElement.cpp +++ b/dom/svg/SVGTransformableElement.cpp @@ -159,7 +159,7 @@ SVGElement* SVGTransformableElement::GetFarthestViewportElement() { } static already_AddRefed ZeroBBox(SVGTransformableElement& aOwner) { - return MakeAndAddRef(&aOwner, Rect {0, 0, 0, 0}); + return MakeAndAddRef(&aOwner, Rect{0, 0, 0, 0}); } already_AddRefed SVGTransformableElement::GetBBox( diff --git a/dom/vr/XRInputSourceArray.h b/dom/vr/XRInputSourceArray.h index cf16f0dca897..cbd70af688a7 100644 --- a/dom/vr/XRInputSourceArray.h +++ b/dom/vr/XRInputSourceArray.h @@ -42,8 +42,8 @@ class XRInputSourceArray final : public nsISupports, public nsWrapperCache { virtual ~XRInputSourceArray() = default; private: - void DispatchInputSourceRemovedEvent(const nsTArray>& aInputs, - XRSession* aSession); + void DispatchInputSourceRemovedEvent( + const nsTArray>& aInputs, XRSession* aSession); nsCOMPtr mParent; nsTArray> mInputSources; diff --git a/dom/vr/XRNativeOriginTracker.cpp b/dom/vr/XRNativeOriginTracker.cpp index f57978cdbf9b..3e517f168e3d 100644 --- a/dom/vr/XRNativeOriginTracker.cpp +++ b/dom/vr/XRNativeOriginTracker.cpp @@ -16,17 +16,17 @@ XRNativeOriginTracker::XRNativeOriginTracker(const gfx::VRPose* aPose) gfx::PointDouble3D XRNativeOriginTracker::GetPosition() { MOZ_ASSERT(mPose); - return gfx::PointDouble3D(mPose->position[0], - mPose->position[1], + return gfx::PointDouble3D(mPose->position[0], mPose->position[1], mPose->position[2]); } gfx::QuaternionDouble XRNativeOriginTracker::GetOrientation() { MOZ_ASSERT(mPose); - gfx::QuaternionDouble orientation(mPose->orientation[0], - mPose->orientation[1], mPose->orientation[2], mPose->orientation[3]); - // Quaternion was inverted for WebVR in XXXVRSession when handling controller poses. - // We need to re-invert it here again. + gfx::QuaternionDouble orientation( + mPose->orientation[0], mPose->orientation[1], mPose->orientation[2], + mPose->orientation[3]); + // Quaternion was inverted for WebVR in XXXVRSession when handling controller + // poses. We need to re-invert it here again. // TODO: Remove those extra inverts when WebVR support is disabled. orientation.Invert(); return orientation; diff --git a/gfx/layers/apz/src/AndroidVelocityTracker.cpp b/gfx/layers/apz/src/AndroidVelocityTracker.cpp index 60a3d7b9a241..e25c4ce83fa7 100644 --- a/gfx/layers/apz/src/AndroidVelocityTracker.cpp +++ b/gfx/layers/apz/src/AndroidVelocityTracker.cpp @@ -31,8 +31,7 @@ static const uint8_t kPolyDegree = kDegree + 1; // Maximum size of position history. static const uint8_t kHistorySize = 20; -AndroidVelocityTracker::AndroidVelocityTracker() - : mLastEventTime(0) {} +AndroidVelocityTracker::AndroidVelocityTracker() : mLastEventTime(0) {} void AndroidVelocityTracker::StartTracking(ParentLayerCoord aPos, uint32_t aTimestampMs) { @@ -275,9 +274,7 @@ Maybe AndroidVelocityTracker::ComputeVelocity(uint32_t aTimestampMs) { return Nothing{}; } -void AndroidVelocityTracker::Clear() { - mHistory.Clear(); -} +void AndroidVelocityTracker::Clear() { mHistory.Clear(); } } // namespace layers } // namespace mozilla diff --git a/gfx/layers/composite/AsyncCompositionManager.cpp b/gfx/layers/composite/AsyncCompositionManager.cpp index 8f3714fd6097..32b35f33db37 100644 --- a/gfx/layers/composite/AsyncCompositionManager.cpp +++ b/gfx/layers/composite/AsyncCompositionManager.cpp @@ -1045,7 +1045,6 @@ bool AsyncCompositionManager::ApplyAsyncContentTransformToTree( Compositor* compositor = mLayerManager->GetCompositor(); if (CompositorBridgeParent* bridge = compositor->GetCompositorBridgeParent()) { - LayersId rootLayerTreeId = bridge->RootLayerTreeId(); if (mIsFirstPaint || FrameMetricsHaveUpdated(metrics)) { if (RefPtr uiController = diff --git a/gfx/layers/ipc/ShadowLayers.cpp b/gfx/layers/ipc/ShadowLayers.cpp index c6c86a1356a3..f686b1e1b681 100644 --- a/gfx/layers/ipc/ShadowLayers.cpp +++ b/gfx/layers/ipc/ShadowLayers.cpp @@ -18,7 +18,7 @@ //#include "gfxSharedImageSurface.h" // for gfxSharedImageSurface #include "ipc/IPCMessageUtils.h" // for gfxContentType, null_t #include "IPDLActor.h" -#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc +#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc #include "mozilla/gfx/Point.h" // for IntSize #include "mozilla/layers/CompositableClient.h" // for CompositableClient, etc #include "mozilla/layers/CompositorBridgeChild.h" diff --git a/gfx/layers/wr/WebRenderBridgeChild.cpp b/gfx/layers/wr/WebRenderBridgeChild.cpp index 13980339becf..a5ed4e4378b1 100644 --- a/gfx/layers/wr/WebRenderBridgeChild.cpp +++ b/gfx/layers/wr/WebRenderBridgeChild.cpp @@ -552,8 +552,8 @@ void WebRenderBridgeChild::SetWebRenderLayerManager( mManager = aManager; MOZ_ASSERT(NS_IsMainThread() || !XRE_IsContentProcess()); - mActiveResourceTracker = MakeUnique( - 1000, "CompositableForwarder", nullptr); + mActiveResourceTracker = + MakeUnique(1000, "CompositableForwarder", nullptr); } ipc::IShmemAllocator* WebRenderBridgeChild::GetShmemAllocator() { diff --git a/gfx/layers/wr/WebRenderBridgeParent.cpp b/gfx/layers/wr/WebRenderBridgeParent.cpp index 82bf2e7cba0f..250609b7bdb3 100644 --- a/gfx/layers/wr/WebRenderBridgeParent.cpp +++ b/gfx/layers/wr/WebRenderBridgeParent.cpp @@ -834,7 +834,7 @@ bool WebRenderBridgeParent::AddSharedExternalImage( mSharedSurfaceIds.insert(std::make_pair(key, aExtId)); wr::ImageDescriptor descriptor(dSurf->GetSize(), dSurf->Stride(), - dSurf->GetFormat()); + dSurf->GetFormat()); aResources.AddExternalImage(aKey, descriptor, aExtId, wr::ExternalImageType::Buffer(), 0); return true; @@ -859,10 +859,10 @@ bool WebRenderBridgeParent::PushExternalImageForTexture( WebRenderTextureHost* wrTexture = aTexture->AsWebRenderTextureHost(); if (wrTexture) { wrTexture->PushResourceUpdates(aResources, op, keys, - wrTexture->GetExternalImageKey()); + wrTexture->GetExternalImageKey()); auto it = mTextureHosts.find(wr::AsUint64(aKey)); MOZ_ASSERT((it == mTextureHosts.end() && !aIsUpdate) || - (it != mTextureHosts.end() && aIsUpdate)); + (it != mTextureHosts.end() && aIsUpdate)); if (it != mTextureHosts.end()) { // Release Texture if it exists. ReleaseTextureOfImage(aKey); @@ -945,7 +945,7 @@ bool WebRenderBridgeParent::UpdateSharedExternalImage( } wr::ImageDescriptor descriptor(dSurf->GetSize(), dSurf->Stride(), - dSurf->GetFormat()); + dSurf->GetFormat()); aResources.UpdateExternalImageWithDirtyRect( aKey, descriptor, aExtId, wr::ExternalImageType::Buffer(), wr::ToDeviceIntRect(aDirtyRect), 0); diff --git a/gfx/src/gfxCrashReporterUtils.cpp b/gfx/src/gfxCrashReporterUtils.cpp index 8e12c46d7860..68d4a68e7fe0 100644 --- a/gfx/src/gfxCrashReporterUtils.cpp +++ b/gfx/src/gfxCrashReporterUtils.cpp @@ -5,17 +5,17 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "gfxCrashReporterUtils.h" -#include // for strcmp -#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2 +#include // for strcmp +#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2 #include "mozilla/SchedulerGroup.h" // for SchedulerGroup -#include "mozilla/Services.h" // for GetObserverService +#include "mozilla/Services.h" // for GetObserverService #include "mozilla/StaticMutex.h" -#include "mozilla/mozalloc.h" // for operator new, etc -#include "mozilla/RefPtr.h" // for RefPtr -#include "MainThreadUtils.h" // for NS_IsMainThread -#include "nsCOMPtr.h" // for nsCOMPtr -#include "nsError.h" // for NS_OK, NS_FAILED, nsresult -#include "nsExceptionHandler.h" // for AppendAppNotesToCrashReport +#include "mozilla/mozalloc.h" // for operator new, etc +#include "mozilla/RefPtr.h" // for RefPtr +#include "MainThreadUtils.h" // for NS_IsMainThread +#include "nsCOMPtr.h" // for nsCOMPtr +#include "nsError.h" // for NS_OK, NS_FAILED, nsresult +#include "nsExceptionHandler.h" // for AppendAppNotesToCrashReport #include "nsID.h" #include "nsIObserver.h" // for nsIObserver, etc #include "nsIObserverService.h" // for nsIObserverService diff --git a/gfx/thebes/gfxMacPlatformFontList.mm b/gfx/thebes/gfxMacPlatformFontList.mm index 216caa4125c7..4b13df2ab8d3 100644 --- a/gfx/thebes/gfxMacPlatformFontList.mm +++ b/gfx/thebes/gfxMacPlatformFontList.mm @@ -415,7 +415,7 @@ CGFontRef MacOSFontEntry::CreateOrCopyFontRef() { ref = CTFontCopyGraphicsFont((CTFontRef)font, nullptr); } } - return ref; // Not saved in mFontRef; caller will own the reference + return ref; // Not saved in mFontRef; caller will own the reference } // For a logging build, we wrap the CFDataRef in a FontTableRec so that we can diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 26b7633ab95f..30fae54511dc 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -2894,9 +2894,9 @@ static FeatureState& WebRenderHardwareQualificationStatus( bool hasBattery = false; gfxInfo->GetHasBattery(&hasBattery); if (hasBattery && !gfxConfig::IsEnabled(Feature::WEBRENDER_COMPOSITOR)) { - featureWebRenderQualified.Disable(FeatureStatus::Blocked, - "Battery Intel requires os compositor", - NS_LITERAL_CSTRING("INTEL_BATTERY_REQUIRES_DCOMP")); + featureWebRenderQualified.Disable( + FeatureStatus::Blocked, "Battery Intel requires os compositor", + NS_LITERAL_CSTRING("INTEL_BATTERY_REQUIRES_DCOMP")); } } #endif @@ -3033,7 +3033,8 @@ void gfxPlatform::InitWebRenderConfig() { } if (StaticPrefs::gfx_webrender_use_optimized_shaders_AtStartup()) { - gfxVars::SetUseWebRenderOptimizedShaders(gfxConfig::IsEnabled(Feature::WEBRENDER)); + gfxVars::SetUseWebRenderOptimizedShaders( + gfxConfig::IsEnabled(Feature::WEBRENDER)); } if (Preferences::GetBool("gfx.webrender.software", false)) { diff --git a/gfx/thebes/gfxPlatformFontList.h b/gfx/thebes/gfxPlatformFontList.h index 8b364ddaa488..6c55daedcdd6 100644 --- a/gfx/thebes/gfxPlatformFontList.h +++ b/gfx/thebes/gfxPlatformFontList.h @@ -263,9 +263,9 @@ class gfxPlatformFontList : public gfxFontInfoLoader { // because (on Windows) we cannot include the proper headers, as they // result in build failure due to (indirect) inclusion of windows.h // in generated bindings code. - void ShareFontListShmBlockToProcess( - uint32_t aGeneration, uint32_t aIndex, base::ProcessId aPid, - base::SharedMemoryHandle* aOut); + void ShareFontListShmBlockToProcess(uint32_t aGeneration, uint32_t aIndex, + base::ProcessId aPid, + base::SharedMemoryHandle* aOut); void SetCharacterMap(uint32_t aGeneration, const mozilla::fontlist::Pointer& aFacePtr, diff --git a/gfx/vr/gfxVR.h b/gfx/vr/gfxVR.h index b836f5f389de..d4d772b6a26e 100644 --- a/gfx/vr/gfxVR.h +++ b/gfx/vr/gfxVR.h @@ -28,7 +28,7 @@ enum class GamepadMappingType : uint8_t; enum class GamepadHand : uint8_t; } // namespace dom namespace gfx { -enum class VRAPIMode : uint8_t {WebXR, WebVR, NumVRAPIModes}; +enum class VRAPIMode : uint8_t { WebXR, WebVR, NumVRAPIModes }; class VRLayerParent; class VRDisplayHost; diff --git a/gfx/vr/service/VRSession.cpp b/gfx/vr/service/VRSession.cpp index 60561eebf5bd..100a9677b60a 100644 --- a/gfx/vr/service/VRSession.cpp +++ b/gfx/vr/service/VRSession.cpp @@ -167,25 +167,25 @@ void VRSession::UpdateTrigger(VRControllerState& aState, uint32_t aButtonIndex, } } -void VRSession::SetControllerSelectionAndSqueezeFrameId(VRControllerState& controllerState, - uint64_t aFrameId) { +void VRSession::SetControllerSelectionAndSqueezeFrameId( + VRControllerState& controllerState, uint64_t aFrameId) { // The 1st button, trigger, is its selection action. const bool selectionPressed = controllerState.buttonPressed & 1ULL; - if (selectionPressed && controllerState.selectActionStopFrameId - >= controllerState.selectActionStartFrameId) { - controllerState.selectActionStartFrameId = aFrameId; - } else if (!selectionPressed && controllerState.selectActionStartFrameId - > controllerState.selectActionStopFrameId) { - controllerState.selectActionStopFrameId = aFrameId; + if (selectionPressed && controllerState.selectActionStopFrameId >= + controllerState.selectActionStartFrameId) { + controllerState.selectActionStartFrameId = aFrameId; + } else if (!selectionPressed && controllerState.selectActionStartFrameId > + controllerState.selectActionStopFrameId) { + controllerState.selectActionStopFrameId = aFrameId; } // The 2nd button, squeeze, is its squeeze action. const bool squeezePressed = controllerState.buttonPressed & (1ULL << 1); - if (squeezePressed && controllerState.squeezeActionStopFrameId - >= controllerState.squeezeActionStartFrameId) { - controllerState.squeezeActionStartFrameId = aFrameId; - } else if (!squeezePressed && controllerState.squeezeActionStartFrameId - > controllerState.squeezeActionStopFrameId) { - controllerState.squeezeActionStopFrameId = aFrameId; + if (squeezePressed && controllerState.squeezeActionStopFrameId >= + controllerState.squeezeActionStartFrameId) { + controllerState.squeezeActionStartFrameId = aFrameId; + } else if (!squeezePressed && controllerState.squeezeActionStartFrameId > + controllerState.squeezeActionStopFrameId) { + controllerState.squeezeActionStopFrameId = aFrameId; } } diff --git a/gfx/vr/service/VRSession.h b/gfx/vr/service/VRSession.h index 844a8f366ce4..ab446a26d7a4 100644 --- a/gfx/vr/service/VRSession.h +++ b/gfx/vr/service/VRSession.h @@ -84,7 +84,8 @@ class VRSession { virtual bool SubmitFrame(const mozilla::gfx::VRLayer_Stereo_Immersive& aLayer, const VRLayerTextureHandle& aTexture) = 0; #endif - void SetControllerSelectionAndSqueezeFrameId(VRControllerState& controllerState, uint64_t aFrameId); + void SetControllerSelectionAndSqueezeFrameId( + VRControllerState& controllerState, uint64_t aFrameId); }; } // namespace gfx diff --git a/gfx/webrender_bindings/Moz2DImageRenderer.cpp b/gfx/webrender_bindings/Moz2DImageRenderer.cpp index 2b8b6d44494d..40f25ecad6c7 100644 --- a/gfx/webrender_bindings/Moz2DImageRenderer.cpp +++ b/gfx/webrender_bindings/Moz2DImageRenderer.cpp @@ -343,7 +343,7 @@ static bool Moz2DRenderCallback(const Range aBlob, const mozilla::wr::DeviceIntRect* aVisibleRect, const mozilla::wr::LayoutIntRect* aRenderRect, const uint16_t aTileSize, - const mozilla::wr::TileOffset *aTileOffset, + const mozilla::wr::TileOffset* aTileOffset, const mozilla::wr::LayoutIntRect* aDirtyRect, Range aOutput) { IntSize size(aRenderRect->size.width, aRenderRect->size.height); diff --git a/image/imgLoader.h b/image/imgLoader.h index ae1c26e5567b..c109fb271f67 100644 --- a/image/imgLoader.h +++ b/image/imgLoader.h @@ -365,8 +365,7 @@ class imgLoader final : public imgILoader, // aURI may be different from imgRequest's URI in the case of blob URIs, as we // can share requests with different URIs. - nsresult CreateNewProxyForRequest(imgRequest* aRequest, - nsIURI* aURI, + nsresult CreateNewProxyForRequest(imgRequest* aRequest, nsIURI* aURI, nsILoadGroup* aLoadGroup, mozilla::dom::Document* aLoadingDocument, imgINotificationObserver* aObserver, diff --git a/js/src/builtin/Stream.cpp b/js/src/builtin/Stream.cpp index b4c700ea1322..247c0a90dc6a 100644 --- a/js/src/builtin/Stream.cpp +++ b/js/src/builtin/Stream.cpp @@ -23,7 +23,7 @@ #include "js/PropertySpec.h" #include "vm/Interpreter.h" #include "vm/JSContext.h" -#include "vm/PlainObject.h" // js::PlainObject +#include "vm/PlainObject.h" // js::PlainObject #include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined #include "vm/SelfHosting.h" diff --git a/js/src/builtin/intl/ListFormat.cpp b/js/src/builtin/intl/ListFormat.cpp index 516cdfaeaa51..daec23fe9aa0 100644 --- a/js/src/builtin/intl/ListFormat.cpp +++ b/js/src/builtin/intl/ListFormat.cpp @@ -27,7 +27,7 @@ #include "unicode/utypes.h" #include "vm/JSContext.h" #include "vm/PlainObject.h" // js::PlainObject -#include "vm/Runtime.h" // js::ReportAllocationOverflow +#include "vm/Runtime.h" // js::ReportAllocationOverflow #include "vm/SelfHosting.h" #include "vm/StringType.h" diff --git a/js/src/builtin/streams/ReadableStreamDefaultController.cpp b/js/src/builtin/streams/ReadableStreamDefaultController.cpp index 01730cf150a9..f4d15a80c58e 100644 --- a/js/src/builtin/streams/ReadableStreamDefaultController.cpp +++ b/js/src/builtin/streams/ReadableStreamDefaultController.cpp @@ -29,7 +29,7 @@ #include "js/PropertySpec.h" #include "vm/Interpreter.h" #include "vm/JSContext.h" -#include "vm/PlainObject.h" // js::PlainObject +#include "vm/PlainObject.h" // js::PlainObject #include "vm/PromiseObject.h" // js::PromiseObject, js::PromiseResolvedWithUndefined #include "vm/SelfHosting.h" diff --git a/js/src/builtin/streams/ReadableStreamInternals.cpp b/js/src/builtin/streams/ReadableStreamInternals.cpp index d1b371c5f487..a6f3fbc82661 100644 --- a/js/src/builtin/streams/ReadableStreamInternals.cpp +++ b/js/src/builtin/streams/ReadableStreamInternals.cpp @@ -40,7 +40,7 @@ #include "vm/JSContext-inl.h" // JSContext::check #include "vm/List-inl.h" // js::ListObject, js::AppendToListInFixedSlot, js::StoreNewListInFixedSlot #include "vm/PlainObject-inl.h" // js::PlainObject::createWithTemplate -#include "vm/Realm-inl.h" // JS::Realm +#include "vm/Realm-inl.h" // JS::Realm using JS::BooleanValue; using JS::CallArgs; diff --git a/js/src/debugger/Environment.cpp b/js/src/debugger/Environment.cpp index 9543923c9da0..3b0550de1294 100644 --- a/js/src/debugger/Environment.cpp +++ b/js/src/debugger/Environment.cpp @@ -37,8 +37,8 @@ #include "vm/Compartment-inl.h" // for Compartment::wrap #include "vm/EnvironmentObject-inl.h" // for JSObject::enclosingEnvironment #include "vm/JSObject-inl.h" // for IsInternalFunctionObject, NewObjectWithGivenProtoAndKind -#include "vm/ObjectOperations-inl.h" // for HasProperty, GetProperty -#include "vm/Realm-inl.h" // for AutoRealm::AutoRealm +#include "vm/ObjectOperations-inl.h" // for HasProperty, GetProperty +#include "vm/Realm-inl.h" // for AutoRealm::AutoRealm namespace js { class GlobalObject; diff --git a/js/src/debugger/Object.cpp b/js/src/debugger/Object.cpp index c99285b5d7d4..add42a1c2da3 100644 --- a/js/src/debugger/Object.cpp +++ b/js/src/debugger/Object.cpp @@ -67,8 +67,8 @@ #include "vm/StringType.h" // for JSAtom, PropertyName #include "vm/WrapperObject.h" // for JSObject::is, WrapperObject -#include "vm/Compartment-inl.h" // for Compartment::wrap -#include "vm/JSAtom-inl.h" // for ValueToId +#include "vm/Compartment-inl.h" // for Compartment::wrap +#include "vm/JSAtom-inl.h" // for ValueToId #include "vm/JSObject-inl.h" // for GetObjectClassName, InitClass, NewObjectWithGivenProtoAndKind #include "vm/NativeObject-inl.h" // for NativeObject::global #include "vm/ObjectOperations-inl.h" // for DeleteProperty, GetProperty diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp index 359ea09ae168..78ac498cc351 100644 --- a/js/src/gc/Marking.cpp +++ b/js/src/gc/Marking.cpp @@ -4001,7 +4001,8 @@ JS_FRIEND_API bool JS::UnmarkGrayGCThingRecursively(JS::GCCellPtr thing) { JSRuntime* rt = thing.asCell()->runtimeFromMainThread(); gcstats::AutoPhase outerPhase(rt->gc.stats(), gcstats::PhaseKind::BARRIER); - gcstats::AutoPhase innerPhase(rt->gc.stats(), gcstats::PhaseKind::UNMARK_GRAY); + gcstats::AutoPhase innerPhase(rt->gc.stats(), + gcstats::PhaseKind::UNMARK_GRAY); return UnmarkGrayGCThingUnchecked(rt, thing); } diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp index f7f0eea679b1..c27a8da9b048 100644 --- a/js/src/vm/Interpreter.cpp +++ b/js/src/vm/Interpreter.cpp @@ -1913,7 +1913,7 @@ class ReservedRooted : public RootedBase> { void set(const T& p) const { *savedRoot = p; } operator Handle() { return *savedRoot; } - operator Rooted &() { return *savedRoot; } + operator Rooted&() { return *savedRoot; } MutableHandle operator&() { return &*savedRoot; } DECLARE_NONPOINTER_ACCESSOR_METHODS(savedRoot->get()) diff --git a/js/src/vm/JSObject-inl.h b/js/src/vm/JSObject-inl.h index 1213457d2ef7..844595cb81ae 100644 --- a/js/src/vm/JSObject-inl.h +++ b/js/src/vm/JSObject-inl.h @@ -409,8 +409,9 @@ JSObject* NewObjectWithGivenTaggedProto(JSContext* cx, const JSClass* clasp, uint32_t initialShapeFlags = 0); template -inline JSObject* NewObjectWithGivenTaggedProto( - JSContext* cx, const JSClass* clasp, Handle proto) { +inline JSObject* NewObjectWithGivenTaggedProto(JSContext* cx, + const JSClass* clasp, + Handle proto) { gc::AllocKind allocKind = gc::GetGCObjectKind(clasp); return NewObjectWithGivenTaggedProto(cx, clasp, proto, allocKind, NewKind, 0); } @@ -420,8 +421,7 @@ namespace detail { template inline T* NewObjectWithGivenTaggedProtoForKind(JSContext* cx, Handle proto) { - JSObject* obj = - NewObjectWithGivenTaggedProto(cx, &T::class_, proto); + JSObject* obj = NewObjectWithGivenTaggedProto(cx, &T::class_, proto); return obj ? &obj->as() : nullptr; } @@ -430,7 +430,6 @@ inline T* NewObjectWithGivenTaggedProtoForKind(JSContext* cx, template inline T* NewObjectWithGivenTaggedProto(JSContext* cx, Handle proto) { - return detail::NewObjectWithGivenTaggedProtoForKind(cx, proto); } diff --git a/js/src/vm/PlainObject-inl.h b/js/src/vm/PlainObject-inl.h index a04ce0679f53..0d3f8ebba334 100644 --- a/js/src/vm/PlainObject-inl.h +++ b/js/src/vm/PlainObject-inl.h @@ -18,7 +18,7 @@ #include "vm/JSFunction.h" // JSFunction #include "vm/NativeObject.h" // js::NativeObject::create #include "vm/ObjectGroup.h" // js::ObjectGroup, js::GenericObject, js::NewObjectKind -#include "vm/Shape.h" // js::Shape +#include "vm/Shape.h" // js::Shape #include "gc/ObjectKind-inl.h" // js::gc::GetGCObjectKind #include "vm/JSObject-inl.h" // js::GetInitialHeap, js::NewBuiltinClassInstance diff --git a/js/src/vm/Shape.h b/js/src/vm/Shape.h index adf9095d4d3c..e6f1d8da3057 100644 --- a/js/src/vm/Shape.h +++ b/js/src/vm/Shape.h @@ -710,9 +710,9 @@ class BaseShape : public gc::TenuredCell { private: using HeaderWithJSClass = gc::CellHeaderWithNonGCPointer; HeaderWithJSClass headerAndClasp_; /* Class of referring object. */ - uint32_t flags; /* Vector of above flags. */ - uint32_t slotSpan_; /* Object slot span for BaseShapes at - * dictionary last properties. */ + uint32_t flags; /* Vector of above flags. */ + uint32_t slotSpan_; /* Object slot span for BaseShapes at + * dictionary last properties. */ /* For owned BaseShapes, the canonical unowned BaseShape. */ GCPtrUnownedBaseShape unowned_; diff --git a/js/src/vm/StringType.h b/js/src/vm/StringType.h index f70e6a594684..a4424cb420f0 100644 --- a/js/src/vm/StringType.h +++ b/js/src/vm/StringType.h @@ -559,7 +559,7 @@ class JSString : public js::gc::Cell { * * Returns mozilla::Nothing on OOM. */ - mozilla::Maybe > encodeUTF8Partial( + mozilla::Maybe> encodeUTF8Partial( const JS::AutoRequireNoGC& nogc, mozilla::Span buffer) const; private: diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 68603901de8e..a60f185686bd 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -1302,8 +1302,7 @@ bool nsLayoutUtils::SetDisplayPortMargins(nsIContent* aContent, // nothing if aContent does not have a frame. So getting the displayport is // useless if the content has no frame, so we avoid calling this to avoid // triggering a warning about not having a frame. - hadDisplayPort = - GetHighResolutionDisplayPort(aContent, &oldDisplayPort); + hadDisplayPort = GetHighResolutionDisplayPort(aContent, &oldDisplayPort); } aContent->SetProperty( diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h index f691bb7ae612..97657009f993 100644 --- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -526,7 +526,6 @@ class nsPresContext : public nsISupports, void SetFullZoom(float aZoom); public: - float GetFullZoom() { return mFullZoom; } /** * Device full zoom differs from full zoom because it gets the zoom from diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 2f317f2b151a..5bc1ae8b0c6c 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -1343,9 +1343,9 @@ nscoord ScrollFrameHelper::GetNondisappearingScrollbarWidth( StyleAppearance::ScrollbarNonDisappearing)) { LayoutDeviceIntSize size; bool canOverride = true; - theme->GetMinimumWidgetSize( - aState->PresContext(), box, - StyleAppearance::ScrollbarNonDisappearing, &size, &canOverride); + theme->GetMinimumWidgetSize(aState->PresContext(), box, + StyleAppearance::ScrollbarNonDisappearing, + &size, &canOverride); return aState->PresContext()->DevPixelsToAppUnits( verticalWM ? size.height : size.width); } diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp index 76bfcf8d4bcc..b330fe07c1ec 100644 --- a/layout/xul/nsMenuPopupFrame.cpp +++ b/layout/xul/nsMenuPopupFrame.cpp @@ -537,7 +537,6 @@ void nsMenuPopupFrame::LayoutPopup(nsBoxLayoutState& aState, } prefSize = XULBoundsCheck(minSize, prefSize, maxSize); - bool sizeChanged = (mPrefSize != prefSize); // if the size changed then set the bounds to be the preferred size if (sizeChanged) { diff --git a/memory/mozalloc/cxxalloc.h b/memory/mozalloc/cxxalloc.h index b5fb6e400542..c6fb4bb1dcf0 100644 --- a/memory/mozalloc/cxxalloc.h +++ b/memory/mozalloc/cxxalloc.h @@ -52,7 +52,7 @@ MOZALLOC_EXPORT_NEW void operator delete(void* ptr) noexcept(true) { } MOZALLOC_EXPORT_NEW void operator delete(void* ptr, - const std::nothrow_t&)noexcept(true) { + const std::nothrow_t&) noexcept(true) { return free_impl(ptr); } diff --git a/toolkit/components/antitracking/ContentBlocking.h b/toolkit/components/antitracking/ContentBlocking.h index f4505110347e..34d57acd485a 100644 --- a/toolkit/components/antitracking/ContentBlocking.h +++ b/toolkit/components/antitracking/ContentBlocking.h @@ -28,7 +28,7 @@ class OriginAttributes; namespace dom { class BrowsingContext; class ContentParent; -} +} // namespace dom class ContentBlocking final { public: diff --git a/toolkit/components/find/nsWebBrowserFind.cpp b/toolkit/components/find/nsWebBrowserFind.cpp index a4a96d1a4478..bbd63c3d1a31 100644 --- a/toolkit/components/find/nsWebBrowserFind.cpp +++ b/toolkit/components/find/nsWebBrowserFind.cpp @@ -745,7 +745,8 @@ nsresult nsWebBrowserFind::OnFind(nsPIDOMWindowOuter* aFoundWindow) { if (nsFocusManager* fm = nsFocusManager::GetFocusManager()) { // get the containing frame and focus it. For top-level windows, the right // window should already be focused. - if (RefPtr frameElement = aFoundWindow->GetFrameElementInternal()) { + if (RefPtr frameElement = + aFoundWindow->GetFrameElementInternal()) { fm->SetFocus(frameElement, 0); } diff --git a/toolkit/components/places/PageIconProtocolHandler.cpp b/toolkit/components/places/PageIconProtocolHandler.cpp index d3300d0c2c6c..237d682cfef3 100644 --- a/toolkit/components/places/PageIconProtocolHandler.cpp +++ b/toolkit/components/places/PageIconProtocolHandler.cpp @@ -201,10 +201,10 @@ nsresult PageIconProtocolHandler::NewChannelInternal(nsIURI* aURI, // We override the channel's loadinfo below anyway, so using a null // principal here is alright. nsCOMPtr loadingPrincipal = - NullPrincipal::CreateWithoutOriginAttributes(); + NullPrincipal::CreateWithoutOriginAttributes(); rv = NS_NewInputStreamChannel( - getter_AddRefs(channel), aURI, pipeIn.forget(), - loadingPrincipal, nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED, + getter_AddRefs(channel), aURI, pipeIn.forget(), loadingPrincipal, + nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED, nsIContentPolicy::TYPE_INTERNAL_IMAGE); NS_ENSURE_SUCCESS(rv, rv); } diff --git a/toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.cpp b/toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.cpp index 55ba277b9dd0..01d38ae02b72 100644 --- a/toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.cpp +++ b/toolkit/components/telemetry/core/ipc/TelemetryIPCAccumulator.cpp @@ -341,6 +341,5 @@ void TelemetryIPCAccumulator::DeInitializeGlobalState() { void TelemetryIPCAccumulator::DispatchToMainThread( already_AddRefed&& aEvent) { - SchedulerGroup::Dispatch(TaskCategory::Other, - std::move(aEvent)); + SchedulerGroup::Dispatch(TaskCategory::Other, std::move(aEvent)); } diff --git a/widget/windows/TSFTextStore.cpp b/widget/windows/TSFTextStore.cpp index a37ae66990eb..d7a30b377f7f 100644 --- a/widget/windows/TSFTextStore.cpp +++ b/widget/windows/TSFTextStore.cpp @@ -28,7 +28,7 @@ // Workaround for mingw32 #ifndef TS_SD_INPUTPANEMANUALDISPLAYENABLE -#define TS_SD_INPUTPANEMANUALDISPLAYENABLE 0x40 +# define TS_SD_INPUTPANEMANUALDISPLAYENABLE 0x40 #endif namespace mozilla { diff --git a/xpcom/base/CycleCollectedJSRuntime.cpp b/xpcom/base/CycleCollectedJSRuntime.cpp index 3fc328890077..5b8eeeeefba3 100644 --- a/xpcom/base/CycleCollectedJSRuntime.cpp +++ b/xpcom/base/CycleCollectedJSRuntime.cpp @@ -942,21 +942,21 @@ void CycleCollectedJSRuntime::TraverseNativeRoots( // would hurt to do this after the JS holders. TraverseAdditionalNativeRoots(aCb); - mJSHolders.ForEach([&aCb](void* holder, nsScriptObjectTracer* tracer, - JS::Zone* zone) { - bool noteRoot = false; - if (MOZ_UNLIKELY(aCb.WantAllTraces())) { - noteRoot = true; - } else { - tracer->Trace(holder, - TraceCallbackFunc(CheckParticipatesInCycleCollection), - ¬eRoot); - } + mJSHolders.ForEach( + [&aCb](void* holder, nsScriptObjectTracer* tracer, JS::Zone* zone) { + bool noteRoot = false; + if (MOZ_UNLIKELY(aCb.WantAllTraces())) { + noteRoot = true; + } else { + tracer->Trace(holder, + TraceCallbackFunc(CheckParticipatesInCycleCollection), + ¬eRoot); + } - if (noteRoot) { - aCb.NoteNativeRoot(holder, tracer); - } - }); + if (noteRoot) { + aCb.NoteNativeRoot(holder, tracer); + } + }); } /* static */ @@ -1286,7 +1286,7 @@ static inline bool ShouldCheckSingleZoneHolders() { return rand() % 256 == 0; #else return false; -# endif +#endif } void CycleCollectedJSRuntime::TraceNativeGrayRoots( @@ -1298,13 +1298,13 @@ void CycleCollectedJSRuntime::TraceNativeGrayRoots( bool checkSingleZoneHolders = ShouldCheckSingleZoneHolders(); mJSHolders.ForEach( [aTracer, checkSingleZoneHolders]( - void* holder, nsScriptObjectTracer* tracer, JS::Zone* zone) { + void* holder, nsScriptObjectTracer* tracer, JS::Zone* zone) { #ifdef CHECK_SINGLE_ZONE_JS_HOLDERS if (checkSingleZoneHolders && !tracer->IsMultiZoneJSHolder()) { CheckHolderIsSingleZone(holder, tracer, zone); } #else - Unused << checkSingleZoneHolders; + Unused << checkSingleZoneHolders; #endif tracer->Trace(holder, JsGcTracer(), aTracer); }, diff --git a/xpcom/threads/Mutex.h b/xpcom/threads/Mutex.h index af3acc57f9a0..4b2c33ddeac9 100644 --- a/xpcom/threads/Mutex.h +++ b/xpcom/threads/Mutex.h @@ -206,7 +206,7 @@ class MOZ_RAII BaseAutoLock { }; template -BaseAutoLock(MutexType&)->BaseAutoLock; +BaseAutoLock(MutexType&) -> BaseAutoLock; } // namespace detail typedef detail::BaseAutoLock MutexAutoLock; @@ -250,7 +250,7 @@ class MOZ_RAII BaseAutoUnlock { }; template -BaseAutoUnlock(MutexType&)->BaseAutoUnlock; +BaseAutoUnlock(MutexType&) -> BaseAutoUnlock; } // namespace detail typedef detail::BaseAutoUnlock MutexAutoUnlock; diff --git a/xpcom/threads/SchedulerGroup.h b/xpcom/threads/SchedulerGroup.h index 917e79eb2eb2..826068a5c11f 100644 --- a/xpcom/threads/SchedulerGroup.h +++ b/xpcom/threads/SchedulerGroup.h @@ -82,7 +82,6 @@ class SchedulerGroup { static nsresult Dispatch(TaskCategory aCategory, already_AddRefed&& aRunnable); - static nsresult UnlabeledDispatch(TaskCategory aCategory, already_AddRefed&& aRunnable); @@ -98,7 +97,6 @@ class SchedulerGroup { static nsresult InternalUnlabeledDispatch( TaskCategory aCategory, already_AddRefed&& aRunnable); - static nsresult LabeledDispatch(TaskCategory aCategory, already_AddRefed&& aRunnable, dom::DocGroup* aDocGroup);