From ec8859e69e5723111e24aac6973b2267cfc38059 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 20 Sep 2020 10:14:09 +0000 Subject: [PATCH] Bug 1519636 - Reformat recent changes to the Google coding style r=andi # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D90793 --- dom/bindings/DOMJSProxyHandler.cpp | 2 +- editor/libeditor/HTMLEditSubActionHandler.cpp | 2 +- gfx/gl/AndroidSurfaceTexture.cpp | 1 - gfx/layers/FrameMetrics.h | 8 +- gfx/layers/apz/public/APZPublicUtils.h | 4 +- gfx/layers/apz/src/APZPublicUtils.cpp | 15 ++-- gfx/layers/ipc/LayersMessageUtils.h | 53 +++++++------ js/src/builtin/Array.cpp | 2 +- js/src/builtin/Eval.cpp | 2 +- js/src/builtin/Promise.cpp | 2 +- js/src/builtin/TypedObject.h | 2 +- js/src/debugger/Environment.cpp | 24 +++--- js/src/debugger/Object.cpp | 2 +- js/src/gc/GCParallelTask.h | 1 - js/src/jit/CacheIRCompiler.cpp | 2 +- js/src/jit/IonBuilder.h | 4 +- js/src/jit/MCallOptimize.cpp | 4 +- js/src/jit/MIR.cpp | 2 +- js/src/jit/VMFunctionList-inl.h | 2 +- js/src/jsapi-tests/testNewObject.cpp | 2 +- .../testScriptSourceCompression.cpp | 6 +- js/src/jsfriendapi.h | 1 - js/src/vm/Interpreter.cpp | 4 +- js/src/vm/JSScript.cpp | 2 +- js/src/vm/WindowProxy.cpp | 8 +- js/src/wasm/WasmJS.cpp | 4 +- js/src/wasm/WasmModule.cpp | 2 +- js/xpconnect/src/nsXPConnect.cpp | 2 +- layout/base/PresShell.cpp | 3 +- layout/base/nsDocumentViewer.cpp | 2 +- layout/generic/nsGfxScrollFrame.cpp | 4 +- netwerk/protocol/http/AlternateServices.cpp | 23 +++--- netwerk/protocol/http/AlternateServices.h | 3 +- netwerk/protocol/http/Http3Session.cpp | 78 +++++++++---------- netwerk/protocol/http/Http3Session.h | 4 +- netwerk/protocol/http/QuicSocketControl.h | 1 + netwerk/protocol/http/TRRServiceChannel.cpp | 6 +- netwerk/socket/neqo_glue/NeqoHttp3Conn.h | 4 +- netwerk/test/gtest/TestHttpResponseHead.cpp | 4 +- xpcom/threads/nsProxyRelease.h | 2 +- 40 files changed, 146 insertions(+), 153 deletions(-) diff --git a/dom/bindings/DOMJSProxyHandler.cpp b/dom/bindings/DOMJSProxyHandler.cpp index fc405688be60..c978175c3aef 100644 --- a/dom/bindings/DOMJSProxyHandler.cpp +++ b/dom/bindings/DOMJSProxyHandler.cpp @@ -14,7 +14,7 @@ #include "jsapi.h" #include "js/friend/DOMProxy.h" // JS::DOMProxyShadowsResult, JS::ExpandoAndGeneration, JS::SetDOMProxyInformation -#include "js/Object.h" // JS::GetCompartment +#include "js/Object.h" // JS::GetCompartment using namespace JS; diff --git a/editor/libeditor/HTMLEditSubActionHandler.cpp b/editor/libeditor/HTMLEditSubActionHandler.cpp index 85dbb0fecb76..c3be07adffa4 100644 --- a/editor/libeditor/HTMLEditSubActionHandler.cpp +++ b/editor/libeditor/HTMLEditSubActionHandler.cpp @@ -5178,7 +5178,7 @@ nsresult HTMLEditor::AutoDeleteRangesHandler::AutoBlockElementsJoiner:: nsresult rv = mDeleteRangesHandlerConst.ComputeRangesToDeleteRangesWithTransaction( - aHTMLEditor, aDirectionAndAmount, aStripWrappers, aRangesToDelete); + aHTMLEditor, aDirectionAndAmount, aStripWrappers, aRangesToDelete); NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "AutoDeleteRangesHandler::" "ComputeRangesToDeleteRangesWithTransaction() failed"); diff --git a/gfx/gl/AndroidSurfaceTexture.cpp b/gfx/gl/AndroidSurfaceTexture.cpp index 811f0b255003..1267b892772a 100644 --- a/gfx/gl/AndroidSurfaceTexture.cpp +++ b/gfx/gl/AndroidSurfaceTexture.cpp @@ -70,7 +70,6 @@ class AndroidSharedBlitGL final { } private: - static already_AddRefed CreateContextImpl(bool aUseGles) { sMutex.AssertCurrentThreadOwns(); MOZ_ASSERT(!sContext); diff --git a/gfx/layers/FrameMetrics.h b/gfx/layers/FrameMetrics.h index ccdda82196a4..1d05a95387d6 100644 --- a/gfx/layers/FrameMetrics.h +++ b/gfx/layers/FrameMetrics.h @@ -880,15 +880,11 @@ struct ScrollMetadata { return mIsRDMTouchSimulationActive; } - bool DidContentGetPainted() const { - return mDidContentGetPainted; - } + bool DidContentGetPainted() const { return mDidContentGetPainted; } private: // For use in IPC only - void SetDidContentGetPainted(bool aValue) { - mDidContentGetPainted = aValue; - } + void SetDidContentGetPainted(bool aValue) { mDidContentGetPainted = aValue; } public: // For more details about the concept of a disregarded direction, refer to the diff --git a/gfx/layers/apz/public/APZPublicUtils.h b/gfx/layers/apz/public/APZPublicUtils.h index ead5dec92a68..a25ab74d8073 100644 --- a/gfx/layers/apz/public/APZPublicUtils.h +++ b/gfx/layers/apz/public/APZPublicUtils.h @@ -100,8 +100,8 @@ std::pair GetMouseWheelAnimationDurations(); * Calculate the physics parameters for smooth scroll animations for the * given origin, based on pref values. */ -ScrollAnimationBezierPhysicsSettings -ComputeBezierAnimationSettingsForOrigin(ScrollOrigin aOrigin); +ScrollAnimationBezierPhysicsSettings ComputeBezierAnimationSettingsForOrigin( + ScrollOrigin aOrigin); } // namespace apz diff --git a/gfx/layers/apz/src/APZPublicUtils.cpp b/gfx/layers/apz/src/APZPublicUtils.cpp index 2e053e942de6..29acc1aaeff7 100644 --- a/gfx/layers/apz/src/APZPublicUtils.cpp +++ b/gfx/layers/apz/src/APZPublicUtils.cpp @@ -80,17 +80,18 @@ static int32_t GetNormalizedAppVersion() { return std::make_pair(minMS, maxMS); } -ScrollAnimationBezierPhysicsSettings -ComputeBezierAnimationSettingsForOrigin(ScrollOrigin aOrigin) { +ScrollAnimationBezierPhysicsSettings ComputeBezierAnimationSettingsForOrigin( + ScrollOrigin aOrigin) { int32_t minMS = 0; int32_t maxMS = 0; bool isOriginSmoothnessEnabled = false; -#define READ_DURATIONS(prefbase) \ - isOriginSmoothnessEnabled = StaticPrefs::general_smoothScroll() && StaticPrefs::general_smoothScroll_ ## prefbase (); \ - if (isOriginSmoothnessEnabled) { \ - minMS = StaticPrefs::general_smoothScroll_ ## prefbase ## _durationMinMS(); \ - maxMS = StaticPrefs::general_smoothScroll_ ## prefbase ## _durationMaxMS(); \ +#define READ_DURATIONS(prefbase) \ + isOriginSmoothnessEnabled = StaticPrefs::general_smoothScroll() && \ + StaticPrefs::general_smoothScroll_##prefbase(); \ + if (isOriginSmoothnessEnabled) { \ + minMS = StaticPrefs::general_smoothScroll_##prefbase##_durationMinMS(); \ + maxMS = StaticPrefs::general_smoothScroll_##prefbase##_durationMaxMS(); \ } switch (aOrigin) { diff --git a/gfx/layers/ipc/LayersMessageUtils.h b/gfx/layers/ipc/LayersMessageUtils.h index 6bfc804d0e15..763d7b6bdbd0 100644 --- a/gfx/layers/ipc/LayersMessageUtils.h +++ b/gfx/layers/ipc/LayersMessageUtils.h @@ -216,31 +216,30 @@ struct ParamTraits static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) { - return ( - ReadParam(aMsg, aIter, &aResult->mScrollId) && - ReadParam(aMsg, aIter, &aResult->mPresShellResolution) && - ReadParam(aMsg, aIter, &aResult->mCompositionBounds) && - ReadParam(aMsg, aIter, &aResult->mDisplayPort) && - ReadParam(aMsg, aIter, &aResult->mCriticalDisplayPort) && - ReadParam(aMsg, aIter, &aResult->mScrollableRect) && - ReadParam(aMsg, aIter, &aResult->mCumulativeResolution) && - ReadParam(aMsg, aIter, &aResult->mDevPixelsPerCSSPixel) && - ReadParam(aMsg, aIter, &aResult->mScrollOffset) && - ReadParam(aMsg, aIter, &aResult->mZoom) && - ReadParam(aMsg, aIter, &aResult->mScrollGeneration) && - ReadParam(aMsg, aIter, &aResult->mRootCompositionSize) && - ReadParam(aMsg, aIter, &aResult->mDisplayPortMargins) && - ReadParam(aMsg, aIter, &aResult->mPresShellId) && - ReadParam(aMsg, aIter, &aResult->mLayoutViewport) && - ReadParam(aMsg, aIter, &aResult->mExtraResolution) && - ReadParam(aMsg, aIter, &aResult->mPaintRequestTime) && - ReadParam(aMsg, aIter, &aResult->mVisualDestination) && - ReadParam(aMsg, aIter, &aResult->mVisualScrollUpdateType) && - ReadParam(aMsg, aIter, &aResult->mFixedLayerMargins) && - ReadBoolForBitfield(aMsg, aIter, aResult, - ¶mType::SetIsRootContent) && - ReadBoolForBitfield(aMsg, aIter, aResult, - ¶mType::SetIsScrollInfoLayer)); + return (ReadParam(aMsg, aIter, &aResult->mScrollId) && + ReadParam(aMsg, aIter, &aResult->mPresShellResolution) && + ReadParam(aMsg, aIter, &aResult->mCompositionBounds) && + ReadParam(aMsg, aIter, &aResult->mDisplayPort) && + ReadParam(aMsg, aIter, &aResult->mCriticalDisplayPort) && + ReadParam(aMsg, aIter, &aResult->mScrollableRect) && + ReadParam(aMsg, aIter, &aResult->mCumulativeResolution) && + ReadParam(aMsg, aIter, &aResult->mDevPixelsPerCSSPixel) && + ReadParam(aMsg, aIter, &aResult->mScrollOffset) && + ReadParam(aMsg, aIter, &aResult->mZoom) && + ReadParam(aMsg, aIter, &aResult->mScrollGeneration) && + ReadParam(aMsg, aIter, &aResult->mRootCompositionSize) && + ReadParam(aMsg, aIter, &aResult->mDisplayPortMargins) && + ReadParam(aMsg, aIter, &aResult->mPresShellId) && + ReadParam(aMsg, aIter, &aResult->mLayoutViewport) && + ReadParam(aMsg, aIter, &aResult->mExtraResolution) && + ReadParam(aMsg, aIter, &aResult->mPaintRequestTime) && + ReadParam(aMsg, aIter, &aResult->mVisualDestination) && + ReadParam(aMsg, aIter, &aResult->mVisualScrollUpdateType) && + ReadParam(aMsg, aIter, &aResult->mFixedLayerMargins) && + ReadBoolForBitfield(aMsg, aIter, aResult, + ¶mType::SetIsRootContent) && + ReadBoolForBitfield(aMsg, aIter, aResult, + ¶mType::SetIsScrollInfoLayer)); } }; @@ -449,8 +448,8 @@ struct ParamTraits ¶mType::SetResolutionUpdated) && ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetIsRDMTouchSimulationActive)) && - ReadBoolForBitfield(aMsg, aIter, aResult, - ¶mType::SetDidContentGetPainted) && + ReadBoolForBitfield(aMsg, aIter, aResult, + ¶mType::SetDidContentGetPainted) && ReadParam(aMsg, aIter, &aResult->mDisregardedDirection) && ReadParam(aMsg, aIter, &aResult->mOverscrollBehavior) && ReadParam(aMsg, aIter, &aResult->mScrollUpdates); diff --git a/js/src/builtin/Array.cpp b/js/src/builtin/Array.cpp index c6f929224d77..2dc665c51ddb 100644 --- a/js/src/builtin/Array.cpp +++ b/js/src/builtin/Array.cpp @@ -26,7 +26,7 @@ #include "js/Class.h" #include "js/Conversions.h" #include "js/experimental/JitInfo.h" // JSJitGetterOp, JSJitInfo -#include "js/friend/StackLimits.h" // js::CheckRecursionLimit +#include "js/friend/StackLimits.h" // js::CheckRecursionLimit #include "js/PropertySpec.h" #include "util/Poison.h" #include "util/StringBuffer.h" diff --git a/js/src/builtin/Eval.cpp b/js/src/builtin/Eval.cpp index 4f8915657120..3c4f6eab0c75 100644 --- a/js/src/builtin/Eval.cpp +++ b/js/src/builtin/Eval.cpp @@ -14,7 +14,7 @@ #include "frontend/CompilationInfo.h" #include "gc/HashUtil.h" #include "js/friend/JSMEnvironment.h" // JS::NewJSMEnvironment, JS::ExecuteInJSMEnvironment, JS::GetJSMEnvironmentOfScriptedCaller, JS::IsJSMEnvironment -#include "js/friend/WindowProxy.h" // js::IsWindowProxy +#include "js/friend/WindowProxy.h" // js::IsWindowProxy #include "js/SourceText.h" #include "js/StableStringChars.h" #include "vm/GlobalObject.h" diff --git a/js/src/builtin/Promise.cpp b/js/src/builtin/Promise.cpp index 9ba8621596e2..d0cc779fd69d 100644 --- a/js/src/builtin/Promise.cpp +++ b/js/src/builtin/Promise.cpp @@ -16,7 +16,7 @@ #include "js/Debug.h" #include "js/experimental/JitInfo.h" // JSJitGetterOp, JSJitInfo -#include "js/ForOfIterator.h" // JS::ForOfIterator +#include "js/ForOfIterator.h" // JS::ForOfIterator #include "js/PropertySpec.h" #include "vm/ArrayObject.h" #include "vm/AsyncFunction.h" diff --git a/js/src/builtin/TypedObject.h b/js/src/builtin/TypedObject.h index 0454c08cd050..c81c9d42f807 100644 --- a/js/src/builtin/TypedObject.h +++ b/js/src/builtin/TypedObject.h @@ -14,7 +14,7 @@ #include "gc/WeakMap.h" #include "js/Conversions.h" #include "js/experimental/JitInfo.h" // JSJitInfo -#include "js/ScalarType.h" // js::Scalar::Type +#include "js/ScalarType.h" // js::Scalar::Type #include "vm/ArrayBufferObject.h" #include "vm/JSObject.h" diff --git a/js/src/debugger/Environment.cpp b/js/src/debugger/Environment.cpp index 05af9a29a3b1..4c8ecf5db620 100644 --- a/js/src/debugger/Environment.cpp +++ b/js/src/debugger/Environment.cpp @@ -21,18 +21,18 @@ #include "debugger/Script.h" // for DebuggerScript #include "frontend/BytecodeCompiler.h" // for IsIdentifier #include "gc/Rooting.h" // for RootedDebuggerEnvironment -#include "gc/Tracer.h" // for TraceManuallyBarrieredCrossCompartmentEdge -#include "js/HeapAPI.h" // for IsInsideNursery -#include "vm/Compartment.h" // for Compartment -#include "vm/JSAtom.h" // for Atomize, PinAtom -#include "vm/JSContext.h" // for JSContext -#include "vm/JSFunction.h" // for JSFunction -#include "vm/JSObject.h" // for JSObject, RequireObject -#include "vm/NativeObject.h" // for NativeObject, JSObject::is -#include "vm/ObjectGroup.h" // for GenericObject, NewObjectKind -#include "vm/Realm.h" // for AutoRealm, ErrorCopier -#include "vm/Scope.h" // for ScopeKind, ScopeKindString -#include "vm/StringType.h" // for JSAtom +#include "gc/Tracer.h" // for TraceManuallyBarrieredCrossCompartmentEdge +#include "js/HeapAPI.h" // for IsInsideNursery +#include "vm/Compartment.h" // for Compartment +#include "vm/JSAtom.h" // for Atomize, PinAtom +#include "vm/JSContext.h" // for JSContext +#include "vm/JSFunction.h" // for JSFunction +#include "vm/JSObject.h" // for JSObject, RequireObject +#include "vm/NativeObject.h" // for NativeObject, JSObject::is +#include "vm/ObjectGroup.h" // for GenericObject, NewObjectKind +#include "vm/Realm.h" // for AutoRealm, ErrorCopier +#include "vm/Scope.h" // for ScopeKind, ScopeKindString +#include "vm/StringType.h" // for JSAtom #include "vm/Compartment-inl.h" // for Compartment::wrap #include "vm/EnvironmentObject-inl.h" // for JSObject::enclosingEnvironment diff --git a/js/src/debugger/Object.cpp b/js/src/debugger/Object.cpp index faa3d8be01fa..7cd45e2e2fc3 100644 --- a/js/src/debugger/Object.cpp +++ b/js/src/debugger/Object.cpp @@ -35,7 +35,7 @@ #include "js/HeapAPI.h" // for IsInsideNursery #include "js/Promise.h" // for PromiseState #include "js/Proxy.h" // for PropertyDescriptor -#include "js/SourceText.h" // for SourceText +#include "js/SourceText.h" // for SourceText #include "js/StableStringChars.h" // for AutoStableStringChars #include "js/String.h" // for JS::StringHasLatin1Chars #include "proxy/ScriptedProxyHandler.h" // for ScriptedProxyHandler diff --git a/js/src/gc/GCParallelTask.h b/js/src/gc/GCParallelTask.h index 6f7cfbd7ac3c..4f1487ae4cfa 100644 --- a/js/src/gc/GCParallelTask.h +++ b/js/src/gc/GCParallelTask.h @@ -130,7 +130,6 @@ class GCParallelTask : public mozilla::LinkedListElement, return state_ == State::Dispatched; } - protected: // Override this method to provide the task's functionality. virtual void run(AutoLockHelperThreadState& lock) = 0; diff --git a/js/src/jit/CacheIRCompiler.cpp b/js/src/jit/CacheIRCompiler.cpp index 91e6df090ad8..bec1dd31e50b 100644 --- a/js/src/jit/CacheIRCompiler.cpp +++ b/js/src/jit/CacheIRCompiler.cpp @@ -27,7 +27,7 @@ #include "jit/SharedICRegisters.h" #include "js/friend/DOMProxy.h" // JS::ExpandoAndGeneration #include "js/friend/XrayJitInfo.h" // js::jit::GetXrayJitInfo -#include "js/ScalarType.h" // js::Scalar::Type +#include "js/ScalarType.h" // js::Scalar::Type #include "proxy/Proxy.h" #include "vm/ArrayBufferObject.h" #include "vm/ArrayBufferViewObject.h" diff --git a/js/src/jit/IonBuilder.h b/js/src/jit/IonBuilder.h index 01310574e1fa..bd28bc9cb847 100644 --- a/js/src/jit/IonBuilder.h +++ b/js/src/jit/IonBuilder.h @@ -24,8 +24,8 @@ #include "jit/MIRGraph.h" #include "jit/TIOracle.h" #include "js/experimental/JitInfo.h" // JSJitInfo -#include "js/ScalarType.h" // js::Scalar::Type -#include "vm/SharedStencil.h" // GCThingIndex +#include "js/ScalarType.h" // js::Scalar::Type +#include "vm/SharedStencil.h" // GCThingIndex namespace js { diff --git a/js/src/jit/MCallOptimize.cpp b/js/src/jit/MCallOptimize.cpp index dfac2d822d82..688e783669de 100644 --- a/js/src/jit/MCallOptimize.cpp +++ b/js/src/jit/MCallOptimize.cpp @@ -21,8 +21,8 @@ #include "jit/MIR.h" #include "jit/MIRGraph.h" #include "js/experimental/JitInfo.h" // JSJitInfo -#include "js/RegExpFlags.h" // JS::RegExpFlag, JS::RegExpFlags -#include "js/ScalarType.h" // js::Scalar::Type +#include "js/RegExpFlags.h" // JS::RegExpFlag, JS::RegExpFlags +#include "js/ScalarType.h" // js::Scalar::Type #include "vm/ArgumentsObject.h" #include "vm/ArrayBufferObject.h" #include "vm/JSObject.h" diff --git a/js/src/jit/MIR.cpp b/js/src/jit/MIR.cpp index 00d06c07afdb..0a4965e362b8 100644 --- a/js/src/jit/MIR.cpp +++ b/js/src/jit/MIR.cpp @@ -26,7 +26,7 @@ #include "jit/RangeAnalysis.h" #include "js/Conversions.h" #include "js/experimental/JitInfo.h" // JSJitInfo, JSTypedMethodJitInfo -#include "js/ScalarType.h" // js::Scalar::Type +#include "js/ScalarType.h" // js::Scalar::Type #include "util/Text.h" #include "util/Unicode.h" #include "vm/PlainObject.h" // js::PlainObject diff --git a/js/src/jit/VMFunctionList-inl.h b/js/src/jit/VMFunctionList-inl.h index da3de3ce2b1c..4018855293fb 100644 --- a/js/src/jit/VMFunctionList-inl.h +++ b/js/src/jit/VMFunctionList-inl.h @@ -9,7 +9,7 @@ #include "builtin/Eval.h" #include "builtin/ModuleObject.h" // js::GetOrCreateModuleMetaObject -#include "builtin/Promise.h" // js::AsyncFunctionAwait +#include "builtin/Promise.h" // js::AsyncFunctionAwait #include "builtin/RegExp.h" #include "builtin/String.h" #include "jit/BaselineIC.h" diff --git a/js/src/jsapi-tests/testNewObject.cpp b/js/src/jsapi-tests/testNewObject.cpp index 1103d68f4ebd..9c64cfcb3e7e 100644 --- a/js/src/jsapi-tests/testNewObject.cpp +++ b/js/src/jsapi-tests/testNewObject.cpp @@ -5,7 +5,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "js/Array.h" // JS::GetArrayLength, JS::IsArrayObject +#include "js/Array.h" // JS::GetArrayLength, JS::IsArrayObject #include "js/Object.h" // JS::GetClass #include "jsapi-tests/tests.h" diff --git a/js/src/jsapi-tests/testScriptSourceCompression.cpp b/js/src/jsapi-tests/testScriptSourceCompression.cpp index 3f6d3c54e4ae..a696dd933a42 100644 --- a/js/src/jsapi-tests/testScriptSourceCompression.cpp +++ b/js/src/jsapi-tests/testScriptSourceCompression.cpp @@ -24,9 +24,9 @@ #include "js/RootingAPI.h" // JS::MutableHandle, JS::Rooted #include "js/SourceText.h" // JS::SourceOwnership, JS::SourceText #include "js/String.h" // JS::GetLatin1LinearStringChars, JS::GetTwoByteLinearStringChars, JS::StringHasLatin1Chars -#include "js/UniquePtr.h" // js::UniquePtr -#include "js/Utility.h" // JS::FreePolicy -#include "js/Value.h" // JS::NullValue, JS::ObjectValue, JS::Value +#include "js/UniquePtr.h" // js::UniquePtr +#include "js/Utility.h" // JS::FreePolicy +#include "js/Value.h" // JS::NullValue, JS::ObjectValue, JS::Value #include "jsapi-tests/tests.h" #include "vm/Compression.h" // js::Compressor::CHUNK_SIZE #include "vm/JSFunction.h" // JSFunction::getOrCreateScript diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h index 036a15c77517..992c89db29a3 100644 --- a/js/src/jsfriendapi.h +++ b/js/src/jsfriendapi.h @@ -619,7 +619,6 @@ extern JS_FRIEND_API uint64_t GetSCOffset(JSStructuredCloneWriter* writer); } // namespace js - namespace js { static MOZ_ALWAYS_INLINE JS::shadow::Function* FunctionObjectToShadowFunction( diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp index aae1eac86cf5..a1fe7bc165eb 100644 --- a/js/src/vm/Interpreter.cpp +++ b/js/src/vm/Interpreter.cpp @@ -33,8 +33,8 @@ #include "jit/Jit.h" #include "js/CharacterEncoding.h" #include "js/experimental/JitInfo.h" // JSJitInfo -#include "js/friend/StackLimits.h" // js::CheckRecursionLimit -#include "js/friend/WindowProxy.h" // js::IsWindowProxy +#include "js/friend/StackLimits.h" // js::CheckRecursionLimit +#include "js/friend/WindowProxy.h" // js::IsWindowProxy #include "util/CheckedArithmetic.h" #include "util/StringBuffer.h" #include "vm/AsyncFunction.h" diff --git a/js/src/vm/JSScript.cpp b/js/src/vm/JSScript.cpp index a2183289a73c..e8a58cf27325 100644 --- a/js/src/vm/JSScript.cpp +++ b/js/src/vm/JSScript.cpp @@ -58,7 +58,7 @@ #include "vm/BytecodeLocation.h" #include "vm/BytecodeUtil.h" #include "vm/Compression.h" -#include "vm/FunctionFlags.h" // js::FunctionFlags +#include "vm/FunctionFlags.h" // js::FunctionFlags #include "vm/HelperThreadState.h" // js::RunPendingSourceCompressions #include "vm/JSAtom.h" #include "vm/JSContext.h" diff --git a/js/src/vm/WindowProxy.cpp b/js/src/vm/WindowProxy.cpp index 460be974216b..260efece9ac2 100644 --- a/js/src/vm/WindowProxy.cpp +++ b/js/src/vm/WindowProxy.cpp @@ -12,10 +12,10 @@ #include "jsapi.h" // js::AssertHeapIsIdle -#include "vm/GlobalObject.h" // js::GlobalObject -#include "vm/JSContext.h" // JSContext, CHECK_THREAD -#include "vm/JSObject.h" // JSObject -#include "vm/Runtime.h" // JSRuntime +#include "vm/GlobalObject.h" // js::GlobalObject +#include "vm/JSContext.h" // JSContext, CHECK_THREAD +#include "vm/JSObject.h" // JSObject +#include "vm/Runtime.h" // JSRuntime #include "vm/JSContext-inl.h" // JSContext::check #include "vm/JSObject-inl.h" // JSObject::nonCCWGlobal diff --git a/js/src/wasm/WasmJS.cpp b/js/src/wasm/WasmJS.cpp index e8d74804deb2..351cc656d46e 100644 --- a/js/src/wasm/WasmJS.cpp +++ b/js/src/wasm/WasmJS.cpp @@ -40,8 +40,8 @@ #include "util/StringBuffer.h" #include "util/Text.h" #include "vm/ErrorObject.h" -#include "vm/FunctionFlags.h" // js::FunctionFlags -#include "vm/GlobalObject.h" // js::GlobalObject +#include "vm/FunctionFlags.h" // js::FunctionFlags +#include "vm/GlobalObject.h" // js::GlobalObject #include "vm/HelperThreadState.h" // js::PromiseHelperTask #include "vm/Interpreter.h" #include "vm/PlainObject.h" // js::PlainObject diff --git a/js/src/wasm/WasmModule.cpp b/js/src/wasm/WasmModule.cpp index 630777534e72..a222a2b98dcc 100644 --- a/js/src/wasm/WasmModule.cpp +++ b/js/src/wasm/WasmModule.cpp @@ -27,7 +27,7 @@ #include "js/experimental/TypedData.h" // JS_NewUint8Array #include "threading/LockGuard.h" #include "vm/HelperThreadState.h" // Tier2GeneratorTask -#include "vm/PlainObject.h" // js::PlainObject +#include "vm/PlainObject.h" // js::PlainObject #include "wasm/WasmBaselineCompile.h" #include "wasm/WasmCompile.h" #include "wasm/WasmInstance.h" diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp index cbd3e98ed9ae..52d8212d0163 100644 --- a/js/xpconnect/src/nsXPConnect.cpp +++ b/js/xpconnect/src/nsXPConnect.cpp @@ -14,7 +14,7 @@ #include "XPCWrapper.h" #include "jsfriendapi.h" #include "js/AllocationLogging.h" // JS::SetLogCtorDtorFunctions -#include "js/Object.h" // JS::GetClass +#include "js/Object.h" // JS::GetClass #include "js/ProfilingStack.h" #include "GeckoProfiler.h" #include "nsJSEnvironment.h" diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 83c1ca2392ae..8871e58e1fde 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -8509,7 +8509,8 @@ void PresShell::EventHandler::RecordEventHandlingResponsePerformance( GetDocument()->GetReadyStateEnum() != Document::READYSTATE_COMPLETE) { Telemetry::Accumulate(Telemetry::LOAD_INPUT_EVENT_RESPONSE_MS, millis); - if (GetDocument()->ShouldIncludeInTelemetry(/* aAllowExtensionURIs = */ false) && + if (GetDocument()->ShouldIncludeInTelemetry( + /* aAllowExtensionURIs = */ false) && GetDocument()->IsTopLevelContentDocument()) { if (auto* wgc = GetDocument()->GetWindowGlobalChild()) { Unused << wgc->SendSubmitLoadInputEventResponsePreloadTelemetry(millis); diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index 0e3a108e65b6..fd47dacf1a66 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -423,7 +423,7 @@ class nsDocumentViewer final : public nsIContentViewer, // (ie, non owning) references. If you add any members to this // class, please make the ownership explicit (pinkerton, scc). - WeakPtr mContainer; // it owns me! + WeakPtr mContainer; // it owns me! RefPtr mDeviceContext; // We create and own this baby // the following six items are explicitly in this order diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 32075c34c3f4..04fc73fee5c5 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -3077,7 +3077,8 @@ void ScrollFrameHelper::ScrollToImpl(nsPoint aPt, const nsRect& aRange, // inconsistencies from querying a stale value. if (mIsRoot && nsLayoutUtils::CanScrollOriginClobberApz(mLastScrollOrigin)) { AutoWeakFrame weakFrame(mOuter); - AutoScrollbarRepaintSuppression repaintSuppression(this, weakFrame, !schedulePaint); + AutoScrollbarRepaintSuppression repaintSuppression(this, weakFrame, + !schedulePaint); nsPoint relativeOffset = presContext->PresShell()->GetVisualViewportOffset() - curPos; @@ -3088,7 +3089,6 @@ void ScrollFrameHelper::ScrollToImpl(nsPoint aPt, const nsRect& aRange, } } - if (schedulePaint) { mOuter->SchedulePaint(); diff --git a/netwerk/protocol/http/AlternateServices.cpp b/netwerk/protocol/http/AlternateServices.cpp index d02dfffcd6d8..8d1dd44173c3 100644 --- a/netwerk/protocol/http/AlternateServices.cpp +++ b/netwerk/protocol/http/AlternateServices.cpp @@ -261,14 +261,11 @@ AltSvcMapping::AltSvcMapping( } } -void AltSvcMapping::MakeHashKey(nsCString& outKey, - const nsACString& originScheme, - const nsACString& originHost, - int32_t originPort, bool privateBrowsing, - bool isolated, - const nsACString& topWindowOrigin, - const OriginAttributes& originAttributes, - bool aHttp3) { +void AltSvcMapping::MakeHashKey( + nsCString& outKey, const nsACString& originScheme, + const nsACString& originHost, int32_t originPort, bool privateBrowsing, + bool isolated, const nsACString& topWindowOrigin, + const OriginAttributes& originAttributes, bool aHttp3) { outKey.Truncate(); if (originPort == -1) { @@ -1154,8 +1151,9 @@ already_AddRefed AltSvcCache::GetAltServiceMapping( // First look for HTTP3 if (aHttp3Allowed) { nsAutoCString key; - AltSvcMapping::MakeHashKey(key, scheme, host, port, privateBrowsing, isolated, - topWindowOrigin, originAttributes, true); + AltSvcMapping::MakeHashKey(key, scheme, host, port, privateBrowsing, + isolated, topWindowOrigin, originAttributes, + true); RefPtr existing = LookupMapping(key, privateBrowsing); LOG( ("AltSvcCache::GetAltServiceMapping %p key=%s " @@ -1170,8 +1168,9 @@ already_AddRefed AltSvcCache::GetAltServiceMapping( // Now look for HTTP2. if (aHttp2Allowed) { nsAutoCString key; - AltSvcMapping::MakeHashKey(key, scheme, host, port, privateBrowsing, isolated, - topWindowOrigin, originAttributes, false); + AltSvcMapping::MakeHashKey(key, scheme, host, port, privateBrowsing, + isolated, topWindowOrigin, originAttributes, + false); RefPtr existing = LookupMapping(key, privateBrowsing); LOG( ("AltSvcCache::GetAltServiceMapping %p key=%s " diff --git a/netwerk/protocol/http/AlternateServices.h b/netwerk/protocol/http/AlternateServices.h index a5f5c55409b7..587780bb2a4e 100644 --- a/netwerk/protocol/http/AlternateServices.h +++ b/netwerk/protocol/http/AlternateServices.h @@ -102,7 +102,8 @@ class AltSvcMapping { const nsACString& originHost, int32_t originPort, bool privateBrowsing, bool isolated, const nsACString& topWindowOrigin, - const OriginAttributes& originAttributes, bool aIsHttp3); + const OriginAttributes& originAttributes, + bool aIsHttp3); bool IsHttp3() { return mIsHttp3; } const nsCString& NPNToken() const { return mNPNToken; } diff --git a/netwerk/protocol/http/Http3Session.cpp b/netwerk/protocol/http/Http3Session.cpp index 4d515ca75cce..696cb17ecfee 100644 --- a/netwerk/protocol/http/Http3Session.cpp +++ b/netwerk/protocol/http/Http3Session.cpp @@ -143,10 +143,11 @@ nsresult Http3Session::Init(const nsACString& aOrigin, gHttpHandler->DefaultQpackTableSize(), gHttpHandler->DefaultHttp3MaxBlockedStreams(), this)); - nsresult rv = NeqoHttp3Conn::Init(aOrigin, aAlpnToken, selfAddrStr, peerAddrStr, - gHttpHandler->DefaultQpackTableSize(), - gHttpHandler->DefaultHttp3MaxBlockedStreams(), - getter_AddRefs(mHttp3Connection)); + nsresult rv = + NeqoHttp3Conn::Init(aOrigin, aAlpnToken, selfAddrStr, peerAddrStr, + gHttpHandler->DefaultQpackTableSize(), + gHttpHandler->DefaultHttp3MaxBlockedStreams(), + getter_AddRefs(mHttp3Connection)); if (NS_FAILED(rv)) { return rv; } @@ -168,12 +169,11 @@ nsresult Http3Session::Init(const nsACString& aOrigin, // Http3Session is still being initialized and ReportHttp3Connection // will try to dispatch transaction on this session therefore it // needs to be executed after the initializationg is done. - DebugOnly rv = NS_DispatchToCurrentThread(NS_NewRunnableFunction( - "Http3Session::ReportHttp3Connection", - [self]() { - self->ReportHttp3Connection(); - })); - NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "NS_DispatchToCurrentThread failed"); + DebugOnly rv = NS_DispatchToCurrentThread( + NS_NewRunnableFunction("Http3Session::ReportHttp3Connection", + [self]() { self->ReportHttp3Connection(); })); + NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), + "NS_DispatchToCurrentThread failed"); } } return NS_OK; @@ -438,36 +438,35 @@ nsresult Http3Session::ProcessEvents(uint32_t count) { case Http3Event::Tag::ZeroRttRejected: LOG(("Http3Session::ProcessEvents - ZeroRttRejected")); if (mState == ZERORTT) { - mState = INITIALIZING; - Finish0Rtt(true); + mState = INITIALIZING; + Finish0Rtt(true); } break; - case Http3Event::Tag::ConnectionConnected: - { - LOG(("Http3Session::ProcessEvents - ConnectionConnected")); - bool was0RTT = mState == ZERORTT; - mState = CONNECTED; - SetSecInfo(); - mSocketControl->HandshakeCompleted(); - if (was0RTT) { - Finish0Rtt(false); - } - nsTArray token; - mHttp3Connection->GetResumptionToken(token); - if (!token.IsEmpty()) { - LOG(("Got a resumption token")); - nsAutoCString peerId; - mSocketControl->GetPeerId(peerId); - if (NS_FAILED( - // Bug 1660080 tto get the proper expiration time for a token. - SSLTokensCache::Put(peerId, token.Elements(), token.Length(), mSocketControl, 1))) { - LOG(("Adding resumption token failed")); - } + case Http3Event::Tag::ConnectionConnected: { + LOG(("Http3Session::ProcessEvents - ConnectionConnected")); + bool was0RTT = mState == ZERORTT; + mState = CONNECTED; + SetSecInfo(); + mSocketControl->HandshakeCompleted(); + if (was0RTT) { + Finish0Rtt(false); + } + nsTArray token; + mHttp3Connection->GetResumptionToken(token); + if (!token.IsEmpty()) { + LOG(("Got a resumption token")); + nsAutoCString peerId; + mSocketControl->GetPeerId(peerId); + if (NS_FAILED( + // Bug 1660080 tto get the proper expiration time for a token. + SSLTokensCache::Put(peerId, token.Elements(), token.Length(), + mSocketControl, 1))) { + LOG(("Adding resumption token failed")); } + } - ReportHttp3Connection(); - } - break; + ReportHttp3Connection(); + } break; case Http3Event::Tag::GoawayReceived: LOG(("Http3Session::ProcessEvents - GoawayReceived")); MOZ_ASSERT(!mGoawayReceived); @@ -649,8 +648,8 @@ bool Http3Session::AddStream(nsAHttpTransaction* aHttpTransaction, if (mState == ZERORTT) { if (!stream->Do0RTT()) { - LOG(("Http3Session %p will not get early data from Http3Stream %p", - this, stream)); + LOG(("Http3Session %p will not get early data from Http3Stream %p", this, + stream)); if (!mCannotDo0RTTStreams.Contains(stream)) { mCannotDo0RTTStreams.AppendElement(stream); } @@ -1334,8 +1333,7 @@ bool Http3Session::JoinConnection(const nsACString& hostname, int32_t port) { bool Http3Session::RealJoinConnection(const nsACString& hostname, int32_t port, bool justKidding) { MOZ_ASSERT(OnSocketThread(), "not on socket thread"); - if (!mConnection || !CanSandData() || mShouldClose || - mGoawayReceived) { + if (!mConnection || !CanSandData() || mShouldClose || mGoawayReceived) { return false; } diff --git a/netwerk/protocol/http/Http3Session.h b/netwerk/protocol/http/Http3Session.h index 184d082b15a1..65f86d5d452f 100644 --- a/netwerk/protocol/http/Http3Session.h +++ b/netwerk/protocol/http/Http3Session.h @@ -51,7 +51,9 @@ class Http3Session final : public nsAHttpTransaction, HttpConnectionUDP* readerWriter); bool IsConnected() const { return mState == CONNECTED; } - bool CanSandData() const { return (mState == CONNECTED) || (mState == ZERORTT); } + bool CanSandData() const { + return (mState == CONNECTED) || (mState == ZERORTT); + } bool IsClosing() const { return (mState == CLOSING || mState == CLOSED); } bool IsClosed() const { return mState == CLOSED; } diff --git a/netwerk/protocol/http/QuicSocketControl.h b/netwerk/protocol/http/QuicSocketControl.h index 27fc657d20f8..b1484eae0119 100644 --- a/netwerk/protocol/http/QuicSocketControl.h +++ b/netwerk/protocol/http/QuicSocketControl.h @@ -44,6 +44,7 @@ class QuicSocketControl final : public CommonSocketControl { void SetCertVerificationResult(PRErrorCode errorCode) override; NS_IMETHOD GetPeerId(nsACString& aResult) override; + private: ~QuicSocketControl() = default; diff --git a/netwerk/protocol/http/TRRServiceChannel.cpp b/netwerk/protocol/http/TRRServiceChannel.cpp index 732fabfdade2..457510973ec5 100644 --- a/netwerk/protocol/http/TRRServiceChannel.cpp +++ b/netwerk/protocol/http/TRRServiceChannel.cpp @@ -400,13 +400,13 @@ nsresult TRRServiceChannel::BeginConnect() { RefPtr mapping; if (!mConnectionInfo && mAllowAltSvc && // per channel - (http2Allowed || http3Allowed) && - !(mLoadFlags & LOAD_FRESH_CONNECTION) && + (http2Allowed || http3Allowed) && !(mLoadFlags & LOAD_FRESH_CONNECTION) && AltSvcMapping::AcceptableProxy(proxyInfo) && (scheme.EqualsLiteral("http") || scheme.EqualsLiteral("https")) && (mapping = gHttpHandler->GetAltServiceMapping( scheme, host, port, mPrivateBrowsing, IsIsolated(), - GetTopWindowOrigin(), OriginAttributes(), http2Allowed, http3Allowed))) { + GetTopWindowOrigin(), OriginAttributes(), http2Allowed, + http3Allowed))) { LOG(("TRRServiceChannel %p Alt Service Mapping Found %s://%s:%d [%s]\n", this, scheme.get(), mapping->AlternateHost().get(), mapping->AlternatePort(), mapping->HashKey().get())); diff --git a/netwerk/socket/neqo_glue/NeqoHttp3Conn.h b/netwerk/socket/neqo_glue/NeqoHttp3Conn.h index 2f249d1c0a95..06265d7b4341 100644 --- a/netwerk/socket/neqo_glue/NeqoHttp3Conn.h +++ b/netwerk/socket/neqo_glue/NeqoHttp3Conn.h @@ -88,9 +88,7 @@ class NeqoHttp3Conn final { neqo_http3conn_set_resumption_token(this, &aToken); } - bool IsZeroRtt() { - return neqo_http3conn_is_zero_rtt(this); - } + bool IsZeroRtt() { return neqo_http3conn_is_zero_rtt(this); } nsrefcnt AddRef() { return neqo_http3conn_addref(this); } nsrefcnt Release() { return neqo_http3conn_release(this); } diff --git a/netwerk/test/gtest/TestHttpResponseHead.cpp b/netwerk/test/gtest/TestHttpResponseHead.cpp index d8fe7d18cfe6..2a9a12e21a2d 100644 --- a/netwerk/test/gtest/TestHttpResponseHead.cpp +++ b/netwerk/test/gtest/TestHttpResponseHead.cpp @@ -36,7 +36,6 @@ void AssertRoundTrips(const nsHttpResponseHead& aHead) { } } - TEST(TestHttpResponseHead, Bug1636930) { // Only create atom table when it's not already created. @@ -79,7 +78,8 @@ TEST(TestHttpResponseHead, bug1649807) Unused << head.ParseHeaderLine("pragma: no-cache"_ns); Unused << head.ParseHeaderLine("date: Tue, 12 May 2020 09:24:23 GMT"_ns); - ASSERT_FALSE(head.NoCache()) << "Cache-Control wins over Pragma: no-cache"; + ASSERT_FALSE(head.NoCache()) + << "Cache-Control wins over Pragma: no-cache"; AssertRoundTrips(head); } diff --git a/xpcom/threads/nsProxyRelease.h b/xpcom/threads/nsProxyRelease.h index d0e35e4608bd..b494706ba9c2 100644 --- a/xpcom/threads/nsProxyRelease.h +++ b/xpcom/threads/nsProxyRelease.h @@ -151,7 +151,7 @@ inline NS_HIDDEN_(void) bool aAlwaysProxy = false) { RefPtr doomed = aDoomed; if (!doomed) { - return; // Nothing to do. + return; // Nothing to do. } // NS_ProxyRelease treats a null event target as "the current thread". So a