From 06c3d29113e60ab1a316fbd5a16c667202d012fb Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Fri, 18 Jan 2019 10:12:56 +0100 Subject: [PATCH] Bug 1521000 - Part 1: Reformat the tree to ensure everything is formatted correctly with clang-format r=sylvestre Summary: # ignore-this-changeset Reviewers: sylvestre Reviewed By: sylvestre Subscribers: reviewbot, emilio, jandem, bbouvier, karlt, jya Bug #: 1521000 Differential Revision: https://phabricator.services.mozilla.com/D16936 --HG-- extra : histedit_source : 4add583bfa729ccc1aef934629ed45ff095189b0 --- accessible/base/nsCoreUtils.cpp | 4 +- docshell/base/nsDocShell.cpp | 18 ++-- dom/events/EventStateManager.cpp | 5 +- dom/ipc/PreallocatedProcessManager.cpp | 10 +-- dom/media/AutoplayPolicy.cpp | 5 +- dom/media/webaudio/AudioContext.cpp | 3 +- dom/xul/XULTreeElement.h | 6 +- gfx/layers/ipc/LayerTransactionParent.cpp | 10 +-- gfx/layers/wr/WebRenderCommandBuilder.cpp | 22 +++-- gfx/src/FilterSupport.h | 4 +- gfx/vr/ipc/VRGPUChild.cpp | 8 +- gfx/vr/ipc/VRGPUParent.cpp | 11 +-- gfx/vr/ipc/VRGPUParent.h | 1 - gfx/webrender_bindings/WebRenderAPI.cpp | 6 +- js/ipc/WrapperOwner.cpp | 4 +- js/src/gc/GC.cpp | 3 +- js/src/gc/GCLock.h | 2 +- js/src/gc/Zone.h | 12 ++- js/src/vm/Realm.h | 4 +- js/src/wasm/WasmInstance.cpp | 3 +- js/src/wasm/WasmSignalHandlers.cpp | 82 +++++++++++-------- layout/generic/nsFrameSetFrame.cpp | 2 +- layout/painting/nsDisplayList.cpp | 5 +- layout/style/nsStyleCoord.h | 1 - layout/xul/nsImageBoxFrame.cpp | 4 +- modules/libpref/Preferences.cpp | 6 +- netwerk/build/nsNetModule.cpp | 17 ++-- netwerk/ipc/SocketProcessChild.cpp | 2 +- security/manager/pki/nsASN1Tree.h | 4 +- security/manager/ssl/nsCertTree.h | 4 +- .../ApplicationReputation.cpp | 3 +- .../sessionstore/SessionStoreUtils.cpp | 32 +++++--- .../sessionstore/SessionStoreUtils.h | 8 +- .../nsUrlClassifierDBService.cpp | 4 +- toolkit/recordreplay/ipc/Channel.cpp | 2 +- toolkit/recordreplay/ipc/Channel.h | 5 +- toolkit/recordreplay/ipc/ChildIPC.cpp | 2 +- toolkit/recordreplay/ipc/ChildInternal.h | 3 +- toolkit/recordreplay/ipc/ChildProcess.cpp | 21 +++-- toolkit/recordreplay/ipc/JSControl.cpp | 73 ++++++++--------- toolkit/recordreplay/ipc/ParentIPC.cpp | 4 +- toolkit/recordreplay/ipc/ParentInternal.h | 3 +- toolkit/xre/LauncherRegistryInfo.cpp | 3 +- toolkit/xre/LauncherRegistryInfo.h | 4 +- .../xre/test/win/TestLauncherRegistryInfo.cpp | 5 +- widget/gtk/nsWindow.cpp | 12 +-- xpcom/build/XPCOMInit.cpp | 17 ++-- xpcom/components/Module.h | 6 +- 48 files changed, 242 insertions(+), 233 deletions(-) diff --git a/accessible/base/nsCoreUtils.cpp b/accessible/base/nsCoreUtils.cpp index 8d9782f4f36ed..1dfcec26e8c56 100644 --- a/accessible/base/nsCoreUtils.cpp +++ b/accessible/base/nsCoreUtils.cpp @@ -63,8 +63,8 @@ bool nsCoreUtils::HasClickListener(nsIContent *aContent) { listenerManager->HasListenersFor(nsGkAtoms::onmouseup)); } -void nsCoreUtils::DispatchClickEvent(XULTreeElement *aTree, - int32_t aRowIndex, nsTreeColumn *aColumn, +void nsCoreUtils::DispatchClickEvent(XULTreeElement *aTree, int32_t aRowIndex, + nsTreeColumn *aColumn, const nsAString &aPseudoElt) { RefPtr tcElm = aTree->GetTreeBody(); if (!tcElm) return; diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 49d91df271e67..dda77b3d092a1 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -1062,9 +1062,8 @@ nsDOMNavigationTiming* nsDocShell::GetNavigationTiming() const { innerTargetURI = NS_GetInnermostURI(targetURI); } - return innerOriginURI && innerTargetURI && - SchemeIsFile(innerOriginURI) && - SchemeIsFile(innerTargetURI); + return innerOriginURI && innerTargetURI && SchemeIsFile(innerOriginURI) && + SchemeIsFile(innerTargetURI); } nsPresContext* nsDocShell::GetEldestPresContext() { @@ -5508,8 +5507,8 @@ nsDocShell::GetAllowMixedContentAndConnectionData( // For things with system principal (e.g. scratchpad) there is no uri // aRootHasSecureConnection should be false. nsCOMPtr rootUri = rootPrincipal->GetURI(); - if (nsContentUtils::IsSystemPrincipal(rootPrincipal) || - !rootUri || !SchemeIsHTTPS(rootUri)) { + if (nsContentUtils::IsSystemPrincipal(rootPrincipal) || !rootUri || + !SchemeIsHTTPS(rootUri)) { *aRootHasSecureConnection = false; } @@ -9770,9 +9769,8 @@ nsresult nsDocShell::DoURILoad(nsDocShellLoadState* aLoadState, true, // aInheritForAboutBlank isSrcdoc); - bool isURIUniqueOrigin = - nsIOService::IsDataURIUniqueOpaqueOrigin() && - SchemeIsData(aLoadState->URI()); + bool isURIUniqueOrigin = nsIOService::IsDataURIUniqueOpaqueOrigin() && + SchemeIsData(aLoadState->URI()); inheritPrincipal = inheritAttrs && !isURIUniqueOrigin; } @@ -9892,8 +9890,8 @@ nsresult nsDocShell::DoURILoad(nsDocShellLoadState* aLoadState, getter_AddRefs(channel)); } else { rv = NS_NewInputStreamChannelInternal( - getter_AddRefs(channel), aLoadState->URI(), aSrcdoc, - NS_LITERAL_CSTRING("text/html"), loadInfo, true); + getter_AddRefs(channel), aLoadState->URI(), aSrcdoc, + NS_LITERAL_CSTRING("text/html"), loadInfo, true); NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr isc = do_QueryInterface(channel); MOZ_ASSERT(isc); diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index bc5efa653e2bf..c877e790ed937 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -222,7 +222,7 @@ EventStateManager::DeltaAccumulator* EventStateManager::DeltaAccumulator::sInstance = nullptr; constexpr const StyleCursorKind kInvalidCursorKind = - static_cast(255); + static_cast(255); EventStateManager::EventStateManager() : mLockCursor(kInvalidCursorKind), @@ -3665,7 +3665,8 @@ void EventStateManager::UpdateCursor(nsPresContext* aPresContext, // Show busy cursor everywhere before page loads // and just replace the arrow cursor after page starts loading if (busyFlags & nsIDocShell::BUSY_FLAGS_BUSY && - (cursor == StyleCursorKind::Auto || cursor == StyleCursorKind::Default)) { + (cursor == StyleCursorKind::Auto || + cursor == StyleCursorKind::Default)) { cursor = StyleCursorKind::Progress; container = nullptr; } diff --git a/dom/ipc/PreallocatedProcessManager.cpp b/dom/ipc/PreallocatedProcessManager.cpp index aa1d9bd275b34..5b4e5c2c39bdd 100644 --- a/dom/ipc/PreallocatedProcessManager.cpp +++ b/dom/ipc/PreallocatedProcessManager.cpp @@ -74,8 +74,7 @@ class PreallocatedProcessManagerImpl final : public nsIObserver { /* static */ StaticRefPtr PreallocatedProcessManagerImpl::sSingleton; -/* static */ uint32_t - PreallocatedProcessManagerImpl::sPrelaunchDelayMS = 0; +/* static */ uint32_t PreallocatedProcessManagerImpl::sPrelaunchDelayMS = 0; /* static */ PreallocatedProcessManagerImpl* PreallocatedProcessManagerImpl::Singleton() { @@ -101,10 +100,9 @@ PreallocatedProcessManagerImpl::~PreallocatedProcessManagerImpl() { } void PreallocatedProcessManagerImpl::Init() { - Preferences::AddUintVarCache( - &sPrelaunchDelayMS, - "dom.ipc.processPrelaunch.delayMs", - DEFAULT_ALLOCATE_DELAY); + Preferences::AddUintVarCache(&sPrelaunchDelayMS, + "dom.ipc.processPrelaunch.delayMs", + DEFAULT_ALLOCATE_DELAY); Preferences::AddStrongObserver(this, "dom.ipc.processPrelaunch.enabled"); // We have to respect processCount at all time. This is especially important // for testing. diff --git a/dom/media/AutoplayPolicy.cpp b/dom/media/AutoplayPolicy.cpp index d454cddf5db4d..b7f8305a35291 100644 --- a/dom/media/AutoplayPolicy.cpp +++ b/dom/media/AutoplayPolicy.cpp @@ -235,8 +235,9 @@ static bool IsAllowedToPlayInternal(const HTMLMediaElement& aElement) { } nsPIDOMWindowInner* window = aContext.GetParentObject(); - Document* approver = aContext.GetParentObject() ? - ApproverDocOf(*(window->GetExtantDoc())) : nullptr; + Document* approver = aContext.GetParentObject() + ? ApproverDocOf(*(window->GetExtantDoc())) + : nullptr; if (IsSiteInAutoplayWhiteList(approver)) { AUTOPLAY_LOG( "Allow autoplay as document has permanent autoplay permission."); diff --git a/dom/media/webaudio/AudioContext.cpp b/dom/media/webaudio/AudioContext.cpp index 61b1aa48bf4c9..87e3bdba7b058 100644 --- a/dom/media/webaudio/AudioContext.cpp +++ b/dom/media/webaudio/AudioContext.cpp @@ -1017,7 +1017,8 @@ void AudioContext::MaybeUpdateAutoplayTelemetryWhenShutdown() { } void AudioContext::ReportBlocked() { - ReportToConsole(nsIScriptError::warningFlag, "BlockAutoplayWebAudioStartError"); + ReportToConsole(nsIScriptError::warningFlag, + "BlockAutoplayWebAudioStartError"); mWasAllowedToStart = false; if (!StaticPrefs::MediaBlockEventEnabled()) { diff --git a/dom/xul/XULTreeElement.h b/dom/xul/XULTreeElement.h index a556d01716c49..eb541b56e0d17 100644 --- a/dom/xul/XULTreeElement.h +++ b/dom/xul/XULTreeElement.h @@ -28,7 +28,7 @@ enum class CallerType : uint32_t; class XULTreeElement final : public nsXULElement { public: - explicit XULTreeElement(already_AddRefed &&aNodeInfo) + explicit XULTreeElement(already_AddRefed&& aNodeInfo) : nsXULElement(std::move(aNodeInfo)), mCachedFirstVisibleRow(0), mTreeBody(nullptr) {} @@ -118,8 +118,8 @@ class XULTreeElement final : public nsXULElement { virtual ~XULTreeElement() {} - JSObject *WrapNode(JSContext *aCx, - JS::Handle aGivenProto) override; + JSObject* WrapNode(JSContext* aCx, + JS::Handle aGivenProto) override; }; } // namespace dom diff --git a/gfx/layers/ipc/LayerTransactionParent.cpp b/gfx/layers/ipc/LayerTransactionParent.cpp index 017fa051d668b..c877ec8d12b75 100644 --- a/gfx/layers/ipc/LayerTransactionParent.cpp +++ b/gfx/layers/ipc/LayerTransactionParent.cpp @@ -886,11 +886,11 @@ bool LayerTransactionParent::IsSameProcess() const { void LayerTransactionParent::SetPendingTransactionId( TransactionId aId, const VsyncId& aVsyncId, const TimeStamp& aVsyncStartTime, const TimeStamp& aRefreshStartTime, - const TimeStamp& aTxnStartTime, const TimeStamp& aTxnEndTime, bool aContainsSVG, - const nsCString& aURL, const TimeStamp& aFwdTime) { - mPendingTransactions.AppendElement( - PendingTransaction{aId, aVsyncId, aVsyncStartTime, aRefreshStartTime, - aTxnStartTime, aTxnEndTime, aFwdTime, aURL, aContainsSVG}); + const TimeStamp& aTxnStartTime, const TimeStamp& aTxnEndTime, + bool aContainsSVG, const nsCString& aURL, const TimeStamp& aFwdTime) { + mPendingTransactions.AppendElement(PendingTransaction{ + aId, aVsyncId, aVsyncStartTime, aRefreshStartTime, aTxnStartTime, + aTxnEndTime, aFwdTime, aURL, aContainsSVG}); } TransactionId LayerTransactionParent::FlushTransactionId( diff --git a/gfx/layers/wr/WebRenderCommandBuilder.cpp b/gfx/layers/wr/WebRenderCommandBuilder.cpp index fd8c26f02adb9..0746ce6608fe0 100644 --- a/gfx/layers/wr/WebRenderCommandBuilder.cpp +++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp @@ -410,9 +410,8 @@ struct DIGroup { geometry->ComputeInvalidationRegion()); aData->mGeometry = std::move(geometry); - IntRect transformedRect = - ToDeviceSpace(clippedBounds, aMatrix, appUnitsPerDevPixel, - mLayerBounds.TopLeft()); + IntRect transformedRect = ToDeviceSpace( + clippedBounds, aMatrix, appUnitsPerDevPixel, mLayerBounds.TopLeft()); aData->mRect = transformedRect.Intersect(mImageBounds); GP("CGC %s %d %d %d %d\n", aItem->Name(), clippedBounds.x, clippedBounds.y, clippedBounds.width, clippedBounds.height); @@ -441,9 +440,8 @@ struct DIGroup { // matrix? // XXX: TransformBounds is expensive. We should avoid doing it if we have // no transform - IntRect transformedRect = - ToDeviceSpace(clippedBounds, aMatrix, appUnitsPerDevPixel, - mLayerBounds.TopLeft()); + IntRect transformedRect = ToDeviceSpace( + clippedBounds, aMatrix, appUnitsPerDevPixel, mLayerBounds.TopLeft()); aData->mRect = transformedRect.Intersect(mImageBounds); InvalidateRect(aData->mRect); GP("new rect: %d %d %d %d\n", aData->mRect.x, aData->mRect.y, @@ -551,8 +549,8 @@ struct DIGroup { geometry->ComputeInvalidationRegion()); aData->mGeometry = std::move(geometry); IntRect transformedRect = - ToDeviceSpace(clippedBounds, aMatrix, - appUnitsPerDevPixel, mLayerBounds.TopLeft()); + ToDeviceSpace(clippedBounds, aMatrix, appUnitsPerDevPixel, + mLayerBounds.TopLeft()); InvalidateRect(aData->mRect.Intersect(mImageBounds)); aData->mRect = transformedRect.Intersect(mImageBounds); InvalidateRect(aData->mRect); @@ -562,8 +560,8 @@ struct DIGroup { nsRect clippedBounds = clip.ApplyNonRoundedIntersection( geometry->ComputeInvalidationRegion()); IntRect transformedRect = - ToDeviceSpace(clippedBounds, aMatrix, - appUnitsPerDevPixel, mLayerBounds.TopLeft()); + ToDeviceSpace(clippedBounds, aMatrix, appUnitsPerDevPixel, + mLayerBounds.TopLeft()); // The invalid rect should contain the old rect and the new rect // but may not because the parent may have been removed. InvalidateRect(aData->mRect); @@ -575,8 +573,8 @@ struct DIGroup { nsRect clippedBounds = clip.ApplyNonRoundedIntersection( geometry->ComputeInvalidationRegion()); IntRect transformedRect = - ToDeviceSpace(clippedBounds, aMatrix, - appUnitsPerDevPixel, mLayerBounds.TopLeft()); + ToDeviceSpace(clippedBounds, aMatrix, appUnitsPerDevPixel, + mLayerBounds.TopLeft()); auto rect = transformedRect.Intersect(mImageBounds); GP("Layer NoChange: %s %d %d %d %d\n", aItem->Name(), aData->mRect.x, aData->mRect.y, aData->mRect.XMost(), diff --git a/gfx/src/FilterSupport.h b/gfx/src/FilterSupport.h index 3c0bb44c68e1c..dc0c0476dd12b 100644 --- a/gfx/src/FilterSupport.h +++ b/gfx/src/FilterSupport.h @@ -19,8 +19,8 @@ namespace mozilla { namespace gfx { class FilterPrimitiveDescription; -} // namespace gfx -} // namespace mozilla +} // namespace gfx +} // namespace mozilla DECLARE_USE_COPY_CONSTRUCTORS(mozilla::gfx::FilterPrimitiveDescription) diff --git a/gfx/vr/ipc/VRGPUChild.cpp b/gfx/vr/ipc/VRGPUChild.cpp index 01b6bb8933c82..0ac363e0b3da1 100644 --- a/gfx/vr/ipc/VRGPUChild.cpp +++ b/gfx/vr/ipc/VRGPUChild.cpp @@ -48,13 +48,9 @@ static StaticRefPtr sVRGPUChildSingleton; sVRGPUChildSingleton = nullptr; } -void VRGPUChild::ActorDestroy(ActorDestroyReason aWhy) { - mClosed = true; -} +void VRGPUChild::ActorDestroy(ActorDestroyReason aWhy) { mClosed = true; } -bool VRGPUChild::IsClosed() { - return mClosed; -} +bool VRGPUChild::IsClosed() { return mClosed; } } // namespace gfx } // namespace mozilla diff --git a/gfx/vr/ipc/VRGPUParent.cpp b/gfx/vr/ipc/VRGPUParent.cpp index d71df6b0da65a..935c8c6127db9 100644 --- a/gfx/vr/ipc/VRGPUParent.cpp +++ b/gfx/vr/ipc/VRGPUParent.cpp @@ -13,17 +13,14 @@ namespace gfx { using namespace ipc; -VRGPUParent::VRGPUParent(ProcessId aChildProcessId) - : mClosed(false) { +VRGPUParent::VRGPUParent(ProcessId aChildProcessId) : mClosed(false) { MOZ_COUNT_CTOR(VRGPUParent); MOZ_ASSERT(NS_IsMainThread()); SetOtherProcessId(aChildProcessId); } -VRGPUParent::~VRGPUParent() { - MOZ_COUNT_DTOR(VRGPUParent); -} +VRGPUParent::~VRGPUParent() { MOZ_COUNT_DTOR(VRGPUParent); } void VRGPUParent::ActorDestroy(ActorDestroyReason aWhy) { #if !defined(MOZ_WIDGET_ANDROID) @@ -80,9 +77,7 @@ mozilla::ipc::IPCResult VRGPUParent::RecvStopVRService() { return IPC_OK(); } -bool VRGPUParent::IsClosed() { - return mClosed; -} +bool VRGPUParent::IsClosed() { return mClosed; } } // namespace gfx } // namespace mozilla \ No newline at end of file diff --git a/gfx/vr/ipc/VRGPUParent.h b/gfx/vr/ipc/VRGPUParent.h index 61b55ca9dfa33..5d48aedba30b9 100644 --- a/gfx/vr/ipc/VRGPUParent.h +++ b/gfx/vr/ipc/VRGPUParent.h @@ -22,7 +22,6 @@ class VRGPUParent final : public PVRGPUParent { bool IsClosed(); protected: - void Bind(Endpoint&& aEndpoint); virtual mozilla::ipc::IPCResult RecvStartVRService() override; virtual mozilla::ipc::IPCResult RecvStopVRService() override; diff --git a/gfx/webrender_bindings/WebRenderAPI.cpp b/gfx/webrender_bindings/WebRenderAPI.cpp index 155db006218b3..2c9879c5bb68d 100644 --- a/gfx/webrender_bindings/WebRenderAPI.cpp +++ b/gfx/webrender_bindings/WebRenderAPI.cpp @@ -799,12 +799,12 @@ wr::WrSpaceAndClip DisplayListBuilder::DefineScrollLayer( // We haven't defined aViewId before, so let's define it now. wr::WrSpaceAndClip defaultParent = wr::RootScrollNode(); - //Note: we are currently ignoring the clipId on the stack here + // Note: we are currently ignoring the clipId on the stack here defaultParent.space = mCurrentSpaceAndClipChain.space; auto spaceAndClip = wr_dp_define_scroll_layer( - mWrState, aViewId, aParent ? aParent.ptr() : &defaultParent, - aContentRect, aClipRect); + mWrState, aViewId, aParent ? aParent.ptr() : &defaultParent, aContentRect, + aClipRect); WRDL_LOG("DefineScrollLayer id=%" PRIu64 "/%zu p=%s co=%s cl=%s\n", mWrState, aViewId, spaceAndClip.space.id, diff --git a/js/ipc/WrapperOwner.cpp b/js/ipc/WrapperOwner.cpp index 818bbf2ac73c2..a5294bcadbd3c 100644 --- a/js/ipc/WrapperOwner.cpp +++ b/js/ipc/WrapperOwner.cpp @@ -147,9 +147,7 @@ const CPOWProxyHandler CPOWProxyHandler::singleton; if (!owner->allowMessage(cx)) { \ return failRetVal; \ } \ - { \ - return owner->call args; \ - } + { return owner->call args; } bool CPOWProxyHandler::getOwnPropertyDescriptor( JSContext* cx, HandleObject proxy, HandleId id, diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp index cdfbd6ce4447d..f2da48b0a7c02 100644 --- a/js/src/gc/GC.cpp +++ b/js/src/gc/GC.cpp @@ -4223,8 +4223,7 @@ static void DiscardJITCodeForGC(JSRuntime* rt) { for (GCZonesIter zone(rt); !zone.done(); zone.next()) { gcstats::AutoPhase ap(rt->gc.stats(), gcstats::PhaseKind::MARK_DISCARD_CODE); - zone->discardJitCode(rt->defaultFreeOp(), - Zone::DiscardBaselineCode, + zone->discardJitCode(rt->defaultFreeOp(), Zone::DiscardBaselineCode, Zone::ReleaseTypes); } } diff --git a/js/src/gc/GCLock.h b/js/src/gc/GCLock.h index 4bb518125ac87..f533d98ccd582 100644 --- a/js/src/gc/GCLock.h +++ b/js/src/gc/GCLock.h @@ -113,6 +113,6 @@ class MOZ_RAII AutoUnlockGC { AutoUnlockGC& operator=(const AutoUnlockGC&) = delete; }; -} // namespace js +} // namespace js #endif /* gc_GCLock_h */ diff --git a/js/src/gc/Zone.h b/js/src/gc/Zone.h index 1a22ae99c9ecf..88d162702eb59 100644 --- a/js/src/gc/Zone.h +++ b/js/src/gc/Zone.h @@ -191,14 +191,12 @@ class Zone : public JS::shadow::Zone, DiscardBaselineCode }; - enum ShouldReleaseTypes : bool { - KeepTypes = false, - ReleaseTypes - }; + enum ShouldReleaseTypes : bool { KeepTypes = false, ReleaseTypes }; - void discardJitCode(js::FreeOp* fop, - ShouldDiscardBaselineCode discardBaselineCode = DiscardBaselineCode, - ShouldReleaseTypes releaseTypes = KeepTypes); + void discardJitCode( + js::FreeOp* fop, + ShouldDiscardBaselineCode discardBaselineCode = DiscardBaselineCode, + ShouldReleaseTypes releaseTypes = KeepTypes); void addSizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf, size_t* typePool, size_t* regexpZone, diff --git a/js/src/vm/Realm.h b/js/src/vm/Realm.h index cc42683e179ae..81ac8be00de1d 100644 --- a/js/src/vm/Realm.h +++ b/js/src/vm/Realm.h @@ -638,9 +638,7 @@ class JS::Realm : public JS::shadow::Realm { * principals during its lifetime (e.g. in case of lazy parsing). */ JSPrincipals* principals() { return principals_; } - void setPrincipals(JSPrincipals* principals) { - principals_ = principals; - } + void setPrincipals(JSPrincipals* principals) { principals_ = principals; } bool isSystem() const { return isSystem_; } diff --git a/js/src/wasm/WasmInstance.cpp b/js/src/wasm/WasmInstance.cpp index 0a0c85b263578..cdd3681e46f27 100644 --- a/js/src/wasm/WasmInstance.cpp +++ b/js/src/wasm/WasmInstance.cpp @@ -1143,8 +1143,7 @@ bool Instance::memoryAccessInGuardRegion(uint8_t* addr, lastByteOffset < memoryMappedSize(); } -bool Instance::memoryAccessInBounds(uint8_t* addr, - unsigned numBytes) const { +bool Instance::memoryAccessInBounds(uint8_t* addr, unsigned numBytes) const { MOZ_ASSERT(numBytes > 0 && numBytes <= sizeof(double)); if (!metadata().usesMemory()) { diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp index ecc1785443f5a..7c544ce092901 100644 --- a/js/src/wasm/WasmSignalHandlers.cpp +++ b/js/src/wasm/WasmSignalHandlers.cpp @@ -447,23 +447,40 @@ struct AutoHandlingTrap { static uintptr_t ReadGPR(CONTEXT* context, uint32_t rn) { switch (rn) { - case 0: return context->uc_mcontext.arm_r0; - case 1: return context->uc_mcontext.arm_r1; - case 2: return context->uc_mcontext.arm_r2; - case 3: return context->uc_mcontext.arm_r3; - case 4: return context->uc_mcontext.arm_r4; - case 5: return context->uc_mcontext.arm_r5; - case 6: return context->uc_mcontext.arm_r6; - case 7: return context->uc_mcontext.arm_r7; - case 8: return context->uc_mcontext.arm_r8; - case 9: return context->uc_mcontext.arm_r9; - case 10: return context->uc_mcontext.arm_r10; - case 11: return context->uc_mcontext.arm_fp; - case 12: return context->uc_mcontext.arm_ip; - case 13: return context->uc_mcontext.arm_sp; - case 14: return context->uc_mcontext.arm_lr; - case 15: return context->uc_mcontext.arm_pc; - default: MOZ_CRASH(); + case 0: + return context->uc_mcontext.arm_r0; + case 1: + return context->uc_mcontext.arm_r1; + case 2: + return context->uc_mcontext.arm_r2; + case 3: + return context->uc_mcontext.arm_r3; + case 4: + return context->uc_mcontext.arm_r4; + case 5: + return context->uc_mcontext.arm_r5; + case 6: + return context->uc_mcontext.arm_r6; + case 7: + return context->uc_mcontext.arm_r7; + case 8: + return context->uc_mcontext.arm_r8; + case 9: + return context->uc_mcontext.arm_r9; + case 10: + return context->uc_mcontext.arm_r10; + case 11: + return context->uc_mcontext.arm_fp; + case 12: + return context->uc_mcontext.arm_ip; + case 13: + return context->uc_mcontext.arm_sp; + case 14: + return context->uc_mcontext.arm_lr; + case 15: + return context->uc_mcontext.arm_pc; + default: + MOZ_CRASH(); } } @@ -482,11 +499,10 @@ static uintptr_t ReadGPR(CONTEXT* context, uint32_t rn) { // vfp_sigframe and VFP_MAGIC in this form since at least Android 3.4 / 2012; // Firefox requires Android 4.0 at least and we're probably safe here. -struct vfp_sigframe -{ - unsigned long magic; - unsigned long size; - struct user_vfp ufp; +struct vfp_sigframe { + unsigned long magic; + unsigned long size; + struct user_vfp ufp; struct user_vfp_exc ufp_exc; }; @@ -558,12 +574,13 @@ static bool HandleUnalignedTrap(CONTEXT* context, uint8_t* pc, // - we're encountering a device that traps on new kinds of accesses, // perhaps unaligned integer accesses // - general code generation bugs that lead to SIGBUS -# ifdef ANDROID - __android_log_print(ANDROID_LOG_ERROR, "WASM", "Bad SIGBUS instr %08x", instr); -# endif -# ifdef DEBUG +#ifdef ANDROID + __android_log_print(ANDROID_LOG_ERROR, "WASM", "Bad SIGBUS instr %08x", + instr); +#endif +#ifdef DEBUG MOZ_CRASH("Unexpected instruction"); -# endif +#endif return false; } @@ -579,8 +596,8 @@ static bool HandleUnalignedTrap(CONTEXT* context, uint8_t* pc, uint8_t* p = (uint8_t*)ReadGPR(context, rn) + (isAdd ? offs : -offs); - if (!instance->memoryAccessInBounds(p, isDouble ? sizeof(double) - : sizeof(float))) { + if (!instance->memoryAccessInBounds( + p, isDouble ? sizeof(double) : sizeof(float))) { return false; } @@ -619,16 +636,17 @@ static bool HandleUnalignedTrap(CONTEXT* context, uint8_t* pc, } #ifdef DEBUG - MOZ_CRASH("SIGBUS handler could not access FP register, incompatible kernel?"); + MOZ_CRASH( + "SIGBUS handler could not access FP register, incompatible kernel?"); #endif return false; } -#else // __linux__ && __arm__ +#else // __linux__ && __arm__ static bool HandleUnalignedTrap(CONTEXT* context, uint8_t* pc, Instance* instance) { return false; } -#endif // __linux__ && __arm__ +#endif // __linux__ && __arm__ static MOZ_MUST_USE bool HandleTrap(CONTEXT* context, bool isUnalignedSignal = false, diff --git a/layout/generic/nsFrameSetFrame.cpp b/layout/generic/nsFrameSetFrame.cpp index fb8e95db98027..d944e49fe71c5 100644 --- a/layout/generic/nsFrameSetFrame.cpp +++ b/layout/generic/nsFrameSetFrame.cpp @@ -1471,7 +1471,7 @@ nsresult nsHTMLFramesetBorderFrame::GetCursor(const nsPoint& aPoint, aCursor.mCursor = StyleCursorKind::Default; } else { aCursor.mCursor = - (mVertical) ? StyleCursorKind::EwResize: StyleCursorKind::NsResize; + (mVertical) ? StyleCursorKind::EwResize : StyleCursorKind::NsResize; } return NS_OK; } diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index dda4fc652bdc1..b2b16f796446e 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -7882,9 +7882,8 @@ bool nsDisplayTransform::CreateWebRenderCommands( aSc, GetActiveScrolledRoot(), mFrame, this, aBuilder, filters, LayoutDeviceRect(position, LayoutDeviceSize()), &newTransformMatrix, animationsId ? &prop : nullptr, nullptr, transformForSC, nullptr, - gfx::CompositionOp::OP_OVER, !BackfaceIsHidden(), - preserve3D, deferredTransformItem, wr::WrStackingContextClip::None(), - animated); + gfx::CompositionOp::OP_OVER, !BackfaceIsHidden(), preserve3D, + deferredTransformItem, wr::WrStackingContextClip::None(), animated); return mStoredList.CreateWebRenderCommands(aBuilder, aResources, sc, aManager, aDisplayListBuilder); diff --git a/layout/style/nsStyleCoord.h b/layout/style/nsStyleCoord.h index 5cbe35014ed5e..c75a5c8b61cb3 100644 --- a/layout/style/nsStyleCoord.h +++ b/layout/style/nsStyleCoord.h @@ -174,7 +174,6 @@ class nsStyleCoord { static bool ConvertsToPercent(const nsStyleUnit aUnit, const nsStyleUnion aValue) { - if (aUnit == eStyleUnit_Percent) { return true; } diff --git a/layout/xul/nsImageBoxFrame.cpp b/layout/xul/nsImageBoxFrame.cpp index 17219eddf59ce..6a975b766414b 100644 --- a/layout/xul/nsImageBoxFrame.cpp +++ b/layout/xul/nsImageBoxFrame.cpp @@ -227,8 +227,8 @@ void nsImageBoxFrame::UpdateImage() { nsresult rv = nsContentUtils::LoadImage( uri, mContent, doc, triggeringPrincipal, requestContextID, doc->GetDocumentURIAsReferrer(), doc->GetReferrerPolicy(), - mListener, mLoadFlags, EmptyString(), - getter_AddRefs(mImageRequest), contentPolicyType); + mListener, mLoadFlags, EmptyString(), getter_AddRefs(mImageRequest), + contentPolicyType); if (NS_SUCCEEDED(rv) && mImageRequest) { nsLayoutUtils::RegisterImageRequestIfAnimated( diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp index ecfff08bc4e5b..b5db0b8fb6f7d 100644 --- a/modules/libpref/Preferences.cpp +++ b/modules/libpref/Preferences.cpp @@ -5416,13 +5416,15 @@ static NS_DEFINE_CID(kPrefServiceCID, NS_PREFSERVICE_CID); static NS_DEFINE_CID(kPrefLocalizedStringCID, NS_PREFLOCALIZEDSTRING_CID); static mozilla::Module::CIDEntry kPrefCIDs[] = { - {&kPrefServiceCID, true, nullptr, PreferencesConstructor, Module::ALLOW_IN_SOCKET_PROCESS}, + {&kPrefServiceCID, true, nullptr, PreferencesConstructor, + Module::ALLOW_IN_SOCKET_PROCESS}, {&kPrefLocalizedStringCID, false, nullptr, nsPrefLocalizedStringConstructor}, {nullptr}}; static mozilla::Module::ContractIDEntry kPrefContracts[] = { - {NS_PREFSERVICE_CONTRACTID, &kPrefServiceCID, Module::ALLOW_IN_SOCKET_PROCESS}, + {NS_PREFSERVICE_CONTRACTID, &kPrefServiceCID, + Module::ALLOW_IN_SOCKET_PROCESS}, {NS_PREFLOCALIZEDSTRING_CONTRACTID, &kPrefLocalizedStringCID}, {nullptr}}; diff --git a/netwerk/build/nsNetModule.cpp b/netwerk/build/nsNetModule.cpp index ad5fa8fd91e12..0837a4eef1865 100644 --- a/netwerk/build/nsNetModule.cpp +++ b/netwerk/build/nsNetModule.cpp @@ -930,13 +930,14 @@ static const mozilla::Module::ContractIDEntry kNeckoContracts[] = { // clang-format on }; -static const mozilla::Module kNeckoModule = {mozilla::Module::kVersion, - kNeckoCIDs, - kNeckoContracts, - kNeckoCategories, - nullptr, - nsNetStartup, - nsNetShutdown, - mozilla::Module::ALLOW_IN_SOCKET_PROCESS}; +static const mozilla::Module kNeckoModule = { + mozilla::Module::kVersion, + kNeckoCIDs, + kNeckoContracts, + kNeckoCategories, + nullptr, + nsNetStartup, + nsNetShutdown, + mozilla::Module::ALLOW_IN_SOCKET_PROCESS}; NSMODULE_DEFN(necko) = &kNeckoModule; diff --git a/netwerk/ipc/SocketProcessChild.cpp b/netwerk/ipc/SocketProcessChild.cpp index af3f2ff450102..998df71d33e12 100644 --- a/netwerk/ipc/SocketProcessChild.cpp +++ b/netwerk/ipc/SocketProcessChild.cpp @@ -158,7 +158,7 @@ mozilla::ipc::IPCResult SocketProcessChild::RecvInitProfiler( mozilla::ipc::IPCResult SocketProcessChild::RecvSocketProcessTelemetryPing() { const uint32_t kExpectedUintValue = 42; Telemetry::ScalarSet(Telemetry::ScalarID::TELEMETRY_TEST_SOCKET_ONLY_UINT, - kExpectedUintValue); + kExpectedUintValue); return IPC_OK(); } diff --git a/security/manager/pki/nsASN1Tree.h b/security/manager/pki/nsASN1Tree.h index e9128093165c2..dcdb4f6de9329 100644 --- a/security/manager/pki/nsASN1Tree.h +++ b/security/manager/pki/nsASN1Tree.h @@ -21,7 +21,7 @@ #elif defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wextra" -#endif // __clang__ || __GNUC__ +#endif // __clang__ || __GNUC__ #include "mozilla/dom/XULTreeElement.h" @@ -29,7 +29,7 @@ #pragma clang diagnostic pop #elif defined(__GNUC__) #pragma GCC diagnostic pop -#endif // __clang__ || __GNUC__ +#endif // __clang__ || __GNUC__ // 4bfaa9f0-1dd2-11b2-afae-a82cbaa0b606 #define NS_NSSASN1OUTINER_CID \ diff --git a/security/manager/ssl/nsCertTree.h b/security/manager/ssl/nsCertTree.h index 2e5b80fe877bf..9347ab1edf324 100644 --- a/security/manager/ssl/nsCertTree.h +++ b/security/manager/ssl/nsCertTree.h @@ -26,7 +26,7 @@ #elif defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wextra" -#endif // __clang__ || __GNUC__ +#endif // __clang__ || __GNUC__ #include "mozilla/dom/XULTreeElement.h" @@ -34,7 +34,7 @@ #pragma clang diagnostic pop #elif defined(__GNUC__) #pragma GCC diagnostic pop -#endif // __clang__ || __GNUC__ +#endif // __clang__ || __GNUC__ typedef struct treeArrayElStr treeArrayEl; diff --git a/toolkit/components/reputationservice/ApplicationReputation.cpp b/toolkit/components/reputationservice/ApplicationReputation.cpp index 6c26cd296319d..8d46f26f5620b 100644 --- a/toolkit/components/reputationservice/ApplicationReputation.cpp +++ b/toolkit/components/reputationservice/ApplicationReputation.cpp @@ -1528,7 +1528,8 @@ nsresult PendingLookup::SendRemoteQueryInternal(Reason& aReason) { if (LOG_ENABLED()) { nsAutoCString serializedStr(serialized.c_str(), serialized.length()); - serializedStr.ReplaceSubstring(NS_LITERAL_CSTRING("\0"), NS_LITERAL_CSTRING("\\0")); + serializedStr.ReplaceSubstring(NS_LITERAL_CSTRING("\0"), + NS_LITERAL_CSTRING("\\0")); LOG(("Serialized protocol buffer [this = %p]: (length=%d) %s", this, serializedStr.Length(), serializedStr.get())); diff --git a/toolkit/components/sessionstore/SessionStoreUtils.cpp b/toolkit/components/sessionstore/SessionStoreUtils.cpp index c84f59f3bae49..7b8f63650565f 100644 --- a/toolkit/components/sessionstore/SessionStoreUtils.cpp +++ b/toolkit/components/sessionstore/SessionStoreUtils.cpp @@ -129,8 +129,8 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(DynamicFrameEventFilter) /* static */ already_AddRefed SessionStoreUtils::AddDynamicFrameFilteredListener( const GlobalObject& aGlobal, EventTarget& aTarget, const nsAString& aType, - JS::Handle aListener, bool aUseCapture, - bool aMozSystemGroup, ErrorResult& aRv) { + JS::Handle aListener, bool aUseCapture, bool aMozSystemGroup, + ErrorResult& aRv) { if (NS_WARN_IF(!aListener.isObject())) { aRv.Throw(NS_ERROR_INVALID_ARG); return nullptr; @@ -157,8 +157,8 @@ SessionStoreUtils::AddDynamicFrameFilteredListener( /* static */ void SessionStoreUtils::RemoveDynamicFrameFilteredListener( const GlobalObject& global, EventTarget& aTarget, const nsAString& aType, - nsISupports* aListener, bool aUseCapture, - bool aMozSystemGroup, ErrorResult& aRv) { + nsISupports* aListener, bool aUseCapture, bool aMozSystemGroup, + ErrorResult& aRv) { nsCOMPtr listener = do_QueryInterface(aListener); if (!listener) { aRv.Throw(NS_ERROR_NO_INTERFACE); @@ -383,7 +383,8 @@ static void CollectFromTextAreaElement(Document& aDocument, textArea->GetValue(value); // In order to reduce XPath generation (which is slow), we only save data // for form fields that have been changed. (cf. bug 537289) - if (textArea->AttrValueIs(kNameSpaceID_None, nsGkAtoms::value, value, eCaseMatters)) { + if (textArea->AttrValueIs(kNameSpaceID_None, nsGkAtoms::value, value, + eCaseMatters)) { continue; } Record::EntryType* entry = @@ -406,7 +407,8 @@ static void CollectFromInputElement(JSContext* aCx, Document& aDocument, uint32_t length = inputlist->Length(true); for (uint32_t i = 0; i < length; ++i) { MOZ_ASSERT(inputlist->Item(i), "null item in node list!"); - nsCOMPtr formControl = do_QueryInterface(inputlist->Item(i)); + nsCOMPtr formControl = + do_QueryInterface(inputlist->Item(i)); if (formControl) { uint8_t controlType = formControl->ControlType(); if (controlType == NS_FORM_INPUT_PASSWORD || @@ -469,7 +471,8 @@ static void CollectFromInputElement(JSContext* aCx, Document& aDocument, // Also, don't want to collect credit card number. if (value.IsEmpty() || IsValidCCNumber(value) || input->HasBeenTypePassword() || - input->AttrValueIs(kNameSpaceID_None, nsGkAtoms::value, value, eCaseMatters)) { + input->AttrValueIs(kNameSpaceID_None, nsGkAtoms::value, value, + eCaseMatters)) { continue; } if (!id.IsEmpty()) { @@ -485,7 +488,8 @@ static void CollectFromInputElement(JSContext* aCx, Document& aDocument, if (JS_ParseJSON(aCx, value.get(), value.Length(), &jsval) && jsval.isObject()) { Record::EntryType* - entry = AppendEntryToCollectedData(input, id, aGeneratedCount, aRetVal); + entry = AppendEntryToCollectedData(input, id, aGeneratedCount, + aRetVal); entry->mValue.SetAsObject() = &jsval.toObject(); } else { JS_ClearPendingException(aCx); @@ -622,7 +626,8 @@ static void CollectFromXULTextbox(Document& aDocument, } input->GetValue(value, CallerType::System); if (value.IsEmpty() || - input->AttrValueIs(kNameSpaceID_None, nsGkAtoms::value, value, eCaseMatters)) { + input->AttrValueIs(kNameSpaceID_None, nsGkAtoms::value, value, + eCaseMatters)) { continue; } uint16_t generatedCount = 0; @@ -635,14 +640,17 @@ static void CollectFromXULTextbox(Document& aDocument, } /* static */ void SessionStoreUtils::CollectFormData( - const GlobalObject& aGlobal, Document& aDocument, CollectedFormData& aRetVal) { + const GlobalObject& aGlobal, Document& aDocument, + CollectedFormData& aRetVal) { uint16_t generatedCount = 0; /* textarea element */ CollectFromTextAreaElement(aDocument, generatedCount, aRetVal); /* input element */ - CollectFromInputElement(aGlobal.Context(), aDocument, generatedCount, aRetVal); + CollectFromInputElement(aGlobal.Context(), aDocument, generatedCount, + aRetVal); /* select element */ - CollectFromSelectElement(aGlobal.Context(), aDocument, generatedCount, aRetVal); + CollectFromSelectElement(aGlobal.Context(), aDocument, generatedCount, + aRetVal); /* special case for about:config's search field */ CollectFromXULTextbox(aDocument, aRetVal); diff --git a/toolkit/components/sessionstore/SessionStoreUtils.h b/toolkit/components/sessionstore/SessionStoreUtils.h index fde3e06076e2c..f68e286baecf5 100644 --- a/toolkit/components/sessionstore/SessionStoreUtils.h +++ b/toolkit/components/sessionstore/SessionStoreUtils.h @@ -28,13 +28,13 @@ class SessionStoreUtils { static already_AddRefed AddDynamicFrameFilteredListener( const GlobalObject& aGlobal, EventTarget& aTarget, const nsAString& aType, - JS::Handle aListener, bool aUseCapture, - bool aMozSystemGroup, ErrorResult& aRv); + JS::Handle aListener, bool aUseCapture, bool aMozSystemGroup, + ErrorResult& aRv); static void RemoveDynamicFrameFilteredListener( const GlobalObject& aGlobal, EventTarget& aTarget, const nsAString& aType, - nsISupports* aListener, bool aUseCapture, - bool aMozSystemGroup, ErrorResult& aRv); + nsISupports* aListener, bool aUseCapture, bool aMozSystemGroup, + ErrorResult& aRv); static void CollectDocShellCapabilities(const GlobalObject& aGlobal, nsIDocShell* aDocShell, diff --git a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp index ac1f2d23bf8c8..12f593c126ec6 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp @@ -2175,8 +2175,8 @@ nsresult nsUrlClassifierDBService::LookupURI( } uint32_t perm; - rv = permissionManager->TestPermissionFromPrincipal( - aPrincipal, "safe-browsing", &perm); + rv = permissionManager->TestPermissionFromPrincipal(aPrincipal, + "safe-browsing", &perm); NS_ENSURE_SUCCESS(rv, rv); bool clean = (perm == nsIPermissionManager::ALLOW_ACTION); diff --git a/toolkit/recordreplay/ipc/Channel.cpp b/toolkit/recordreplay/ipc/Channel.cpp index 9ed3b36e57907..be134cc33b881 100644 --- a/toolkit/recordreplay/ipc/Channel.cpp +++ b/toolkit/recordreplay/ipc/Channel.cpp @@ -239,7 +239,7 @@ void Channel::PrintMessage(const char* aPrefix, const Message& aMsg) { switch (aMsg.mType) { case MessageType::HitExecutionPoint: { const HitExecutionPointMessage& nmsg = - (const HitExecutionPointMessage&)aMsg; + (const HitExecutionPointMessage&)aMsg; nmsg.mPoint.ToString(data); data.AppendPrintf(" Endpoint %d Duration %.2f ms", nmsg.mRecordingEndpoint, diff --git a/toolkit/recordreplay/ipc/Channel.h b/toolkit/recordreplay/ipc/Channel.h index 853b4bf3c18d7..8b1c207bd52e5 100644 --- a/toolkit/recordreplay/ipc/Channel.h +++ b/toolkit/recordreplay/ipc/Channel.h @@ -161,7 +161,10 @@ struct Message { } public: - struct FreePolicy { void operator()(Message* msg) { /*free(msg);*/ } }; + struct FreePolicy { + void operator()(Message* msg) { /*free(msg);*/ + } + }; typedef UniquePtr UniquePtr; UniquePtr Clone() const { diff --git a/toolkit/recordreplay/ipc/ChildIPC.cpp b/toolkit/recordreplay/ipc/ChildIPC.cpp index b325ac91eef75..9d918482dd066 100644 --- a/toolkit/recordreplay/ipc/ChildIPC.cpp +++ b/toolkit/recordreplay/ipc/ChildIPC.cpp @@ -65,7 +65,7 @@ static bool gDebuggerRunsInMiddleman; // Any response received to the last MiddlemanCallRequest message. static UniquePtr - gCallResponseMessage; + gCallResponseMessage; // Whether some thread has sent a MiddlemanCallRequest and is waiting for // gCallResponseMessage to be filled in. diff --git a/toolkit/recordreplay/ipc/ChildInternal.h b/toolkit/recordreplay/ipc/ChildInternal.h index 58bf6dea750bc..f2dbf30b60e28 100644 --- a/toolkit/recordreplay/ipc/ChildInternal.h +++ b/toolkit/recordreplay/ipc/ChildInternal.h @@ -87,7 +87,8 @@ namespace child { // IPC activity that can be triggered by navigation. void RespondToRequest(const js::CharBuffer& aBuffer); -void HitExecutionPoint(const js::ExecutionPoint& aPoint, bool aRecordingEndpoint); +void HitExecutionPoint(const js::ExecutionPoint& aPoint, + bool aRecordingEndpoint); // Optional information about a crash that occurred. If not provided to // ReportFatalError, the current thread will be treated as crashed. diff --git a/toolkit/recordreplay/ipc/ChildProcess.cpp b/toolkit/recordreplay/ipc/ChildProcess.cpp index b786cb74f58f9..c37578e90555b 100644 --- a/toolkit/recordreplay/ipc/ChildProcess.cpp +++ b/toolkit/recordreplay/ipc/ChildProcess.cpp @@ -65,13 +65,13 @@ void ChildProcessInfo::OnIncomingMessage(const Message& aMsg, case MessageType::FatalError: { mHasFatalError = true; const FatalErrorMessage& nmsg = - static_cast(aMsg); + static_cast(aMsg); OnCrash(nmsg.Error()); return; } case MessageType::HitExecutionPoint: { const HitExecutionPointMessage& nmsg = - static_cast(aMsg); + static_cast(aMsg); mPaused = true; if (this == GetActiveChild() && !nmsg.mPoint.HasPosition()) { MaybeUpdateGraphicsAtCheckpoint(nmsg.mPoint.mCheckpoint); @@ -93,7 +93,7 @@ void ChildProcessInfo::OnIncomingMessage(const Message& aMsg, break; case MessageType::MiddlemanCallRequest: { const MiddlemanCallRequestMessage& nmsg = - static_cast(aMsg); + static_cast(aMsg); Message::UniquePtr response(ProcessMiddlemanCallMessage(nmsg)); SendMessage(*response); break; @@ -163,10 +163,10 @@ void ChildProcessInfo::LaunchSubprocess( // deleting or tearing down the old one's state. This is pretty lame and it // would be nice if we could do something better here, especially because // with restarts we could create any number of channels over time. - mChannel = new Channel(channelId, IsRecording(), - [=](Message::UniquePtr aMsg) { - ReceiveChildMessageOnMainThread(std::move(aMsg)); - }); + mChannel = + new Channel(channelId, IsRecording(), [=](Message::UniquePtr aMsg) { + ReceiveChildMessageOnMainThread(std::move(aMsg)); + }); MOZ_RELEASE_ASSERT(IsRecording() == aRecordingProcessData.isSome()); if (IsRecording()) { @@ -259,9 +259,7 @@ struct PendingMessage { return *this; } - PendingMessage(PendingMessage&& aOther) { - *this = std::move(aOther); - } + PendingMessage(PendingMessage&& aOther) { *this = std::move(aOther); } }; static StaticInfallibleVector gPendingMessages; @@ -364,7 +362,8 @@ Message::UniquePtr ChildProcessInfo::WaitUntilPaused() { // Execute a task that processes a message received from the child. This is // called on a channel thread, and the function executes asynchronously on // the main thread. -void ChildProcessInfo::ReceiveChildMessageOnMainThread(Message::UniquePtr aMsg) { +void ChildProcessInfo::ReceiveChildMessageOnMainThread( + Message::UniquePtr aMsg) { MOZ_RELEASE_ASSERT(!NS_IsMainThread()); MonitorAutoLock lock(*gMonitor); diff --git a/toolkit/recordreplay/ipc/JSControl.cpp b/toolkit/recordreplay/ipc/JSControl.cpp index d6cfd0a9b95ef..2a278b5d915f3 100644 --- a/toolkit/recordreplay/ipc/JSControl.cpp +++ b/toolkit/recordreplay/ipc/JSControl.cpp @@ -150,11 +150,9 @@ bool BreakpointPosition::Decode(JSContext* aCx, HandleObject aObject) { return true; } -void -BreakpointPosition::ToString(nsCString& aStr) const -{ +void BreakpointPosition::ToString(nsCString& aStr) const { aStr.AppendPrintf("{ Kind: %s, Script: %d, Offset: %d, Frame: %d }", - KindString(), (int) mScript, (int) mOffset, (int) mFrameIndex); + KindString(), (int)mScript, (int)mOffset, (int)mFrameIndex); } /////////////////////////////////////////////////////////////////////////////// @@ -178,9 +176,8 @@ JSObject* ExecutionPoint::Encode(JSContext* aCx) const { } if (HasPosition()) { RootedObject position(aCx, mPosition.Encode(aCx)); - if (!position || - !JS_DefineProperty(aCx, obj, gPositionProperty, position, - JSPROP_ENUMERATE)) { + if (!position || !JS_DefineProperty(aCx, obj, gPositionProperty, position, + JSPROP_ENUMERATE)) { return nullptr; } } @@ -205,10 +202,8 @@ bool ExecutionPoint::Decode(JSContext* aCx, HandleObject aObject) { GetNumberProperty(aCx, aObject, gProgressProperty, &mProgress); } -void -ExecutionPoint::ToString(nsCString& aStr) const -{ - aStr.AppendPrintf("{ Checkpoint %d", (int) mCheckpoint); +void ExecutionPoint::ToString(nsCString& aStr) const { + aStr.AppendPrintf("{ Checkpoint %d", (int)mCheckpoint); if (HasPosition()) { aStr.AppendPrintf(" Progress %llu Position ", mProgress); mPosition.ToString(aStr); @@ -229,10 +224,9 @@ static JSObject* EncodeChannelMessage(JSContext* aCx, RootedObject pointObject(aCx, aMsg.mPoint.Encode(aCx)); if (!pointObject || - !JS_DefineProperty(aCx, obj, "point", pointObject, + !JS_DefineProperty(aCx, obj, "point", pointObject, JSPROP_ENUMERATE) || + !JS_DefineProperty(aCx, obj, "recordingEndpoint", aMsg.mRecordingEndpoint, JSPROP_ENUMERATE) || - !JS_DefineProperty(aCx, obj, "recordingEndpoint", - aMsg.mRecordingEndpoint, JSPROP_ENUMERATE) || !JS_DefineProperty(aCx, obj, "duration", aMsg.mDurationMicroseconds / 1000.0, JSPROP_ENUMERATE)) { @@ -252,7 +246,7 @@ void SetupMiddlemanControl(const Maybe& aRecordingChildId) { MOZ_RELEASE_ASSERT(!gControl); nsCOMPtr control = - do_ImportModule("resource://devtools/server/actors/replay/control.js"); + do_ImportModule("resource://devtools/server/actors/replay/control.js"); gControl = control.forget(); ClearOnShutdown(&gControl); @@ -270,7 +264,8 @@ void SetupMiddlemanControl(const Maybe& aRecordingChildId) { } } -void ForwardHitExecutionPointMessage(size_t aId, const HitExecutionPointMessage& aMsg) { +void ForwardHitExecutionPointMessage(size_t aId, + const HitExecutionPointMessage& aMsg) { MOZ_RELEASE_ASSERT(gControl); AutoSafeJSContext cx; @@ -361,8 +356,8 @@ static bool Middleman_CanRewind(JSContext* aCx, unsigned aArgc, Value* aVp) { return true; } -static bool Middleman_SpawnReplayingChild(JSContext* aCx, - unsigned aArgc, Value* aVp) { +static bool Middleman_SpawnReplayingChild(JSContext* aCx, unsigned aArgc, + Value* aVp) { CallArgs args = CallArgsFromVp(aArgc, aVp); size_t id = parent::SpawnReplayingChild(); @@ -370,8 +365,8 @@ static bool Middleman_SpawnReplayingChild(JSContext* aCx, return true; } -static bool Middleman_SetActiveChild(JSContext* aCx, - unsigned aArgc, Value* aVp) { +static bool Middleman_SetActiveChild(JSContext* aCx, unsigned aArgc, + Value* aVp) { CallArgs args = CallArgsFromVp(aArgc, aVp); parent::ChildProcessInfo* child = GetChildById(aCx, args.get(0)); @@ -385,8 +380,8 @@ static bool Middleman_SetActiveChild(JSContext* aCx, return true; } -static bool Middleman_SendSetSaveCheckpoint(JSContext* aCx, - unsigned aArgc, Value* aVp) { +static bool Middleman_SendSetSaveCheckpoint(JSContext* aCx, unsigned aArgc, + Value* aVp) { CallArgs args = CallArgsFromVp(aArgc, aVp); parent::ChildProcessInfo* child = GetChildById(aCx, args.get(0)); @@ -407,8 +402,8 @@ static bool Middleman_SendSetSaveCheckpoint(JSContext* aCx, return true; } -static bool Middleman_SendFlushRecording(JSContext* aCx, - unsigned aArgc, Value* aVp) { +static bool Middleman_SendFlushRecording(JSContext* aCx, unsigned aArgc, + Value* aVp) { CallArgs args = CallArgsFromVp(aArgc, aVp); parent::ChildProcessInfo* child = GetChildById(aCx, args.get(0)); @@ -441,7 +436,8 @@ static bool Middleman_SendResume(JSContext* aCx, unsigned aArgc, Value* aVp) { return true; } -static bool Middleman_SendRestoreCheckpoint(JSContext* aCx, unsigned aArgc, Value* aVp) { +static bool Middleman_SendRestoreCheckpoint(JSContext* aCx, unsigned aArgc, + Value* aVp) { CallArgs args = CallArgsFromVp(aArgc, aVp); parent::ChildProcessInfo* child = GetChildById(aCx, args.get(0)); @@ -460,7 +456,8 @@ static bool Middleman_SendRestoreCheckpoint(JSContext* aCx, unsigned aArgc, Valu return true; } -static bool Middleman_SendRunToPoint(JSContext* aCx, unsigned aArgc, Value* aVp) { +static bool Middleman_SendRunToPoint(JSContext* aCx, unsigned aArgc, + Value* aVp) { CallArgs args = CallArgsFromVp(aArgc, aVp); parent::ChildProcessInfo* child = GetChildById(aCx, args.get(0)); @@ -489,13 +486,13 @@ static js::CharBuffer* gResponseBuffer; void OnDebuggerResponse(const Message& aMsg) { const DebuggerResponseMessage& nmsg = - static_cast(aMsg); + static_cast(aMsg); MOZ_RELEASE_ASSERT(gResponseBuffer && gResponseBuffer->empty()); gResponseBuffer->append(nmsg.Buffer(), nmsg.BufferSize()); } -static bool Middleman_SendDebuggerRequest(JSContext* aCx, - unsigned aArgc, Value* aVp) { +static bool Middleman_SendDebuggerRequest(JSContext* aCx, unsigned aArgc, + Value* aVp) { CallArgs args = CallArgsFromVp(aArgc, aVp); parent::ChildProcessInfo* child = GetChildById(aCx, args.get(0)); @@ -519,8 +516,8 @@ static bool Middleman_SendDebuggerRequest(JSContext* aCx, MOZ_RELEASE_ASSERT(!gResponseBuffer); gResponseBuffer = &responseBuffer; - DebuggerRequestMessage* msg = - DebuggerRequestMessage::New(requestBuffer.begin(), requestBuffer.length()); + DebuggerRequestMessage* msg = DebuggerRequestMessage::New( + requestBuffer.begin(), requestBuffer.length()); child->SendMessage(*msg); free(msg); @@ -534,8 +531,8 @@ static bool Middleman_SendDebuggerRequest(JSContext* aCx, args.rval()); } -static bool Middleman_SendAddBreakpoint(JSContext* aCx, - unsigned aArgc, Value* aVp) { +static bool Middleman_SendAddBreakpoint(JSContext* aCx, unsigned aArgc, + Value* aVp) { CallArgs args = CallArgsFromVp(aArgc, aVp); parent::ChildProcessInfo* child = GetChildById(aCx, args.get(0)); @@ -559,8 +556,8 @@ static bool Middleman_SendAddBreakpoint(JSContext* aCx, return true; } -static bool Middleman_SendClearBreakpoints(JSContext* aCx, - unsigned aArgc, Value* aVp) { +static bool Middleman_SendClearBreakpoints(JSContext* aCx, unsigned aArgc, + Value* aVp) { CallArgs args = CallArgsFromVp(aArgc, aVp); parent::ChildProcessInfo* child = GetChildById(aCx, args.get(0)); @@ -602,8 +599,8 @@ static bool Middleman_HadRepaintFailure(JSContext* aCx, unsigned aArgc, return true; } -static bool Middleman_InRepaintStressMode(JSContext* aCx, - unsigned aArgc, Value* aVp) { +static bool Middleman_InRepaintStressMode(JSContext* aCx, unsigned aArgc, + Value* aVp) { CallArgs args = CallArgsFromVp(aArgc, aVp); args.rval().setBoolean(parent::InRepaintStressMode()); @@ -641,7 +638,7 @@ static bool Middleman_WaitUntilPaused(JSContext* aCx, unsigned aArgc, MOZ_RELEASE_ASSERT(msg->mType == MessageType::HitExecutionPoint); const HitExecutionPointMessage& nmsg = - static_cast(*msg); + static_cast(*msg); JSObject* obj = EncodeChannelMessage(aCx, nmsg); if (!obj) { diff --git a/toolkit/recordreplay/ipc/ParentIPC.cpp b/toolkit/recordreplay/ipc/ParentIPC.cpp index 7f62c34afe9de..e5be5bba2f1ea 100644 --- a/toolkit/recordreplay/ipc/ParentIPC.cpp +++ b/toolkit/recordreplay/ipc/ParentIPC.cpp @@ -69,9 +69,7 @@ bool IsMiddlemanWithRecordingChild() { return IsMiddleman() && gRecordingChild; } -ChildProcessInfo* GetActiveChild() { - return gActiveChild; -} +ChildProcessInfo* GetActiveChild() { return gActiveChild; } ChildProcessInfo* GetChildProcess(size_t aId) { if (gRecordingChild && gRecordingChild->GetId() == aId) { diff --git a/toolkit/recordreplay/ipc/ParentInternal.h b/toolkit/recordreplay/ipc/ParentInternal.h index a23def9e7356c..90d87fe5a1878 100644 --- a/toolkit/recordreplay/ipc/ParentInternal.h +++ b/toolkit/recordreplay/ipc/ParentInternal.h @@ -151,7 +151,8 @@ class ChildProcessInfo { const Maybe& aRecordingProcessData); public: - explicit ChildProcessInfo(const Maybe& aRecordingProcessData); + explicit ChildProcessInfo( + const Maybe& aRecordingProcessData); ~ChildProcessInfo(); size_t GetId() { return mChannel->GetId(); } diff --git a/toolkit/xre/LauncherRegistryInfo.cpp b/toolkit/xre/LauncherRegistryInfo.cpp index 1200e1ae608cc..0912827845842 100644 --- a/toolkit/xre/LauncherRegistryInfo.cpp +++ b/toolkit/xre/LauncherRegistryInfo.cpp @@ -260,7 +260,8 @@ std::wstring LauncherRegistryInfo::ResolveImageTimestampValueName() { } LauncherVoidResult LauncherRegistryInfo::WriteStartTimestamp( - LauncherRegistryInfo::ProcessType aProcessType, const Maybe& aValue) { + LauncherRegistryInfo::ProcessType aProcessType, + const Maybe& aValue) { LauncherResult name = ResolveValueName(aProcessType); if (name.isErr()) { return LAUNCHER_ERROR_FROM_RESULT(name); diff --git a/toolkit/xre/LauncherRegistryInfo.h b/toolkit/xre/LauncherRegistryInfo.h index 4de22011f3a25..a7b266e820daa 100644 --- a/toolkit/xre/LauncherRegistryInfo.h +++ b/toolkit/xre/LauncherRegistryInfo.h @@ -44,8 +44,8 @@ class LauncherRegistryInfo final { private: LauncherResult Open(); - LauncherVoidResult WriteStartTimestamp(ProcessType aProcessType, - const Maybe& aValue = Nothing()); + LauncherVoidResult WriteStartTimestamp( + ProcessType aProcessType, const Maybe& aValue = Nothing()); LauncherResult GetCurrentImageTimestamp(); LauncherVoidResult WriteImageTimestamp(DWORD aTimestamp); LauncherResult ClearStartTimestamp(ProcessType aProcessType); diff --git a/toolkit/xre/test/win/TestLauncherRegistryInfo.cpp b/toolkit/xre/test/win/TestLauncherRegistryInfo.cpp index 74b26f0f765e3..19e22f53f4e5b 100644 --- a/toolkit/xre/test/win/TestLauncherRegistryInfo.cpp +++ b/toolkit/xre/test/win/TestLauncherRegistryInfo.cpp @@ -674,9 +674,8 @@ int main(int argc, char* argv[]) { return 1; } - auto onExit = mozilla::MakeScopeExit([]() { - mozilla::Unused << DeleteAllTimestamps(); - }); + auto onExit = mozilla::MakeScopeExit( + []() { mozilla::Unused << DeleteAllTimestamps(); }); VoidResult vr = mozilla::Ok(); diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index 2abcd8b1584cc..48ef34dc2ed60 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -3231,14 +3231,14 @@ nsresult nsWindow::Create(nsIWidget *aParent, nsNativeWidget aNativeParent, MOZ_ASSERT(shouldAccelerate | !useWebRender); // Some Gtk+ themes use non-rectangular toplevel windows. To fully support - // such themes we need to make toplevel window transparent with ARGB visual. - // It may cause performanance issue so make it configurable - // and enable it by default for selected window managers. - // Also disable it for X11 SW rendering (Bug 1516224) by default. + // such themes we need to make toplevel window transparent with ARGB + // visual. It may cause performanance issue so make it configurable and + // enable it by default for selected window managers. Also disable it for + // X11 SW rendering (Bug 1516224) by default. if (mWindowType == eWindowType_toplevel && (shouldAccelerate || !mIsX11Display || - Preferences::HasUserValue("mozilla.widget.use-argb-visuals"))) { - needsAlphaVisual = TopLevelWindowUseARGBVisual(); + Preferences::HasUserValue("mozilla.widget.use-argb-visuals"))) { + needsAlphaVisual = TopLevelWindowUseARGBVisual(); } bool isSetVisual = false; diff --git a/xpcom/build/XPCOMInit.cpp b/xpcom/build/XPCOMInit.cpp index eb3619255657c..3f5efeb564966 100644 --- a/xpcom/build/XPCOMInit.cpp +++ b/xpcom/build/XPCOMInit.cpp @@ -301,14 +301,15 @@ const mozilla::Module::ContractIDEntry kXPCOMContracts[] = { #undef COMPONENT #undef COMPONENT_M -const mozilla::Module kXPCOMModule = {mozilla::Module::kVersion, - kXPCOMCIDEntries, - kXPCOMContracts, - nullptr, - nullptr, - nullptr, - nullptr, - Module::ALLOW_IN_GPU_VR_AND_SOCKET_PROCESS}; +const mozilla::Module kXPCOMModule = { + mozilla::Module::kVersion, + kXPCOMCIDEntries, + kXPCOMContracts, + nullptr, + nullptr, + nullptr, + nullptr, + Module::ALLOW_IN_GPU_VR_AND_SOCKET_PROCESS}; // gDebug will be freed during shutdown. static nsIDebug2* gDebug = nullptr; diff --git a/xpcom/components/Module.h b/xpcom/components/Module.h index cc409bd4eb5b3..ab204de1f2ab1 100644 --- a/xpcom/components/Module.h +++ b/xpcom/components/Module.h @@ -53,8 +53,10 @@ struct Module { ALLOW_IN_VR_PROCESS = 0x8, ALLOW_IN_SOCKET_PROCESS = 0x10, ALLOW_IN_GPU_AND_VR_PROCESS = ALLOW_IN_GPU_PROCESS | ALLOW_IN_VR_PROCESS, - ALLOW_IN_GPU_AND_SOCKET_PROCESS = ALLOW_IN_GPU_PROCESS | ALLOW_IN_SOCKET_PROCESS, - ALLOW_IN_GPU_VR_AND_SOCKET_PROCESS = ALLOW_IN_GPU_PROCESS | ALLOW_IN_VR_PROCESS | ALLOW_IN_SOCKET_PROCESS + ALLOW_IN_GPU_AND_SOCKET_PROCESS = + ALLOW_IN_GPU_PROCESS | ALLOW_IN_SOCKET_PROCESS, + ALLOW_IN_GPU_VR_AND_SOCKET_PROCESS = + ALLOW_IN_GPU_PROCESS | ALLOW_IN_VR_PROCESS | ALLOW_IN_SOCKET_PROCESS }; /**