From 7f60810d8613c150c5efd762229bbfaea7c95b34 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 12 Apr 2019 13:14:25 +0000 Subject: [PATCH] Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D27245 --HG-- extra : moz-landing-system : lando --- accessible/atk/Platform.cpp | 7 +- .../app/winlauncher/LauncherProcessWin.cpp | 8 +- docshell/shistory/nsSHistory.cpp | 4 +- dom/base/ImageEncoder.cpp | 12 +- dom/base/MaybeCrossOriginObject.cpp | 6 +- dom/base/RemoteOuterWindowProxy.cpp | 11 +- dom/base/WindowNamedPropertiesHandler.h | 6 +- dom/base/nsJSEnvironment.cpp | 4 +- dom/base/nsObjectLoadingContent.cpp | 7 +- dom/base/nsObjectLoadingContent.h | 3 +- dom/bindings/BindingUtils.cpp | 9 +- dom/bindings/BindingUtils.h | 6 +- dom/bindings/DOMJSProxyHandler.cpp | 9 +- dom/bindings/DOMJSProxyHandler.h | 8 +- dom/bindings/RemoteObjectProxy.cpp | 6 +- dom/bindings/RemoteObjectProxy.h | 6 +- dom/bindings/WebIDLGlobalNameHash.cpp | 4 +- dom/bindings/WebIDLGlobalNameHash.h | 10 +- dom/gamepad/GamepadRemapping.cpp | 104 ++++++++---------- dom/gamepad/GamepadRemapping.h | 2 +- dom/gamepad/windows/WindowsGamepad.cpp | 21 ++-- dom/html/HTMLFormElement.cpp | 3 +- dom/ipc/TabChild.cpp | 3 +- dom/ipc/TabChild.h | 3 +- dom/ipc/TabParent.cpp | 8 +- dom/media/ipc/RDDProcessHost.h | 2 +- dom/media/webaudio/AudioContext.h | 4 +- dom/svg/SVGAnimatedIntegerPair.h | 2 +- dom/svg/SVGAnimatedNumberPair.h | 2 +- editor/libeditor/HTMLAbsPositionEditor.cpp | 3 +- editor/libeditor/HTMLEditRules.cpp | 3 +- editor/libeditor/SelectionState.h | 3 +- editor/libeditor/WSRunObject.cpp | 6 +- .../src/base/nsUniversalDetector.cpp | 14 +-- gfx/gl/GLContextProviderEGL.cpp | 3 +- gfx/layers/apz/src/AsyncPanZoomController.cpp | 8 +- gfx/layers/apz/src/Axis.cpp | 4 +- gfx/layers/apz/src/GenericFlingAnimation.h | 6 +- gfx/layers/client/ClientTiledPaintedLayer.cpp | 1 - gfx/layers/wr/WebRenderCommandBuilder.cpp | 4 +- gfx/src/nsFont.h | 8 +- gfx/thebes/gfxFontFamilyList.h | 4 +- gfx/thebes/gfxPlatformGtk.cpp | 4 +- gfx/thebes/gfxTextRun.cpp | 5 +- gfx/thebes/gfxTextRun.h | 3 +- gfx/vr/VRDisplayHost.h | 1 - gfx/vr/ipc/VRGPUChild.cpp | 5 +- ipc/glue/GeckoChildProcessHost.cpp | 4 +- ipc/glue/ProcessUtils_common.cpp | 4 +- js/ipc/WrapperOwner.cpp | 13 ++- js/public/Wrapper.h | 15 ++- js/src/builtin/Stream.cpp | 6 +- js/src/builtin/TypedObject.cpp | 4 +- js/src/frontend/TokenStream.h | 4 +- js/src/gc/GCRuntime.h | 4 +- js/src/jit/BaselineIC.h | 4 +- js/src/jit/CacheIR.cpp | 9 +- .../testFreshGlobalEvalRedefinition.cpp | 2 +- js/src/jsapi-tests/testSavedStacks.cpp | 27 +++-- js/src/jsapi-tests/testScriptObject.cpp | 2 +- js/src/jsapi-tests/testXDR.cpp | 2 +- js/src/jsapi.cpp | 11 +- js/src/jsapi.h | 10 +- js/src/jsfriendapi.h | 3 +- js/src/proxy/BaseProxyHandler.cpp | 5 +- js/src/proxy/CrossCompartmentWrapper.cpp | 5 +- .../proxy/OpaqueCrossCompartmentWrapper.cpp | 9 +- js/src/proxy/Proxy.cpp | 3 +- js/src/proxy/Proxy.h | 3 +- js/src/proxy/Wrapper.cpp | 4 +- js/src/util/StringBuffer.h | 3 +- js/src/vm/EnvironmentObject.h | 3 +- js/src/vm/ForOfIterator.cpp | 3 +- js/src/vm/Interpreter.h | 3 +- js/src/vm/Iteration.cpp | 7 +- js/src/vm/JSContext-inl.h | 3 +- js/src/vm/JSContext.cpp | 4 +- js/src/vm/StructuredClone.cpp | 4 +- js/src/wasm/WasmJS.cpp | 2 +- js/xpconnect/public/xpc_make_class.h | 3 +- js/xpconnect/src/Sandbox.cpp | 3 +- js/xpconnect/src/XPCComponents.cpp | 3 +- js/xpconnect/src/XPCRuntimeService.cpp | 3 +- js/xpconnect/src/XPCWrappedNativeJSOps.cpp | 3 +- js/xpconnect/wrappers/FilteringWrapper.cpp | 9 +- js/xpconnect/wrappers/XrayWrapper.cpp | 20 ++-- layout/base/nsCounterManager.h | 12 +- layout/generic/nsBlockFrame.cpp | 5 +- layout/generic/nsGfxScrollFrame.cpp | 5 +- layout/generic/nsImageFrame.cpp | 2 +- layout/style/ServoStyleSet.h | 3 +- layout/style/StyleColor.cpp | 4 +- layout/style/nsStyleStruct.cpp | 4 +- layout/xul/nsMenuPopupFrame.cpp | 4 +- memory/build/mozjemalloc.cpp | 8 +- netwerk/base/nsURLParsers.cpp | 3 +- .../manager/ssl/SSLServerCertVerification.cpp | 3 +- security/manager/ssl/nsKeygenHandler.cpp | 3 +- testing/gtest/mozilla/GTestRunner.cpp | 29 ++--- toolkit/components/startup/StartupTimeline.h | 4 +- .../components/url-classifier/Classifier.cpp | 11 +- .../tests/gtest/TestLookupCacheV4.cpp | 3 +- .../client/crashreporter_gtk_common.cpp | 2 +- .../library/gtest/static/TestUCRTDepends.cpp | 6 +- toolkit/xre/nsAppRunner.cpp | 10 +- widget/android/nsWindow.cpp | 53 +++++---- widget/cocoa/nsAppShell.mm | 5 +- widget/cocoa/nsTouchBarUpdater.mm | 3 +- widget/cocoa/nsWidgetFactory.mm | 17 +-- widget/gtk/WindowSurfaceWayland.cpp | 11 +- widget/gtk/nsWaylandDisplay.cpp | 5 +- widget/gtk/nsWaylandDisplay.h | 4 +- xpcom/build/GeckoProcessTypes.h | 9 +- xpcom/components/Module.h | 4 +- 114 files changed, 420 insertions(+), 406 deletions(-) diff --git a/accessible/atk/Platform.cpp b/accessible/atk/Platform.cpp index b49a506d765a..c06f9dad46d7 100644 --- a/accessible/atk/Platform.cpp +++ b/accessible/atk/Platform.cpp @@ -310,14 +310,15 @@ dbus_done: // check GSettings #define GSETINGS_A11Y_INTERFACE "org.gnome.desktop.interface" -#define GSETINGS_A11Y_KEY "toolkit-accessibility" +#define GSETINGS_A11Y_KEY "toolkit-accessibility" nsCOMPtr gsettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID); nsCOMPtr a11y_settings; if (gsettings) { - gsettings->GetCollectionForSchema(NS_LITERAL_CSTRING(GSETINGS_A11Y_INTERFACE), - getter_AddRefs(a11y_settings)); + gsettings->GetCollectionForSchema( + NS_LITERAL_CSTRING(GSETINGS_A11Y_INTERFACE), + getter_AddRefs(a11y_settings)); if (a11y_settings) { a11y_settings->GetBoolean(NS_LITERAL_CSTRING(GSETINGS_A11Y_KEY), &sShouldEnable); diff --git a/browser/app/winlauncher/LauncherProcessWin.cpp b/browser/app/winlauncher/LauncherProcessWin.cpp index 37b38d72ca65..04e70f99ebdb 100644 --- a/browser/app/winlauncher/LauncherProcessWin.cpp +++ b/browser/app/winlauncher/LauncherProcessWin.cpp @@ -180,10 +180,10 @@ static mozilla::Maybe RunAsLauncherProcess(int& argc, wchar_t** argv) { #endif // defined(MOZ_LAUNCHER_PROCESS) // We must check for force-launcher *after* we do LauncherRegistryInfo checks - runAsLauncher |= mozilla::CheckArg(argc, argv, L"force-launcher", - static_cast(nullptr), - mozilla::CheckArgFlag::RemoveArg) == - mozilla::ARG_FOUND; + runAsLauncher |= + mozilla::CheckArg(argc, argv, L"force-launcher", + static_cast(nullptr), + mozilla::CheckArgFlag::RemoveArg) == mozilla::ARG_FOUND; if (!runAsLauncher) { // In this case, we will be proceeding to run as the browser. diff --git a/docshell/shistory/nsSHistory.cpp b/docshell/shistory/nsSHistory.cpp index 3a17c5866905..2ac449ad99b4 100644 --- a/docshell/shistory/nsSHistory.cpp +++ b/docshell/shistory/nsSHistory.cpp @@ -598,9 +598,7 @@ nsSHistory::AddEntry(nsISHEntry* aSHEntry, bool aPersist) { } NS_IMETHODIMP_(void) -nsSHistory::ClearRootDocShell() { - mRootDocShell = nullptr; -} +nsSHistory::ClearRootDocShell() { mRootDocShell = nullptr; } /* Get size of the history list */ NS_IMETHODIMP diff --git a/dom/base/ImageEncoder.cpp b/dom/base/ImageEncoder.cpp index f69d02bcfcb2..ba1e99d629b4 100644 --- a/dom/base/ImageEncoder.cpp +++ b/dom/base/ImageEncoder.cpp @@ -287,9 +287,9 @@ nsresult ImageEncoder::GetInputStream(int32_t aWidth, int32_t aHeight, imgIEncoder* aEncoder, const nsAString& aEncoderOptions, nsIInputStream** aStream) { - nsresult rv = aEncoder->InitFromData(aImageBuffer, aWidth * aHeight * 4, - aWidth, aHeight, aWidth * 4, aFormat, - aEncoderOptions); + nsresult rv = + aEncoder->InitFromData(aImageBuffer, aWidth * aHeight * 4, aWidth, + aHeight, aWidth * 4, aFormat, aEncoderOptions); NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr encoder(aEncoder); @@ -317,9 +317,9 @@ nsresult ImageEncoder::ExtractDataInternal( return NS_ERROR_INVALID_ARG; } - rv = ImageEncoder::GetInputStream( - aSize.width, aSize.height, aImageBuffer, aFormat, aEncoder, - aOptions, getter_AddRefs(imgStream)); + rv = ImageEncoder::GetInputStream(aSize.width, aSize.height, aImageBuffer, + aFormat, aEncoder, aOptions, + getter_AddRefs(imgStream)); } else if (aContext && !aUsePlaceholder) { NS_ConvertUTF16toUTF8 encoderType(aType); rv = aContext->GetInputStream(encoderType.get(), aOptions, diff --git a/dom/base/MaybeCrossOriginObject.cpp b/dom/base/MaybeCrossOriginObject.cpp index 174d4b95b937..165db05d4c4a 100644 --- a/dom/base/MaybeCrossOriginObject.cpp +++ b/dom/base/MaybeCrossOriginObject.cpp @@ -435,9 +435,9 @@ bool MaybeCrossOriginObject::defineProperty( } template -bool MaybeCrossOriginObject::enumerate(JSContext* cx, - JS::Handle proxy, - JS::MutableHandleVector props) const { +bool MaybeCrossOriginObject::enumerate( + JSContext* cx, JS::Handle proxy, + JS::MutableHandleVector props) const { // Just get the property keys from ourselves, in whatever Realm we happen to // be in. It's important to not enter the Realm of "proxy" here, because that // would affect the list of keys we claim to have. We wrap the proxy in the diff --git a/dom/base/RemoteOuterWindowProxy.cpp b/dom/base/RemoteOuterWindowProxy.cpp index 47c215b8d480..8d134c83feec 100644 --- a/dom/base/RemoteOuterWindowProxy.cpp +++ b/dom/base/RemoteOuterWindowProxy.cpp @@ -45,8 +45,9 @@ class RemoteOuterWindowProxy JS::MutableHandleVector aProps) const final; // SpiderMonkey extensions - bool getOwnEnumerablePropertyKeys(JSContext* cx, JS::Handle proxy, - JS::MutableHandleVector props) const final; + bool getOwnEnumerablePropertyKeys( + JSContext* cx, JS::Handle proxy, + JS::MutableHandleVector props) const final; void NoteChildren(JSObject* aProxy, nsCycleCollectionTraversalCallback& aCb) const override { @@ -140,9 +141,9 @@ bool AppendIndexedPropertyNames(JSContext* aCx, BrowsingContext* aContext, return true; } -bool RemoteOuterWindowProxy::ownPropertyKeys(JSContext* aCx, - JS::Handle aProxy, - JS::MutableHandleVector aProps) const { +bool RemoteOuterWindowProxy::ownPropertyKeys( + JSContext* aCx, JS::Handle aProxy, + JS::MutableHandleVector aProps) const { BrowsingContext* bc = GetBrowsingContext(aProxy); // https://html.spec.whatwg.org/multipage/window-object.html#windowproxy-ownpropertykeys:crossoriginownpropertykeys-(-o-) diff --git a/dom/base/WindowNamedPropertiesHandler.h b/dom/base/WindowNamedPropertiesHandler.h index 2ce4f1d22216..1fc6e722ff55 100644 --- a/dom/base/WindowNamedPropertiesHandler.h +++ b/dom/base/WindowNamedPropertiesHandler.h @@ -24,9 +24,9 @@ class WindowNamedPropertiesHandler : public BaseDOMProxyHandler { JS::Handle aId, JS::Handle aDesc, JS::ObjectOpResult& result) const override; - virtual bool ownPropNames(JSContext* aCx, JS::Handle aProxy, - unsigned flags, - JS::MutableHandleVector aProps) const override; + virtual bool ownPropNames( + JSContext* aCx, JS::Handle aProxy, unsigned flags, + JS::MutableHandleVector aProps) const override; virtual bool delete_(JSContext* aCx, JS::Handle aProxy, JS::Handle aId, JS::ObjectOpResult& aResult) const override; diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 580dcc39ce5e..7c94e9463541 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -499,8 +499,8 @@ void DispatchScriptErrorEvent(nsPIDOMWindowInner* win, xpc::ErrorReport* xpcReport, JS::Handle exception, JS::Handle exceptionStack) { - nsContentUtils::AddScriptRunner( - new ScriptErrorEvent(win, rootingCx, xpcReport, exception, exceptionStack)); + nsContentUtils::AddScriptRunner(new ScriptErrorEvent( + win, rootingCx, xpcReport, exception, exceptionStack)); } } /* namespace xpc */ diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp index a16a7c79d5ca..37f82679fd5d 100644 --- a/dom/base/nsObjectLoadingContent.cpp +++ b/dom/base/nsObjectLoadingContent.cpp @@ -3508,10 +3508,9 @@ bool nsObjectLoadingContent::MayResolve(jsid aId) { return true; } -void nsObjectLoadingContent::GetOwnPropertyNames(JSContext* aCx, - JS::MutableHandleVector /* unused */, - bool /* unused */, - ErrorResult& aRv) { +void nsObjectLoadingContent::GetOwnPropertyNames( + JSContext* aCx, JS::MutableHandleVector /* unused */, + bool /* unused */, ErrorResult& aRv) { // Just like DoResolve, just make sure we're instantiated. That will do // the work our Enumerate hook needs to do. This purposefully does not fire // for xray resolves, see bug 967694 diff --git a/dom/base/nsObjectLoadingContent.h b/dom/base/nsObjectLoadingContent.h index 47101c20a2aa..d73a04cab24a 100644 --- a/dom/base/nsObjectLoadingContent.h +++ b/dom/base/nsObjectLoadingContent.h @@ -189,7 +189,8 @@ class nsObjectLoadingContent : public nsImageLoadingContent, static bool MayResolve(jsid aId); // Helper for WebIDL enumeration - void GetOwnPropertyNames(JSContext* aCx, JS::MutableHandleVector /* unused */, + void GetOwnPropertyNames(JSContext* aCx, + JS::MutableHandleVector /* unused */, bool /* unused */, mozilla::ErrorResult& aRv); // WebIDL API diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp index 8bac9ab5ee65..ae6417af32f3 100644 --- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -1870,7 +1870,8 @@ bool XrayAppendPropertyKeys( bool XrayOwnPropertyKeys(JSContext* cx, JS::Handle wrapper, JS::Handle obj, unsigned flags, - JS::MutableHandleVector props, DOMObjectType type, + JS::MutableHandleVector props, + DOMObjectType type, const NativeProperties* nativeProperties) { MOZ_ASSERT(type != eNamedPropertiesObject); @@ -1902,7 +1903,8 @@ bool XrayOwnPropertyKeys(JSContext* cx, JS::Handle wrapper, bool XrayOwnNativePropertyKeys(JSContext* cx, JS::Handle wrapper, const NativePropertyHooks* nativePropertyHooks, DOMObjectType type, JS::Handle obj, - unsigned flags, JS::MutableHandleVector props) { + unsigned flags, + JS::MutableHandleVector props) { MOZ_ASSERT(type != eNamedPropertiesObject); if (type == eInterface && @@ -2739,7 +2741,8 @@ bool MayResolveGlobal(const JSAtomState& aNames, jsid aId, } bool EnumerateGlobal(JSContext* aCx, JS::HandleObject aObj, - JS::MutableHandleVector aProperties, bool aEnumerableOnly) { + JS::MutableHandleVector aProperties, + bool aEnumerableOnly) { MOZ_ASSERT(JS_IsGlobalObject(aObj), "Should have a global here, since we plan to enumerate standard " "classes!"); diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h index 898a440cbcf1..3a44201177fa 100644 --- a/dom/bindings/BindingUtils.h +++ b/dom/bindings/BindingUtils.h @@ -2192,7 +2192,8 @@ inline bool IdEquals(jsid id, const char* string) { JS_FlatStringEqualsAscii(JSID_TO_FLAT_STRING(id), string); } -inline bool AddStringToIDVector(JSContext* cx, JS::MutableHandleVector vector, +inline bool AddStringToIDVector(JSContext* cx, + JS::MutableHandleVector vector, const char* name) { return vector.growBy(1) && AtomizeAndPinJSString(cx, *(vector[vector.length() - 1]).address(), @@ -2778,7 +2779,8 @@ bool ResolveGlobal(JSContext* aCx, JS::Handle aObj, bool MayResolveGlobal(const JSAtomState& aNames, jsid aId, JSObject* aMaybeObj); bool EnumerateGlobal(JSContext* aCx, JS::HandleObject aObj, - JS::MutableHandleVector aProperties, bool aEnumerableOnly); + JS::MutableHandleVector aProperties, + bool aEnumerableOnly); struct CreateGlobalOptionsGeneric { static void TraceGlobal(JSTracer* aTrc, JSObject* aObj) { diff --git a/dom/bindings/DOMJSProxyHandler.cpp b/dom/bindings/DOMJSProxyHandler.cpp index 5d92faf2d16b..f074547976dd 100644 --- a/dom/bindings/DOMJSProxyHandler.cpp +++ b/dom/bindings/DOMJSProxyHandler.cpp @@ -253,9 +253,9 @@ bool DOMProxyHandler::delete_(JSContext* cx, JS::Handle proxy, return result.succeed(); } -bool BaseDOMProxyHandler::ownPropertyKeys(JSContext* cx, - JS::Handle proxy, - JS::MutableHandleVector props) const { +bool BaseDOMProxyHandler::ownPropertyKeys( + JSContext* cx, JS::Handle proxy, + JS::MutableHandleVector props) const { return ownPropNames(cx, proxy, JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS, props); } @@ -269,7 +269,8 @@ bool BaseDOMProxyHandler::getPrototypeIfOrdinary( } bool BaseDOMProxyHandler::getOwnEnumerablePropertyKeys( - JSContext* cx, JS::Handle proxy, JS::MutableHandleVector props) const { + JSContext* cx, JS::Handle proxy, + JS::MutableHandleVector props) const { return ownPropNames(cx, proxy, JSITER_OWNONLY, props); } diff --git a/dom/bindings/DOMJSProxyHandler.h b/dom/bindings/DOMJSProxyHandler.h index d4742dedeae8..b7f924274189 100644 --- a/dom/bindings/DOMJSProxyHandler.h +++ b/dom/bindings/DOMJSProxyHandler.h @@ -52,8 +52,9 @@ class BaseDOMProxyHandler : public js::BaseProxyHandler { bool getOwnPropertyDescriptor( JSContext* cx, JS::Handle proxy, JS::Handle id, JS::MutableHandle desc) const override; - virtual bool ownPropertyKeys(JSContext* cx, JS::Handle proxy, - JS::MutableHandleVector props) const override; + virtual bool ownPropertyKeys( + JSContext* cx, JS::Handle proxy, + JS::MutableHandleVector props) const override; virtual bool getPrototypeIfOrdinary( JSContext* cx, JS::Handle proxy, bool* isOrdinary, @@ -73,7 +74,8 @@ class BaseDOMProxyHandler : public js::BaseProxyHandler { // or JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS (for // ownPropertyKeys()). virtual bool ownPropNames(JSContext* cx, JS::Handle proxy, - unsigned flags, JS::MutableHandleVector props) const = 0; + unsigned flags, + JS::MutableHandleVector props) const = 0; // Hook for subclasses to allow set() to ignore named props while other things // that look at property descriptors see them. This is intentionally not diff --git a/dom/bindings/RemoteObjectProxy.cpp b/dom/bindings/RemoteObjectProxy.cpp index 5995a1c049e8..3812362b5a5b 100644 --- a/dom/bindings/RemoteObjectProxy.cpp +++ b/dom/bindings/RemoteObjectProxy.cpp @@ -33,9 +33,9 @@ bool RemoteObjectProxyBase::defineProperty( return ReportCrossOriginDenial(aCx, aId, NS_LITERAL_CSTRING("define")); } -bool RemoteObjectProxyBase::ownPropertyKeys(JSContext* aCx, - JS::Handle aProxy, - JS::MutableHandleVector aProps) const { +bool RemoteObjectProxyBase::ownPropertyKeys( + JSContext* aCx, JS::Handle aProxy, + JS::MutableHandleVector aProps) const { // https://html.spec.whatwg.org/multipage/browsers.html#crossoriginownpropertykeys-(-o-) // step 2 and // https://html.spec.whatwg.org/multipage/browsers.html#crossoriginproperties-(-o-) diff --git a/dom/bindings/RemoteObjectProxy.h b/dom/bindings/RemoteObjectProxy.h index b82e3092cdd0..cc786d224fb4 100644 --- a/dom/bindings/RemoteObjectProxy.h +++ b/dom/bindings/RemoteObjectProxy.h @@ -67,9 +67,9 @@ class RemoteObjectProxyBase : public js::BaseProxyHandler, // SpiderMonkey extensions bool hasOwn(JSContext* aCx, JS::Handle aProxy, JS::Handle aId, bool* aBp) const override; - bool getOwnEnumerablePropertyKeys(JSContext* aCx, - JS::Handle aProxy, - JS::MutableHandleVector aProps) const override; + bool getOwnEnumerablePropertyKeys( + JSContext* aCx, JS::Handle aProxy, + JS::MutableHandleVector aProps) const override; const char* className(JSContext* aCx, JS::Handle aProxy) const final; diff --git a/dom/bindings/WebIDLGlobalNameHash.cpp b/dom/bindings/WebIDLGlobalNameHash.cpp index 34446e4d4352..86ffba0c77ad 100644 --- a/dom/bindings/WebIDLGlobalNameHash.cpp +++ b/dom/bindings/WebIDLGlobalNameHash.cpp @@ -243,8 +243,8 @@ bool WebIDLGlobalNameHash::ResolveForSystemGlobal(JSContext* aCx, /* static */ bool WebIDLGlobalNameHash::NewEnumerateSystemGlobal( - JSContext* aCx, JS::Handle aObj, JS::MutableHandleVector aProperties, - bool aEnumerableOnly) { + JSContext* aCx, JS::Handle aObj, + JS::MutableHandleVector aProperties, bool aEnumerableOnly) { MOZ_ASSERT(JS_IsGlobalObject(aObj)); if (!JS_NewEnumerateStandardClasses(aCx, aObj, aProperties, diff --git a/dom/bindings/WebIDLGlobalNameHash.h b/dom/bindings/WebIDLGlobalNameHash.h index 6d633244cca5..6a6fa0261a1b 100644 --- a/dom/bindings/WebIDLGlobalNameHash.h +++ b/dom/bindings/WebIDLGlobalNameHash.h @@ -59,7 +59,8 @@ class WebIDLGlobalNameHash { }; // Returns false if an exception has been thrown on aCx. static bool GetNames(JSContext* aCx, JS::Handle aObj, - NameType aNameType, JS::MutableHandleVector aNames); + NameType aNameType, + JS::MutableHandleVector aNames); // Helpers for resolving & enumerating names on the system global. // NOTE: These are distinct as it currently lacks a ProtoAndIfaceCache, and is @@ -67,10 +68,9 @@ class WebIDLGlobalNameHash { static bool ResolveForSystemGlobal(JSContext* aCx, JS::Handle aObj, JS::Handle aId, bool* aResolvedp); - static bool NewEnumerateSystemGlobal(JSContext* aCx, - JS::Handle aObj, - JS::MutableHandleVector aProperties, - bool aEnumerableOnly); + static bool NewEnumerateSystemGlobal( + JSContext* aCx, JS::Handle aObj, + JS::MutableHandleVector aProperties, bool aEnumerableOnly); private: friend struct WebIDLNameTableEntry; diff --git a/dom/gamepad/GamepadRemapping.cpp b/dom/gamepad/GamepadRemapping.cpp index a0d44f4c9e1d..606ca116cf88 100644 --- a/dom/gamepad/GamepadRemapping.cpp +++ b/dom/gamepad/GamepadRemapping.cpp @@ -77,46 +77,42 @@ void FetchDpadFromAxis(uint32_t aIndex, double dir) { } class DefaultRemapper final : public GamepadRemapper { - public: - virtual uint32_t GetAxisCount() const override { - return numAxes; - } + public: + virtual uint32_t GetAxisCount() const override { return numAxes; } - virtual uint32_t GetButtonCount() const override { - return numButtons; - } + virtual uint32_t GetButtonCount() const override { return numButtons; } - virtual void SetAxisCount(uint32_t aAxisCount) override { - numAxes = aAxisCount; - } + virtual void SetAxisCount(uint32_t aAxisCount) override { + numAxes = aAxisCount; + } - virtual void SetButtonCount(uint32_t aButtonCount) override { - numButtons = aButtonCount; - } + virtual void SetButtonCount(uint32_t aButtonCount) override { + numButtons = aButtonCount; + } - virtual void RemapAxisMoveEvent(uint32_t aIndex, uint32_t aAxis, + virtual void RemapAxisMoveEvent(uint32_t aIndex, uint32_t aAxis, double aValue) const override { - RefPtr service = - GamepadPlatformService::GetParentService(); - if (!service) { - return; - } - service->NewAxisMoveEvent(aIndex, aAxis, aValue); + RefPtr service = + GamepadPlatformService::GetParentService(); + if (!service) { + return; } + service->NewAxisMoveEvent(aIndex, aAxis, aValue); + } - virtual void RemapButtonEvent(uint32_t aIndex, uint32_t aButton, - bool aPressed) const override { - RefPtr service = - GamepadPlatformService::GetParentService(); - if (!service) { - return; - } - service->NewButtonEvent(aIndex, aButton, aPressed); + virtual void RemapButtonEvent(uint32_t aIndex, uint32_t aButton, + bool aPressed) const override { + RefPtr service = + GamepadPlatformService::GetParentService(); + if (!service) { + return; } + service->NewButtonEvent(aIndex, aButton, aPressed); + } - private: - uint32_t numAxes; - uint32_t numButtons; + private: + uint32_t numAxes; + uint32_t numButtons; }; class Dualshock4Remapper final : public GamepadRemapper { @@ -180,29 +176,26 @@ class Dualshock4Remapper final : public GamepadRemapper { return; } - const std::vector buttonMapping = { - BUTTON_INDEX_TERTIARY, - BUTTON_INDEX_PRIMARY, - BUTTON_INDEX_SECONDARY, - BUTTON_INDEX_QUATERNARY, - BUTTON_INDEX_LEFT_SHOULDER, - BUTTON_INDEX_RIGHT_SHOULDER, - BUTTON_INDEX_LEFT_TRIGGER, - BUTTON_INDEX_RIGHT_TRIGGER, - BUTTON_INDEX_BACK_SELECT, - BUTTON_INDEX_START, - BUTTON_INDEX_LEFT_THUMBSTICK, - BUTTON_INDEX_RIGHT_THUMBSTICK, - BUTTON_INDEX_META, - DUALSHOCK_BUTTON_TOUCHPAD - }; + const std::vector buttonMapping = {BUTTON_INDEX_TERTIARY, + BUTTON_INDEX_PRIMARY, + BUTTON_INDEX_SECONDARY, + BUTTON_INDEX_QUATERNARY, + BUTTON_INDEX_LEFT_SHOULDER, + BUTTON_INDEX_RIGHT_SHOULDER, + BUTTON_INDEX_LEFT_TRIGGER, + BUTTON_INDEX_RIGHT_TRIGGER, + BUTTON_INDEX_BACK_SELECT, + BUTTON_INDEX_START, + BUTTON_INDEX_LEFT_THUMBSTICK, + BUTTON_INDEX_RIGHT_THUMBSTICK, + BUTTON_INDEX_META, + DUALSHOCK_BUTTON_TOUCHPAD}; if (buttonMapping.size() <= aIndex) { - NS_WARNING( - nsPrintfCString( - "Button idx '%d' doesn't support in Dualshock4Remapper().", - aButton) - .get()); + NS_WARNING(nsPrintfCString( + "Button idx '%d' doesn't support in Dualshock4Remapper().", + aButton) + .get()); return; } @@ -216,13 +209,12 @@ class Dualshock4Remapper final : public GamepadRemapper { }; }; -already_AddRefed GetGamepadRemapper(const uint16_t aVendorId, - const uint16_t aProductId) { +already_AddRefed GetGamepadRemapper( + const uint16_t aVendorId, const uint16_t aProductId) { const std::vector remappingRules = { {GamepadId::kSonyDualshock4, new Dualshock4Remapper()}, {GamepadId::kSonyDualshock4Slim, new Dualshock4Remapper()}, - {GamepadId::kSonyDualshock4USBReceiver, new Dualshock4Remapper()} - }; + {GamepadId::kSonyDualshock4USBReceiver, new Dualshock4Remapper()}}; const GamepadId id = static_cast((aVendorId << 16) | aProductId); for (uint32_t i = 0; i < remappingRules.size(); ++i) { diff --git a/dom/gamepad/GamepadRemapping.h b/dom/gamepad/GamepadRemapping.h index 94a4d95a01d4..681124e6a341 100644 --- a/dom/gamepad/GamepadRemapping.h +++ b/dom/gamepad/GamepadRemapping.h @@ -32,7 +32,7 @@ class GamepadRemapper { double aValue) const = 0; virtual void RemapButtonEvent(uint32_t aIndex, uint32_t aButton, bool aPressed) const = 0; - + protected: GamepadRemapper() = default; virtual ~GamepadRemapper() = default; diff --git a/dom/gamepad/windows/WindowsGamepad.cpp b/dom/gamepad/windows/WindowsGamepad.cpp index 2be47e18a069..23e1dc33ae2d 100644 --- a/dom/gamepad/windows/WindowsGamepad.cpp +++ b/dom/gamepad/windows/WindowsGamepad.cpp @@ -135,10 +135,7 @@ class Gamepad { bool present; Gamepad(uint32_t aNumAxes, uint32_t aNumButtons, GamepadType aType) - : type(aType), - numAxes(aNumAxes), - numButtons(aNumButtons), - present(true) { + : type(aType), numAxes(aNumAxes), numButtons(aNumButtons), present(true) { buttons.SetLength(numButtons); axes.SetLength(numAxes); } @@ -431,7 +428,8 @@ bool WindowsGamepadService::ScanForXInputDevices() { } // Not already present, add it. - Gamepad gamepad(kStandardGamepadAxes, kStandardGamepadButtons, kXInputGamepad); + Gamepad gamepad(kStandardGamepadAxes, kStandardGamepadButtons, + kXInputGamepad); gamepad.userIndex = i; gamepad.state = state; gamepad.id = service->AddGamepad( @@ -688,7 +686,8 @@ bool WindowsGamepadService::GetRawGamepad(HANDLE handle) { size_t numAxes = 0; nsTArray axes(kAxesLengthCap); - // We store these value caps and handle the dpad info in GamepadRemapper later. + // We store these value caps and handle the dpad info in GamepadRemapper + // later. axes.SetLength(kAxesLengthCap); // Looking for the exisiting ramapping rule. @@ -697,7 +696,8 @@ bool WindowsGamepadService::GetRawGamepad(HANDLE handle) { MOZ_ASSERT(remapper); for (size_t i = 0; i < count; i++) { - const size_t axisIndex = axisCaps[i].Range.UsageMin - kAxisMinimumUsageNumber; + const size_t axisIndex = + axisCaps[i].Range.UsageMin - kAxisMinimumUsageNumber; if (axisIndex < kAxesLengthCap && !axes[axisIndex].active) { axes[axisIndex].caps = axisCaps[i]; axes[axisIndex].active = true; @@ -717,10 +717,9 @@ bool WindowsGamepadService::GetRawGamepad(HANDLE handle) { } gamepad.remapper = remapper.forget(); - gamepad.id = - service->AddGamepad(gamepad_id, gamepad.remapper->GetMappingType(), - GamepadHand::_empty, gamepad.remapper->GetButtonCount(), - gamepad.remapper->GetAxisCount(), 0); + gamepad.id = service->AddGamepad( + gamepad_id, gamepad.remapper->GetMappingType(), GamepadHand::_empty, + gamepad.remapper->GetButtonCount(), gamepad.remapper->GetAxisCount(), 0); mGamepads.AppendElement(gamepad); return true; } diff --git a/dom/html/HTMLFormElement.cpp b/dom/html/HTMLFormElement.cpp index 3c2306391fe3..10c4de2cf47c 100644 --- a/dom/html/HTMLFormElement.cpp +++ b/dom/html/HTMLFormElement.cpp @@ -1622,8 +1622,7 @@ bool HTMLFormElement::IsLastActiveElement( for (auto* element : Reversed(mControls->mElements)) { // XXX How about date/time control? - if (element->IsTextOrNumberControl(false) && - !element->IsDisabled()) { + if (element->IsTextOrNumberControl(false) && !element->IsDisabled()) { return element == aControl; } } diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index 8f15d7ee8c0b..159c8e6fcf37 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -1463,7 +1463,8 @@ void TabChild::ProcessPendingCoalescedMouseDataAndDispatchEvents() { } } -LayoutDeviceToLayoutDeviceMatrix4x4 TabChild::GetChildToParentConversionMatrix() const { +LayoutDeviceToLayoutDeviceMatrix4x4 TabChild::GetChildToParentConversionMatrix() + const { if (mChildToParentConversionMatrix) { return *mChildToParentConversionMatrix; } diff --git a/dom/ipc/TabChild.h b/dom/ipc/TabChild.h index 7de7cb1cb7db..20ffa8639f64 100644 --- a/dom/ipc/TabChild.h +++ b/dom/ipc/TabChild.h @@ -642,7 +642,8 @@ class TabChild final : public TabChildBase, // The transform from the coordinate space of this TabChild to the coordinate // space of the native window its TabParent is in. - mozilla::LayoutDeviceToLayoutDeviceMatrix4x4 GetChildToParentConversionMatrix() const; + mozilla::LayoutDeviceToLayoutDeviceMatrix4x4 + GetChildToParentConversionMatrix() const; // Prepare to dispatch all coalesced mousemove events. We'll move all data // in mCoalescedMouseData to a nsDeque; then we start processing them. We diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index 267bd4ad85a8..4c802d4cebb4 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -1041,7 +1041,8 @@ IPCResult TabParent::RecvPBrowserBridgeConstructor( const nsString& aRemoteType, BrowsingContext* aBrowsingContext, const uint32_t& aChromeFlags) { static_cast(aActor)->Init( - aName, aRemoteType, CanonicalBrowsingContext::Cast(aBrowsingContext), aChromeFlags); + aName, aRemoteType, CanonicalBrowsingContext::Cast(aBrowsingContext), + aChromeFlags); return IPC_OK(); } @@ -1360,9 +1361,10 @@ class SynthesizedEventObserver : public nsIObserver { if (mTabParent->IsDestroyed()) { // If this happens it's probably a bug in the test that's triggering this. - NS_WARNING("TabParent was unexpectedly destroyed during event synthesization!"); + NS_WARNING( + "TabParent was unexpectedly destroyed during event synthesization!"); } else if (!mTabParent->SendNativeSynthesisResponse(mObserverId, - nsCString(aTopic))) { + nsCString(aTopic))) { NS_WARNING("Unable to send native event synthesization response!"); } // Null out tabparent to indicate we already sent the response diff --git a/dom/media/ipc/RDDProcessHost.h b/dom/media/ipc/RDDProcessHost.h index 8340054b02f4..9f6bb0128de6 100644 --- a/dom/media/ipc/RDDProcessHost.h +++ b/dom/media/ipc/RDDProcessHost.h @@ -17,7 +17,7 @@ namespace mozilla { namespace ipc { class SharedPreferenceSerializer; } -} +} // namespace mozilla class nsITimer; namespace mozilla { diff --git a/dom/media/webaudio/AudioContext.h b/dom/media/webaudio/AudioContext.h index e55c3980004b..06808c569254 100644 --- a/dom/media/webaudio/AudioContext.h +++ b/dom/media/webaudio/AudioContext.h @@ -249,8 +249,8 @@ class AudioContext final : public DOMEventTargetHelper, already_AddRefed CreateMediaStreamSource( DOMMediaStream& aMediaStream, ErrorResult& aRv); already_AddRefed - CreateMediaStreamTrackSource(MediaStreamTrack& aMediaStreamTrack, - ErrorResult& aRv); + CreateMediaStreamTrackSource(MediaStreamTrack& aMediaStreamTrack, + ErrorResult& aRv); already_AddRefed CreateDelay(double aMaxDelayTime, ErrorResult& aRv); diff --git a/dom/svg/SVGAnimatedIntegerPair.h b/dom/svg/SVGAnimatedIntegerPair.h index 30e9670ff9da..be048f8111f4 100644 --- a/dom/svg/SVGAnimatedIntegerPair.h +++ b/dom/svg/SVGAnimatedIntegerPair.h @@ -79,7 +79,7 @@ class SVGAnimatedIntegerPair { virtual ~DOMAnimatedInteger(); SVGAnimatedIntegerPair* mVal; // kept alive because it belongs to content - PairIndex mIndex; // are we the first or second integer + PairIndex mIndex; // are we the first or second integer virtual int32_t BaseVal() override { return mVal->GetBaseValue(mIndex); } virtual void SetBaseVal(int32_t aValue) override { diff --git a/dom/svg/SVGAnimatedNumberPair.h b/dom/svg/SVGAnimatedNumberPair.h index 24f1bf425ed4..54a284dad0cf 100644 --- a/dom/svg/SVGAnimatedNumberPair.h +++ b/dom/svg/SVGAnimatedNumberPair.h @@ -82,7 +82,7 @@ class SVGAnimatedNumberPair { virtual ~DOMAnimatedNumber(); SVGAnimatedNumberPair* mVal; // kept alive because it belongs to content - PairIndex mIndex; // are we the first or second number + PairIndex mIndex; // are we the first or second number virtual float BaseVal() override { return mVal->GetBaseValue(mIndex); } virtual void SetBaseVal(float aValue) override { diff --git a/editor/libeditor/HTMLAbsPositionEditor.cpp b/editor/libeditor/HTMLAbsPositionEditor.cpp index dfbf44a5f879..a2e9f60a70a1 100644 --- a/editor/libeditor/HTMLAbsPositionEditor.cpp +++ b/editor/libeditor/HTMLAbsPositionEditor.cpp @@ -624,8 +624,7 @@ nsresult HTMLEditor::GetTemporaryStyleForFocusedPositionedElement( const uint8_t kBlackBgTrigger = 0xd0; const auto& color = style->StyleColor()->mColor; - if (color.red >= kBlackBgTrigger && - color.green >= kBlackBgTrigger && + if (color.red >= kBlackBgTrigger && color.green >= kBlackBgTrigger && color.blue >= kBlackBgTrigger) { aReturn.AssignLiteral("black"); } else { diff --git a/editor/libeditor/HTMLEditRules.cpp b/editor/libeditor/HTMLEditRules.cpp index 219599087370..f43af24f08bd 100644 --- a/editor/libeditor/HTMLEditRules.cpp +++ b/editor/libeditor/HTMLEditRules.cpp @@ -341,7 +341,8 @@ nsresult HTMLEditRules::BeforeEdit(EditSubAction aEditSubAction, if (HTMLEditorRef().GetCompositionStartPoint().IsSet()) { // If there is composition string, let's remember current composition // range. - mRangeItem->StoreRange(HTMLEditorRef().GetCompositionStartPoint(), HTMLEditorRef().GetCompositionEndPoint()); + mRangeItem->StoreRange(HTMLEditorRef().GetCompositionStartPoint(), + HTMLEditorRef().GetCompositionEndPoint()); } else { // Get the selection location if (!SelectionRefPtr()->RangeCount()) { diff --git a/editor/libeditor/SelectionState.h b/editor/libeditor/SelectionState.h index 443f85c480b8..52a365ca97fe 100644 --- a/editor/libeditor/SelectionState.h +++ b/editor/libeditor/SelectionState.h @@ -34,7 +34,8 @@ struct RangeItem final { public: void StoreRange(nsRange* aRange); - void StoreRange(const EditorRawDOMPoint& aStartPoint, const EditorRawDOMPoint& aEndPoint) { + void StoreRange(const EditorRawDOMPoint& aStartPoint, + const EditorRawDOMPoint& aEndPoint) { MOZ_ASSERT(aStartPoint.IsSet()); MOZ_ASSERT(aEndPoint.IsSet()); mStartContainer = aStartPoint.GetContainer(); diff --git a/editor/libeditor/WSRunObject.cpp b/editor/libeditor/WSRunObject.cpp index b449f634f16e..a208c3132c78 100644 --- a/editor/libeditor/WSRunObject.cpp +++ b/editor/libeditor/WSRunObject.cpp @@ -247,9 +247,9 @@ already_AddRefed WSRunObject::InsertBreak( return newBrElement.forget(); } -nsresult WSRunObject::InsertText( - Document& aDocument, const nsAString& aStringToInsert, - EditorRawDOMPoint* aPointAfterInsertedString) +nsresult WSRunObject::InsertText(Document& aDocument, + const nsAString& aStringToInsert, + EditorRawDOMPoint* aPointAfterInsertedString) MOZ_CAN_RUN_SCRIPT_FOR_DEFINITION { // MOOSE: for now, we always assume non-PRE formatting. Fix this later. // meanwhile, the pre case is handled in WillInsertText in diff --git a/extensions/universalchardet/src/base/nsUniversalDetector.cpp b/extensions/universalchardet/src/base/nsUniversalDetector.cpp index 9ff46fa1dff2..263cc5739c21 100644 --- a/extensions/universalchardet/src/base/nsUniversalDetector.cpp +++ b/extensions/universalchardet/src/base/nsUniversalDetector.cpp @@ -45,7 +45,7 @@ void nsUniversalDetector::Reset() { } if (mEscCharSetProber) { - mEscCharSetProber->Reset(); + mEscCharSetProber->Reset(); } } @@ -136,12 +136,12 @@ nsresult nsUniversalDetector::HandleData(const char* aBuf, uint32_t aLen) { } break; case eHighbyte: - st = mMultibyteProber->HandleData(aBuf, aLen); - if (st == eFoundIt) { - mDone = true; - mDetectedCharset = mMultibyteProber->GetCharSetName(); - return NS_OK; - } + st = mMultibyteProber->HandleData(aBuf, aLen); + if (st == eFoundIt) { + mDone = true; + mDetectedCharset = mMultibyteProber->GetCharSetName(); + return NS_OK; + } break; default: // pure ascii diff --git a/gfx/gl/GLContextProviderEGL.cpp b/gfx/gl/GLContextProviderEGL.cpp index 27e72be63378..0ee98f3fce58 100644 --- a/gfx/gl/GLContextProviderEGL.cpp +++ b/gfx/gl/GLContextProviderEGL.cpp @@ -480,8 +480,7 @@ bool GLContextEGL::RenewSurface(CompositorWidget* aWidget) { const bool ok = MakeCurrent(true); MOZ_ASSERT(ok); #if defined(MOZ_WAYLAND) - if (mSurface && - !GDK_IS_X11_DISPLAY(gdk_display_get_default())) { + if (mSurface && !GDK_IS_X11_DISPLAY(gdk_display_get_default())) { const auto* egl = gl::GLLibraryEGL::Get(); // Make eglSwapBuffers() non-blocking on wayland egl->fSwapInterval(EGL_DISPLAY(), 0); diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index a3935cbb5eab..4c078ad99337 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -3144,7 +3144,7 @@ bool AsyncPanZoomController::AttemptScroll( #endif bool displacementIsUserVisible = true; - { // Release the APZC lock before calling ToScreenCoordinates which + { // Release the APZC lock before calling ToScreenCoordinates which // acquires the APZ tree lock. Note that this just unlocks the mutex // once, so if we're locking it multiple times on the callstack then // this will be insufficient. @@ -3359,7 +3359,7 @@ void AsyncPanZoomController::HandleFlingOverscroll( ParentLayerPoint residualVelocity = treeManagerLocal->DispatchFling(this, handoffState); FLING_LOG("APZC %p left with residual velocity %s\n", this, - Stringify(residualVelocity).c_str()); + Stringify(residualVelocity).c_str()); if (!IsZero(residualVelocity) && IsPannable() && gfxPrefs::APZOverscrollEnabled()) { // Obey overscroll-behavior. @@ -4820,8 +4820,8 @@ void AsyncPanZoomController::ZoomToRect(CSSRect aRect, const uint32_t aFlags) { std::max(mZoomConstraints.mMinZoom.scale, std::max(compositionBounds.Width() / cssPageRect.Width(), compositionBounds.Height() / cssPageRect.Height()))); - CSSToParentLayerScale localMaxZoom - = std::max(localMinZoom, mZoomConstraints.mMaxZoom); + CSSToParentLayerScale localMaxZoom = + std::max(localMinZoom, mZoomConstraints.mMaxZoom); if (!aRect.IsEmpty()) { // Intersect the zoom-to-rect to the CSS rect to make sure it fits. diff --git a/gfx/layers/apz/src/Axis.cpp b/gfx/layers/apz/src/Axis.cpp index 55095f55ac9e..75bd6a283dc5 100644 --- a/gfx/layers/apz/src/Axis.cpp +++ b/gfx/layers/apz/src/Axis.cpp @@ -66,12 +66,12 @@ void Axis::UpdateWithTouchAtDevicePoint(ParentLayerCoord aPos, mPos = aPos; AXIS_LOG("%p|%s got position %f\n", mAsyncPanZoomController, Name(), - mPos.value); + mPos.value); if (Maybe newVelocity = mVelocityTracker->AddPosition(aPos, aTimestampMs)) { mVelocity = mAxisLocked ? 0 : *newVelocity; AXIS_LOG("%p|%s velocity from tracker is %f\n", mAsyncPanZoomController, - Name(), mVelocity); + Name(), mVelocity); } } diff --git a/gfx/layers/apz/src/GenericFlingAnimation.h b/gfx/layers/apz/src/GenericFlingAnimation.h index 19362d492c89..52beb8e5cecb 100644 --- a/gfx/layers/apz/src/GenericFlingAnimation.h +++ b/gfx/layers/apz/src/GenericFlingAnimation.h @@ -97,14 +97,16 @@ class GenericFlingAnimation : public AsyncPanZoomAnimation, (now - mApzc.mLastFlingTime).ToMilliseconds() < gfxPrefs::APZFlingAccelInterval() && velocity.Length() >= gfxPrefs::APZFlingAccelMinVelocity()) { - if (velocity.x != 0 && SameDirection(velocity.x, mApzc.mLastFlingVelocity.x)) { + if (velocity.x != 0 && + SameDirection(velocity.x, mApzc.mLastFlingVelocity.x)) { velocity.x = Accelerate(velocity.x, mApzc.mLastFlingVelocity.x); FLING_LOG("%p Applying fling x-acceleration from %f to %f (delta %f)\n", &mApzc, mApzc.mX.GetVelocity(), velocity.x, mApzc.mLastFlingVelocity.x); mApzc.mX.SetVelocity(velocity.x); } - if (velocity.y != 0 && SameDirection(velocity.y, mApzc.mLastFlingVelocity.y)) { + if (velocity.y != 0 && + SameDirection(velocity.y, mApzc.mLastFlingVelocity.y)) { velocity.y = Accelerate(velocity.y, mApzc.mLastFlingVelocity.y); FLING_LOG("%p Applying fling y-acceleration from %f to %f (delta %f)\n", &mApzc, mApzc.mY.GetVelocity(), velocity.y, diff --git a/gfx/layers/client/ClientTiledPaintedLayer.cpp b/gfx/layers/client/ClientTiledPaintedLayer.cpp index e463e98a2d3e..f7e389ca457f 100644 --- a/gfx/layers/client/ClientTiledPaintedLayer.cpp +++ b/gfx/layers/client/ClientTiledPaintedLayer.cpp @@ -69,7 +69,6 @@ static Maybe ApplyParentLayerToLayerTransform( static LayerToParentLayerMatrix4x4 GetTransformToAncestorsParentLayer( Layer* aStart, const LayerMetricsWrapper& aAncestor) { - // If the ancestor layer Combines3DTransformWithAncestors, then the // scroll offset is contained in the transform of the layer at the // root of the 3D context. So we must first find that layer, then diff --git a/gfx/layers/wr/WebRenderCommandBuilder.cpp b/gfx/layers/wr/WebRenderCommandBuilder.cpp index d59f3248fd4f..75cebafc8af9 100644 --- a/gfx/layers/wr/WebRenderCommandBuilder.cpp +++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp @@ -1134,8 +1134,8 @@ static bool IsItemProbablyActive(nsDisplayItem* aItem, /* BLEND_MODE needs to be active if it might have a previous sibling * that is active. We use the activeness of the parent as a rough * proxy for this situation. */ - return aParentActive || HasActiveChildren(*aItem->GetChildren(), - aDisplayListBuilder); + return aParentActive || + HasActiveChildren(*aItem->GetChildren(), aDisplayListBuilder); } case DisplayItemType::TYPE_WRAP_LIST: case DisplayItemType::TYPE_PERSPECTIVE: { diff --git a/gfx/src/nsFont.h b/gfx/src/nsFont.h index c69f2478a0f6..90ca6bdc8bc6 100644 --- a/gfx/src/nsFont.h +++ b/gfx/src/nsFont.h @@ -14,10 +14,10 @@ #include "gfxFontFeatures.h" #include "gfxFontVariations.h" #include "mozilla/FontPropertyTypes.h" -#include "mozilla/RefPtr.h" // for RefPtr -#include "mozilla/StyleColorInlines.h" // for StyleRGBA -#include "nsCoord.h" // for nscoord -#include "nsTArray.h" // for nsTArray +#include "mozilla/RefPtr.h" // for RefPtr +#include "mozilla/StyleColorInlines.h" // for StyleRGBA +#include "nsCoord.h" // for nscoord +#include "nsTArray.h" // for nsTArray struct gfxFontStyle; diff --git a/gfx/thebes/gfxFontFamilyList.h b/gfx/thebes/gfxFontFamilyList.h index ec395af4eae1..93791bf4136e 100644 --- a/gfx/thebes/gfxFontFamilyList.h +++ b/gfx/thebes/gfxFontFamilyList.h @@ -49,9 +49,7 @@ struct FontFamilyName final { bool IsGeneric() const { return !IsNamed(); } - bool IsQuoted() const { - return mSyntax == StyleFontFamilyNameSyntax::Quoted; - } + bool IsQuoted() const { return mSyntax == StyleFontFamilyNameSyntax::Quoted; } void AppendToString(nsACString& aFamilyList, bool aQuotes = true) const { if (IsNamed()) { diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp index 34717634956a..d67d020d1e97 100644 --- a/gfx/thebes/gfxPlatformGtk.cpp +++ b/gfx/thebes/gfxPlatformGtk.cpp @@ -329,9 +329,7 @@ uint32_t gfxPlatformGtk::MaxGenericSubstitions() { return uint32_t(mMaxGenericSubstitutions); } -bool gfxPlatformGtk::AccelerateLayersByDefault() { - return true; -} +bool gfxPlatformGtk::AccelerateLayersByDefault() { return true; } void gfxPlatformGtk::GetPlatformCMSOutputProfile(void*& mem, size_t& size) { mem = nullptr; diff --git a/gfx/thebes/gfxTextRun.cpp b/gfx/thebes/gfxTextRun.cpp index c11450eed49e..916afc22fd8b 100644 --- a/gfx/thebes/gfxTextRun.cpp +++ b/gfx/thebes/gfxTextRun.cpp @@ -1756,9 +1756,8 @@ void gfxFontGroup::AddPlatformFont(const nsACString& aName, bool aQuotedName, // Not known in the user font set ==> check system fonts gfxPlatformFontList::PlatformFontList()->FindAndAddFamilies( aName, &aFamilyList, - aQuotedName - ? gfxPlatformFontList::FindFamiliesFlags::eQuotedFamilyName - : gfxPlatformFontList::FindFamiliesFlags(0), + aQuotedName ? gfxPlatformFontList::FindFamiliesFlags::eQuotedFamilyName + : gfxPlatformFontList::FindFamiliesFlags(0), &mStyle, mDevToCssSize); } diff --git a/gfx/thebes/gfxTextRun.h b/gfx/thebes/gfxTextRun.h index 00e5e4182817..c2bf67b919ea 100644 --- a/gfx/thebes/gfxTextRun.h +++ b/gfx/thebes/gfxTextRun.h @@ -1256,8 +1256,7 @@ class gfxFontGroup final : public gfxTextRunFactory { // helper methods for looking up fonts // lookup and add a font with a given name (i.e. *not* a generic!) - void AddPlatformFont(const nsACString& aName, - bool aQuotedName, + void AddPlatformFont(const nsACString& aName, bool aQuotedName, nsTArray& aFamilyList); // do style selection and add entries to list diff --git a/gfx/vr/VRDisplayHost.h b/gfx/vr/VRDisplayHost.h index 85f6898f6922..b9340ca8c7a3 100644 --- a/gfx/vr/VRDisplayHost.h +++ b/gfx/vr/VRDisplayHost.h @@ -60,7 +60,6 @@ class VRDisplayHost { bool GetIsConnected(); void ShutdownSubmitThread(); - class AutoRestoreRenderState { public: explicit AutoRestoreRenderState(VRDisplayHost* aDisplay); diff --git a/gfx/vr/ipc/VRGPUChild.cpp b/gfx/vr/ipc/VRGPUChild.cpp index d3a4dac8bb2b..f8dd55653a03 100644 --- a/gfx/vr/ipc/VRGPUChild.cpp +++ b/gfx/vr/ipc/VRGPUChild.cpp @@ -53,9 +53,8 @@ void VRGPUChild::Shutdown() { void VRGPUChild::ActorDestroy(ActorDestroyReason aWhy) { VRManager* vm = VRManager::Get(); - CompositorThreadHolder::Loop()->PostTask(NewRunnableMethod( - "VRGPUChild::ActorDestroy", - vm, &VRManager::Shutdown)); + CompositorThreadHolder::Loop()->PostTask( + NewRunnableMethod("VRGPUChild::ActorDestroy", vm, &VRManager::Shutdown)); mClosed = true; } diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp index c3d0fcd0063f..ad268b77f578 100644 --- a/ipc/glue/GeckoChildProcessHost.cpp +++ b/ipc/glue/GeckoChildProcessHost.cpp @@ -183,8 +183,8 @@ void GeckoChildProcessHost::Destroy() { } // static -mozilla::BinPathType GeckoChildProcessHost::GetPathToBinary(FilePath& exePath, - GeckoProcessType processType) { +mozilla::BinPathType GeckoChildProcessHost::GetPathToBinary( + FilePath& exePath, GeckoProcessType processType) { BinPathType pathType = XRE_GetChildProcBinPathType(processType); if (pathType == BinPathType::Self) { diff --git a/ipc/glue/ProcessUtils_common.cpp b/ipc/glue/ProcessUtils_common.cpp index bba91288194c..052a30c03f19 100644 --- a/ipc/glue/ProcessUtils_common.cpp +++ b/ipc/glue/ProcessUtils_common.cpp @@ -70,8 +70,7 @@ void SharedPreferenceSerializer::AddSharedPrefCmdLineArgs( aExtraOpts.push_back("-prefsHandle"); aExtraOpts.push_back(formatPtrArg(prefsHandle).get()); aExtraOpts.push_back("-prefMapHandle"); - aExtraOpts.push_back( - formatPtrArg(GetPrefMapHandle().get()).get()); + aExtraOpts.push_back(formatPtrArg(GetPrefMapHandle().get()).get()); #else // In contrast, Unix fds are per-process. So remap the fd to a fixed one that // will be used in the child. @@ -91,7 +90,6 @@ void SharedPreferenceSerializer::AddSharedPrefCmdLineArgs( aExtraOpts.push_back(formatPtrArg(GetPrefMapSize()).get()); } - #ifdef ANDROID static int gPrefsFd = -1; static int gPrefMapFd = -1; diff --git a/js/ipc/WrapperOwner.cpp b/js/ipc/WrapperOwner.cpp index a64e66188a12..cbd8c0a99bb4 100644 --- a/js/ipc/WrapperOwner.cpp +++ b/js/ipc/WrapperOwner.cpp @@ -111,8 +111,9 @@ class CPOWProxyHandler : public BaseProxyHandler { virtual bool hasOwn(JSContext* cx, HandleObject proxy, HandleId id, bool* bp) const override; - virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, HandleObject proxy, - MutableHandleIdVector props) const override; + virtual bool getOwnEnumerablePropertyKeys( + JSContext* cx, HandleObject proxy, + MutableHandleIdVector props) const override; virtual bool hasInstance(JSContext* cx, HandleObject proxy, MutableHandleValue v, bool* bp) const override; virtual bool getBuiltinClass(JSContext* cx, HandleObject obj, @@ -516,9 +517,8 @@ bool WrapperOwner::set(JSContext* cx, JS::HandleObject proxy, JS::HandleId id, return ok(cx, status, result); } -bool CPOWProxyHandler::getOwnEnumerablePropertyKeys(JSContext* cx, - HandleObject proxy, - MutableHandleIdVector props) const { +bool CPOWProxyHandler::getOwnEnumerablePropertyKeys( + JSContext* cx, HandleObject proxy, MutableHandleIdVector props) const { FORWARD(getOwnEnumerablePropertyKeys, (cx, proxy, props), false); } @@ -889,7 +889,8 @@ void WrapperOwner::updatePointer(JSObject* obj, const JSObject* old) { } bool WrapperOwner::getPropertyKeys(JSContext* cx, HandleObject proxy, - uint32_t flags, MutableHandleIdVector props) { + uint32_t flags, + MutableHandleIdVector props) { ObjectId objId = idOf(proxy); ReturnStatus status; diff --git a/js/public/Wrapper.h b/js/public/Wrapper.h index f9f6f01f4cc3..d8457d3d9287 100644 --- a/js/public/Wrapper.h +++ b/js/public/Wrapper.h @@ -86,8 +86,9 @@ class JS_FRIEND_API ForwardingProxyHandler : public BaseProxyHandler { /* SpiderMonkey extensions. */ virtual bool hasOwn(JSContext* cx, HandleObject proxy, HandleId id, bool* bp) const override; - virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, HandleObject proxy, - MutableHandleIdVector props) const override; + virtual bool getOwnEnumerablePropertyKeys( + JSContext* cx, HandleObject proxy, + MutableHandleIdVector props) const override; virtual bool nativeCall(JSContext* cx, IsAcceptableThis test, NativeImpl impl, const CallArgs& args) const override; virtual bool hasInstance(JSContext* cx, HandleObject proxy, @@ -226,8 +227,9 @@ class JS_FRIEND_API CrossCompartmentWrapper : public Wrapper { /* SpiderMonkey extensions. */ virtual bool hasOwn(JSContext* cx, HandleObject wrapper, HandleId id, bool* bp) const override; - virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, HandleObject wrapper, - MutableHandleIdVector props) const override; + virtual bool getOwnEnumerablePropertyKeys( + JSContext* cx, HandleObject wrapper, + MutableHandleIdVector props) const override; virtual bool nativeCall(JSContext* cx, IsAcceptableThis test, NativeImpl impl, const CallArgs& args) const override; virtual bool hasInstance(JSContext* cx, HandleObject wrapper, @@ -296,8 +298,9 @@ class JS_FRIEND_API OpaqueCrossCompartmentWrapper /* SpiderMonkey extensions. */ virtual bool hasOwn(JSContext* cx, HandleObject wrapper, HandleId id, bool* bp) const override; - virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, HandleObject wrapper, - MutableHandleIdVector props) const override; + virtual bool getOwnEnumerablePropertyKeys( + JSContext* cx, HandleObject wrapper, + MutableHandleIdVector props) const override; virtual bool getBuiltinClass(JSContext* cx, HandleObject wrapper, ESClass* cls) const override; virtual bool isArray(JSContext* cx, HandleObject obj, diff --git a/js/src/builtin/Stream.cpp b/js/src/builtin/Stream.cpp index 63d56a94e10a..299f4748512a 100644 --- a/js/src/builtin/Stream.cpp +++ b/js/src/builtin/Stream.cpp @@ -3058,7 +3058,8 @@ static MOZ_MUST_USE bool ReadableStreamDefaultControllerEnqueue( if (!success) { RootedValue exn(cx); RootedSavedFrame stack(cx); - if (!cx->isExceptionPending() || !GetAndClearExceptionAndStack(cx, &exn, &stack)) { + if (!cx->isExceptionPending() || + !GetAndClearExceptionAndStack(cx, &exn, &stack)) { // Uncatchable error. Die immediately without erroring the // stream. return false; @@ -3882,7 +3883,8 @@ static MOZ_MUST_USE bool ReadableByteStreamControllerClose( JSMSG_READABLEBYTESTREAMCONTROLLER_CLOSE_PENDING_PULL); RootedValue e(cx); RootedSavedFrame stack(cx); - if (!cx->isExceptionPending() || !GetAndClearExceptionAndStack(cx, &e, &stack)) { + if (!cx->isExceptionPending() || + !GetAndClearExceptionAndStack(cx, &e, &stack)) { // Uncatchable error. Die immediately without erroring the // stream. return false; diff --git a/js/src/builtin/TypedObject.cpp b/js/src/builtin/TypedObject.cpp index 2a13b34058ba..c8040dae4736 100644 --- a/js/src/builtin/TypedObject.cpp +++ b/js/src/builtin/TypedObject.cpp @@ -838,8 +838,8 @@ JSObject* StructMetaTypeDescr::create(JSContext* cx, HandleObject metaTypeDescr, /* static */ StructTypeDescr* StructMetaTypeDescr::createFromArrays( JSContext* cx, HandleObject structTypePrototype, bool opaque, - bool allowConstruct, HandleIdVector ids, JS::HandleValueVector fieldTypeObjs, - Vector& fieldProps) { + bool allowConstruct, HandleIdVector ids, + JS::HandleValueVector fieldTypeObjs, Vector& fieldProps) { StringBuffer stringBuffer(cx); // Canonical string repr RootedValueVector fieldNames(cx); // Name of each field. RootedValueVector fieldOffsets(cx); // Offset of each field field. diff --git a/js/src/frontend/TokenStream.h b/js/src/frontend/TokenStream.h index fde1b909f1d0..d87eab7bbe6b 100644 --- a/js/src/frontend/TokenStream.h +++ b/js/src/frontend/TokenStream.h @@ -638,8 +638,8 @@ class TokenStreamAnyChars : public TokenStreamShared { // // The first program shows why orExpr() has use SlashIsDiv mode when peeking // ahead for the next operator after parsing `q`. The second program shows - // why matchOrInsertSemicolon() must use SlashIsRegExp mode when scanning ahead - // for a semicolon. + // why matchOrInsertSemicolon() must use SlashIsRegExp mode when scanning + // ahead for a semicolon. void allowGettingNextTokenWithSlashIsRegExp() { #ifdef DEBUG // Check the precondition: Caller already peeked ahead at the next token, diff --git a/js/src/gc/GCRuntime.h b/js/src/gc/GCRuntime.h index 0811336803b2..b2b8d894d5c7 100644 --- a/js/src/gc/GCRuntime.h +++ b/js/src/gc/GCRuntime.h @@ -310,9 +310,7 @@ class GCRuntime { bool isForegroundSweeping() const { return state() == State::Sweep; } bool isBackgroundSweeping() { return sweepTask.isRunning(); } void waitBackgroundSweepEnd(); - void waitBackgroundAllocEnd() { - allocTask.cancelAndWait(); - } + void waitBackgroundAllocEnd() { allocTask.cancelAndWait(); } void waitBackgroundFreeEnd(); void lockGC() { lock.lock(); } diff --git a/js/src/jit/BaselineIC.h b/js/src/jit/BaselineIC.h index 21e185646ef4..e065c3dab9c3 100644 --- a/js/src/jit/BaselineIC.h +++ b/js/src/jit/BaselineIC.h @@ -225,12 +225,12 @@ class ICEntry { uint32_t pcOffset_; #ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED -#ifdef JS_64BIT +# ifdef JS_64BIT // On 64-bit architectures, we have 32 bits of alignment padding. // We fill it with a magic value, and check that value when tracing. static const uint32_t EXPECTED_TRACE_MAGIC = 0xdeaddead; uint32_t traceMagic_ = EXPECTED_TRACE_MAGIC; -#endif +# endif #endif public: diff --git a/js/src/jit/CacheIR.cpp b/js/src/jit/CacheIR.cpp index 3d2f80c43687..8d4ba572ce6e 100644 --- a/js/src/jit/CacheIR.cpp +++ b/js/src/jit/CacheIR.cpp @@ -4723,11 +4723,13 @@ AttachDecision CallIRGenerator::tryAttachStringSplit() { js::intrinsic_StringSplitString); // Ensure arg0 is a string. - ValOperandId arg0ValId = writer.loadArgumentFixedSlot(ArgumentKind::Arg0, argc_); + ValOperandId arg0ValId = + writer.loadArgumentFixedSlot(ArgumentKind::Arg0, argc_); StringOperandId arg0StrId = writer.guardIsString(arg0ValId); // Ensure arg1 is a string. - ValOperandId arg1ValId = writer.loadArgumentFixedSlot(ArgumentKind::Arg1, argc_); + ValOperandId arg1ValId = + writer.loadArgumentFixedSlot(ArgumentKind::Arg1, argc_); StringOperandId arg1StrId = writer.guardIsString(arg1ValId); // Call custom string splitter VM-function. @@ -4794,7 +4796,8 @@ AttachDecision CallIRGenerator::tryAttachArrayPush() { writer.guardSpecificNativeFunction(calleeObjId, js::array_push); // Guard this is an array object. - ValOperandId thisValId = writer.loadArgumentFixedSlot(ArgumentKind::This, argc_); + ValOperandId thisValId = + writer.loadArgumentFixedSlot(ArgumentKind::This, argc_); ObjOperandId thisObjId = writer.guardIsObject(thisValId); // This is a soft assert, documenting the fact that we pass 'true' diff --git a/js/src/jsapi-tests/testFreshGlobalEvalRedefinition.cpp b/js/src/jsapi-tests/testFreshGlobalEvalRedefinition.cpp index b569de6a8eb8..04b32fb3be59 100644 --- a/js/src/jsapi-tests/testFreshGlobalEvalRedefinition.cpp +++ b/js/src/jsapi-tests/testFreshGlobalEvalRedefinition.cpp @@ -6,7 +6,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "mozilla/ArrayUtils.h" // mozilla::ArrayLength -#include "mozilla/Utf8.h" // mozilla::Utf8Unit +#include "mozilla/Utf8.h" // mozilla::Utf8Unit #include "js/CompilationAndEvaluation.h" // JS::Evaluate #include "js/SourceText.h" // JS::Source{Ownership,Text} diff --git a/js/src/jsapi-tests/testSavedStacks.cpp b/js/src/jsapi-tests/testSavedStacks.cpp index 890e25faa946..1b0210818fe0 100644 --- a/js/src/jsapi-tests/testSavedStacks.cpp +++ b/js/src/jsapi-tests/testSavedStacks.cpp @@ -298,8 +298,7 @@ BEGIN_TEST(testSavedStacks_selfHostedFrames) { } END_TEST(testSavedStacks_selfHostedFrames) -BEGIN_TEST(test_JS_GetPendingExceptionStack) -{ +BEGIN_TEST(test_JS_GetPendingExceptionStack) { CHECK(js::DefineTestingFunctions(cx, global, false, false)); JSPrincipals* principals = cx->realm()->principals(); @@ -343,21 +342,20 @@ BEGIN_TEST(test_JS_GetPendingExceptionStack) uint32_t column; const char* source; const char* functionDisplayName; - } expected[] = { - { 4, 7, "filename.js", "three" }, - { 5, 6, "filename.js", "two" }, - { 6, 4, "filename.js", "one" }, - { 7, 2, "filename.js", nullptr } - }; + } expected[] = {{4, 7, "filename.js", "three"}, + {5, 6, "filename.js", "two"}, + {6, 4, "filename.js", "one"}, + {7, 2, "filename.js", nullptr}}; size_t i = 0; - for (JS::Handle frame : js::SavedFrame::RootedRange(cx, savedFrameStack)) { + for (JS::Handle frame : + js::SavedFrame::RootedRange(cx, savedFrameStack)) { CHECK(i < 4); // Line uint32_t line = 123; - JS::SavedFrameResult result = JS::GetSavedFrameLine(cx, principals, frame, &line, - JS::SavedFrameSelfHosted::Exclude); + JS::SavedFrameResult result = JS::GetSavedFrameLine( + cx, principals, frame, &line, JS::SavedFrameSelfHosted::Exclude); CHECK(result == JS::SavedFrameResult::Ok); CHECK_EQUAL(line, expected[i].line); @@ -370,15 +368,16 @@ BEGIN_TEST(test_JS_GetPendingExceptionStack) // Source JS::RootedString str(cx); - result = JS::GetSavedFrameSource(cx, principals, frame, &str, JS::SavedFrameSelfHosted::Exclude); + result = JS::GetSavedFrameSource(cx, principals, frame, &str, + JS::SavedFrameSelfHosted::Exclude); CHECK(result == JS::SavedFrameResult::Ok); JSLinearString* linear = str->ensureLinear(cx); CHECK(linear); CHECK(js::StringEqualsAscii(linear, expected[i].source)); // Function display name - result = JS::GetSavedFrameFunctionDisplayName(cx, principals, frame, &str, - JS::SavedFrameSelfHosted::Exclude); + result = JS::GetSavedFrameFunctionDisplayName( + cx, principals, frame, &str, JS::SavedFrameSelfHosted::Exclude); CHECK(result == JS::SavedFrameResult::Ok); if (auto expectedName = expected[i].functionDisplayName) { CHECK(str); diff --git a/js/src/jsapi-tests/testScriptObject.cpp b/js/src/jsapi-tests/testScriptObject.cpp index a567040917fb..105cd520b33a 100644 --- a/js/src/jsapi-tests/testScriptObject.cpp +++ b/js/src/jsapi-tests/testScriptObject.cpp @@ -8,7 +8,7 @@ #include "mozilla/Utf8.h" // mozilla::Utf8Unit #include "js/CompilationAndEvaluation.h" // JS::Compile{,DontInflate,Utf8{FileDontInflate,Path}} -#include "js/SourceText.h" // JS::Source{Ownership,Text} +#include "js/SourceText.h" // JS::Source{Ownership,Text} #include "jsapi-tests/tests.h" struct ScriptObjectFixture : public JSAPITest { diff --git a/js/src/jsapi-tests/testXDR.cpp b/js/src/jsapi-tests/testXDR.cpp index a20a8a3f3339..cb6ab1ef64ca 100644 --- a/js/src/jsapi-tests/testXDR.cpp +++ b/js/src/jsapi-tests/testXDR.cpp @@ -12,7 +12,7 @@ #include "builtin/String.h" #include "js/BuildId.h" // JS::BuildIdCharVector, JS::SetProcessBuildIdOp #include "js/CompilationAndEvaluation.h" // JS::CompileDontInflate -#include "js/SourceText.h" // JS::Source{Ownership,Text} +#include "js/SourceText.h" // JS::Source{Ownership,Text} #include "js/Transcoding.h" #include "jsapi-tests/tests.h" #include "vm/JSScript.h" diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 805a2ccb8a8e..30bbd89a3613 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -984,10 +984,9 @@ static bool EnumerateStandardClasses(JSContext* cx, JS::HandleObject obj, return true; } -JS_PUBLIC_API bool JS_NewEnumerateStandardClasses(JSContext* cx, - JS::HandleObject obj, - JS::MutableHandleIdVector properties, - bool enumerableOnly) { +JS_PUBLIC_API bool JS_NewEnumerateStandardClasses( + JSContext* cx, JS::HandleObject obj, JS::MutableHandleIdVector properties, + bool enumerableOnly) { return EnumerateStandardClasses(cx, obj, properties, enumerableOnly, false); } @@ -4992,9 +4991,7 @@ JS_PUBLIC_API void JS_ClearPendingException(JSContext* cx) { cx->clearPendingException(); } -JS_PUBLIC_API JSObject* -JS::GetPendingExceptionStack(JSContext* cx) -{ +JS_PUBLIC_API JSObject* JS::GetPendingExceptionStack(JSContext* cx) { AssertHeapIsIdle(); CHECK_THREAD(cx); return cx->getPendingExceptionStack(); diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 5db3a9ca5c98..d8913ed70670 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -2781,7 +2781,7 @@ extern JS_PUBLIC_API bool JS_GetPendingException(JSContext* cx, namespace JS { -enum class ExceptionStackBehavior: bool { +enum class ExceptionStackBehavior : bool { // Do not capture any stack. DoNotCapture, @@ -2790,11 +2790,11 @@ enum class ExceptionStackBehavior: bool { Capture }; -} // namespace JS +} // namespace JS -extern JS_PUBLIC_API void JS_SetPendingException(JSContext* cx, - JS::HandleValue v, - JS::ExceptionStackBehavior behavior = JS::ExceptionStackBehavior::Capture); +extern JS_PUBLIC_API void JS_SetPendingException( + JSContext* cx, JS::HandleValue v, + JS::ExceptionStackBehavior behavior = JS::ExceptionStackBehavior::Capture); extern JS_PUBLIC_API void JS_ClearPendingException(JSContext* cx); diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h index 74002e094bbd..f2e0fffcf74f 100644 --- a/js/src/jsfriendapi.h +++ b/js/src/jsfriendapi.h @@ -960,7 +960,8 @@ inline void CopyFlatStringChars(char16_t* dest, JSFlatString* s, size_t len) { * results that match the output of Reflect.ownKeys. */ JS_FRIEND_API bool GetPropertyKeys(JSContext* cx, JS::HandleObject obj, - unsigned flags, JS::MutableHandleIdVector props); + unsigned flags, + JS::MutableHandleIdVector props); JS_FRIEND_API bool AppendUnique(JSContext* cx, JS::MutableHandleIdVector base, JS::HandleIdVector others); diff --git a/js/src/proxy/BaseProxyHandler.cpp b/js/src/proxy/BaseProxyHandler.cpp index 061cbc966a24..b182e3353507 100644 --- a/js/src/proxy/BaseProxyHandler.cpp +++ b/js/src/proxy/BaseProxyHandler.cpp @@ -228,9 +228,8 @@ bool js::SetPropertyIgnoringNamedGetter(JSContext* cx, HandleObject obj, return result.succeed(); } -bool BaseProxyHandler::getOwnEnumerablePropertyKeys(JSContext* cx, - HandleObject proxy, - MutableHandleIdVector props) const { +bool BaseProxyHandler::getOwnEnumerablePropertyKeys( + JSContext* cx, HandleObject proxy, MutableHandleIdVector props) const { assertEnteredPolicy(cx, proxy, JSID_VOID, ENUMERATE); MOZ_ASSERT(props.length() == 0); diff --git a/js/src/proxy/CrossCompartmentWrapper.cpp b/js/src/proxy/CrossCompartmentWrapper.cpp index 1b5b0a18be05..90a1560695fa 100644 --- a/js/src/proxy/CrossCompartmentWrapper.cpp +++ b/js/src/proxy/CrossCompartmentWrapper.cpp @@ -60,9 +60,8 @@ bool CrossCompartmentWrapper::defineProperty(JSContext* cx, Wrapper::defineProperty(cx, wrapper, id, desc2, result), NOTHING); } -bool CrossCompartmentWrapper::ownPropertyKeys(JSContext* cx, - HandleObject wrapper, - MutableHandleIdVector props) const { +bool CrossCompartmentWrapper::ownPropertyKeys( + JSContext* cx, HandleObject wrapper, MutableHandleIdVector props) const { PIERCE(cx, wrapper, NOTHING, Wrapper::ownPropertyKeys(cx, wrapper, props), MarkAtoms(cx, props)); } diff --git a/js/src/proxy/OpaqueCrossCompartmentWrapper.cpp b/js/src/proxy/OpaqueCrossCompartmentWrapper.cpp index bd0c8a7add38..a98cbae21c79 100644 --- a/js/src/proxy/OpaqueCrossCompartmentWrapper.cpp +++ b/js/src/proxy/OpaqueCrossCompartmentWrapper.cpp @@ -23,9 +23,8 @@ bool OpaqueCrossCompartmentWrapper::defineProperty( return result.succeed(); } -bool OpaqueCrossCompartmentWrapper::ownPropertyKeys(JSContext* cx, - HandleObject wrapper, - MutableHandleIdVector props) const { +bool OpaqueCrossCompartmentWrapper::ownPropertyKeys( + JSContext* cx, HandleObject wrapper, MutableHandleIdVector props) const { return true; } @@ -35,8 +34,8 @@ bool OpaqueCrossCompartmentWrapper::delete_(JSContext* cx, HandleObject wrapper, return result.succeed(); } -bool OpaqueCrossCompartmentWrapper::enumerate(JSContext* cx, HandleObject proxy, - MutableHandleIdVector props) const { +bool OpaqueCrossCompartmentWrapper::enumerate( + JSContext* cx, HandleObject proxy, MutableHandleIdVector props) const { return BaseProxyHandler::enumerate(cx, proxy, props); } diff --git a/js/src/proxy/Proxy.cpp b/js/src/proxy/Proxy.cpp index 5e8cd083c60b..040c9fe1e602 100644 --- a/js/src/proxy/Proxy.cpp +++ b/js/src/proxy/Proxy.cpp @@ -443,7 +443,8 @@ bool Proxy::getOwnEnumerablePropertyKeys(JSContext* cx, HandleObject proxy, return handler->getOwnEnumerablePropertyKeys(cx, proxy, props); } -bool Proxy::enumerate(JSContext* cx, HandleObject proxy, MutableHandleIdVector props) { +bool Proxy::enumerate(JSContext* cx, HandleObject proxy, + MutableHandleIdVector props) { if (!CheckRecursionLimit(cx)) { return false; } diff --git a/js/src/proxy/Proxy.h b/js/src/proxy/Proxy.h index b06f30b04941..72da54efcd98 100644 --- a/js/src/proxy/Proxy.h +++ b/js/src/proxy/Proxy.h @@ -36,7 +36,8 @@ class Proxy { MutableHandleIdVector props); static bool delete_(JSContext* cx, HandleObject proxy, HandleId id, ObjectOpResult& result); - static bool enumerate(JSContext* cx, HandleObject proxy, MutableHandleIdVector props); + static bool enumerate(JSContext* cx, HandleObject proxy, + MutableHandleIdVector props); static bool isExtensible(JSContext* cx, HandleObject proxy, bool* extensible); static bool preventExtensions(JSContext* cx, HandleObject proxy, ObjectOpResult& result); diff --git a/js/src/proxy/Wrapper.cpp b/js/src/proxy/Wrapper.cpp index 3e583b69240a..1f692ee3dff9 100644 --- a/js/src/proxy/Wrapper.cpp +++ b/js/src/proxy/Wrapper.cpp @@ -59,8 +59,8 @@ bool ForwardingProxyHandler::defineProperty(JSContext* cx, HandleObject proxy, return DefineProperty(cx, target, id, desc, result); } -bool ForwardingProxyHandler::ownPropertyKeys(JSContext* cx, HandleObject proxy, - MutableHandleIdVector props) const { +bool ForwardingProxyHandler::ownPropertyKeys( + JSContext* cx, HandleObject proxy, MutableHandleIdVector props) const { assertEnteredPolicy(cx, proxy, JSID_VOID, ENUMERATE); RootedObject target(cx, proxy->as().target()); return GetPropertyKeys( diff --git a/js/src/util/StringBuffer.h b/js/src/util/StringBuffer.h index af87acf24050..8320cbfa8cda 100644 --- a/js/src/util/StringBuffer.h +++ b/js/src/util/StringBuffer.h @@ -278,8 +278,7 @@ class StringBuffer { class JSStringBuilder : public StringBuffer { public: - explicit JSStringBuilder(JSContext* cx) - : StringBuffer(cx) {} + explicit JSStringBuilder(JSContext* cx) : StringBuffer(cx) {} /* * Creates a string from the characters in this buffer, then (regardless diff --git a/js/src/vm/EnvironmentObject.h b/js/src/vm/EnvironmentObject.h index f1b88b17d7f7..90590c37f640 100644 --- a/js/src/vm/EnvironmentObject.h +++ b/js/src/vm/EnvironmentObject.h @@ -438,7 +438,8 @@ class ModuleEnvironmentObject : public EnvironmentObject { static bool deleteProperty(JSContext* cx, HandleObject obj, HandleId id, ObjectOpResult& result); static bool newEnumerate(JSContext* cx, HandleObject obj, - MutableHandleIdVector properties, bool enumerableOnly); + MutableHandleIdVector properties, + bool enumerableOnly); }; typedef Rooted RootedModuleEnvironmentObject; diff --git a/js/src/vm/ForOfIterator.cpp b/js/src/vm/ForOfIterator.cpp index 2076cecb5c45..82a67dbbcbf6 100644 --- a/js/src/vm/ForOfIterator.cpp +++ b/js/src/vm/ForOfIterator.cpp @@ -163,7 +163,8 @@ void ForOfIterator::closeThrow() { RootedValue completionException(cx_); RootedSavedFrame completionExceptionStack(cx_); if (cx_->isExceptionPending()) { - if (!GetAndClearExceptionAndStack(cx_, &completionException, &completionExceptionStack)) { + if (!GetAndClearExceptionAndStack(cx_, &completionException, + &completionExceptionStack)) { completionException.setUndefined(); completionExceptionStack = nullptr; } diff --git a/js/src/vm/Interpreter.h b/js/src/vm/Interpreter.h index 81df97797abf..b924e4d90ca7 100644 --- a/js/src/vm/Interpreter.h +++ b/js/src/vm/Interpreter.h @@ -547,7 +547,8 @@ bool ThrowMsgOperation(JSContext* cx, const unsigned errorNum); bool GetAndClearException(JSContext* cx, MutableHandleValue res); -bool GetAndClearExceptionAndStack(JSContext* cx, MutableHandleValue res, MutableHandleSavedFrame stack); +bool GetAndClearExceptionAndStack(JSContext* cx, MutableHandleValue res, + MutableHandleSavedFrame stack); bool DeleteNameOperation(JSContext* cx, HandlePropertyName name, HandleObject scopeObj, MutableHandleValue res); diff --git a/js/src/vm/Iteration.cpp b/js/src/vm/Iteration.cpp index a81df15c283e..61d6bd1c00cb 100644 --- a/js/src/vm/Iteration.cpp +++ b/js/src/vm/Iteration.cpp @@ -543,7 +543,8 @@ static bool Snapshot(JSContext* cx, HandleObject pobj_, unsigned flags, } JS_FRIEND_API bool js::GetPropertyKeys(JSContext* cx, HandleObject obj, - unsigned flags, MutableHandleIdVector props) { + unsigned flags, + MutableHandleIdVector props) { return Snapshot(cx, obj, flags & (JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS | JSITER_SYMBOLSONLY), @@ -592,8 +593,8 @@ static PropertyIteratorObject* NewPropertyIteratorObject(JSContext* cx) { } static PropertyIteratorObject* CreatePropertyIterator( - JSContext* cx, Handle objBeingIterated, - HandleIdVector props, uint32_t numGuards, uint32_t guardKey) { + JSContext* cx, Handle objBeingIterated, HandleIdVector props, + uint32_t numGuards, uint32_t guardKey) { Rooted propIter(cx, NewPropertyIteratorObject(cx)); if (!propIter) { return nullptr; diff --git a/js/src/vm/JSContext-inl.h b/js/src/vm/JSContext-inl.h index 96eeb694fdf4..1fb921ee1edf 100644 --- a/js/src/vm/JSContext-inl.h +++ b/js/src/vm/JSContext-inl.h @@ -302,7 +302,8 @@ inline void JSContext::minorGC(JS::GCReason reason) { runtime()->gc.minorGC(reason); } -inline void JSContext::setPendingException(JS::HandleValue v, js::HandleSavedFrame stack) { +inline void JSContext::setPendingException(JS::HandleValue v, + js::HandleSavedFrame stack) { #if defined(NIGHTLY_BUILD) do { // Do not intercept exceptions if we are already diff --git a/js/src/vm/JSContext.cpp b/js/src/vm/JSContext.cpp index 7d861b22e3fd..342a6e329c97 100644 --- a/js/src/vm/JSContext.cpp +++ b/js/src/vm/JSContext.cpp @@ -1352,7 +1352,9 @@ static const size_t MAX_REPORTED_STACK_DEPTH = 1u << 7; void JSContext::setPendingExceptionAndCaptureStack(HandleValue value) { RootedObject stack(this); - if (!CaptureCurrentStack(this, &stack, JS::StackCapture(JS::MaxFrames(MAX_REPORTED_STACK_DEPTH)))) { + if (!CaptureCurrentStack( + this, &stack, + JS::StackCapture(JS::MaxFrames(MAX_REPORTED_STACK_DEPTH)))) { clearPendingException(); } diff --git a/js/src/vm/StructuredClone.cpp b/js/src/vm/StructuredClone.cpp index 8c5d69065e72..6865ef231a1d 100644 --- a/js/src/vm/StructuredClone.cpp +++ b/js/src/vm/StructuredClone.cpp @@ -1329,8 +1329,8 @@ bool JSStructuredCloneWriter::startObject(HandleObject obj, bool* backref) { } static bool TryAppendNativeProperties(JSContext* cx, HandleObject obj, - MutableHandleIdVector entries, size_t* properties, - bool* optimized) { + MutableHandleIdVector entries, + size_t* properties, bool* optimized) { *optimized = false; if (!obj->isNative()) { diff --git a/js/src/wasm/WasmJS.cpp b/js/src/wasm/WasmJS.cpp index de54c9ceda42..7c808f776e8b 100644 --- a/js/src/wasm/WasmJS.cpp +++ b/js/src/wasm/WasmJS.cpp @@ -241,7 +241,7 @@ static bool GetProperty(JSContext* cx, HandleObject obj, const char* chars, } bool js::wasm::GetImports(JSContext* cx, const Module& module, - HandleObject importObj, ImportValues* imports) { + HandleObject importObj, ImportValues* imports) { if (!module.imports().empty() && !importObj) { return ThrowBadImportArg(cx); } diff --git a/js/xpconnect/public/xpc_make_class.h b/js/xpconnect/public/xpc_make_class.h index 2d9bb7c01a87..380723f98478 100644 --- a/js/xpconnect/public/xpc_make_class.h +++ b/js/xpconnect/public/xpc_make_class.h @@ -30,7 +30,8 @@ bool XPC_WN_Helper_Enumerate(JSContext* cx, JS::HandleObject obj); bool XPC_WN_Shared_Enumerate(JSContext* cx, JS::HandleObject obj); bool XPC_WN_NewEnumerate(JSContext* cx, JS::HandleObject obj, - JS::MutableHandleIdVector properties, bool enumerableOnly); + JS::MutableHandleIdVector properties, + bool enumerableOnly); bool XPC_WN_Helper_Resolve(JSContext* cx, JS::HandleObject obj, JS::HandleId id, bool* resolvedp); diff --git a/js/xpconnect/src/Sandbox.cpp b/js/xpconnect/src/Sandbox.cpp index a5cc74300489..744ff223f28b 100644 --- a/js/xpconnect/src/Sandbox.cpp +++ b/js/xpconnect/src/Sandbox.cpp @@ -795,7 +795,8 @@ bool SandboxProxyHandler::set(JSContext* cx, JS::Handle proxy, } bool SandboxProxyHandler::getOwnEnumerablePropertyKeys( - JSContext* cx, JS::Handle proxy, MutableHandleIdVector props) const { + JSContext* cx, JS::Handle proxy, + MutableHandleIdVector props) const { return BaseProxyHandler::getOwnEnumerablePropertyKeys(cx, proxy, props); } diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index 4ce88d9e898d..4652723567ed 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -1347,7 +1347,8 @@ nsXPCComponents_Utils::ReportError(HandleValue error, HandleValue stack, if (errorObj) { JS::RootedObject stackVal(cx); JS::RootedObject stackGlobal(cx); - FindExceptionStackForConsoleReport(win, error, nullptr, &stackVal, &stackGlobal); + FindExceptionStackForConsoleReport(win, error, nullptr, &stackVal, + &stackGlobal); if (stackVal) { scripterr = new nsScriptErrorWithStack(stackVal, stackGlobal); } diff --git a/js/xpconnect/src/XPCRuntimeService.cpp b/js/xpconnect/src/XPCRuntimeService.cpp index f85136a35bb0..8f9decc2e095 100644 --- a/js/xpconnect/src/XPCRuntimeService.cpp +++ b/js/xpconnect/src/XPCRuntimeService.cpp @@ -61,7 +61,8 @@ BackstagePass::Resolve(nsIXPConnectWrappedNative* wrapper, JSContext* cx, NS_IMETHODIMP BackstagePass::NewEnumerate(nsIXPConnectWrappedNative* wrapper, JSContext* cx, - JSObject* objArg, JS::MutableHandleIdVector properties, + JSObject* objArg, + JS::MutableHandleIdVector properties, bool enumerableOnly, bool* _retval) { JS::RootedObject obj(cx, objArg); *_retval = WebIDLGlobalNameHash::NewEnumerateSystemGlobal(cx, obj, properties, diff --git a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp index eaf11a299472..83b3db216f44 100644 --- a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp +++ b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp @@ -850,7 +850,8 @@ bool XPC_WN_Helper_Enumerate(JSContext* cx, HandleObject obj) { /***************************************************************************/ bool XPC_WN_NewEnumerate(JSContext* cx, HandleObject obj, - MutableHandleIdVector properties, bool enumerableOnly) { + MutableHandleIdVector properties, + bool enumerableOnly) { XPCCallContext ccx(cx, obj); XPCWrappedNative* wrapper = ccx.GetWrapper(); THROW_AND_RETURN_IF_BAD_WRAPPER(cx, wrapper); diff --git a/js/xpconnect/wrappers/FilteringWrapper.cpp b/js/xpconnect/wrappers/FilteringWrapper.cpp index 509552f5f5a2..20648c3bd2d6 100644 --- a/js/xpconnect/wrappers/FilteringWrapper.cpp +++ b/js/xpconnect/wrappers/FilteringWrapper.cpp @@ -76,7 +76,8 @@ bool AppendCrossOriginWhitelistedPropNames(JSContext* cx, } template -static bool Filter(JSContext* cx, HandleObject wrapper, MutableHandleIdVector props) { +static bool Filter(JSContext* cx, HandleObject wrapper, + MutableHandleIdVector props) { size_t w = 0; RootedId id(cx); for (size_t n = 0; n < props.length(); ++n) { @@ -162,9 +163,9 @@ bool FilteringWrapper::getOwnEnumerablePropertyKeys( } template -bool FilteringWrapper::enumerate(JSContext* cx, - HandleObject wrapper, - JS::MutableHandleIdVector props) const { +bool FilteringWrapper::enumerate( + JSContext* cx, HandleObject wrapper, + JS::MutableHandleIdVector props) const { assertEnteredPolicy(cx, wrapper, JSID_VOID, BaseProxyHandler::ENUMERATE); // Trigger the default proxy enumerate trap, which will use // js::GetPropertyKeys for the list of (censored) ids. diff --git a/js/xpconnect/wrappers/XrayWrapper.cpp b/js/xpconnect/wrappers/XrayWrapper.cpp index 2e9ed1dc7a6c..e9121618ee51 100644 --- a/js/xpconnect/wrappers/XrayWrapper.cpp +++ b/js/xpconnect/wrappers/XrayWrapper.cpp @@ -1713,7 +1713,8 @@ bool DOMXrayTraits::defineProperty(JSContext* cx, HandleObject wrapper, } bool DOMXrayTraits::enumerateNames(JSContext* cx, HandleObject wrapper, - unsigned flags, MutableHandleIdVector props) { + unsigned flags, + MutableHandleIdVector props) { // Put the indexed properties for a window first. nsGlobalWindowInner* win = AsWindow(cx, wrapper); if (win) { @@ -2032,9 +2033,8 @@ bool XrayWrapper::defineProperty(JSContext* cx, } template -bool XrayWrapper::ownPropertyKeys(JSContext* cx, - HandleObject wrapper, - MutableHandleIdVector props) const { +bool XrayWrapper::ownPropertyKeys( + JSContext* cx, HandleObject wrapper, MutableHandleIdVector props) const { assertEnteredPolicy(cx, wrapper, JSID_VOID, BaseProxyHandler::ENUMERATE); return getPropertyKeys( cx, wrapper, JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS, props); @@ -2134,8 +2134,9 @@ bool XrayWrapper::getOwnEnumerablePropertyKeys( } template -bool XrayWrapper::enumerate(JSContext* cx, HandleObject wrapper, - JS::MutableHandleIdVector props) const { +bool XrayWrapper::enumerate( + JSContext* cx, HandleObject wrapper, + JS::MutableHandleIdVector props) const { MOZ_CRASH("Shouldn't be called: we return true for hasPrototype()"); } @@ -2292,10 +2293,9 @@ bool XrayWrapper::setImmutablePrototype(JSContext* cx, } template -bool XrayWrapper::getPropertyKeys(JSContext* cx, - HandleObject wrapper, - unsigned flags, - MutableHandleIdVector props) const { +bool XrayWrapper::getPropertyKeys( + JSContext* cx, HandleObject wrapper, unsigned flags, + MutableHandleIdVector props) const { assertEnteredPolicy(cx, wrapper, JSID_VOID, BaseProxyHandler::ENUMERATE); // Enumerate expando properties first. Note that the expando object lives diff --git a/layout/base/nsCounterManager.h b/layout/base/nsCounterManager.h index 8d0ed3c83fc5..233f557fef25 100644 --- a/layout/base/nsCounterManager.h +++ b/layout/base/nsCounterManager.h @@ -118,12 +118,12 @@ struct nsCounterChangeNode : public nsCounterNode { int32_t aPropIndex) : nsCounterNode( // Fake a content index for resets, increments and sets // that comes before all the real content, with - // the resets first, in order, and then the increments and - // then the sets. - aPropIndex + (aChangeType == RESET - ? (INT32_MIN) - : (aChangeType == INCREMENT ? ((INT32_MIN / 3) * 2) - : INT32_MIN / 3)), + // the resets first, in order, and then the increments + // and then the sets. + aPropIndex + (aChangeType == RESET ? (INT32_MIN) + : (aChangeType == INCREMENT + ? ((INT32_MIN / 3) * 2) + : INT32_MIN / 3)), aChangeType), mChangeValue(aChangeValue) { NS_ASSERTION(aPropIndex >= 0, "out of range"); diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index f027042ff7fb..cb2893bba99e 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -4699,8 +4699,9 @@ bool nsBlockFrame::DrainOverflowLines() { ReparentingDirection::Forwards); // Collect overflow containers from our [Excess]OverflowContainers lists - // that are continuations from the frames we picked up from our prev-in-flow. - // We'll append these to mFrames to ensure the continuations are ordered. + // that are continuations from the frames we picked up from our + // prev-in-flow. We'll append these to mFrames to ensure the continuations + // are ordered. auto HasOverflowContainers = [this]() -> bool { return GetPropTableFrames(OverflowContainersProperty()) || GetPropTableFrames(ExcessOverflowContainersProperty()); diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 54670baf205b..8cd8811ba111 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -3717,8 +3717,9 @@ void ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, // create a displayport for this frame. We'll add the item later on. if (!mWillBuildScrollableLayer) { if (aBuilder->BuildCompositorHitTestInfo()) { - CompositorHitTestInfo info(CompositorHitTestFlags::eVisibleToHitTest, - CompositorHitTestFlags::eInactiveScrollframe); + CompositorHitTestInfo info( + CompositorHitTestFlags::eVisibleToHitTest, + CompositorHitTestFlags::eInactiveScrollframe); // If the scroll frame has non-default overscroll-behavior, instruct // APZ to require a target confirmation before processing events that // hit this scroll frame (that is, to drop the events if a diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index fb86f5d638a0..3c42a69e52f9 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -2306,7 +2306,7 @@ Maybe nsImageFrame::GetCursor(const nsPoint& aPoint) { // Use the cursor from the style of the *area* element. RefPtr areaStyle = - PresShell()->StyleSet()->ResolveStyleLazily(*area); + PresShell()->StyleSet()->ResolveStyleLazily(*area); StyleCursorKind kind = areaStyle->StyleUI()->mCursor; if (kind == StyleCursorKind::Auto) { kind = StyleCursorKind::Default; diff --git a/layout/style/ServoStyleSet.h b/layout/style/ServoStyleSet.h index b19d40f7c33a..e9d39e594da8 100644 --- a/layout/style/ServoStyleSet.h +++ b/layout/style/ServoStyleSet.h @@ -180,8 +180,7 @@ class ServoStyleSet { // // TODO(emilio): Element argument should be `const`. already_AddRefed ResolveStyleLazily( - dom::Element&, - PseudoStyleType = PseudoStyleType::NotPseudo, + dom::Element&, PseudoStyleType = PseudoStyleType::NotPseudo, StyleRuleInclusion = StyleRuleInclusion::All); // Get a ComputedStyle for an anonymous box. The pseudo type must be an diff --git a/layout/style/StyleColor.cpp b/layout/style/StyleColor.cpp index 06ee03e15285..8149f89d605e 100644 --- a/layout/style/StyleColor.cpp +++ b/layout/style/StyleColor.cpp @@ -70,8 +70,8 @@ nscolor StyleColor::CalcColor(const StyleRGBA& aForegroundColor) const { } MOZ_ASSERT(IsComplex()); const auto& complex = AsComplex(); - return LinearBlendColors(complex.color, complex.ratios.bg, - aForegroundColor, complex.ratios.fg); + return LinearBlendColors(complex.color, complex.ratios.bg, aForegroundColor, + complex.ratios.fg); } template <> diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index 52b3408ab1ce..7246e4886cb0 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -1698,8 +1698,8 @@ nsChangeHint nsStyleTableBorder::CalcDifference( // static StyleRGBA DefaultColor(const Document& aDocument) { - return - StyleRGBA::FromColor(PreferenceSheet::PrefsFor(aDocument).mDefaultColor); + return StyleRGBA::FromColor( + PreferenceSheet::PrefsFor(aDocument).mDefaultColor); } nsStyleColor::nsStyleColor(const Document& aDocument) diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp index 2333285c3f0c..5281b10375f9 100644 --- a/layout/xul/nsMenuPopupFrame.cpp +++ b/layout/xul/nsMenuPopupFrame.cpp @@ -163,8 +163,8 @@ void nsMenuPopupFrame::Init(nsIContent* aContent, nsContainerFrame* aParent, mInContentShell = false; } - // Support incontentshell=false attribute to allow popups to be displayed outside of the - // content shell. Chrome only. + // Support incontentshell=false attribute to allow popups to be displayed + // outside of the content shell. Chrome only. if (aContent->NodePrincipal()->IsSystemPrincipal()) { if (aContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::incontentshell, diff --git a/memory/build/mozjemalloc.cpp b/memory/build/mozjemalloc.cpp index ec4d0d8f740b..e9ccdc67662b 100644 --- a/memory/build/mozjemalloc.cpp +++ b/memory/build/mozjemalloc.cpp @@ -2433,13 +2433,13 @@ void arena_t::Purge(bool aAll) { mStats.committed -= npages; #ifndef MALLOC_DECOMMIT -#ifdef XP_SOLARIS +# ifdef XP_SOLARIS posix_madvise((void*)(uintptr_t(chunk) + (i << gPageSize2Pow)), - (npages << gPageSize2Pow), MADV_FREE); -#else + (npages << gPageSize2Pow), MADV_FREE); +# else madvise((void*)(uintptr_t(chunk) + (i << gPageSize2Pow)), (npages << gPageSize2Pow), MADV_FREE); -#endif +# endif # ifdef MALLOC_DOUBLE_PURGE madvised = true; # endif diff --git a/netwerk/base/nsURLParsers.cpp b/netwerk/base/nsURLParsers.cpp index 89fe96b5ed79..c949af2a442d 100644 --- a/netwerk/base/nsURLParsers.cpp +++ b/netwerk/base/nsURLParsers.cpp @@ -559,7 +559,8 @@ nsAuthURLParser::ParseServerInfo(const char *serverinfo, int32_t serverinfoLen, // In case of IPv6 address check its validity if (*hostnameLen > 1 && *(serverinfo + *hostnamePos) == '[' && *(serverinfo + *hostnamePos + *hostnameLen - 1) == ']' && - !net_IsValidIPv6Addr(Substring(serverinfo + *hostnamePos + 1, *hostnameLen - 2))) + !net_IsValidIPv6Addr( + Substring(serverinfo + *hostnamePos + 1, *hostnameLen - 2))) return NS_ERROR_MALFORMED_URI; return NS_OK; diff --git a/security/manager/ssl/SSLServerCertVerification.cpp b/security/manager/ssl/SSLServerCertVerification.cpp index ec8f105c2ffe..35ee3a6a88d4 100644 --- a/security/manager/ssl/SSLServerCertVerification.cpp +++ b/security/manager/ssl/SSLServerCertVerification.cpp @@ -958,8 +958,7 @@ void GatherBaselineRequirementsTelemetry(const UniqueCERTCertList& certList) { // Note that the net_IsValidHostName check will catch things like // "a.*.example.com". if (!net_IsValidHostName(altNameWithoutWildcard) || - net_IsValidIPv4Addr(altName) || - net_IsValidIPv6Addr(altName)) { + net_IsValidIPv4Addr(altName) || net_IsValidIPv6Addr(altName)) { MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("BR telemetry: DNSName '%s' not valid (for '%s')\n", altName.get(), commonName.get())); diff --git a/security/manager/ssl/nsKeygenHandler.cpp b/security/manager/ssl/nsKeygenHandler.cpp index 75f2791e16b9..edbcc5bf31af 100644 --- a/security/manager/ssl/nsKeygenHandler.cpp +++ b/security/manager/ssl/nsKeygenHandler.cpp @@ -700,8 +700,7 @@ nsresult nsKeygenFormProcessor::ProcessValueIPC(const nsAString& aOldValue, const nsAString& aKeyType, const nsAString& aKeyParams, nsAString& newValue) { - return GetPublicKey(aOldValue, aChallenge, aKeyType, - newValue, aKeyParams); + return GetPublicKey(aOldValue, aChallenge, aKeyType, newValue, aKeyParams); } nsresult nsKeygenFormProcessor::ProvideContent(const nsAString& aFormType, diff --git a/testing/gtest/mozilla/GTestRunner.cpp b/testing/gtest/mozilla/GTestRunner.cpp index 51a6d3877fc8..348469e4c732 100644 --- a/testing/gtest/mozilla/GTestRunner.cpp +++ b/testing/gtest/mozilla/GTestRunner.cpp @@ -28,9 +28,10 @@ using ::testing::UnitTest; namespace mozilla { #ifdef ANDROID - #define MOZ_STDOUT_PRINT(...) __android_log_print(ANDROID_LOG_INFO, "gtest", __VA_ARGS__); +# define MOZ_STDOUT_PRINT(...) \ + __android_log_print(ANDROID_LOG_INFO, "gtest", __VA_ARGS__); #else - #define MOZ_STDOUT_PRINT(...) printf(__VA_ARGS__); +# define MOZ_STDOUT_PRINT(...) printf(__VA_ARGS__); #endif #define MOZ_PRINT(...) \ @@ -53,8 +54,8 @@ class MozillaPrinter : public EmptyTestEventListener { } virtual void OnTestProgramEnd(const UnitTest& aUnitTest) override { MOZ_PRINT("TEST-%s | GTest unit test: %s\n", - aUnitTest.Passed() ? "PASS" : "UNEXPECTED-FAIL", - aUnitTest.Passed() ? "passed" : "failed"); + aUnitTest.Passed() ? "PASS" : "UNEXPECTED-FAIL", + aUnitTest.Passed() ? "passed" : "failed"); MOZ_PRINT("Passed: %d\n", aUnitTest.successful_test_count()); MOZ_PRINT("Failed: %d\n", aUnitTest.failed_test_count()); if (mLogFile) { @@ -65,21 +66,21 @@ class MozillaPrinter : public EmptyTestEventListener { virtual void OnTestStart(const TestInfo& aTestInfo) override { mTestInfo = &aTestInfo; MOZ_PRINT("TEST-START | %s.%s\n", mTestInfo->test_case_name(), - mTestInfo->name()); + mTestInfo->name()); } virtual void OnTestPartResult( const TestPartResult& aTestPartResult) override { MOZ_PRINT("TEST-%s | %s.%s | %s @ %s:%i\n", - !aTestPartResult.failed() ? "PASS" : "UNEXPECTED-FAIL", - mTestInfo ? mTestInfo->test_case_name() : "?", - mTestInfo ? mTestInfo->name() : "?", aTestPartResult.summary(), - aTestPartResult.file_name(), aTestPartResult.line_number()); + !aTestPartResult.failed() ? "PASS" : "UNEXPECTED-FAIL", + mTestInfo ? mTestInfo->test_case_name() : "?", + mTestInfo ? mTestInfo->name() : "?", aTestPartResult.summary(), + aTestPartResult.file_name(), aTestPartResult.line_number()); } virtual void OnTestEnd(const TestInfo& aTestInfo) override { MOZ_PRINT("TEST-%s | %s.%s | test completed (time: %llims)\n", - aTestInfo.result()->Passed() ? "PASS" : "UNEXPECTED-FAIL", - aTestInfo.test_case_name(), aTestInfo.name(), - aTestInfo.result()->elapsed_time()); + aTestInfo.result()->Passed() ? "PASS" : "UNEXPECTED-FAIL", + aTestInfo.test_case_name(), aTestInfo.name(), + aTestInfo.result()->elapsed_time()); MOZ_ASSERT(&aTestInfo == mTestInfo); mTestInfo = nullptr; } @@ -134,8 +135,8 @@ int RunGTestFunc(int* argc, char** argv) { if (!file) { nsCOMPtr dirsvc = do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID); - nsresult rv = dirsvc->Get(NS_OS_CURRENT_WORKING_DIR, NS_GET_IID(nsIFile), - getter_AddRefs(file)); + nsresult rv = dirsvc->Get(NS_OS_CURRENT_WORKING_DIR, + NS_GET_IID(nsIFile), getter_AddRefs(file)); MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv)); } crashreporter->SetEnabled(true); diff --git a/toolkit/components/startup/StartupTimeline.h b/toolkit/components/startup/StartupTimeline.h index 142e5d2add42..a76124a375f0 100644 --- a/toolkit/components/startup/StartupTimeline.h +++ b/toolkit/components/startup/StartupTimeline.h @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifdef mozilla_StartupTimeline_Event - // clang-format off +// clang-format off mozilla_StartupTimeline_Event(PROCESS_CREATION, "process") mozilla_StartupTimeline_Event(START, "start") mozilla_StartupTimeline_Event(MAIN, "main") @@ -27,7 +27,7 @@ // of shutdown mozilla_StartupTimeline_Event(QUIT_APPLICATION, "quitApplication") mozilla_StartupTimeline_Event(PROFILE_BEFORE_CHANGE, "profileBeforeChange") - // clang-format on +// clang-format on #else # ifndef mozilla_StartupTimeline diff --git a/toolkit/components/url-classifier/Classifier.cpp b/toolkit/components/url-classifier/Classifier.cpp index c55439ae6c62..4c31101de747 100644 --- a/toolkit/components/url-classifier/Classifier.cpp +++ b/toolkit/components/url-classifier/Classifier.cpp @@ -420,7 +420,8 @@ nsresult Classifier::CheckURIFragments( urlIdx = i; } } - LOG(("Checking table %s, URL is %s", aTable.BeginReading(), aSpecFragments[urlIdx].get())); + LOG(("Checking table %s, URL is %s", aTable.BeginReading(), + aSpecFragments[urlIdx].get())); } RefPtr cache = GetLookupCache(aTable); @@ -446,10 +447,10 @@ nsresult Classifier::CheckURIFragments( if (LOG_ENABLED()) { nsAutoCString checking; lookupHash.ToHexString(checking); - LOG(("Found a result in fragment %s, hash %s (%X)", aSpecFragments[i].get(), - checking.get(), lookupHash.ToUint32())); - LOG(("Result %s, match %d-bytes prefix", confirmed ? "confirmed." : "Not confirmed.", - matchLength)); + LOG(("Found a result in fragment %s, hash %s (%X)", + aSpecFragments[i].get(), checking.get(), lookupHash.ToUint32())); + LOG(("Result %s, match %d-bytes prefix", + confirmed ? "confirmed." : "Not confirmed.", matchLength)); } result->hash.complete = lookupHash; diff --git a/toolkit/components/url-classifier/tests/gtest/TestLookupCacheV4.cpp b/toolkit/components/url-classifier/tests/gtest/TestLookupCacheV4.cpp index 32e16d777abc..f81962d40594 100644 --- a/toolkit/components/url-classifier/tests/gtest/TestLookupCacheV4.cpp +++ b/toolkit/components/url-classifier/tests/gtest/TestLookupCacheV4.cpp @@ -125,7 +125,8 @@ TEST(UrlClassifierLookupCacheV4, LoadOldPset) oldPsetFile->Remove(false); } -TEST(UrlClassifierLookupCacheV4, BuildAPI) { +TEST(UrlClassifierLookupCacheV4, BuildAPI) +{ _PrefixArray init = {_Prefix("alph")}; RefPtr cache = SetupLookupCache(init); diff --git a/toolkit/crashreporter/client/crashreporter_gtk_common.cpp b/toolkit/crashreporter/client/crashreporter_gtk_common.cpp index c4a5b2996e8d..d6fc269b2fd8 100644 --- a/toolkit/crashreporter/client/crashreporter_gtk_common.cpp +++ b/toolkit/crashreporter/client/crashreporter_gtk_common.cpp @@ -107,7 +107,7 @@ static gboolean ReportCompleted(gpointer success) { return FALSE; } -# define HTTP_PROXY_DIR "/system/http_proxy" +#define HTTP_PROXY_DIR "/system/http_proxy" void LoadProxyinfo() { class GConfClient; diff --git a/toolkit/library/gtest/static/TestUCRTDepends.cpp b/toolkit/library/gtest/static/TestUCRTDepends.cpp index 3687c6b45b89..23369525a1ea 100644 --- a/toolkit/library/gtest/static/TestUCRTDepends.cpp +++ b/toolkit/library/gtest/static/TestUCRTDepends.cpp @@ -37,7 +37,8 @@ static LPWSTR GetModuleFileDir(HMODULE module, LPWSTR path, DWORD size) { // Make sure that Universal CRT forwarder DLLs are not in app directory if it // is in Api Sets. -TEST(TestUCRTDepends, AppDir) { +TEST(TestUCRTDepends, AppDir) +{ WCHAR appdir[MAX_PATH]; ASSERT_TRUE(GetModuleFileDir(nullptr, appdir, MAX_PATH)); @@ -95,7 +96,8 @@ TEST(TestUCRTDepends, AppDir) { // Make sure that we do not depend on Universal CRT forwarder DLLs in the // system directory. -TEST(TestUCRTDepends, SystemDir) { +TEST(TestUCRTDepends, SystemDir) +{ WCHAR appdir[MAX_PATH]; ASSERT_TRUE(GetModuleFileDir(nullptr, appdir, MAX_PATH)); diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index f82aa116a604..115627034a18 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -1264,8 +1264,7 @@ static const mozilla::Module::CIDEntry kXRECIDs[] = { {nullptr}}; static const mozilla::Module::ContractIDEntry kXREContracts[] = { - {NS_PROFILESERVICE_CONTRACTID, &kProfileServiceCID}, - {nullptr}}; + {NS_PROFILESERVICE_CONTRACTID, &kProfileServiceCID}, {nullptr}}; extern const mozilla::Module kXREModule = {mozilla::Module::kVersion, kXRECIDs, kXREContracts}; @@ -5065,7 +5064,8 @@ void XRE_EnableSameExecutableForContentProc() { } } -mozilla::BinPathType XRE_GetChildProcBinPathType(GeckoProcessType aProcessType) { +mozilla::BinPathType XRE_GetChildProcBinPathType( + GeckoProcessType aProcessType) { MOZ_ASSERT(aProcessType != GeckoProcessType_Default); if (!gRunSelfAsContentProc) { @@ -5074,8 +5074,8 @@ mozilla::BinPathType XRE_GetChildProcBinPathType(GeckoProcessType aProcessType) switch (aProcessType) { #define GECKO_PROCESS_TYPE(enum_name, string_name, xre_name, bin_type) \ - case GeckoProcessType_##enum_name: \ - return BinPathType::bin_type; + case GeckoProcessType_##enum_name: \ + return BinPathType::bin_type; #include "mozilla/GeckoProcessTypes.h" #undef GECKO_PROCESS_TYPE default: diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index d1569b651140..3605762e1cd4 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -472,7 +472,9 @@ class nsWindow::NPZCSupport final } } - const PanZoomController::NativeProvider::Ref& GetJavaNPZC() const { return mNPZC; } + const PanZoomController::NativeProvider::Ref& GetJavaNPZC() const { + return mNPZC; + } public: void SetIsLongpressEnabled(bool aIsLongpressEnabled) { @@ -651,15 +653,13 @@ class nsWindow::NPZCSupport final return true; } - bool HandleMotionEvent(const PanZoomController::NativeProvider::LocalRef& aInstance, - int32_t aAction, int32_t aActionIndex, int64_t aTime, - int32_t aMetaState, float aScreenX, float aScreenY, - jni::IntArray::Param aPointerId, - jni::FloatArray::Param aX, jni::FloatArray::Param aY, - jni::FloatArray::Param aOrientation, - jni::FloatArray::Param aPressure, - jni::FloatArray::Param aToolMajor, - jni::FloatArray::Param aToolMinor) { + bool HandleMotionEvent( + const PanZoomController::NativeProvider::LocalRef& aInstance, + int32_t aAction, int32_t aActionIndex, int64_t aTime, int32_t aMetaState, + float aScreenX, float aScreenY, jni::IntArray::Param aPointerId, + jni::FloatArray::Param aX, jni::FloatArray::Param aY, + jni::FloatArray::Param aOrientation, jni::FloatArray::Param aPressure, + jni::FloatArray::Param aToolMajor, jni::FloatArray::Param aToolMinor) { MOZ_ASSERT(AndroidBridge::IsJavaUiThread()); RefPtr controller; @@ -939,13 +939,13 @@ class nsWindow::LayerViewSupport final } auto npzc = PanZoomController::NativeProvider::LocalRef( - jni::GetGeckoThreadEnv(), PanZoomController::NativeProvider::Ref::From(aNPZC)); + jni::GetGeckoThreadEnv(), + PanZoomController::NativeProvider::Ref::From(aNPZC)); mWindow->mNPZCSupport.Attach(npzc, mWindow, npzc); DispatchToUiThread("LayerViewSupport::AttachNPZC", - [npzc = PanZoomController::NativeProvider::GlobalRef(npzc)] { - npzc->SetAttached(true); - }); + [npzc = PanZoomController::NativeProvider::GlobalRef( + npzc)] { npzc->SetAttached(true); }); } void OnBoundsChanged(int32_t aLeft, int32_t aTop, int32_t aWidth, @@ -2125,12 +2125,12 @@ nsresult nsWindow::SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint, aPoint.x -= bounds.x; aPoint.y -= bounds.y; - DispatchToUiThread( - "nsWindow::SynthesizeNativeMouseEvent", - [npzc = PanZoomController::NativeProvider::GlobalRef(npzc), - aNativeMessage, aPoint] { - npzc->SynthesizeNativeMouseEvent(aNativeMessage, aPoint.x, aPoint.y); - }); + DispatchToUiThread("nsWindow::SynthesizeNativeMouseEvent", + [npzc = PanZoomController::NativeProvider::GlobalRef(npzc), + aNativeMessage, aPoint] { + npzc->SynthesizeNativeMouseEvent(aNativeMessage, + aPoint.x, aPoint.y); + }); return NS_OK; } @@ -2144,13 +2144,12 @@ nsresult nsWindow::SynthesizeNativeMouseMove(LayoutDeviceIntPoint aPoint, aPoint.x -= bounds.x; aPoint.y -= bounds.y; - DispatchToUiThread("nsWindow::SynthesizeNativeMouseMove", - [npzc = PanZoomController::NativeProvider::GlobalRef(npzc), - aPoint] { - npzc->SynthesizeNativeMouseEvent( - sdk::MotionEvent::ACTION_HOVER_MOVE, aPoint.x, - aPoint.y); - }); + DispatchToUiThread( + "nsWindow::SynthesizeNativeMouseMove", + [npzc = PanZoomController::NativeProvider::GlobalRef(npzc), aPoint] { + npzc->SynthesizeNativeMouseEvent(sdk::MotionEvent::ACTION_HOVER_MOVE, + aPoint.x, aPoint.y); + }); return NS_OK; } diff --git a/widget/cocoa/nsAppShell.mm b/widget/cocoa/nsAppShell.mm index 1ef6a67040a7..6b872513be5e 100644 --- a/widget/cocoa/nsAppShell.mm +++ b/widget/cocoa/nsAppShell.mm @@ -292,9 +292,8 @@ nsresult nsAppShell::Init() { mAutoreleasePools = ::CFArrayCreateMutable(nullptr, 0, nullptr); NS_ENSURE_STATE(mAutoreleasePools); - bool isNSApplicationProcessType = - (XRE_GetProcessType() != GeckoProcessType_RDD) && - (XRE_GetProcessType() != GeckoProcessType_Socket); + bool isNSApplicationProcessType = (XRE_GetProcessType() != GeckoProcessType_RDD) && + (XRE_GetProcessType() != GeckoProcessType_Socket); if (isNSApplicationProcessType) { // Get the path of the nib file, which lives in the GRE location diff --git a/widget/cocoa/nsTouchBarUpdater.mm b/widget/cocoa/nsTouchBarUpdater.mm index 314277e9c27e..ab02922048ad 100644 --- a/widget/cocoa/nsTouchBarUpdater.mm +++ b/widget/cocoa/nsTouchBarUpdater.mm @@ -22,7 +22,8 @@ NS_IMPL_ISUPPORTS(nsTouchBarUpdater, nsITouchBarUpdater); NS_IMETHODIMP -nsTouchBarUpdater::UpdateTouchBarInputs(nsIBaseWindow* aWindow, const nsTArray>& aInputs) { +nsTouchBarUpdater::UpdateTouchBarInputs(nsIBaseWindow* aWindow, + const nsTArray>& aInputs) { nsCOMPtr widget = nullptr; aWindow->GetMainWidget(getter_AddRefs(widget)); if (!widget) { diff --git a/widget/cocoa/nsWidgetFactory.mm b/widget/cocoa/nsWidgetFactory.mm index 980d29a6c53a..46313ec02730 100644 --- a/widget/cocoa/nsWidgetFactory.mm +++ b/widget/cocoa/nsWidgetFactory.mm @@ -200,11 +200,12 @@ static void nsWidgetCocoaModuleDtor() { nsAppShellShutdown(); } -extern const mozilla::Module kWidgetModule = {mozilla::Module::kVersion, - kWidgetCIDs, - kWidgetContracts, - NULL, - NULL, - nsAppShellInit, - nsWidgetCocoaModuleDtor, - mozilla::Module::ALLOW_IN_GPU_RDD_VR_AND_SOCKET_PROCESS}; +extern const mozilla::Module kWidgetModule = { + mozilla::Module::kVersion, + kWidgetCIDs, + kWidgetContracts, + NULL, + NULL, + nsAppShellInit, + nsWidgetCocoaModuleDtor, + mozilla::Module::ALLOW_IN_GPU_RDD_VR_AND_SOCKET_PROCESS}; diff --git a/widget/gtk/WindowSurfaceWayland.cpp b/widget/gtk/WindowSurfaceWayland.cpp index cdb87b35b5b3..3f8c2ea3d4f8 100644 --- a/widget/gtk/WindowSurfaceWayland.cpp +++ b/widget/gtk/WindowSurfaceWayland.cpp @@ -629,7 +629,8 @@ static void WaylandBufferDelayCommitHandler(WindowSurfaceWayland** aSurface) { } } -void WindowSurfaceWayland::CalcRectScale(LayoutDeviceIntRect& aRect, int aScale) { +void WindowSurfaceWayland::CalcRectScale(LayoutDeviceIntRect& aRect, + int aScale) { if (aRect.x & 0x1) { aRect.width += 1; } @@ -640,10 +641,10 @@ void WindowSurfaceWayland::CalcRectScale(LayoutDeviceIntRect& aRect, int aScale) } aRect.y = aRect.y / aScale; - aRect.width = (aRect.width & 0x1) ? aRect.width / aScale + 1 : - aRect.width / aScale; - aRect.height = (aRect.height & 0x1) ? aRect.height / aScale + 1 : - aRect.height / aScale; + aRect.width = + (aRect.width & 0x1) ? aRect.width / aScale + 1 : aRect.width / aScale; + aRect.height = + (aRect.height & 0x1) ? aRect.height / aScale + 1 : aRect.height / aScale; } void WindowSurfaceWayland::CommitWaylandBuffer() { diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp index 266765655bb5..96f6dfc8a523 100644 --- a/widget/gtk/nsWaylandDisplay.cpp +++ b/widget/gtk/nsWaylandDisplay.cpp @@ -116,8 +116,7 @@ static void global_registry_handler(void *data, wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { auto display = reinterpret_cast(data); - if (!display) - return; + if (!display) return; if (strcmp(interface, "wl_shm") == 0) { auto shm = static_cast( @@ -168,7 +167,7 @@ bool nsWaylandDisplay::Matches(wl_display *aDisplay) { return mThreadId == PR_GetCurrentThread() && aDisplay == mDisplay; } -nsWaylandDisplay::nsWaylandDisplay(wl_display* aDisplay) +nsWaylandDisplay::nsWaylandDisplay(wl_display *aDisplay) : mThreadId(PR_GetCurrentThread()), mDisplay(aDisplay), mEventQueue(nullptr), diff --git a/widget/gtk/nsWaylandDisplay.h b/widget/gtk/nsWaylandDisplay.h index ddca2e8a496e..64df09a0a61e 100644 --- a/widget/gtk/nsWaylandDisplay.h +++ b/widget/gtk/nsWaylandDisplay.h @@ -47,7 +47,7 @@ class nsWaylandDisplay { void SetPrimarySelectionDeviceManager( gtk_primary_selection_device_manager* aPrimarySelectionDeviceManager); -private: + private: PRThread* mThreadId; wl_display* mDisplay; wl_event_queue* mEventQueue; @@ -56,7 +56,7 @@ private: wl_seat* mSeat; wl_shm* mShm; gtk_primary_selection_device_manager* mPrimarySelectionDeviceManager; - wl_registry *mRegistry; + wl_registry* mRegistry; }; nsWaylandDisplay* WaylandDisplayGet(GdkDisplay* aGdkDisplay = nullptr); diff --git a/xpcom/build/GeckoProcessTypes.h b/xpcom/build/GeckoProcessTypes.h index 83e33099c38f..81ea58e141cc 100644 --- a/xpcom/build/GeckoProcessTypes.h +++ b/xpcom/build/GeckoProcessTypes.h @@ -4,9 +4,9 @@ * 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/. */ -// GECKO_PROCESS_TYPE(enum-name, string-name, XRE_Is${NAME}Process, process-bin-type) -// Note that string-name is exposed to various things like telemetry -// and the crash reporter, so it should not be changed casually. +// GECKO_PROCESS_TYPE(enum-name, string-name, XRE_Is${NAME}Process, +// process-bin-type) Note that string-name is exposed to various things like +// telemetry and the crash reporter, so it should not be changed casually. // // process-bin-type should be either Self or PluginContainer, and determines // whether the child process may be started using the same binary as the parent @@ -35,4 +35,5 @@ GECKO_PROCESS_TYPE(VR, "vr", VR, Self) GECKO_PROCESS_TYPE(RDD, "rdd", RDD, Self) // Socket process GECKO_PROCESS_TYPE(Socket, "socket", Socket, Self) -GECKO_PROCESS_TYPE(RemoteSandboxBroker, "sandbox", RemoteSandboxBroker, PluginContainer) +GECKO_PROCESS_TYPE(RemoteSandboxBroker, "sandbox", RemoteSandboxBroker, + PluginContainer) diff --git a/xpcom/components/Module.h b/xpcom/components/Module.h index 078f46a1c0da..9f3de89f13ad 100644 --- a/xpcom/components/Module.h +++ b/xpcom/components/Module.h @@ -64,8 +64,8 @@ struct Module { ALLOW_IN_GPU_RDD_AND_SOCKET_PROCESS = ALLOW_IN_GPU_PROCESS | ALLOW_IN_RDD_PROCESS | ALLOW_IN_SOCKET_PROCESS, ALLOW_IN_GPU_RDD_VR_AND_SOCKET_PROCESS = - ALLOW_IN_GPU_PROCESS | ALLOW_IN_RDD_PROCESS | - ALLOW_IN_VR_PROCESS | ALLOW_IN_SOCKET_PROCESS + ALLOW_IN_GPU_PROCESS | ALLOW_IN_RDD_PROCESS | ALLOW_IN_VR_PROCESS | + ALLOW_IN_SOCKET_PROCESS }; static constexpr size_t kMaxProcessSelector =