From 7c309095ea846c08a2aa4f430f98e14db95639c4 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 21 Oct 2019 14:13:44 +0000 Subject: [PATCH] Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan Please note that it is the first reformat with clang-format 9 I only saw a fix in the .mm file # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D49056 --HG-- extra : moz-landing-system : lando --- accessible/base/AccIterator.cpp | 8 +- accessible/ipc/win/HandlerProvider.cpp | 36 +++--- accessible/mac/mozAccessible.mm | 4 +- accessible/mac/mozActionElements.mm | 4 +- accessible/xul/XULComboboxAccessible.cpp | 4 +- caps/nsJSPrincipals.cpp | 3 +- dom/base/SerializedStackHolder.cpp | 3 +- dom/base/nsMappedAttributes.cpp | 2 +- dom/base/test/gtest/TestContentUtils.cpp | 12 +- dom/bindings/BindingUtils.h | 4 +- dom/canvas/WebGLTexelConversions.h | 16 +-- dom/events/EventStateManager.h | 4 +- dom/media/ForwardedInputTrack.cpp | 5 +- dom/media/Tracing.h | 5 +- dom/media/VideoFrameContainer.cpp | 4 +- dom/media/ipc/RemoteAudioDecoder.h | 1 + .../webrtc/MediaEngineTabVideoSource.cpp | 3 +- dom/plugins/base/nptypes.h | 62 +++++------ .../ServiceWorkerPrivateImpl.cpp | 4 +- .../ServiceWorkerRegistrationDescriptor.cpp | 10 +- gfx/2d/Swizzle.cpp | 21 ++-- gfx/2d/Swizzle.h | 9 +- gfx/2d/SwizzleNEON.cpp | 3 +- gfx/layers/wr/WebRenderCommandBuilder.cpp | 8 +- gfx/tests/gtest/TestSwizzle.cpp | 27 +++-- gfx/thebes/gfxDWriteFontList.cpp | 19 ++-- ipc/mscom/MainThreadInvoker.h | 3 +- ipc/mscom/oop/Factory.h | 3 +- js/src/builtin/Promise.cpp | 6 +- .../jit/mips-shared/Assembler-mips-shared.cpp | 74 ++++++------- js/src/jit/mips64/Assembler-mips64.cpp | 6 +- js/src/jit/mips64/MacroAssembler-mips64.cpp | 8 +- js/src/jsexn.cpp | 3 +- js/xpconnect/loader/IOBuffers.h | 4 +- js/xpconnect/loader/mozJSSubScriptLoader.cpp | 19 ++-- js/xpconnect/loader/mozJSSubScriptLoader.h | 8 +- js/xpconnect/src/XPCWrappedNativeJSOps.cpp | 2 +- layout/generic/nsGfxScrollFrame.cpp | 2 +- layout/generic/nsLineBox.h | 20 ++-- layout/mathml/nsMathMLmencloseFrame.cpp | 3 +- mfbt/Types.h | 104 +++++++++--------- netwerk/base/LoadInfo.h | 4 +- netwerk/test/fuzz/FuzzingStreamListener.h | 4 +- netwerk/test/fuzz/TestFtpFuzzing.cpp | 2 +- netwerk/test/gtest/TestMozURL.cpp | 3 +- toolkit/components/places/History.cpp | 4 +- .../satchel/nsFormFillController.cpp | 9 +- .../components/satchel/nsFormFillController.h | 4 +- .../TelemetryGeckoViewPersistence.cpp | 6 +- toolkit/mozapps/update/updater/updater.cpp | 4 +- toolkit/xre/glxtest.cpp | 18 ++- widget/GfxInfoX11.cpp | 7 +- widget/android/AndroidBridge.cpp | 6 +- widget/android/GfxInfo.h | 7 +- widget/cocoa/GfxInfo.mm | 9 +- widget/windows/GfxInfo.cpp | 45 ++++---- widget/windows/GfxInfo.h | 12 +- 57 files changed, 354 insertions(+), 336 deletions(-) diff --git a/accessible/base/AccIterator.cpp b/accessible/base/AccIterator.cpp index e2b65e480c1f..62caeebfadc0 100644 --- a/accessible/base/AccIterator.cpp +++ b/accessible/base/AccIterator.cpp @@ -69,13 +69,11 @@ AccIterator::IteratorState::IteratorState(const Accessible* aParent, RelatedAccIterator::RelatedAccIterator(DocAccessible* aDocument, nsIContent* aDependentContent, nsAtom* aRelAttr) - : mDocument(aDocument), - mRelAttr(aRelAttr), - mProviders(nullptr), - mIndex(0) { + : mDocument(aDocument), mRelAttr(aRelAttr), mProviders(nullptr), mIndex(0) { nsAutoString id; if (aDependentContent->IsElement() && - aDependentContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::id, id)) { + aDependentContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::id, + id)) { mProviders = mDocument->GetRelProviders(aDependentContent->AsElement(), id); } } diff --git a/accessible/ipc/win/HandlerProvider.cpp b/accessible/ipc/win/HandlerProvider.cpp index 5e0dbc230a75..36da57263fef 100644 --- a/accessible/ipc/win/HandlerProvider.cpp +++ b/accessible/ipc/win/HandlerProvider.cpp @@ -103,11 +103,12 @@ void HandlerProvider::GetAndSerializePayload( IA2Payload payload{}; - if (!mscom::InvokeOnMainThread("HandlerProvider::BuildInitialIA2Data", this, - &HandlerProvider::BuildInitialIA2Data, - std::forward>(aInterceptor), - std::forward(&payload.mStaticData), - std::forward(&payload.mDynamicData)) || + if (!mscom::InvokeOnMainThread( + "HandlerProvider::BuildInitialIA2Data", this, + &HandlerProvider::BuildInitialIA2Data, + std::forward>(aInterceptor), + std::forward(&payload.mStaticData), + std::forward(&payload.mDynamicData)) || !payload.mDynamicData.mUniqueId) { return; } @@ -634,8 +635,7 @@ HandlerProvider::get_AllTextInfo(BSTR* aText, std::forward(aHyperlinks), std::forward(aNHyperlinks), std::forward(aAttribRuns), - std::forward(aNAttribRuns), - std::forward(&hr))) { + std::forward(aNAttribRuns), std::forward(&hr))) { return E_FAIL; } @@ -700,12 +700,11 @@ HandlerProvider::get_RelationsInfo(IARelationData** aRelations, } HRESULT hr; - if (!mscom::InvokeOnMainThread("HandlerProvider::GetRelationsInfoMainThread", - this, - &HandlerProvider::GetRelationsInfoMainThread, - std::forward(aRelations), - std::forward(aNRelations), - std::forward(&hr))) { + if (!mscom::InvokeOnMainThread( + "HandlerProvider::GetRelationsInfoMainThread", this, + &HandlerProvider::GetRelationsInfoMainThread, + std::forward(aRelations), + std::forward(aNRelations), std::forward(&hr))) { return E_FAIL; } @@ -843,12 +842,11 @@ HandlerProvider::get_AllChildren(AccChildData** aChildren, ULONG* aNChildren) { MOZ_ASSERT(mscom::IsCurrentThreadMTA()); HRESULT hr; - if (!mscom::InvokeOnMainThread("HandlerProvider::GetAllChildrenMainThread", - this, - &HandlerProvider::GetAllChildrenMainThread, - std::forward(aChildren), - std::forward(aNChildren), - std::forward(&hr))) { + if (!mscom::InvokeOnMainThread( + "HandlerProvider::GetAllChildrenMainThread", this, + &HandlerProvider::GetAllChildrenMainThread, + std::forward(aChildren), + std::forward(aNChildren), std::forward(&hr))) { return E_FAIL; } diff --git a/accessible/mac/mozAccessible.mm b/accessible/mac/mozAccessible.mm index 3cd3b1fd5fe9..0d21d2def286 100644 --- a/accessible/mac/mozAccessible.mm +++ b/accessible/mac/mozAccessible.mm @@ -90,9 +90,9 @@ static inline NSMutableArray* ConvertToNSArray(nsTArray& aArra if ((self = [super init])) { mGeckoAccessible = aGeckoAccessible; if (aGeckoAccessible & IS_PROXY) - mRole = [self getProxyAccessible] -> Role(); + mRole = [self getProxyAccessible]->Role(); else - mRole = [self getGeckoAccessible] -> Role(); + mRole = [self getGeckoAccessible]->Role(); } return self; diff --git a/accessible/mac/mozActionElements.mm b/accessible/mac/mozActionElements.mm index 9fa2b5e2c8d5..3b53cc857366 100644 --- a/accessible/mac/mozActionElements.mm +++ b/accessible/mac/mozActionElements.mm @@ -284,13 +284,13 @@ enum CheckboxValue { - (NSArray*)children { if (![self getGeckoAccessible]) return nil; - nsDeckFrame* deckFrame = do_QueryFrame([self getGeckoAccessible] -> GetFrame()); + nsDeckFrame* deckFrame = do_QueryFrame([self getGeckoAccessible]->GetFrame()); nsIFrame* selectedFrame = deckFrame ? deckFrame->GetSelectedBox() : nullptr; Accessible* selectedAcc = nullptr; if (selectedFrame) { nsINode* node = selectedFrame->GetContent(); - selectedAcc = [self getGeckoAccessible] -> Document() -> GetAccessible(node); + selectedAcc = [self getGeckoAccessible]->Document() -> GetAccessible(node); } if (selectedAcc) { diff --git a/accessible/xul/XULComboboxAccessible.cpp b/accessible/xul/XULComboboxAccessible.cpp index 716d5db1b7f5..5651be386b93 100644 --- a/accessible/xul/XULComboboxAccessible.cpp +++ b/accessible/xul/XULComboboxAccessible.cpp @@ -28,9 +28,7 @@ XULComboboxAccessible::XULComboboxAccessible(nsIContent* aContent, mGenericTypes |= eCombobox; } -role XULComboboxAccessible::NativeRole() const { - return roles::COMBOBOX; -} +role XULComboboxAccessible::NativeRole() const { return roles::COMBOBOX; } uint64_t XULComboboxAccessible::NativeState() const { // As a nsComboboxAccessible we can have the following states: diff --git a/caps/nsJSPrincipals.cpp b/caps/nsJSPrincipals.cpp index 9ffaa43e0d3c..5518e461ee8a 100644 --- a/caps/nsJSPrincipals.cpp +++ b/caps/nsJSPrincipals.cpp @@ -389,5 +389,6 @@ bool nsJSPrincipals::write(JSContext* aCx, JSStructuredCloneWriter* aWriter) { } bool nsJSPrincipals::isSystemOrAddonPrincipal() { - return this->IsSystemPrincipal() || this->GetIsAddonOrExpandedAddonPrincipal(); + return this->IsSystemPrincipal() || + this->GetIsAddonOrExpandedAddonPrincipal(); } diff --git a/dom/base/SerializedStackHolder.cpp b/dom/base/SerializedStackHolder.cpp index a64440f2d4fd..142bcdab4316 100644 --- a/dom/base/SerializedStackHolder.cpp +++ b/dom/base/SerializedStackHolder.cpp @@ -81,7 +81,8 @@ JSObject* SerializedStackHolder::ReadStack(JSContext* aCx) { set.emplace(mWorkerRef->Private()->GetPrincipal()); } - mHolder.Read(xpc::CurrentNativeGlobal(aCx), aCx, &stackValue, IgnoreErrors()); + mHolder.Read(xpc::CurrentNativeGlobal(aCx), aCx, &stackValue, + IgnoreErrors()); } return stackValue.isObject() ? &stackValue.toObject() : nullptr; diff --git a/dom/base/nsMappedAttributes.cpp b/dom/base/nsMappedAttributes.cpp index 7ed0f9354334..f0fd95965c4f 100644 --- a/dom/base/nsMappedAttributes.cpp +++ b/dom/base/nsMappedAttributes.cpp @@ -87,7 +87,7 @@ void* nsMappedAttributes::operator new(size_t aSize, // if we have zero attributes. The zero attribute case only happens // for 's mapped attributes if (aAttrCount != 0) { - size -= sizeof(void * [1]); + size -= sizeof(void* [1]); } if (sCachedMappedAttributeAllocations) { diff --git a/dom/base/test/gtest/TestContentUtils.cpp b/dom/base/test/gtest/TestContentUtils.cpp index f4fef3ac2ab6..5e75bf5e1b6e 100644 --- a/dom/base/test/gtest/TestContentUtils.cpp +++ b/dom/base/test/gtest/TestContentUtils.cpp @@ -14,9 +14,9 @@ TEST(DOM_Base_ContentUtils, StringifyJSON_EmptyValue) { JS::RootedObject globalObject( - mozilla::dom::RootingCx(), - mozilla::dom::SimpleGlobalObject::Create( - mozilla::dom::SimpleGlobalObject::GlobalType::BindingDetail)); + mozilla::dom::RootingCx(), + mozilla::dom::SimpleGlobalObject::Create( + mozilla::dom::SimpleGlobalObject::GlobalType::BindingDetail)); mozilla::dom::AutoJSAPI jsAPI; ASSERT_TRUE(jsAPI.Init(globalObject)); JSContext* cx = jsAPI.cx(); @@ -31,9 +31,9 @@ TEST(DOM_Base_ContentUtils, StringifyJSON_EmptyValue) TEST(DOM_Base_ContentUtils, StringifyJSON_Object) { JS::RootedObject globalObject( - mozilla::dom::RootingCx(), - mozilla::dom::SimpleGlobalObject::Create( - mozilla::dom::SimpleGlobalObject::GlobalType::BindingDetail)); + mozilla::dom::RootingCx(), + mozilla::dom::SimpleGlobalObject::Create( + mozilla::dom::SimpleGlobalObject::GlobalType::BindingDetail)); mozilla::dom::AutoJSAPI jsAPI; ASSERT_TRUE(jsAPI.Init(globalObject)); JSContext* cx = jsAPI.cx(); diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h index f6d35c17135d..2be3fdeacfe8 100644 --- a/dom/bindings/BindingUtils.h +++ b/dom/bindings/BindingUtils.h @@ -1528,8 +1528,8 @@ static inline JSObject* WrapNativeISupports(JSContext* cx, T* p, JS::Rooted scope(cx, JS::CurrentGlobalOrNull(cx)); JS::Rooted v(cx); retval = XPCOMObjectToJsval(cx, scope, helper, nullptr, false, &v) - ? v.toObjectOrNull() - : nullptr; + ? v.toObjectOrNull() + : nullptr; } return retval; } diff --git a/dom/canvas/WebGLTexelConversions.h b/dom/canvas/WebGLTexelConversions.h index 7a594a8c05d2..59f84311d920 100644 --- a/dom/canvas/WebGLTexelConversions.h +++ b/dom/canvas/WebGLTexelConversions.h @@ -26,16 +26,16 @@ */ #ifndef WEBGLTEXELCONVERSIONS_H_ -# define WEBGLTEXELCONVERSIONS_H_ +#define WEBGLTEXELCONVERSIONS_H_ -# ifdef __SUNPRO_CC -# define __restrict -# endif +#ifdef __SUNPRO_CC +# define __restrict +#endif -# include "WebGLTypes.h" -# include -# include "mozilla/Attributes.h" -# include "mozilla/Casting.h" +#include "WebGLTypes.h" +#include +#include "mozilla/Attributes.h" +#include "mozilla/Casting.h" namespace mozilla { diff --git a/dom/events/EventStateManager.h b/dom/events/EventStateManager.h index 73b227ef219c..64017b1a9f68 100644 --- a/dom/events/EventStateManager.h +++ b/dom/events/EventStateManager.h @@ -1079,8 +1079,8 @@ class EventStateManager : public nsSupportsWeakReference, public nsIObserver { bool DoDefaultDragStart(nsPresContext* aPresContext, WidgetDragEvent* aDragEvent, dom::DataTransfer* aDataTransfer, - bool aAllowEmptyDataTransfer, - nsIContent* aDragTarget, dom::Selection* aSelection, + bool aAllowEmptyDataTransfer, nsIContent* aDragTarget, + dom::Selection* aSelection, dom::RemoteDragStartData* aDragStartData, nsIPrincipal* aPrincipal, nsIContentSecurityPolicy* aCsp); diff --git a/dom/media/ForwardedInputTrack.cpp b/dom/media/ForwardedInputTrack.cpp index a4f14998a238..5867a4efcd54 100644 --- a/dom/media/ForwardedInputTrack.cpp +++ b/dom/media/ForwardedInputTrack.cpp @@ -86,8 +86,9 @@ void ForwardedInputTrack::SetInput(MediaInputPort* aPort) { } void ForwardedInputTrack::ProcessInputImpl(MediaTrack* aSource, - MediaSegment* aSegment, GraphTime aFrom, - GraphTime aTo, uint32_t aFlags) { + MediaSegment* aSegment, + GraphTime aFrom, GraphTime aTo, + uint32_t aFlags) { GraphTime next; for (GraphTime t = aFrom; t < aTo; t = next) { MediaInputPort::InputInterval interval = diff --git a/dom/media/Tracing.h b/dom/media/Tracing.h index eaabadbddbf4..2d1c042d20f9 100644 --- a/dom/media/Tracing.h +++ b/dom/media/Tracing.h @@ -55,9 +55,10 @@ void StartAudioCallbackTracing(); 1, AutoTracer::EventType::BUDGET, aFrames, aSampleRate); # define TRACE_AUDIO_CALLBACK_COMMENT(aFmt, ...) \ AutoTracer trace(gAudioCallbackTraceLogger, FUNCTION_SIGNATURE, getpid(), \ - 0, AutoTracer::EventType::DURATION, aFmt, ## __VA_ARGS__); + 0, AutoTracer::EventType::DURATION, aFmt, ##__VA_ARGS__); # define TRACE() \ - AutoTracer trace(gAudioCallbackTraceLogger, FUNCTION_SIGNATURE, getpid(),\ + AutoTracer trace( \ + gAudioCallbackTraceLogger, FUNCTION_SIGNATURE, getpid(), \ std::hash{}(std::this_thread::get_id())); # define TRACE_COMMENT(aFmt, ...) \ AutoTracer trace(gAudioCallbackTraceLogger, FUNCTION_SIGNATURE, getpid(), \ diff --git a/dom/media/VideoFrameContainer.cpp b/dom/media/VideoFrameContainer.cpp index 90eec731565c..727fe5c7fe13 100644 --- a/dom/media/VideoFrameContainer.cpp +++ b/dom/media/VideoFrameContainer.cpp @@ -7,7 +7,7 @@ #include "VideoFrameContainer.h" #ifdef MOZ_WIDGET_ANDROID -#include "GLImages.h" // for SurfaceTextureImage +# include "GLImages.h" // for SurfaceTextureImage #endif #include "MediaDecoderOwner.h" #include "mozilla/Telemetry.h" @@ -102,7 +102,7 @@ void VideoFrameContainer::SetCurrentFrame(const gfx::IntSize& aIntrinsicSize, Image* aImage, const TimeStamp& aTargetTime) { #ifdef MOZ_WIDGET_ANDROID - NotifySetCurrent(aImage); + NotifySetCurrent(aImage); #endif if (aImage) { MutexAutoLock lock(mMutex); diff --git a/dom/media/ipc/RemoteAudioDecoder.h b/dom/media/ipc/RemoteAudioDecoder.h index ebf7d87374e9..6a7bcf2aee2f 100644 --- a/dom/media/ipc/RemoteAudioDecoder.h +++ b/dom/media/ipc/RemoteAudioDecoder.h @@ -35,6 +35,7 @@ class RemoteAudioDecoderParent final : public RemoteDecoderParent { protected: MediaResult ProcessDecodedData(const MediaDataDecoder::DecodedData& aData, DecodedOutputIPDL& aDecodedData) override; + private: // Can only be accessed from the manager thread // Note: we can't keep a reference to the original AudioInfo here diff --git a/dom/media/webrtc/MediaEngineTabVideoSource.cpp b/dom/media/webrtc/MediaEngineTabVideoSource.cpp index a627d34c33fd..75e6d3a917fd 100644 --- a/dom/media/webrtc/MediaEngineTabVideoSource.cpp +++ b/dom/media/webrtc/MediaEngineTabVideoSource.cpp @@ -243,8 +243,7 @@ nsresult MediaEngineTabVideoSource::Start() { AssertIsOnOwningThread(); MOZ_ASSERT(mState == kAllocated); - NS_DispatchToMainThread( - new StartRunnable(this, mTrack, mPrincipalHandle)); + NS_DispatchToMainThread(new StartRunnable(this, mTrack, mPrincipalHandle)); mState = kStarted; return NS_OK; diff --git a/dom/plugins/base/nptypes.h b/dom/plugins/base/nptypes.h index b6558a5e2615..02e32ed99c33 100644 --- a/dom/plugins/base/nptypes.h +++ b/dom/plugins/base/nptypes.h @@ -4,14 +4,14 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef nptypes_h_ -# define nptypes_h_ +#define nptypes_h_ /* * Header file for ensuring that C99 types ([u]int32_t, [u]int64_t and bool) and * true/false macros are available. */ -# if defined(WIN32) +#if defined(WIN32) /* * Win32 and OS/2 don't know C99, so define [u]int_16/32/64 here. The bool * is predefined tho, both in C and C++. @@ -22,68 +22,68 @@ typedef int int32_t; typedef unsigned int uint32_t; typedef long long int64_t; typedef unsigned long long uint64_t; -# elif defined(_AIX) || defined(__sun) || defined(__osf__) || \ - defined(IRIX) || defined(HPUX) +#elif defined(_AIX) || defined(__sun) || defined(__osf__) || defined(IRIX) || \ + defined(HPUX) /* * AIX and SunOS ship a inttypes.h header that defines [u]int32_t, * but not bool for C. */ -# include +# include -# ifndef __cplusplus +# ifndef __cplusplus typedef int bool; -# define true 1 -# define false 0 -# endif -# elif defined(bsdi) || defined(FREEBSD) || defined(OPENBSD) +# define true 1 +# define false 0 +# endif +#elif defined(bsdi) || defined(FREEBSD) || defined(OPENBSD) /* * BSD/OS, FreeBSD, and OpenBSD ship sys/types.h that define int32_t and * u_int32_t. */ -# include +# include /* * BSD/OS ships no header that defines uint32_t, nor bool (for C) */ -# if defined(bsdi) +# if defined(bsdi) typedef u_int32_t uint32_t; typedef u_int64_t uint64_t; -# if !defined(__cplusplus) +# if !defined(__cplusplus) typedef int bool; -# define true 1 -# define false 0 -# endif -# else +# define true 1 +# define false 0 +# endif +# else /* * FreeBSD and OpenBSD define uint32_t and bool. */ -# include -# include -# endif -# elif defined(BEOS) # include -# else +# include +# endif +#elif defined(BEOS) +# include +#else /* * For those that ship a standard C99 stdint.h header file, include * it. Can't do the same for stdbool.h tho, since some systems ship * with a stdbool.h file that doesn't compile! */ -# include +# include -# ifndef __cplusplus -# if !defined(__GNUC__) || (__GNUC__ > 2 || __GNUC_MINOR__ > 95) -# include -# else +# ifndef __cplusplus +# if !defined(__GNUC__) || (__GNUC__ > 2 || __GNUC_MINOR__ > 95) +# include +# else /* * GCC 2.91 can't deal with a typedef for bool, but a #define * works. */ -# define bool int -# define true 1 -# define false 0 -# endif +# define bool int +# define true 1 +# define false 0 # endif # endif +#endif #endif /* nptypes_h_ */ diff --git a/dom/serviceworkers/ServiceWorkerPrivateImpl.cpp b/dom/serviceworkers/ServiceWorkerPrivateImpl.cpp index d4886dfb9f0e..1b2fc900a8b5 100644 --- a/dom/serviceworkers/ServiceWorkerPrivateImpl.cpp +++ b/dom/serviceworkers/ServiceWorkerPrivateImpl.cpp @@ -65,8 +65,8 @@ ServiceWorkerPrivateImpl::RAIIActorPtrHolder::~RAIIActorPtrHolder() { mActor->MaybeSendDelete(); } -RemoteWorkerControllerChild* ServiceWorkerPrivateImpl::RAIIActorPtrHolder:: -operator->() const { +RemoteWorkerControllerChild* + ServiceWorkerPrivateImpl::RAIIActorPtrHolder::operator->() const { AssertIsOnMainThread(); return get(); diff --git a/dom/serviceworkers/ServiceWorkerRegistrationDescriptor.cpp b/dom/serviceworkers/ServiceWorkerRegistrationDescriptor.cpp index db5dad6f0e28..f4f676430ef4 100644 --- a/dom/serviceworkers/ServiceWorkerRegistrationDescriptor.cpp +++ b/dom/serviceworkers/ServiceWorkerRegistrationDescriptor.cpp @@ -67,8 +67,9 @@ ServiceWorkerRegistrationDescriptor::ServiceWorkerRegistrationDescriptor( operator=(aRight); } -ServiceWorkerRegistrationDescriptor& ServiceWorkerRegistrationDescriptor:: -operator=(const ServiceWorkerRegistrationDescriptor& aRight) { +ServiceWorkerRegistrationDescriptor& +ServiceWorkerRegistrationDescriptor::operator=( + const ServiceWorkerRegistrationDescriptor& aRight) { if (this == &aRight) { return *this; } @@ -84,8 +85,9 @@ ServiceWorkerRegistrationDescriptor::ServiceWorkerRegistrationDescriptor( MOZ_DIAGNOSTIC_ASSERT(IsValid()); } -ServiceWorkerRegistrationDescriptor& ServiceWorkerRegistrationDescriptor:: -operator=(ServiceWorkerRegistrationDescriptor&& aRight) { +ServiceWorkerRegistrationDescriptor& +ServiceWorkerRegistrationDescriptor::operator=( + ServiceWorkerRegistrationDescriptor&& aRight) { mData.reset(); mData = std::move(aRight.mData); MOZ_DIAGNOSTIC_ASSERT(IsValid()); diff --git a/gfx/2d/Swizzle.cpp b/gfx/2d/Swizzle.cpp index d1aecb6ff1c4..f6be40de990b 100644 --- a/gfx/2d/Swizzle.cpp +++ b/gfx/2d/Swizzle.cpp @@ -154,16 +154,18 @@ void SwizzleRow_SSE2(const uint8_t*, uint8_t*, int32_t); template void UnpackRowRGB24_SSSE3(const uint8_t*, uint8_t*, int32_t); -#define UNPACK_ROW_RGB_SSSE3(aDstFormat) \ - FORMAT_CASE_ROW(SurfaceFormat::R8G8B8, aDstFormat, \ - UnpackRowRGB24_SSSE3) +# define UNPACK_ROW_RGB_SSSE3(aDstFormat) \ + FORMAT_CASE_ROW( \ + SurfaceFormat::R8G8B8, aDstFormat, \ + UnpackRowRGB24_SSSE3) template void UnpackRowRGB24_AVX2(const uint8_t*, uint8_t*, int32_t); -#define UNPACK_ROW_RGB_AVX2(aDstFormat) \ - FORMAT_CASE_ROW(SurfaceFormat::R8G8B8, aDstFormat, \ - UnpackRowRGB24_AVX2) +# define UNPACK_ROW_RGB_AVX2(aDstFormat) \ + FORMAT_CASE_ROW( \ + SurfaceFormat::R8G8B8, aDstFormat, \ + UnpackRowRGB24_AVX2) #endif @@ -891,9 +893,10 @@ void UnpackRowRGB24(const uint8_t* aSrc, uint8_t* aDst, int32_t aLength) { template void UnpackRowRGB24(const uint8_t*, uint8_t*, int32_t); template void UnpackRowRGB24(const uint8_t*, uint8_t*, int32_t); -#define UNPACK_ROW_RGB(aDstFormat) \ - FORMAT_CASE_ROW(SurfaceFormat::R8G8B8, aDstFormat, \ - UnpackRowRGB24) +#define UNPACK_ROW_RGB(aDstFormat) \ + FORMAT_CASE_ROW( \ + SurfaceFormat::R8G8B8, aDstFormat, \ + UnpackRowRGB24) bool SwizzleData(const uint8_t* aSrc, int32_t aSrcStride, SurfaceFormat aSrcFormat, uint8_t* aDst, int32_t aDstStride, diff --git a/gfx/2d/Swizzle.h b/gfx/2d/Swizzle.h index 44b4073ee66f..b8d3f68ef855 100644 --- a/gfx/2d/Swizzle.h +++ b/gfx/2d/Swizzle.h @@ -45,17 +45,20 @@ GFX2D_API bool SwizzleData(const uint8_t* aSrc, int32_t aSrcStride, * Swizzles source and writes it to destination. Source and destination may be * the same to swizzle in-place. */ -typedef void (*SwizzleRowFn)(const uint8_t* aSrc, uint8_t* aDst, int32_t aLength); +typedef void (*SwizzleRowFn)(const uint8_t* aSrc, uint8_t* aDst, + int32_t aLength); /** * Get a function pointer to perform premultiplication between two formats. */ -GFX2D_API SwizzleRowFn PremultiplyRow(SurfaceFormat aSrcFormat, SurfaceFormat aDstFormat); +GFX2D_API SwizzleRowFn PremultiplyRow(SurfaceFormat aSrcFormat, + SurfaceFormat aDstFormat); /** * Get a function pointer to perform swizzling between two formats. */ -GFX2D_API SwizzleRowFn SwizzleRow(SurfaceFormat aSrcFormat, SurfaceFormat aDstFormat); +GFX2D_API SwizzleRowFn SwizzleRow(SurfaceFormat aSrcFormat, + SurfaceFormat aDstFormat); } // namespace gfx } // namespace mozilla diff --git a/gfx/2d/SwizzleNEON.cpp b/gfx/2d/SwizzleNEON.cpp index 5e56a5ffe834..fab7c832eef5 100644 --- a/gfx/2d/SwizzleNEON.cpp +++ b/gfx/2d/SwizzleNEON.cpp @@ -353,8 +353,7 @@ void Swizzle_NEON(const uint8_t* aSrc, int32_t aSrcGap, uint8_t* aDst, aDstGap += 4 * remainder; for (int32_t height = aSize.height; height > 0; height--) { - SwizzleChunk_NEON(aSrc, aDst, alignedRow, - remainder); + SwizzleChunk_NEON(aSrc, aDst, alignedRow, remainder); aSrc += aSrcGap; aDst += aDstGap; } diff --git a/gfx/layers/wr/WebRenderCommandBuilder.cpp b/gfx/layers/wr/WebRenderCommandBuilder.cpp index 3885e3ba1210..7c4275ac48fd 100644 --- a/gfx/layers/wr/WebRenderCommandBuilder.cpp +++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp @@ -575,9 +575,8 @@ struct DIGroup { GP("\n\n"); GP("Begin EndGroup\n"); - mVisibleRect = mVisibleRect.Intersect( - ViewAs(mActualBounds, - PixelCastJustification::LayerIsImage)); + mVisibleRect = mVisibleRect.Intersect(ViewAs( + mActualBounds, PixelCastJustification::LayerIsImage)); if (mVisibleRect.IsEmpty()) { return; @@ -785,7 +784,8 @@ struct DIGroup { dirty = false; BlobItemData* data = GetBlobItemData(item); if (data->mInvalid) { - gfxCriticalError() << "DisplayItem" << item->Name() << "-should be invalid"; + gfxCriticalError() + << "DisplayItem" << item->Name() << "-should be invalid"; } // if the item is invalid it needs to be fully contained MOZ_RELEASE_ASSERT(!data->mInvalid); diff --git a/gfx/tests/gtest/TestSwizzle.cpp b/gfx/tests/gtest/TestSwizzle.cpp index 778c23872330..127e5a14b27b 100644 --- a/gfx/tests/gtest/TestSwizzle.cpp +++ b/gfx/tests/gtest/TestSwizzle.cpp @@ -64,7 +64,7 @@ TEST(Moz2D, PremultiplyRow) }; SwizzleRowFn func = - PremultiplyRow(SurfaceFormat::B8G8R8A8, SurfaceFormat::B8G8R8A8); + PremultiplyRow(SurfaceFormat::B8G8R8A8, SurfaceFormat::B8G8R8A8); func(in_bgra, out, 5); EXPECT_TRUE(ArrayEqual(out, check_bgra)); @@ -203,26 +203,25 @@ TEST(Moz2D, SwizzleRow) // check unpacking uint8_t out_unpack[16 * 4]; const uint8_t in_rgb[16 * 3] = { - 0, 254, 253, 255, 0, 0, 0, 0, 0, 3, 2, 1, - 9, 0, 127, 4, 5, 6, 9, 8, 7, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 0, 254, 253, 255, 0, 0, 0, 0, 0, 3, 2, 1, 9, 0, 127, 4, + 5, 6, 9, 8, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, }; const uint8_t check_unpack_rgbx[16 * 4] = { - 0, 254, 253, 255, 255, 0, 0, 255, 0, 0, 0, 255, 3, 2, 1, 255, - 9, 0, 127, 255, 4, 5, 6, 255, 9, 8, 7, 255, 10, 11, 12, 255, - 13, 14, 15, 255, 16, 17, 18, 255, 19, 20, 21, 255, 22, 23, 24, 255, - 25, 26, 27, 255, 28, 29, 30, 255, 31, 32, 33, 255, 34, 35, 36, 255, + 0, 254, 253, 255, 255, 0, 0, 255, 0, 0, 0, 255, 3, 2, 1, 255, + 9, 0, 127, 255, 4, 5, 6, 255, 9, 8, 7, 255, 10, 11, 12, 255, + 13, 14, 15, 255, 16, 17, 18, 255, 19, 20, 21, 255, 22, 23, 24, 255, + 25, 26, 27, 255, 28, 29, 30, 255, 31, 32, 33, 255, 34, 35, 36, 255, }; const uint8_t check_unpack_bgrx[16 * 4] = { - 253, 254, 0, 255, 0, 0, 255, 255, 0, 0, 0, 255, 1, 2, 3, 255, - 127, 0, 9, 255, 6, 5, 4, 255, 7, 8, 9, 255, 12, 11, 10, 255, - 15, 14, 13, 255, 18, 17, 16, 255, 21, 20, 19, 255, 24, 23, 22, 255, - 27, 26, 25, 255, 30, 29, 28, 255, 33, 32, 31, 255, 36, 35, 34, 255, + 253, 254, 0, 255, 0, 0, 255, 255, 0, 0, 0, 255, 1, 2, 3, 255, + 127, 0, 9, 255, 6, 5, 4, 255, 7, 8, 9, 255, 12, 11, 10, 255, + 15, 14, 13, 255, 18, 17, 16, 255, 21, 20, 19, 255, 24, 23, 22, 255, + 27, 26, 25, 255, 30, 29, 28, 255, 33, 32, 31, 255, 36, 35, 34, 255, }; SwizzleRowFn func = - SwizzleRow(SurfaceFormat::B8G8R8A8, SurfaceFormat::R8G8B8A8); + SwizzleRow(SurfaceFormat::B8G8R8A8, SurfaceFormat::R8G8B8A8); func(in_bgra, out, 5); EXPECT_TRUE(ArrayEqual(out, check_rgba)); diff --git a/gfx/thebes/gfxDWriteFontList.cpp b/gfx/thebes/gfxDWriteFontList.cpp index 568a7b001d6d..f23fd330e96c 100644 --- a/gfx/thebes/gfxDWriteFontList.cpp +++ b/gfx/thebes/gfxDWriteFontList.cpp @@ -940,12 +940,15 @@ gfxFontEntry* gfxDWriteFontList::CreateFontEntry( mSystemFonts; #endif RefPtr family; - HRESULT hr = collection->GetFontFamily(aFamily->Index(), getter_AddRefs(family)); - // Check that the family name is what we expected; if not, fall back to search by name. - // It's sad we have to do this, but it is possible for Windows to have given different versions - // of the system font collection to the parent and child processes. + HRESULT hr = + collection->GetFontFamily(aFamily->Index(), getter_AddRefs(family)); + // Check that the family name is what we expected; if not, fall back to search + // by name. It's sad we have to do this, but it is possible for Windows to + // have given different versions of the system font collection to the parent + // and child processes. bool foundFamily = false; - const nsCString& familyName = aFamily->DisplayName().AsString(SharedFontList()); + const nsCString& familyName = + aFamily->DisplayName().AsString(SharedFontList()); if (SUCCEEDED(hr) && family) { RefPtr names; hr = family->GetFamilyNames(getter_AddRefs(names)); @@ -957,11 +960,13 @@ gfxFontEntry* gfxDWriteFontList::CreateFontEntry( } } if (!foundFamily) { - // Try to get family by name instead of index (to deal with the case of collection mismatch). + // Try to get family by name instead of index (to deal with the case of + // collection mismatch). UINT32 index; BOOL exists; NS_ConvertUTF8toUTF16 name16(familyName); - hr = collection->FindFamilyName(reinterpret_cast(name16.BeginReading()), &index, &exists); + hr = collection->FindFamilyName( + reinterpret_cast(name16.BeginReading()), &index, &exists); if (SUCCEEDED(hr) && exists && index != UINT_MAX) { hr = collection->GetFontFamily(index, getter_AddRefs(family)); if (FAILED(hr) || !family) { diff --git a/ipc/mscom/MainThreadInvoker.h b/ipc/mscom/MainThreadInvoker.h index ddfe671765f6..a2d2bda76ad7 100644 --- a/ipc/mscom/MainThreadInvoker.h +++ b/ipc/mscom/MainThreadInvoker.h @@ -40,7 +40,8 @@ class MainThreadInvoker { template inline bool InvokeOnMainThread(const char* aName, Class* aObject, - void (Class::*aMethod)(Args...), Args&&... aArgs) { + void (Class::*aMethod)(Args...), + Args&&... aArgs) { nsCOMPtr runnable(NewNonOwningRunnableMethod( aName, aObject, aMethod, std::forward(aArgs)...)); diff --git a/ipc/mscom/oop/Factory.h b/ipc/mscom/oop/Factory.h index 4914f83d1dd6..9dce8fe4d596 100644 --- a/ipc/mscom/oop/Factory.h +++ b/ipc/mscom/oop/Factory.h @@ -37,7 +37,8 @@ class MOZ_NONHEAP_CLASS Factory : public IClassFactory { } template - HRESULT DoCreate(HRESULT (*aFnPtr)(IUnknown*, REFIID, void**), Args&&... args) { + HRESULT DoCreate(HRESULT (*aFnPtr)(IUnknown*, REFIID, void**), + Args&&... args) { return aFnPtr(std::forward(args)...); } diff --git a/js/src/builtin/Promise.cpp b/js/src/builtin/Promise.cpp index f74125e1fea9..cd4ec599d961 100644 --- a/js/src/builtin/Promise.cpp +++ b/js/src/builtin/Promise.cpp @@ -2281,11 +2281,7 @@ static MOZ_MUST_USE bool PerformPromiseRace( JSContext* cx, PromiseForOfIterator& iterator, HandleObject C, Handle resultCapability, bool* done); -enum class IterationMode { - All, - AllSettled, - Race -}; +enum class IterationMode { All, AllSettled, Race }; // ES2020 draft rev dc1e21c454bd316810be1c0e7af0131a2d7f38e9 // diff --git a/js/src/jit/mips-shared/Assembler-mips-shared.cpp b/js/src/jit/mips-shared/Assembler-mips-shared.cpp index 104388af0528..9e6dafb10fb2 100644 --- a/js/src/jit/mips-shared/Assembler-mips-shared.cpp +++ b/js/src/jit/mips-shared/Assembler-mips-shared.cpp @@ -880,16 +880,14 @@ BufferOffset AssemblerMIPSShared::as_sdr(Register rd, Register rs, return writeInst(InstImm(op_sdr, rs, rd, Imm16(off)).encode()); } -BufferOffset -AssemblerMIPSShared::as_seleqz(Register rd, Register rs, Register rt) -{ +BufferOffset AssemblerMIPSShared::as_seleqz(Register rd, Register rs, + Register rt) { spew("seleqz %3s,%3s,%3s", rd.name(), rs.name(), rt.name()); return writeInst(InstReg(op_special, rs, rt, rd, 0x0, ff_seleqz).encode()); } -BufferOffset -AssemblerMIPSShared::as_selnez(Register rd, Register rs, Register rt) -{ +BufferOffset AssemblerMIPSShared::as_selnez(Register rd, Register rs, + Register rt) { spew("selnez %3s,%3s,%3s", rd.name(), rs.name(), rt.name()); return writeInst(InstReg(op_special, rs, rt, rd, 0x0, ff_selnez).encode()); } @@ -1532,8 +1530,8 @@ BufferOffset AssemblerMIPSShared::as_cf(FloatFormat fmt, FloatRegister fs, spew("c.f.d FCC%d,%3s,%3s", fcc, fs.name(), ft.name()); #ifdef MIPSR6 return writeInst( - InstReg(op_cop1, rs_d_r6, ft, fs, FloatRegisters::f24, - ff_c_f_fmt).encode()); + InstReg(op_cop1, rs_d_r6, ft, fs, FloatRegisters::f24, ff_c_f_fmt) + .encode()); #else return writeInst( InstReg(op_cop1, rs_d, ft, fs, fcc << FccShift, ff_c_f_fmt).encode()); @@ -1542,8 +1540,8 @@ BufferOffset AssemblerMIPSShared::as_cf(FloatFormat fmt, FloatRegister fs, spew("c.f.s FCC%d,%3s,%3s", fcc, fs.name(), ft.name()); #ifdef MIPSR6 return writeInst( - InstReg(op_cop1, rs_s_r6, ft, fs, FloatRegisters::f24, - ff_c_f_fmt).encode()); + InstReg(op_cop1, rs_s_r6, ft, fs, FloatRegisters::f24, ff_c_f_fmt) + .encode()); #else return writeInst( InstReg(op_cop1, rs_s, ft, fs, fcc << FccShift, ff_c_f_fmt).encode()); @@ -1557,8 +1555,8 @@ BufferOffset AssemblerMIPSShared::as_cun(FloatFormat fmt, FloatRegister fs, spew("c.un.d FCC%d,%3s,%3s", fcc, fs.name(), ft.name()); #ifdef MIPSR6 return writeInst( - InstReg(op_cop1, rs_d_r6, ft, fs, FloatRegisters::f24, - ff_c_un_fmt).encode()); + InstReg(op_cop1, rs_d_r6, ft, fs, FloatRegisters::f24, ff_c_un_fmt) + .encode()); #else return writeInst( InstReg(op_cop1, rs_d, ft, fs, fcc << FccShift, ff_c_un_fmt).encode()); @@ -1567,8 +1565,8 @@ BufferOffset AssemblerMIPSShared::as_cun(FloatFormat fmt, FloatRegister fs, spew("c.un.s FCC%d,%3s,%3s", fcc, fs.name(), ft.name()); #ifdef MIPSR6 return writeInst( - InstReg(op_cop1, rs_s_r6, ft, fs, FloatRegisters::f24, - ff_c_un_fmt).encode()); + InstReg(op_cop1, rs_s_r6, ft, fs, FloatRegisters::f24, ff_c_un_fmt) + .encode()); #else return writeInst( InstReg(op_cop1, rs_s, ft, fs, fcc << FccShift, ff_c_un_fmt).encode()); @@ -1582,8 +1580,8 @@ BufferOffset AssemblerMIPSShared::as_ceq(FloatFormat fmt, FloatRegister fs, spew("c.eq.d FCC%d,%3s,%3s", fcc, fs.name(), ft.name()); #ifdef MIPSR6 return writeInst( - InstReg(op_cop1, rs_d_r6, ft, fs, FloatRegisters::f24, - ff_c_eq_fmt).encode()); + InstReg(op_cop1, rs_d_r6, ft, fs, FloatRegisters::f24, ff_c_eq_fmt) + .encode()); #else return writeInst( InstReg(op_cop1, rs_d, ft, fs, fcc << FccShift, ff_c_eq_fmt).encode()); @@ -1592,8 +1590,8 @@ BufferOffset AssemblerMIPSShared::as_ceq(FloatFormat fmt, FloatRegister fs, spew("c.eq.s FCC%d,%3s,%3s", fcc, fs.name(), ft.name()); #ifdef MIPSR6 return writeInst( - InstReg(op_cop1, rs_s_r6, ft, fs, FloatRegisters::f24, - ff_c_eq_fmt).encode()); + InstReg(op_cop1, rs_s_r6, ft, fs, FloatRegisters::f24, ff_c_eq_fmt) + .encode()); #else return writeInst( InstReg(op_cop1, rs_s, ft, fs, fcc << FccShift, ff_c_eq_fmt).encode()); @@ -1608,8 +1606,8 @@ BufferOffset AssemblerMIPSShared::as_cueq(FloatFormat fmt, FloatRegister fs, spew("c.ueq.d FCC%d,%3s,%3s", fcc, fs.name(), ft.name()); #ifdef MIPSR6 return writeInst( - InstReg(op_cop1, rs_d_r6, ft, fs, FloatRegisters::f24, - ff_c_ueq_fmt).encode()); + InstReg(op_cop1, rs_d_r6, ft, fs, FloatRegisters::f24, ff_c_ueq_fmt) + .encode()); #else return writeInst( InstReg(op_cop1, rs_d, ft, fs, fcc << FccShift, ff_c_ueq_fmt).encode()); @@ -1618,8 +1616,8 @@ BufferOffset AssemblerMIPSShared::as_cueq(FloatFormat fmt, FloatRegister fs, spew("c.ueq.s FCC%d,%3s,%3s", fcc, fs.name(), ft.name()); #ifdef MIPSR6 return writeInst( - InstReg(op_cop1, rs_s_r6, ft, fs, FloatRegisters::f24, - ff_c_ueq_fmt).encode()); + InstReg(op_cop1, rs_s_r6, ft, fs, FloatRegisters::f24, ff_c_ueq_fmt) + .encode()); #else return writeInst( InstReg(op_cop1, rs_s, ft, fs, fcc << FccShift, ff_c_ueq_fmt).encode()); @@ -1634,8 +1632,8 @@ BufferOffset AssemblerMIPSShared::as_colt(FloatFormat fmt, FloatRegister fs, spew("c.olt.d FCC%d,%3s,%3s", fcc, fs.name(), ft.name()); #ifdef MIPSR6 return writeInst( - InstReg(op_cop1, rs_d_r6, ft, fs, FloatRegisters::f24, - ff_c_olt_fmt).encode()); + InstReg(op_cop1, rs_d_r6, ft, fs, FloatRegisters::f24, ff_c_olt_fmt) + .encode()); #else return writeInst( InstReg(op_cop1, rs_d, ft, fs, fcc << FccShift, ff_c_olt_fmt).encode()); @@ -1644,8 +1642,8 @@ BufferOffset AssemblerMIPSShared::as_colt(FloatFormat fmt, FloatRegister fs, spew("c.olt.s FCC%d,%3s,%3s", fcc, fs.name(), ft.name()); #ifdef MIPSR6 return writeInst( - InstReg(op_cop1, rs_s_r6, ft, fs, FloatRegisters::f24, - ff_c_olt_fmt).encode()); + InstReg(op_cop1, rs_s_r6, ft, fs, FloatRegisters::f24, ff_c_olt_fmt) + .encode()); #else return writeInst( InstReg(op_cop1, rs_s, ft, fs, fcc << FccShift, ff_c_olt_fmt).encode()); @@ -1660,8 +1658,8 @@ BufferOffset AssemblerMIPSShared::as_cult(FloatFormat fmt, FloatRegister fs, spew("c.ult.d FCC%d,%3s,%3s", fcc, fs.name(), ft.name()); #ifdef MIPSR6 return writeInst( - InstReg(op_cop1, rs_d_r6, ft, fs, FloatRegisters::f24, - ff_c_ult_fmt).encode()); + InstReg(op_cop1, rs_d_r6, ft, fs, FloatRegisters::f24, ff_c_ult_fmt) + .encode()); #else return writeInst( InstReg(op_cop1, rs_d, ft, fs, fcc << FccShift, ff_c_ult_fmt).encode()); @@ -1670,8 +1668,8 @@ BufferOffset AssemblerMIPSShared::as_cult(FloatFormat fmt, FloatRegister fs, spew("c.ult.s FCC%d,%3s,%3s", fcc, fs.name(), ft.name()); #ifdef MIPSR6 return writeInst( - InstReg(op_cop1, rs_s_r6, ft, fs, FloatRegisters::f24, - ff_c_ult_fmt).encode()); + InstReg(op_cop1, rs_s_r6, ft, fs, FloatRegisters::f24, ff_c_ult_fmt) + .encode()); #else return writeInst( InstReg(op_cop1, rs_s, ft, fs, fcc << FccShift, ff_c_ult_fmt).encode()); @@ -1686,8 +1684,8 @@ BufferOffset AssemblerMIPSShared::as_cole(FloatFormat fmt, FloatRegister fs, spew("c.ole.d FCC%d,%3s,%3s", fcc, fs.name(), ft.name()); #ifdef MIPSR6 return writeInst( - InstReg(op_cop1, rs_d_r6, ft, fs, FloatRegisters::f24, - ff_c_ole_fmt).encode()); + InstReg(op_cop1, rs_d_r6, ft, fs, FloatRegisters::f24, ff_c_ole_fmt) + .encode()); #else return writeInst( InstReg(op_cop1, rs_d, ft, fs, fcc << FccShift, ff_c_ole_fmt).encode()); @@ -1696,8 +1694,8 @@ BufferOffset AssemblerMIPSShared::as_cole(FloatFormat fmt, FloatRegister fs, spew("c.ole.s FCC%d,%3s,%3s", fcc, fs.name(), ft.name()); #ifdef MIPSR6 return writeInst( - InstReg(op_cop1, rs_s_r6, ft, fs, FloatRegisters::f24, - ff_c_ole_fmt).encode()); + InstReg(op_cop1, rs_s_r6, ft, fs, FloatRegisters::f24, ff_c_ole_fmt) + .encode()); #else return writeInst( InstReg(op_cop1, rs_s, ft, fs, fcc << FccShift, ff_c_ole_fmt).encode()); @@ -1712,8 +1710,8 @@ BufferOffset AssemblerMIPSShared::as_cule(FloatFormat fmt, FloatRegister fs, spew("c.ule.d FCC%d,%3s,%3s", fcc, fs.name(), ft.name()); #ifdef MIPSR6 return writeInst( - InstReg(op_cop1, rs_d_r6, ft, fs, FloatRegisters::f24, - ff_c_ule_fmt).encode()); + InstReg(op_cop1, rs_d_r6, ft, fs, FloatRegisters::f24, ff_c_ule_fmt) + .encode()); #else return writeInst( InstReg(op_cop1, rs_d, ft, fs, fcc << FccShift, ff_c_ule_fmt).encode()); @@ -1722,8 +1720,8 @@ BufferOffset AssemblerMIPSShared::as_cule(FloatFormat fmt, FloatRegister fs, spew("c.ule.s FCC%d,%3s,%3s", fcc, fs.name(), ft.name()); #ifdef MIPSR6 return writeInst( - InstReg(op_cop1, rs_s_r6, ft, fs, FloatRegisters::f24, - ff_c_ule_fmt).encode()); + InstReg(op_cop1, rs_s_r6, ft, fs, FloatRegisters::f24, ff_c_ule_fmt) + .encode()); #else return writeInst( InstReg(op_cop1, rs_s, ft, fs, fcc << FccShift, ff_c_ule_fmt).encode()); diff --git a/js/src/jit/mips64/Assembler-mips64.cpp b/js/src/jit/mips64/Assembler-mips64.cpp index fbc54b9139de..7b3500810ae0 100644 --- a/js/src/jit/mips64/Assembler-mips64.cpp +++ b/js/src/jit/mips64/Assembler-mips64.cpp @@ -207,7 +207,8 @@ void Assembler::bind(InstImm* inst, uintptr_t branch, uintptr_t target) { Assembler::WriteLoad64Instructions(inst, ScratchRegister, LabelBase::INVALID_OFFSET); #ifdef MIPSR6 - inst[4] = InstReg(op_special, ScratchRegister, zero, zero, ff_jalr).encode(); + inst[4] = + InstReg(op_special, ScratchRegister, zero, zero, ff_jalr).encode(); #else inst[4] = InstReg(op_special, ScratchRegister, zero, zero, ff_jr).encode(); #endif @@ -220,7 +221,8 @@ void Assembler::bind(InstImm* inst, uintptr_t branch, uintptr_t target) { Assembler::WriteLoad64Instructions(&inst[1], ScratchRegister, LabelBase::INVALID_OFFSET); #ifdef MIPSR6 - inst[5] = InstReg(op_special, ScratchRegister, zero, zero, ff_jalr).encode(); + inst[5] = + InstReg(op_special, ScratchRegister, zero, zero, ff_jalr).encode(); #else inst[5] = InstReg(op_special, ScratchRegister, zero, zero, ff_jr).encode(); #endif diff --git a/js/src/jit/mips64/MacroAssembler-mips64.cpp b/js/src/jit/mips64/MacroAssembler-mips64.cpp index fb77e564b888..b339740fbcb0 100644 --- a/js/src/jit/mips64/MacroAssembler-mips64.cpp +++ b/js/src/jit/mips64/MacroAssembler-mips64.cpp @@ -343,11 +343,11 @@ void MacroAssemblerMIPS64::ma_dctz(Register rd, Register rs) { ma_dnegu(SecondScratchReg, rd); ma_daddu(SecondScratchReg, Imm32(0x3f)); #ifdef MIPS64 - as_selnez(SecondScratchReg, SecondScratchReg, ScratchRegister); - as_seleqz(rd, rd, ScratchRegister); - as_or(rd, rd, SecondScratchReg); + as_selnez(SecondScratchReg, SecondScratchReg, ScratchRegister); + as_seleqz(rd, rd, ScratchRegister); + as_or(rd, rd, SecondScratchReg); #else - as_movn(rd, SecondScratchReg, ScratchRegister); + as_movn(rd, SecondScratchReg, ScratchRegister); #endif } diff --git a/js/src/jsexn.cpp b/js/src/jsexn.cpp index 478033c4b95e..c77d87e9c3a4 100644 --- a/js/src/jsexn.cpp +++ b/js/src/jsexn.cpp @@ -764,8 +764,7 @@ static JSString* ErrorReportToString(JSContext* cx, JSErrorReport* reportp) { return ConcatStrings(cx, str, message); } -ErrorReport::ErrorReport(JSContext* cx) - : reportp(nullptr), exnObject(cx) {} +ErrorReport::ErrorReport(JSContext* cx) : reportp(nullptr), exnObject(cx) {} ErrorReport::~ErrorReport() = default; diff --git a/js/xpconnect/loader/IOBuffers.h b/js/xpconnect/loader/IOBuffers.h index 0f1a863360de..e26b0c3bca82 100644 --- a/js/xpconnect/loader/IOBuffers.h +++ b/js/xpconnect/loader/IOBuffers.h @@ -142,7 +142,7 @@ class InputBuffer { size_t cursor_ = 0; }; -} // namespace loader -} // namespace mozilla +} // namespace loader +} // namespace mozilla #endif // IOBuffers_h diff --git a/js/xpconnect/loader/mozJSSubScriptLoader.cpp b/js/xpconnect/loader/mozJSSubScriptLoader.cpp index 35cb7c2278e4..130e33db2d04 100644 --- a/js/xpconnect/loader/mozJSSubScriptLoader.cpp +++ b/js/xpconnect/loader/mozJSSubScriptLoader.cpp @@ -242,10 +242,12 @@ static bool EvalScript(JSContext* cx, HandleObject targetObj, return true; } -bool mozJSSubScriptLoader::ReadScript( - JS::MutableHandle script, - nsIURI* uri, JSContext* cx, HandleObject targetObj, const char* uriStr, - nsIIOService* serv, bool wantReturnValue, bool useCompilationScope) { +bool mozJSSubScriptLoader::ReadScript(JS::MutableHandle script, + nsIURI* uri, JSContext* cx, + HandleObject targetObj, + const char* uriStr, nsIIOService* serv, + bool wantReturnValue, + bool useCompilationScope) { // We create a channel and call SetContentType, to avoid expensive MIME type // lookups (bug 632490). nsCOMPtr chan; @@ -302,8 +304,8 @@ bool mozJSSubScriptLoader::ReadScript( ar.emplace(cx, xpc::CompilationScope()); } - JSScript* ret = PrepareScript(uri, cx, JS_IsGlobalObject(targetObj), uriStr, buf.get(), - len, wantReturnValue); + JSScript* ret = PrepareScript(uri, cx, JS_IsGlobalObject(targetObj), uriStr, + buf.get(), len, wantReturnValue); if (!ret) { return false; } @@ -472,8 +474,9 @@ nsresult mozJSSubScriptLoader::DoLoadSubScriptWithOptions( // |back there. cache = nullptr; } else { - if (!ReadScript(&script, uri, cx, targetObj, static_cast(uriStr.get()), - serv, options.wantReturnValue, useCompilationScope)) { + if (!ReadScript(&script, uri, cx, targetObj, + static_cast(uriStr.get()), serv, + options.wantReturnValue, useCompilationScope)) { return NS_OK; } } diff --git a/js/xpconnect/loader/mozJSSubScriptLoader.h b/js/xpconnect/loader/mozJSSubScriptLoader.h index a1f68d83f61a..1d9b99ddffae 100644 --- a/js/xpconnect/loader/mozJSSubScriptLoader.h +++ b/js/xpconnect/loader/mozJSSubScriptLoader.h @@ -31,10 +31,10 @@ class mozJSSubScriptLoader : public mozIJSSubScriptLoader { private: virtual ~mozJSSubScriptLoader(); - bool ReadScript(JS::MutableHandle script, - nsIURI* uri, JSContext* cx, JS::HandleObject targetObj, - const char* uriStr, nsIIOService* serv, - bool wantReturnValue, bool useCompilationScope); + bool ReadScript(JS::MutableHandle script, nsIURI* uri, + JSContext* cx, JS::HandleObject targetObj, const char* uriStr, + nsIIOService* serv, bool wantReturnValue, + bool useCompilationScope); nsresult ReadScriptAsync(nsIURI* uri, JS::HandleObject targetObj, JS::HandleObject loadScope, nsIIOService* serv, diff --git a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp index 635f2e4d4d91..05397b8f1234 100644 --- a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp +++ b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp @@ -194,7 +194,7 @@ static JSObject* GetDoubleWrappedJSObject(XPCCallContext& ccx, RootedObject obj(ccx); { nsCOMPtr underware = - do_QueryInterface(wrapper->GetIdentityObject()); + do_QueryInterface(wrapper->GetIdentityObject()); if (!underware) { return nullptr; } diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 747eba6cf35d..4c745e12e2cb 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -1708,7 +1708,7 @@ NS_QUERYFRAME_HEAD(nsXULScrollFrame) NS_QUERYFRAME_ENTRY(nsIScrollbarMediator) NS_QUERYFRAME_TAIL_INHERITING(nsBoxFrame) - //-------------------- Helper ---------------------- +//-------------------- Helper ---------------------- // AsyncSmoothMSDScroll has ref counting. class ScrollFrameHelper::AsyncSmoothMSDScroll final diff --git a/layout/generic/nsLineBox.h b/layout/generic/nsLineBox.h index 2cac8c9e9a87..0996a3d0510a 100644 --- a/layout/generic/nsLineBox.h +++ b/layout/generic/nsLineBox.h @@ -1617,23 +1617,27 @@ inline nsLineList_const_iterator& nsLineList_const_iterator::operator=( ASSIGN_FROM(aOther) } -inline nsLineList_const_reverse_iterator& nsLineList_const_reverse_iterator:: -operator=(const nsLineList_iterator& aOther) { +inline nsLineList_const_reverse_iterator& +nsLineList_const_reverse_iterator::operator=( + const nsLineList_iterator& aOther) { ASSIGN_FROM(aOther) } -inline nsLineList_const_reverse_iterator& nsLineList_const_reverse_iterator:: -operator=(const nsLineList_reverse_iterator& aOther) { +inline nsLineList_const_reverse_iterator& +nsLineList_const_reverse_iterator::operator=( + const nsLineList_reverse_iterator& aOther) { ASSIGN_FROM(aOther) } -inline nsLineList_const_reverse_iterator& nsLineList_const_reverse_iterator:: -operator=(const nsLineList_const_iterator& aOther) { +inline nsLineList_const_reverse_iterator& +nsLineList_const_reverse_iterator::operator=( + const nsLineList_const_iterator& aOther) { ASSIGN_FROM(aOther) } -inline nsLineList_const_reverse_iterator& nsLineList_const_reverse_iterator:: -operator=(const nsLineList_const_reverse_iterator& aOther) { +inline nsLineList_const_reverse_iterator& +nsLineList_const_reverse_iterator::operator=( + const nsLineList_const_reverse_iterator& aOther) { ASSIGN_FROM(aOther) } diff --git a/layout/mathml/nsMathMLmencloseFrame.cpp b/layout/mathml/nsMathMLmencloseFrame.cpp index 09511a3c58bb..c2a30a2cd968 100644 --- a/layout/mathml/nsMathMLmencloseFrame.cpp +++ b/layout/mathml/nsMathMLmencloseFrame.cpp @@ -107,7 +107,8 @@ nsresult nsMathMLmencloseFrame::AddNotation(const nsAString& aNotation) { mNotationsToDraw += NOTATION_TOP; } else if (aNotation.EqualsLiteral("radical")) { if (!StaticPrefs::mathml_deprecated_menclose_notation_radical_disabled()) { - mContent->OwnerDoc()->WarnOnceAbout(dom::Document::eMathML_DeprecatedMencloseNotationRadical); + mContent->OwnerDoc()->WarnOnceAbout( + dom::Document::eMathML_DeprecatedMencloseNotationRadical); rv = AllocateMathMLChar(NOTATION_RADICAL); NS_ENSURE_SUCCESS(rv, rv); mNotationsToDraw += NOTATION_RADICAL; diff --git a/mfbt/Types.h b/mfbt/Types.h index 2bc3f026a79a..47a9be2cc48d 100644 --- a/mfbt/Types.h +++ b/mfbt/Types.h @@ -7,7 +7,7 @@ /* mfbt foundational types and macros. */ #ifndef mozilla_Types_h -# define mozilla_Types_h +#define mozilla_Types_h /* * This header must be valid C and C++, includable by code embedding either @@ -15,8 +15,8 @@ */ /* Expose all types and size_t. */ -# include -# include +#include +#include /* Implement compiler and linker macros needed for APIs. */ @@ -37,17 +37,17 @@ * These macros are designed for use by library interfaces -- not for normal * methods or data used cross-file. */ -# if defined(WIN32) -# define MOZ_EXPORT __declspec(dllexport) -# else /* Unix */ -# ifdef HAVE_VISIBILITY_ATTRIBUTE -# define MOZ_EXPORT __attribute__((visibility("default"))) -# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) -# define MOZ_EXPORT __global -# else -# define MOZ_EXPORT /* nothing */ -# endif +#if defined(WIN32) +# define MOZ_EXPORT __declspec(dllexport) +#else /* Unix */ +# ifdef HAVE_VISIBILITY_ATTRIBUTE +# define MOZ_EXPORT __attribute__((visibility("default"))) +# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# define MOZ_EXPORT __global +# else +# define MOZ_EXPORT /* nothing */ # endif +#endif /* * Whereas implementers use MOZ_EXPORT to declare and define library symbols, @@ -56,37 +56,37 @@ * the export or import version of the macro, depending upon the compilation * mode. */ -# ifdef _WIN32 -# if defined(__MWERKS__) -# define MOZ_IMPORT_API /* nothing */ -# else -# define MOZ_IMPORT_API __declspec(dllimport) -# endif +#ifdef _WIN32 +# if defined(__MWERKS__) +# define MOZ_IMPORT_API /* nothing */ # else -# define MOZ_IMPORT_API MOZ_EXPORT +# define MOZ_IMPORT_API __declspec(dllimport) # endif +#else +# define MOZ_IMPORT_API MOZ_EXPORT +#endif -# if defined(_WIN32) && !defined(__MWERKS__) -# define MOZ_IMPORT_DATA __declspec(dllimport) -# else -# define MOZ_IMPORT_DATA MOZ_EXPORT -# endif +#if defined(_WIN32) && !defined(__MWERKS__) +# define MOZ_IMPORT_DATA __declspec(dllimport) +#else +# define MOZ_IMPORT_DATA MOZ_EXPORT +#endif /* * Consistent with the above comment, the MFBT_API and MFBT_DATA macros expose * export mfbt declarations when building mfbt, and they expose import mfbt * declarations when using mfbt. */ -# if defined(IMPL_MFBT) || \ - (defined(JS_STANDALONE) && !defined(MOZ_MEMORY) && \ - (defined(EXPORT_JS_API) || defined(STATIC_EXPORTABLE_JS_API))) -# define MFBT_API MOZ_EXPORT -# define MFBT_DATA MOZ_EXPORT +#if defined(IMPL_MFBT) || \ + (defined(JS_STANDALONE) && !defined(MOZ_MEMORY) && \ + (defined(EXPORT_JS_API) || defined(STATIC_EXPORTABLE_JS_API))) +# define MFBT_API MOZ_EXPORT +# define MFBT_DATA MOZ_EXPORT +#else +# if defined(JS_STANDALONE) && !defined(MOZ_MEMORY) && defined(STATIC_JS_API) +# define MFBT_API +# define MFBT_DATA # else -# if defined(JS_STANDALONE) && !defined(MOZ_MEMORY) && defined(STATIC_JS_API) -# define MFBT_API -# define MFBT_DATA -# else /* * On linux mozglue is linked in the program and we link libxul.so with * -z,defs. Normally that causes the linker to reject undefined references in @@ -94,15 +94,15 @@ * symbols. We add the weak attribute to the import version of the MFBT API * macros to exploit this. */ -# if defined(MOZ_GLUE_IN_PROGRAM) -# define MFBT_API __attribute__((weak)) MOZ_IMPORT_API -# define MFBT_DATA __attribute__((weak)) MOZ_IMPORT_DATA -# else -# define MFBT_API MOZ_IMPORT_API -# define MFBT_DATA MOZ_IMPORT_DATA -# endif +# if defined(MOZ_GLUE_IN_PROGRAM) +# define MFBT_API __attribute__((weak)) MOZ_IMPORT_API +# define MFBT_DATA __attribute__((weak)) MOZ_IMPORT_DATA +# else +# define MFBT_API MOZ_IMPORT_API +# define MFBT_DATA MOZ_IMPORT_DATA # endif # endif +#endif /* * C symbols in C++ code must be declared immediately within |extern "C"| @@ -121,20 +121,20 @@ * This said, it is preferable to just use |extern "C"| in C++ header files for * its greater clarity. */ -# ifdef __cplusplus -# define MOZ_BEGIN_EXTERN_C extern "C" { -# define MOZ_END_EXTERN_C } -# else -# define MOZ_BEGIN_EXTERN_C -# define MOZ_END_EXTERN_C -# endif +#ifdef __cplusplus +# define MOZ_BEGIN_EXTERN_C extern "C" { +# define MOZ_END_EXTERN_C } +#else +# define MOZ_BEGIN_EXTERN_C +# define MOZ_END_EXTERN_C +#endif /* * GCC's typeof is available when decltype is not. */ -# if defined(__GNUC__) && defined(__cplusplus) && \ - !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L -# define decltype __typeof__ -# endif +#if defined(__GNUC__) && defined(__cplusplus) && \ + !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L +# define decltype __typeof__ +#endif #endif /* mozilla_Types_h */ diff --git a/netwerk/base/LoadInfo.h b/netwerk/base/LoadInfo.h index fb5ad8c62fc2..e140463f1c6f 100644 --- a/netwerk/base/LoadInfo.h +++ b/netwerk/base/LoadInfo.h @@ -135,8 +135,8 @@ class LoadInfo final : public nsILoadInfo { const Maybe& aController, nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType, LoadTainting aTainting, - bool aBlockAllMixedContent, - bool aUpgradeInsecureRequests, bool aBrowserUpgradeInsecureRequests, + bool aBlockAllMixedContent, bool aUpgradeInsecureRequests, + bool aBrowserUpgradeInsecureRequests, bool aBrowserWouldUpgradeInsecureRequests, bool aForceAllowDataURI, bool aAllowInsecureRedirectToDataURI, bool aBypassCORSChecks, bool aSkipContentPolicyCheckForWebRequest, diff --git a/netwerk/test/fuzz/FuzzingStreamListener.h b/netwerk/test/fuzz/FuzzingStreamListener.h index c2e38bcea151..9ec01a95c21b 100644 --- a/netwerk/test/fuzz/FuzzingStreamListener.h +++ b/netwerk/test/fuzz/FuzzingStreamListener.h @@ -23,9 +23,7 @@ class FuzzingStreamListener final : public nsIStreamListener { SpinEventLoopUntil([&]() { return mChannelDone; }); } - bool isDone() { - return mChannelDone; - } + bool isDone() { return mChannelDone; } private: ~FuzzingStreamListener() = default; diff --git a/netwerk/test/fuzz/TestFtpFuzzing.cpp b/netwerk/test/fuzz/TestFtpFuzzing.cpp index 0a01ea2c07df..44439b52478c 100644 --- a/netwerk/test/fuzz/TestFtpFuzzing.cpp +++ b/netwerk/test/fuzz/TestFtpFuzzing.cpp @@ -47,7 +47,7 @@ static int FuzzingRunNetworkFtp(const uint8_t* data, size_t size) { // If we have more than 1024 bytes, we use the excess for // an optional data connection. addNetworkFuzzingBuffer(data, 1024, true); - addNetworkFuzzingBuffer(data+1024, size-1024, true, true); + addNetworkFuzzingBuffer(data + 1024, size - 1024, true, true); } else { addNetworkFuzzingBuffer(data, size, true); } diff --git a/netwerk/test/gtest/TestMozURL.cpp b/netwerk/test/gtest/TestMozURL.cpp index 136bc1855a44..dcd3e3bc4490 100644 --- a/netwerk/test/gtest/TestMozURL.cpp +++ b/netwerk/test/gtest/TestMozURL.cpp @@ -354,7 +354,8 @@ TEST(TestMozURL, UrlTestData) Json::Value root; Json::CharReaderBuilder builder; std::unique_ptr const reader(builder.newCharReader()); - ASSERT_TRUE(reader->parse(data.BeginReading(), data.EndReading(), &root, nullptr)); + ASSERT_TRUE( + reader->parse(data.BeginReading(), data.EndReading(), &root, nullptr)); ASSERT_TRUE(root.isArray()); for (uint32_t index = 0; index < root.size(); index++) { diff --git a/toolkit/components/places/History.cpp b/toolkit/components/places/History.cpp index 12f96d369fde..560bc20fdc7c 100644 --- a/toolkit/components/places/History.cpp +++ b/toolkit/components/places/History.cpp @@ -227,8 +227,8 @@ already_AddRefed GetJSValueAsURI(JSContext* aCtx, nsCOMPtr wrappedObj; JS::Rooted obj(aCtx, aValue.toObjectOrNull()); - nsresult rv = xpc->GetWrappedNativeOfJSObject(aCtx, obj, - getter_AddRefs(wrappedObj)); + nsresult rv = + xpc->GetWrappedNativeOfJSObject(aCtx, obj, getter_AddRefs(wrappedObj)); NS_ENSURE_SUCCESS(rv, nullptr); nsCOMPtr uri = do_QueryInterface(wrappedObj->Native()); return uri.forget(); diff --git a/toolkit/components/satchel/nsFormFillController.cpp b/toolkit/components/satchel/nsFormFillController.cpp index 61a8406b84b0..8f07e15f6c42 100644 --- a/toolkit/components/satchel/nsFormFillController.cpp +++ b/toolkit/components/satchel/nsFormFillController.cpp @@ -67,8 +67,8 @@ static nsIFormAutoComplete* GetFormAutoComplete() { } NS_IMPL_CYCLE_COLLECTION(nsFormFillController, mController, mLoginManagerAC, - mLoginReputationService, mFocusedPopup, - mPopups, mLastListener, mLastFormAutoComplete) + mLoginReputationService, mFocusedPopup, mPopups, + mLastListener, mLastFormAutoComplete) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsFormFillController) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIFormFillController) @@ -211,8 +211,9 @@ void nsFormFillController::MaybeRemoveMutationObserver(nsINode* aNode) { NS_IMETHODIMP nsFormFillController::AttachToDocument(Document* aDocument, nsIAutoCompletePopup* aPopup) { - MOZ_LOG(sLogger, LogLevel::Debug, - ("AttachToDocument for document %p with popup %p", aDocument, aPopup)); + MOZ_LOG( + sLogger, LogLevel::Debug, + ("AttachToDocument for document %p with popup %p", aDocument, aPopup)); NS_ENSURE_TRUE(aDocument && aPopup, NS_ERROR_ILLEGAL_VALUE); mPopups.Put(aDocument, aPopup); diff --git a/toolkit/components/satchel/nsFormFillController.h b/toolkit/components/satchel/nsFormFillController.h index 4d98a159c542..8425c5b81c57 100644 --- a/toolkit/components/satchel/nsFormFillController.h +++ b/toolkit/components/satchel/nsFormFillController.h @@ -116,7 +116,9 @@ class nsFormFillController final : public nsIFormFillController, nsINode* mListNode; nsCOMPtr mFocusedPopup; - nsInterfaceHashtable, nsIAutoCompletePopup> mPopups; + nsInterfaceHashtable, + nsIAutoCompletePopup> + mPopups; // The observer passed to StartSearch. It will be notified when the search is // complete or the data from a datalist changes. diff --git a/toolkit/components/telemetry/geckoview/TelemetryGeckoViewPersistence.cpp b/toolkit/components/telemetry/geckoview/TelemetryGeckoViewPersistence.cpp index 0fc7d0b32557..47e6ee64581f 100644 --- a/toolkit/components/telemetry/geckoview/TelemetryGeckoViewPersistence.cpp +++ b/toolkit/components/telemetry/geckoview/TelemetryGeckoViewPersistence.cpp @@ -243,8 +243,10 @@ void MainThreadParsePersistedProbes(const nsACString& aProbeData) { ANDROID_LOG("MainThreadParsePersistedProbes"); // We need a JS context to run the parsing stuff in. - JS::Rooted cleanGlobal(mozilla::dom::RootingCx(), - SimpleGlobalObject::Create(SimpleGlobalObject::GlobalType::BindingDetail)); + JS::Rooted cleanGlobal( + mozilla::dom::RootingCx(), + SimpleGlobalObject::Create( + SimpleGlobalObject::GlobalType::BindingDetail)); if (!cleanGlobal) { ANDROID_LOG( "MainThreadParsePersistedProbes - Failed to create a JS global object"); diff --git a/toolkit/mozapps/update/updater/updater.cpp b/toolkit/mozapps/update/updater/updater.cpp index 939f833cb99a..8cfb60a6b095 100644 --- a/toolkit/mozapps/update/updater/updater.cpp +++ b/toolkit/mozapps/update/updater/updater.cpp @@ -2976,8 +2976,8 @@ int NS_main(int argc, NS_tchar** argv) { NS_T("%s\\update.log"), gPatchDirPath); } #else - NS_tsnprintf(logFilePath, sizeof(logFilePath) / sizeof(logFilePath[0]), - NS_T("%s/update.log"), gPatchDirPath); + NS_tsnprintf(logFilePath, sizeof(logFilePath) / sizeof(logFilePath[0]), + NS_T("%s/update.log"), gPatchDirPath); #endif LogInit(logFilePath); diff --git a/toolkit/xre/glxtest.cpp b/toolkit/xre/glxtest.cpp index 34b7a76d1c17..bd462ff702af 100644 --- a/toolkit/xre/glxtest.cpp +++ b/toolkit/xre/glxtest.cpp @@ -356,21 +356,19 @@ void glxtest() { int screenCount = ScreenCount(dpy); int defaultScreen = DefaultScreen(dpy); - if (screenCount != 0) - { + if (screenCount != 0) { length += snprintf(buf + length, bufsize - length, "SCREEN_INFO\n"); if (length >= bufsize) - fatal_error("Screen Info strings length too large for buffer size"); - for (int idx = 0; idx < screenCount; idx++) - { + fatal_error("Screen Info strings length too large for buffer size"); + for (int idx = 0; idx < screenCount; idx++) { Screen* scrn = ScreenOfDisplay(dpy, idx); int current_height = scrn->height; - int current_width = scrn->width; + int current_width = scrn->width; - length += snprintf(buf + length, bufsize - length, "%dx%d%s%s", - current_width, current_height, - idx == defaultScreen ? " default" : "", - idx == screenCount -1 ? ";\n" : ";"); + length += + snprintf(buf + length, bufsize - length, "%dx%d%s%s", current_width, + current_height, idx == defaultScreen ? " default" : "", + idx == screenCount - 1 ? ";\n" : ";"); if (length >= bufsize) fatal_error("Screen Info strings length too large for buffer size"); } diff --git a/widget/GfxInfoX11.cpp b/widget/GfxInfoX11.cpp index 59aac0d60eae..05b17495575e 100644 --- a/widget/GfxInfoX11.cpp +++ b/widget/GfxInfoX11.cpp @@ -296,14 +296,13 @@ void GfxInfo::GetData() { if (!screenInfo.IsEmpty()) { PRInt32 start = 0; PRInt32 loc = screenInfo.Find(";", PR_FALSE, start); - while (loc != kNotFound) - { + while (loc != kNotFound) { nsCString line(screenInfo.get() + start, loc - start); nsString value; CopyASCIItoUTF16(line, value); mScreenInfo.AppendElement(value); - start = loc+1; + start = loc + 1; loc = screenInfo.Find(";", PR_FALSE, start); } } @@ -605,7 +604,7 @@ GfxInfo::GetAdapterSubsysID2(nsAString& aAdapterSubsysID) { NS_IMETHODIMP GfxInfo::GetDisplayInfo(nsTArray& aDisplayInfo) { GetData(); - if (!mScreenInfo.IsEmpty()){ + if (!mScreenInfo.IsEmpty()) { aDisplayInfo = mScreenInfo; return NS_OK; diff --git a/widget/android/AndroidBridge.cpp b/widget/android/AndroidBridge.cpp index 61fbc41bf5a8..e3f147818bf2 100644 --- a/widget/android/AndroidBridge.cpp +++ b/widget/android/AndroidBridge.cpp @@ -298,12 +298,12 @@ void AndroidBridge::GetExtensionFromMimeType(const nsACString& aMimeType, } } -gfx::Rect AndroidBridge::getScreenSize() -{ +gfx::Rect AndroidBridge::getScreenSize() { ALOG_BRIDGE("AndroidBridge::getScreenSize"); java::sdk::Rect::LocalRef screenrect = GeckoAppShell::GetScreenSize(); - gfx::Rect screensize(screenrect->Left(), screenrect->Top(), screenrect->Width(), screenrect->Height()); + gfx::Rect screensize(screenrect->Left(), screenrect->Top(), + screenrect->Width(), screenrect->Height()); return screensize; } diff --git a/widget/android/GfxInfo.h b/widget/android/GfxInfo.h index c7fa669901c7..5b49ec9b09ad 100644 --- a/widget/android/GfxInfo.h +++ b/widget/android/GfxInfo.h @@ -78,9 +78,10 @@ class GfxInfo : public GfxInfoBase { virtual const nsTArray& GetGfxDriverInfo() override; private: - struct ScreenInfo { - gfx::Rect mScreenDimensions; - }; + struct ScreenInfo { + gfx::Rect mScreenDimensions; + }; + private: void AddCrashReportAnnotations(); int32_t WebRtcHwVp8EncodeSupported(); diff --git a/widget/cocoa/GfxInfo.mm b/widget/cocoa/GfxInfo.mm index 752eb26c83b0..fb26fcb957b5 100644 --- a/widget/cocoa/GfxInfo.mm +++ b/widget/cocoa/GfxInfo.mm @@ -225,14 +225,11 @@ GfxInfo::GetAdapterSubsysID2(nsAString& aAdapterSubsysID) { return NS_ERROR_FAIL /* readonly attribute Array displayInfo; */ NS_IMETHODIMP GfxInfo::GetDisplayInfo(nsTArray& aDisplayInfo) { -for (NSScreen* screen in [NSScreen screens]) { + for (NSScreen* screen in [NSScreen screens]) { NSRect rect = [screen frame]; nsString desc; - desc.AppendPrintf( - "%dx%d scale:%f", - (int32_t)rect.size.width, (int32_t)rect.size.height, - nsCocoaUtils::GetBackingScaleFactor(screen) - ); + desc.AppendPrintf("%dx%d scale:%f", (int32_t)rect.size.width, (int32_t)rect.size.height, + nsCocoaUtils::GetBackingScaleFactor(screen)); aDisplayInfo.AppendElement(desc); } diff --git a/widget/windows/GfxInfo.cpp b/widget/windows/GfxInfo.cpp index 00521f6d3049..a5eb0cab660a 100644 --- a/widget/windows/GfxInfo.cpp +++ b/widget/windows/GfxInfo.cpp @@ -905,11 +905,9 @@ NS_IMETHODIMP GfxInfo::GetDisplayInfo(nsTArray& aDisplayInfo) { for (auto displayInfo : mDisplayInfo) { nsString value; - value.AppendPrintf( - "%dx%d@%dHz %s", - displayInfo.mScreenWidth, displayInfo.mScreenHeight, - displayInfo.mRefreshRate, displayInfo.mIsPseudoDisplay ? "Pseudo Display" : "" - ); + value.AppendPrintf("%dx%d@%dHz %s", displayInfo.mScreenWidth, + displayInfo.mScreenHeight, displayInfo.mRefreshRate, + displayInfo.mIsPseudoDisplay ? "Pseudo Display" : ""); aDisplayInfo.AppendElement(value); } @@ -1800,33 +1798,36 @@ const nsTArray& GfxInfo::GetGfxDriverInfo() { (nsAString&)GfxDriverInfo::GetDeviceVendor(VendorIntel), (nsAString&)GfxDriverInfo::GetDriverVendor(DriverVendorAll), GfxDriverInfo::allDevices, nsIGfxInfo::FEATURE_WEBRENDER, - nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, - DRIVER_BETWEEN_INCLUSIVE, V(10, 18, 15, 4256), V(10, 18, 15, 4281), - "FEATURE_FAILURE_WEBRENDER_INTEL_BAD_DRIVER", "Intel driver >= 21.20.16.4590"); + nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_BETWEEN_INCLUSIVE, + V(10, 18, 15, 4256), V(10, 18, 15, 4281), + "FEATURE_FAILURE_WEBRENDER_INTEL_BAD_DRIVER", + "Intel driver >= 21.20.16.4590"); APPEND_TO_DRIVER_BLOCKLIST_RANGE( OperatingSystem::Windows, (nsAString&)GfxDriverInfo::GetDeviceVendor(VendorIntel), (nsAString&)GfxDriverInfo::GetDriverVendor(DriverVendorAll), GfxDriverInfo::allDevices, nsIGfxInfo::FEATURE_WEBRENDER, - nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, - DRIVER_BETWEEN_INCLUSIVE, V(20, 19, 15, 4285), V(20, 19, 15, 4835), - "FEATURE_FAILURE_WEBRENDER_INTEL_BAD_DRIVER", "Intel driver >= 21.20.16.4590"); + nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_BETWEEN_INCLUSIVE, + V(20, 19, 15, 4285), V(20, 19, 15, 4835), + "FEATURE_FAILURE_WEBRENDER_INTEL_BAD_DRIVER", + "Intel driver >= 21.20.16.4590"); APPEND_TO_DRIVER_BLOCKLIST_RANGE( OperatingSystem::Windows, (nsAString&)GfxDriverInfo::GetDeviceVendor(VendorIntel), (nsAString&)GfxDriverInfo::GetDriverVendor(DriverVendorAll), GfxDriverInfo::allDevices, nsIGfxInfo::FEATURE_WEBRENDER, - nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, - DRIVER_BETWEEN_INCLUSIVE, V(21, 20, 16, 4471), V(21, 20, 16, 4565), - "FEATURE_FAILURE_WEBRENDER_INTEL_BAD_DRIVER", "Intel driver >= 21.20.16.4590"); + nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_BETWEEN_INCLUSIVE, + V(21, 20, 16, 4471), V(21, 20, 16, 4565), + "FEATURE_FAILURE_WEBRENDER_INTEL_BAD_DRIVER", + "Intel driver >= 21.20.16.4590"); #else APPEND_TO_DRIVER_BLOCKLIST2( OperatingSystem::Windows, (nsAString&)GfxDriverInfo::GetDeviceVendor(VendorIntel), (nsAString&)GfxDriverInfo::GetDriverVendor(DriverVendorAll), GfxDriverInfo::allDevices, nsIGfxInfo::FEATURE_WEBRENDER, - nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, - DRIVER_LESS_THAN, V(21, 20, 16, 4590), "Intel driver >= 21.20.16.4590"); + nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, DRIVER_LESS_THAN, + V(21, 20, 16, 4590), "Intel driver >= 21.20.16.4590"); #endif } return *sDriverInfo; @@ -1908,16 +1909,20 @@ nsresult GfxInfo::FindMonitors(JSContext* aCx, JS::HandleObject aOutArray) { for (auto displayInfo : mDisplayInfo) { JS::Rooted obj(aCx, JS_NewPlainObject(aCx)); - JS::Rooted screenWidth(aCx, JS::Int32Value(displayInfo.mScreenWidth)); + JS::Rooted screenWidth(aCx, + JS::Int32Value(displayInfo.mScreenWidth)); JS_SetProperty(aCx, obj, "screenWidth", screenWidth); - JS::Rooted screenHeight(aCx, JS::Int32Value(displayInfo.mScreenHeight)); + JS::Rooted screenHeight( + aCx, JS::Int32Value(displayInfo.mScreenHeight)); JS_SetProperty(aCx, obj, "screenHeight", screenHeight); - JS::Rooted refreshRate(aCx, JS::Int32Value(displayInfo.mRefreshRate)); + JS::Rooted refreshRate(aCx, + JS::Int32Value(displayInfo.mRefreshRate)); JS_SetProperty(aCx, obj, "refreshRate", refreshRate); - JS::Rooted pseudoDisplay(aCx, JS::BooleanValue(displayInfo.mIsPseudoDisplay)); + JS::Rooted pseudoDisplay( + aCx, JS::BooleanValue(displayInfo.mIsPseudoDisplay)); JS_SetProperty(aCx, obj, "pseudoDisplay", pseudoDisplay); JS::Rooted element(aCx, JS::ObjectValue(*obj)); diff --git a/widget/windows/GfxInfo.h b/widget/windows/GfxInfo.h index 5701c5888089..26345a791724 100644 --- a/widget/windows/GfxInfo.h +++ b/widget/windows/GfxInfo.h @@ -71,12 +71,12 @@ class GfxInfo : public GfxInfoBase { void DescribeFeatures(JSContext* cx, JS::Handle aOut) override; private: - struct DisplayInfo { - uint32_t mScreenWidth; - uint32_t mScreenHeight; - uint32_t mRefreshRate; - bool mIsPseudoDisplay; - }; + struct DisplayInfo { + uint32_t mScreenWidth; + uint32_t mScreenHeight; + uint32_t mRefreshRate; + bool mIsPseudoDisplay; + }; private: void AddCrashReportAnnotations();