From 8285dfaab8ff4505519934c8b402dee4a327ffd0 Mon Sep 17 00:00:00 2001 From: Tamas Szentpeteri Date: Tue, 8 Oct 2024 23:27:18 +0300 Subject: [PATCH] Backed out changeset 4b1409597101 (bug 1920718) for causing bp bustages on rapl.cpp. --- browser/app/nsBrowserApp.cpp | 2 +- .../coding-style/coding_style_cpp.rst | 5 -- docshell/shistory/nsSHistory.cpp | 2 +- dom/base/CCGCScheduler.cpp | 27 ++++----- dom/base/Document.cpp | 2 +- dom/base/PlacesObservers.cpp | 9 +-- dom/base/PointerLockManager.cpp | 4 +- dom/base/ScrollingMetrics.cpp | 2 +- dom/base/nsDOMWindowUtils.cpp | 2 +- dom/bindings/Codegen.py | 2 +- dom/bindings/DOMJSProxyHandler.cpp | 2 +- dom/canvas/WebGLContext.cpp | 2 +- dom/canvas/WebGLFormats.cpp | 5 +- dom/canvas/WebGLTexture.cpp | 2 +- dom/events/EventStateManager.cpp | 8 +-- dom/events/IMEStateManager.cpp | 4 +- dom/fetch/FetchParent.cpp | 3 +- dom/fetch/FetchUtil.cpp | 2 +- dom/ipc/BrowserParent.cpp | 3 +- dom/ipc/ContentParent.cpp | 3 +- dom/localstorage/ActorsParent.cpp | 2 +- dom/media/CubebUtils.cpp | 2 +- dom/media/ExternalEngineStateMachine.cpp | 2 +- dom/media/Tracing.cpp | 2 +- dom/media/ipc/RemoteDecoderManagerChild.cpp | 2 +- .../platforms/ffmpeg/FFmpegVideoDecoder.cpp | 3 +- dom/media/systemservices/CamerasParent.cpp | 5 +- dom/media/webrtc/jsapi/PeerConnectionImpl.cpp | 2 +- .../webrtc/jsapi/WebrtcGlobalInformation.cpp | 5 +- .../webrtc/sdp/RsdparsaSdpAttributeList.cpp | 2 +- .../webrtc/sdp/SipccSdpAttributeList.cpp | 2 +- dom/midi/midirMIDIPlatformService.cpp | 3 +- dom/promise/PromiseDebugging.cpp | 2 +- dom/serviceworkers/ServiceWorkerRegistrar.cpp | 4 +- dom/svg/DOMSVGAnimatedTransformList.cpp | 4 +- dom/svg/DOMSVGLength.cpp | 2 +- dom/svg/DOMSVGPoint.cpp | 3 +- dom/svg/SVGAnimatedClassOrString.cpp | 3 +- dom/svg/SVGAnimatedEnumeration.cpp | 4 +- dom/svg/SVGAnimatedInteger.cpp | 4 +- dom/svg/SVGAnimatedIntegerPair.cpp | 8 +-- dom/svg/SVGAnimatedLength.cpp | 2 +- dom/svg/SVGAnimatedNumber.cpp | 4 +- dom/svg/SVGAnimatedNumberPair.cpp | 8 +-- dom/svg/SVGAnimatedOrient.cpp | 9 ++- dom/svg/SVGAnimatedPreserveAspectRatio.cpp | 12 ++-- dom/svg/SVGAnimatedViewBox.cpp | 6 +- dom/system/IOUtils.cpp | 2 +- dom/system/PathUtils.cpp | 4 +- editor/libeditor/HTMLEditor.cpp | 58 +++++++++---------- .../autoconfig/src/nsJSConfigTriggers.cpp | 4 +- .../hunspell/glue/mozHunspellRLBoxHost.cpp | 4 +- gfx/gl/GLContextProviderEGL.cpp | 2 +- gfx/gl/GLContextProviderGLX.cpp | 2 +- gfx/gl/GLLibraryEGL.cpp | 2 +- gfx/ipc/CanvasManagerParent.cpp | 2 +- gfx/ipc/CanvasShutdownManager.cpp | 2 +- gfx/layers/GLImages.cpp | 2 +- gfx/layers/apz/src/OvershootDetector.cpp | 3 +- gfx/layers/apz/src/SimpleVelocityTracker.cpp | 3 +- gfx/layers/apz/util/InputAPZContext.cpp | 2 +- gfx/layers/ipc/CompositorBridgeParent.cpp | 5 +- gfx/layers/ipc/CompositorManagerParent.cpp | 3 +- gfx/layers/ipc/ImageBridgeParent.cpp | 2 +- gfx/layers/ipc/VideoBridgeParent.cpp | 2 +- gfx/thebes/gfxFontMissingGlyphs.cpp | 4 +- gfx/thebes/gfxFontUtils.cpp | 6 +- gfx/thebes/gfxGradientCache.cpp | 2 +- gfx/thebes/gfxHarfBuzzShaper.cpp | 2 +- gfx/thebes/gfxUtils.cpp | 2 +- gfx/webrender_bindings/Moz2DImageRenderer.cpp | 5 +- ipc/chromium/src/base/process_util_linux.cc | 2 +- ipc/glue/BackgroundImpl.cpp | 3 +- ipc/glue/ForkServiceChild.cpp | 3 +- ipc/glue/IdleSchedulerParent.cpp | 3 +- ipc/glue/ProcessChild.cpp | 2 +- js/src/frontend/ParserAtom.cpp | 2 +- js/src/jit/CacheIRSpewer.cpp | 2 +- js/src/jit/JitOptions.cpp | 2 +- js/src/jit/JitSpewer.cpp | 2 +- js/src/jit/PerfSpewer.cpp | 7 +-- js/src/jit/ProcessExecutableMemory.cpp | 2 +- js/src/proxy/Wrapper.cpp | 2 +- js/src/vm/HelperThreads.cpp | 2 +- js/src/vm/NativeObject.cpp | 5 +- js/src/vm/SavedStacks.cpp | 5 +- js/src/vm/SharedScriptDataTableHolder.cpp | 5 +- js/src/vm/StencilCache.cpp | 3 +- js/src/wasm/WasmBuiltins.cpp | 2 +- js/src/wasm/WasmModuleTypes.cpp | 2 +- js/src/wasm/WasmProcess.cpp | 4 +- js/src/wasm/WasmSignalHandlers.cpp | 4 +- js/src/wasm/WasmTypeDef.cpp | 2 +- js/xpconnect/loader/ChromeScriptLoader.cpp | 2 +- js/xpconnect/loader/JSMEnvironmentProxy.cpp | 3 +- .../loader/ModuleEnvironmentProxy.cpp | 3 +- js/xpconnect/wrappers/XrayWrapper.cpp | 4 +- layout/base/PresShell.cpp | 2 +- layout/painting/DashedCornerFinder.cpp | 2 +- layout/painting/DottedCornerFinder.cpp | 2 +- layout/style/SharedSubResourceCache.h | 2 +- layout/style/nsStyleStruct.cpp | 3 +- memory/build/mozjemalloc.cpp | 2 +- memory/replace/dmd/test/SmokeDMD.cpp | 2 +- memory/replace/logalloc/replay/Replay.cpp | 4 +- mfbt/Attributes.h | 6 -- mfbt/Poison.cpp | 7 +-- mfbt/tests/TestCompactPair.cpp | 4 +- modules/libpref/Preferences.cpp | 4 +- mozglue/baseprofiler/core/platform.cpp | 3 +- mozglue/baseprofiler/lul/LulCommonExt.h | 2 +- mozglue/misc/AutoProfilerLabel.cpp | 3 +- mozglue/misc/SSE.cpp | 30 +++++----- mozglue/misc/TimeStamp.cpp | 2 +- netwerk/base/nsNetUtil.cpp | 2 +- netwerk/base/nsStandardURL.cpp | 2 +- netwerk/cache2/CacheFileUtils.cpp | 5 +- .../protocol/http/HttpConnectionMgrParent.cpp | 2 +- netwerk/protocol/http/nsHttp.cpp | 3 +- ...UrlClassifierFeaturePhishingProtection.cpp | 4 +- security/ct/CTPolicyEnforcer.cpp | 2 +- security/manager/ssl/nsNSSComponent.cpp | 2 +- .../cmd/EncryptedClientHelloServer.cpp | 2 +- .../tests/unit/tlsserver/cmd/FaultyServer.cpp | 2 +- .../unit/tlsserver/cmd/OCSPStaplingServer.cpp | 2 +- security/sandbox/linux/SandboxInfo.cpp | 2 +- testing/mochitest/ssltunnel/ssltunnel.cpp | 4 +- third_party/rlbox/include/rlbox_sandbox.hpp | 2 +- .../antitracking/SettingsChangeObserver.cpp | 3 +- .../mediasniffer/nsMediaSniffer.cpp | 2 +- .../components/nimbus/lib/NimbusFeatures.cpp | 2 +- .../build_scripts/gen_scalar_data.py | 2 +- .../components/telemetry/core/Telemetry.cpp | 3 +- .../telemetry/core/TelemetryEvent.cpp | 8 +-- .../telemetry/core/TelemetryScalar.cpp | 10 ++-- .../other/TelemetryIOInterposeObserver.cpp | 2 +- toolkit/crashreporter/nsExceptionHandler.cpp | 16 ++--- .../mozapps/update/updater/progressui_gtk.cpp | 2 +- toolkit/mozapps/update/updater/updater.cpp | 4 +- toolkit/xre/nsAppRunner.cpp | 14 ++--- toolkit/xre/nsX11ErrorHandler.cpp | 2 +- toolkit/xre/nsXREDirProvider.cpp | 4 +- tools/power/rapl.cpp | 4 +- .../profiler/core/ProfilerThreadRegistry.cpp | 5 +- tools/profiler/core/platform.cpp | 10 ++-- tools/profiler/gecko/ProfilerChild.cpp | 4 +- tools/profiler/gecko/ProfilerParent.cpp | 5 +- tools/profiler/lul/LulCommonExt.h | 2 +- widget/GfxInfoBase.cpp | 2 +- widget/gtk/DMABufSurface.cpp | 2 +- widget/gtk/MPRISServiceHandler.cpp | 3 +- widget/gtk/WaylandBuffer.cpp | 5 +- widget/gtk/WaylandVsyncSource.cpp | 2 +- widget/gtk/nsClipboard.cpp | 4 +- widget/gtk/nsWindow.cpp | 2 +- widget/nsBaseWidget.cpp | 2 +- widget/nsXPLookAndFeel.cpp | 3 +- xpcom/base/nsIClassInfoImpl.h | 11 ++-- xpcom/base/nsMemoryInfoDumper.cpp | 2 +- xpcom/base/nsTraceRefcnt.cpp | 2 +- xpfe/appshell/AppWindow.cpp | 2 +- 161 files changed, 298 insertions(+), 365 deletions(-) diff --git a/browser/app/nsBrowserApp.cpp b/browser/app/nsBrowserApp.cpp index df8d29da8f95..4957b4244ebd 100644 --- a/browser/app/nsBrowserApp.cpp +++ b/browser/app/nsBrowserApp.cpp @@ -159,7 +159,7 @@ static bool IsArg(const char* arg, const char* s) { return false; } -MOZ_RUNINIT Bootstrap::UniquePtr gBootstrap; +Bootstrap::UniquePtr gBootstrap; static int do_main(int argc, char* argv[], char* envp[]) { // Allow firefox.exe to launch XULRunner apps via -app diff --git a/docs/code-quality/coding-style/coding_style_cpp.rst b/docs/code-quality/coding-style/coding_style_cpp.rst index 06684e469c84..eb47cdde17c3 100644 --- a/docs/code-quality/coding-style/coding_style_cpp.rst +++ b/docs/code-quality/coding-style/coding_style_cpp.rst @@ -394,11 +394,6 @@ C/C++ practices - One-argument constructors, that are not copy or move constructors, should generally be marked explicit. Exceptions should be annotated with ``MOZ_IMPLICIT``. -- Global variables with runtimle initialization should be avoided. Flagging - them as ``constexpr`` or ``MOZ_CONSTINIT`` is a good way to make sure the - initialization happens at compile-time. If runtime initialization cannot be - avoided, use the attribute ``MOZ_RUNINIT`` to identify those and tell the - linter to ignore that variable. - Use ``char32_t`` as the return type or argument type of a method that returns or takes as argument a single Unicode scalar value. (Don't use UTF-32 strings, though.) diff --git a/docshell/shistory/nsSHistory.cpp b/docshell/shistory/nsSHistory.cpp index fc10827076d5..9cbf072b6d28 100644 --- a/docshell/shistory/nsSHistory.cpp +++ b/docshell/shistory/nsSHistory.cpp @@ -82,7 +82,7 @@ struct ListHelper { LinkedList mList; }; -MOZ_RUNINIT static ListHelper gSHistoryList; +static ListHelper gSHistoryList; // Max viewers allowed total, across all SHistory objects - negative default // means we will calculate how many viewers to cache based on total memory int32_t nsSHistory::sHistoryMaxTotalViewers = -1; diff --git a/dom/base/CCGCScheduler.cpp b/dom/base/CCGCScheduler.cpp index 4ffc27b88064..d25279e49495 100644 --- a/dom/base/CCGCScheduler.cpp +++ b/dom/base/CCGCScheduler.cpp @@ -15,25 +15,20 @@ /* Globally initialized constants */ namespace mozilla { -MOZ_RUNINIT const TimeDuration kOneMinute = TimeDuration::FromSeconds(60.0f); -MOZ_RUNINIT const TimeDuration kCCDelay = TimeDuration::FromSeconds(6); -MOZ_RUNINIT const TimeDuration kCCSkippableDelay = - TimeDuration::FromMilliseconds(250); -MOZ_RUNINIT const TimeDuration kTimeBetweenForgetSkippableCycles = +const TimeDuration kOneMinute = TimeDuration::FromSeconds(60.0f); +const TimeDuration kCCDelay = TimeDuration::FromSeconds(6); +const TimeDuration kCCSkippableDelay = TimeDuration::FromMilliseconds(250); +const TimeDuration kTimeBetweenForgetSkippableCycles = TimeDuration::FromSeconds(2); -MOZ_RUNINIT const TimeDuration kForgetSkippableSliceDuration = +const TimeDuration kForgetSkippableSliceDuration = TimeDuration::FromMilliseconds(2); -MOZ_RUNINIT const TimeDuration kICCIntersliceDelay = - TimeDuration::FromMilliseconds(250); -MOZ_RUNINIT const TimeDuration kICCSliceBudget = - TimeDuration::FromMilliseconds(3); -MOZ_RUNINIT const TimeDuration kIdleICCSliceBudget = - TimeDuration::FromMilliseconds(2); -MOZ_RUNINIT const TimeDuration kMaxICCDuration = TimeDuration::FromSeconds(2); +const TimeDuration kICCIntersliceDelay = TimeDuration::FromMilliseconds(250); +const TimeDuration kICCSliceBudget = TimeDuration::FromMilliseconds(3); +const TimeDuration kIdleICCSliceBudget = TimeDuration::FromMilliseconds(2); +const TimeDuration kMaxICCDuration = TimeDuration::FromSeconds(2); -MOZ_RUNINIT const TimeDuration kCCForced = kOneMinute * 2; -MOZ_RUNINIT const TimeDuration kMaxCCLockedoutTime = - TimeDuration::FromSeconds(30); +const TimeDuration kCCForced = kOneMinute * 2; +const TimeDuration kMaxCCLockedoutTime = TimeDuration::FromSeconds(30); } // namespace mozilla /* diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp index 47d1e4e3a133..94ad51086977 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -14766,7 +14766,7 @@ class PendingFullscreenChangeList { }; /* static */ -MOZ_RUNINIT LinkedList PendingFullscreenChangeList::sList; +LinkedList PendingFullscreenChangeList::sList; size_t Document::CountFullscreenElements() const { size_t count = 0; diff --git a/dom/base/PlacesObservers.cpp b/dom/base/PlacesObservers.cpp index a9174b782af6..b5211733ea05 100644 --- a/dom/base/PlacesObservers.cpp +++ b/dom/base/PlacesObservers.cpp @@ -54,11 +54,9 @@ struct ListenerCollection { }; template -MOZ_RUNINIT MOZ_GENERATED StaticAutoPtr> - ListenerCollection::gListeners; +StaticAutoPtr> ListenerCollection::gListeners; template -MOZ_RUNINIT MOZ_GENERATED StaticAutoPtr> - ListenerCollection::gListenersToRemove; +StaticAutoPtr> ListenerCollection::gListenersToRemove; using JSListeners = ListenerCollection>; using WeakJSListeners = ListenerCollection>; @@ -68,8 +66,7 @@ using WeakNativeListeners = // Even if NotifyListeners is called any timing, we mange the notifications with // adding to this queue, then sending in sequence. This avoids sending nested // notifications while previous ones are still being sent. -MOZ_RUNINIT static nsTArray>> - gNotificationQueue; +static nsTArray>> gNotificationQueue; uint32_t GetEventTypeFlag(PlacesEventType aEventType) { if (aEventType == PlacesEventType::None) { diff --git a/dom/base/PointerLockManager.cpp b/dom/base/PointerLockManager.cpp index fa92858dbf23..f574ed26d83f 100644 --- a/dom/base/PointerLockManager.cpp +++ b/dom/base/PointerLockManager.cpp @@ -34,10 +34,10 @@ using mozilla::dom::Element; using mozilla::dom::WindowContext; // Reference to the pointer locked element. -MOZ_RUNINIT static nsWeakPtr sLockedElement; +static nsWeakPtr sLockedElement; // Reference to the document which requested pointer lock. -MOZ_RUNINIT static nsWeakPtr sLockedDoc; +static nsWeakPtr sLockedDoc; // Reference to the BrowserParent requested pointer lock. static BrowserParent* sLockedRemoteTarget = nullptr; diff --git a/dom/base/ScrollingMetrics.cpp b/dom/base/ScrollingMetrics.cpp index 73b67a082bac..78dc6070235c 100644 --- a/dom/base/ScrollingMetrics.cpp +++ b/dom/base/ScrollingMetrics.cpp @@ -13,7 +13,7 @@ namespace mozilla { static TimeStamp gScrollingStartTime; static TimeStamp gScrollingEndTime; static uint32_t gScrollDistanceCSSPixels = 0; -MOZ_RUNINIT static dom::InteractionData gScrollingInteraction = {}; +static dom::InteractionData gScrollingInteraction = {}; void ScrollingMetrics::OnScrollingInteractionEnded() { // We are only interested in content process scrolling diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 0278074c5da5..7e22693477bb 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -219,7 +219,7 @@ already_AddRefed NativeInputRunnable::Create( } // unnamed namespace -MOZ_RUNINIT LinkedList OldWindowSize::sList; +LinkedList OldWindowSize::sList; NS_INTERFACE_MAP_BEGIN(nsDOMWindowUtils) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMWindowUtils) diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 1753e1dfe6ae..c0f5b4a6b0e7 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -2618,7 +2618,7 @@ class PropertyDefiner: specType = "const " + specType arrays = fill( """ - MOZ_RUNINIT MOZ_GENERATED static ${specType} ${name}_specs[] = { + static ${specType} ${name}_specs[] = { ${specs} }; diff --git a/dom/bindings/DOMJSProxyHandler.cpp b/dom/bindings/DOMJSProxyHandler.cpp index 49ace4cc9a60..a0f93afcb937 100644 --- a/dom/bindings/DOMJSProxyHandler.cpp +++ b/dom/bindings/DOMJSProxyHandler.cpp @@ -71,7 +71,7 @@ struct SetDOMProxyInformation { } }; -MOZ_RUNINIT SetDOMProxyInformation gSetDOMProxyInformation; +SetDOMProxyInformation gSetDOMProxyInformation; static inline void CheckExpandoObject(JSObject* proxy, const JS::Value& expando) { diff --git a/dom/canvas/WebGLContext.cpp b/dom/canvas/WebGLContext.cpp index da3a3cce91b7..13ed8c1bc14d 100644 --- a/dom/canvas/WebGLContext.cpp +++ b/dom/canvas/WebGLContext.cpp @@ -102,7 +102,7 @@ WebGLContextOptions::WebGLContextOptions() { } StaticMutex WebGLContext::sLruMutex; -MOZ_RUNINIT std::list WebGLContext::sLru; +std::list WebGLContext::sLru; WebGLContext::LruPosition::LruPosition() { StaticMutexAutoLock lock(sLruMutex); diff --git a/dom/canvas/WebGLFormats.cpp b/dom/canvas/WebGLFormats.cpp index 355ddfbe9706..e27d9d133557 100644 --- a/dom/canvas/WebGLFormats.cpp +++ b/dom/canvas/WebGLFormats.cpp @@ -85,9 +85,8 @@ static inline auto FindPtrOrNull(C& container, const K2& key) { ////////////////////////////////////////////////////////////////////////////////////////// -MOZ_RUNINIT std::map - gCompressedFormatInfoMap; -MOZ_RUNINIT std::map gFormatInfoMap; +std::map gCompressedFormatInfoMap; +std::map gFormatInfoMap; static inline const CompressedFormatInfo* GetCompressedFormatInfo( EffectiveFormat format) { diff --git a/dom/canvas/WebGLTexture.cpp b/dom/canvas/WebGLTexture.cpp index 62ad89b51c0d..db8906f7f508 100644 --- a/dom/canvas/WebGLTexture.cpp +++ b/dom/canvas/WebGLTexture.cpp @@ -25,7 +25,7 @@ namespace mozilla { namespace webgl { -MOZ_RUNINIT /*static*/ const ImageInfo ImageInfo::kUndefined; +/*static*/ const ImageInfo ImageInfo::kUndefined; size_t ImageInfo::MemoryUsage() const { if (!IsDefined()) return 0; diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index 3cc923e583aa..dd4e43a41e5b 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -142,12 +142,12 @@ static nsITimer* gUserInteractionTimer = nullptr; static nsITimerCallback* gUserInteractionTimerCallback = nullptr; static const double kCursorLoadingTimeout = 1000; // ms -MOZ_RUNINIT static AutoWeakFrame gLastCursorSourceFrame; +static AutoWeakFrame gLastCursorSourceFrame; static TimeStamp gLastCursorUpdateTime; static TimeStamp gTypingStartTime; static TimeStamp gTypingEndTime; static int32_t gTypingInteractionKeyPresses = 0; -MOZ_RUNINIT static dom::InteractionData gTypingInteraction = {}; +static dom::InteractionData gTypingInteraction = {}; static inline int32_t RoundDown(double aDouble) { return (aDouble > 0) ? static_cast(floor(aDouble)) @@ -559,14 +559,14 @@ bool EventStateManager::sNormalLMouseEventInProcess = false; int16_t EventStateManager::sCurrentMouseBtn = MouseButton::eNotPressed; EventStateManager* EventStateManager::sActiveESM = nullptr; EventStateManager* EventStateManager::sCursorSettingManager = nullptr; -MOZ_RUNINIT AutoWeakFrame EventStateManager::sLastDragOverFrame = nullptr; +AutoWeakFrame EventStateManager::sLastDragOverFrame = nullptr; LayoutDeviceIntPoint EventStateManager::sPreLockScreenPoint = LayoutDeviceIntPoint(0, 0); LayoutDeviceIntPoint EventStateManager::sLastRefPoint = kInvalidRefPoint; CSSIntPoint EventStateManager::sLastScreenPoint = CSSIntPoint(0, 0); LayoutDeviceIntPoint EventStateManager::sSynthCenteringPoint = kInvalidRefPoint; CSSIntPoint EventStateManager::sLastClientPoint = CSSIntPoint(0, 0); -MOZ_RUNINIT nsCOMPtr EventStateManager::sDragOverContent = nullptr; +nsCOMPtr EventStateManager::sDragOverContent = nullptr; EventStateManager::WheelPrefs* EventStateManager::WheelPrefs::sInstance = nullptr; diff --git a/dom/events/IMEStateManager.cpp b/dom/events/IMEStateManager.cpp index a9c20f595368..7a16751ce506 100644 --- a/dom/events/IMEStateManager.cpp +++ b/dom/events/IMEStateManager.cpp @@ -79,12 +79,12 @@ nsIWidget* IMEStateManager::sActiveInputContextWidget = nullptr; StaticRefPtr IMEStateManager::sActiveIMEContentObserver; TextCompositionArray* IMEStateManager::sTextCompositions = nullptr; InputContext::Origin IMEStateManager::sOrigin = InputContext::ORIGIN_MAIN; -MOZ_RUNINIT InputContext IMEStateManager::sActiveChildInputContext; +InputContext IMEStateManager::sActiveChildInputContext; bool IMEStateManager::sInstalledMenuKeyboardListener = false; bool IMEStateManager::sIsGettingNewIMEState = false; bool IMEStateManager::sCleaningUpForStoppingIMEStateManagement = false; bool IMEStateManager::sIsActive = false; -MOZ_RUNINIT Maybe +Maybe IMEStateManager::sPendingFocusedBrowserSwitchingData; class PseudoFocusChangeRunnable : public Runnable { diff --git a/dom/fetch/FetchParent.cpp b/dom/fetch/FetchParent.cpp index ac5e53da2279..eabe44e8cc01 100644 --- a/dom/fetch/FetchParent.cpp +++ b/dom/fetch/FetchParent.cpp @@ -49,8 +49,7 @@ NS_IMETHODIMP FetchParent::FetchParentCSPEventListener::OnCSPViolationEvent( return NS_OK; } -MOZ_RUNINIT nsTHashMap> - FetchParent::sActorTable; +nsTHashMap> FetchParent::sActorTable; /*static*/ RefPtr FetchParent::GetActorByID(const nsID& aID) { diff --git a/dom/fetch/FetchUtil.cpp b/dom/fetch/FetchUtil.cpp index 2bcf6fcf2c68..0b69306b2e84 100644 --- a/dom/fetch/FetchUtil.cpp +++ b/dom/fetch/FetchUtil.cpp @@ -655,7 +655,7 @@ class JSStreamConsumer final : public nsIInputStreamCallback, NS_IMPL_ISUPPORTS(JSStreamConsumer, nsIInputStreamCallback) // static -MOZ_RUNINIT const nsCString FetchUtil::WasmAltDataType; +const nsCString FetchUtil::WasmAltDataType; // static void FetchUtil::InitWasmAltDataType() { diff --git a/dom/ipc/BrowserParent.cpp b/dom/ipc/BrowserParent.cpp index eb65fe4730e1..6df1a568f3f5 100644 --- a/dom/ipc/BrowserParent.cpp +++ b/dom/ipc/BrowserParent.cpp @@ -255,8 +255,7 @@ class RequestingAccessKeyEventData { static int32_t sBrowserParentCount; }; int32_t RequestingAccessKeyEventData::sBrowserParentCount = 0; -MOZ_RUNINIT Maybe - RequestingAccessKeyEventData::sData; +Maybe RequestingAccessKeyEventData::sData; namespace dom { diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index f28549a808b2..9b9cc0ad453d 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -370,8 +370,7 @@ namespace dom { LazyLogModule gProcessLog("Process"); -MOZ_RUNINIT static std::map - sCodecsSupported; +static std::map sCodecsSupported; /* static */ uint32_t ContentParent::sMaxContentProcesses = 0; diff --git a/dom/localstorage/ActorsParent.cpp b/dom/localstorage/ActorsParent.cpp index 198cf167d776..c1443b36c98c 100644 --- a/dom/localstorage/ActorsParent.cpp +++ b/dom/localstorage/ActorsParent.cpp @@ -2802,7 +2802,7 @@ using PrivateDatastoreHashtable = // event of an (unlikely) race where the private browsing windows are still // being torn down, will cause the Datastore to be discarded when the last // window actually goes away. -MOZ_RUNINIT UniquePtr gPrivateDatastores; +UniquePtr gPrivateDatastores; using DatabaseArray = nsTArray; diff --git a/dom/media/CubebUtils.cpp b/dom/media/CubebUtils.cpp index bb662c974094..0659dc5e7c00 100644 --- a/dom/media/CubebUtils.cpp +++ b/dom/media/CubebUtils.cpp @@ -121,7 +121,7 @@ int sInCommunicationCount = 0; const char kBrandBundleURL[] = "chrome://branding/locale/brand.properties"; -MOZ_RUNINIT std::unordered_map +std::unordered_map kTelemetryBackendLabel = { {"audiounit", LABELS_MEDIA_AUDIO_BACKEND::audiounit}, {"audiounit-rust", LABELS_MEDIA_AUDIO_BACKEND::audiounit_rust}, diff --git a/dom/media/ExternalEngineStateMachine.cpp b/dom/media/ExternalEngineStateMachine.cpp index cb40d6b39873..3a81a6816691 100644 --- a/dom/media/ExternalEngineStateMachine.cpp +++ b/dom/media/ExternalEngineStateMachine.cpp @@ -130,7 +130,7 @@ class ProcessCrashMonitor final { } static inline StaticMutex sMutex; - static inline MOZ_RUNINIT UniquePtr sCrashMonitor; + static inline UniquePtr sCrashMonitor; static inline Atomic sIsShutdown{false}; uint32_t mCrashNums; diff --git a/dom/media/Tracing.cpp b/dom/media/Tracing.cpp index 62a6e1b1177b..2430ac9761f8 100644 --- a/dom/media/Tracing.cpp +++ b/dom/media/Tracing.cpp @@ -12,7 +12,7 @@ using namespace mozilla; using TracingPhase = mozilla::AsyncLogger::TracingPhase; -MOZ_RUNINIT mozilla::AsyncLogger gAudioCallbackTraceLogger; +mozilla::AsyncLogger gAudioCallbackTraceLogger; static std::atomic gTracingStarted(0); void StartAudioCallbackTracing() { diff --git a/dom/media/ipc/RemoteDecoderManagerChild.cpp b/dom/media/ipc/RemoteDecoderManagerChild.cpp index c8894762b750..9ce14e65d679 100644 --- a/dom/media/ipc/RemoteDecoderManagerChild.cpp +++ b/dom/media/ipc/RemoteDecoderManagerChild.cpp @@ -57,7 +57,7 @@ static EnumeratedArray, // Only modified on the main-thread, read on any thread. While it could be read // on the main thread directly, for clarity we force access via the DataMutex // wrapper. -MOZ_RUNINIT static StaticDataMutex> +static StaticDataMutex> sRemoteDecoderManagerChildThread("sRemoteDecoderManagerChildThread"); // Only accessed from sRemoteDecoderManagerChildThread diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp index 3e37f224a3e0..aac1aa7baba7 100644 --- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp +++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp @@ -88,8 +88,7 @@ typedef mozilla::layers::PlanarYCbCrImage PlanarYCbCrImage; namespace mozilla { #ifdef MOZ_USE_HWDECODE -MOZ_RUNINIT nsTArray - FFmpegVideoDecoder::mAcceleratedFormats; +nsTArray FFmpegVideoDecoder::mAcceleratedFormats; #endif using media::TimeUnit; diff --git a/dom/media/systemservices/CamerasParent.cpp b/dom/media/systemservices/CamerasParent.cpp index ed103b6b1f5d..9eeada1301cd 100644 --- a/dom/media/systemservices/CamerasParent.cpp +++ b/dom/media/systemservices/CamerasParent.cpp @@ -61,9 +61,8 @@ namespace mozilla { using media::ShutdownBlockingTicket; namespace camera { -MOZ_RUNINIT std::map sDeviceUniqueIDs; -MOZ_RUNINIT std::map - sAllRequestedCapabilities; +std::map sDeviceUniqueIDs; +std::map sAllRequestedCapabilities; uint32_t ResolutionFeasibilityDistance(int32_t candidate, int32_t requested) { // The purpose of this function is to find a smallest resolution diff --git a/dom/media/webrtc/jsapi/PeerConnectionImpl.cpp b/dom/media/webrtc/jsapi/PeerConnectionImpl.cpp index 9bd852ec3893..7a8249042f29 100644 --- a/dom/media/webrtc/jsapi/PeerConnectionImpl.cpp +++ b/dom/media/webrtc/jsapi/PeerConnectionImpl.cpp @@ -4855,6 +4855,6 @@ std::unique_ptr PeerConnectionImpl::GetProxyConfig() net::WebrtcProxyConfig(id, alpn, loadInfoArgs, mForceProxy))); } -MOZ_RUNINIT std::map +std::map PeerConnectionImpl::sCallDurationTimers; } // namespace mozilla diff --git a/dom/media/webrtc/jsapi/WebrtcGlobalInformation.cpp b/dom/media/webrtc/jsapi/WebrtcGlobalInformation.cpp index d6dedd23a9fc..eabf7ee3357f 100644 --- a/dom/media/webrtc/jsapi/WebrtcGlobalInformation.cpp +++ b/dom/media/webrtc/jsapi/WebrtcGlobalInformation.cpp @@ -67,8 +67,7 @@ class WebrtcContentParents { static std::vector> sContentParents; }; -MOZ_RUNINIT std::vector> - WebrtcContentParents::sContentParents; +std::vector> WebrtcContentParents::sContentParents; WebrtcGlobalParent* WebrtcContentParents::Alloc() { RefPtr cp = new WebrtcGlobalParent; @@ -534,7 +533,7 @@ void WebrtcGlobalInformation::GetLogging( } static bool sLastAECDebug = false; -MOZ_RUNINIT static Maybe sAecDebugLogDir; +static Maybe sAecDebugLogDir; void WebrtcGlobalInformation::SetAecDebug(const GlobalObject& aGlobal, bool aEnable) { diff --git a/dom/media/webrtc/sdp/RsdparsaSdpAttributeList.cpp b/dom/media/webrtc/sdp/RsdparsaSdpAttributeList.cpp index c1625922a325..0b76757c444b 100644 --- a/dom/media/webrtc/sdp/RsdparsaSdpAttributeList.cpp +++ b/dom/media/webrtc/sdp/RsdparsaSdpAttributeList.cpp @@ -17,7 +17,7 @@ namespace mozilla { -MOZ_RUNINIT const std::string RsdparsaSdpAttributeList::kEmptyString = ""; +const std::string RsdparsaSdpAttributeList::kEmptyString = ""; RsdparsaSdpAttributeList::~RsdparsaSdpAttributeList() { for (size_t i = 0; i < kNumAttributeTypes; ++i) { diff --git a/dom/media/webrtc/sdp/SipccSdpAttributeList.cpp b/dom/media/webrtc/sdp/SipccSdpAttributeList.cpp index b05993f96d29..15572b6dd396 100644 --- a/dom/media/webrtc/sdp/SipccSdpAttributeList.cpp +++ b/dom/media/webrtc/sdp/SipccSdpAttributeList.cpp @@ -18,7 +18,7 @@ namespace mozilla { using InternalResults = SdpParser::InternalResults; /* static */ -MOZ_RUNINIT const std::string SipccSdpAttributeList::kEmptyString = ""; +const std::string SipccSdpAttributeList::kEmptyString = ""; SipccSdpAttributeList::SipccSdpAttributeList( const SipccSdpAttributeList* sessionLevel) diff --git a/dom/midi/midirMIDIPlatformService.cpp b/dom/midi/midirMIDIPlatformService.cpp index 78c4624540b9..842eb51dcddc 100644 --- a/dom/midi/midirMIDIPlatformService.cpp +++ b/dom/midi/midirMIDIPlatformService.cpp @@ -54,8 +54,7 @@ class SendRunnable : public MIDIBackgroundRunnable { StaticMutex midirMIDIPlatformService::gOwnerThreadMutex; // static -MOZ_RUNINIT nsCOMPtr - midirMIDIPlatformService::gOwnerThread; +nsCOMPtr midirMIDIPlatformService::gOwnerThread; midirMIDIPlatformService::midirMIDIPlatformService() : mImplementation(nullptr) { diff --git a/dom/promise/PromiseDebugging.cpp b/dom/promise/PromiseDebugging.cpp index 16969f301621..b27661ef5e60 100644 --- a/dom/promise/PromiseDebugging.cpp +++ b/dom/promise/PromiseDebugging.cpp @@ -159,7 +159,7 @@ void PromiseDebugging::GetFullfillmentStack(GlobalObject& aGlobal, } /*static */ -MOZ_RUNINIT nsString PromiseDebugging::sIDPrefix; +nsString PromiseDebugging::sIDPrefix; /* static */ void PromiseDebugging::Init() { diff --git a/dom/serviceworkers/ServiceWorkerRegistrar.cpp b/dom/serviceworkers/ServiceWorkerRegistrar.cpp index 789e06373cc9..8c5fd2671329 100644 --- a/dom/serviceworkers/ServiceWorkerRegistrar.cpp +++ b/dom/serviceworkers/ServiceWorkerRegistrar.cpp @@ -138,8 +138,8 @@ nsresult CreatePrincipalInfo(nsILineInputStream* aStream, return NS_OK; } -MOZ_RUNINIT const IPCNavigationPreloadState - gDefaultNavigationPreloadState(false, "true"_ns); +const IPCNavigationPreloadState gDefaultNavigationPreloadState(false, + "true"_ns); } // namespace diff --git a/dom/svg/DOMSVGAnimatedTransformList.cpp b/dom/svg/DOMSVGAnimatedTransformList.cpp index 2aa936bca509..ab09bab1fc82 100644 --- a/dom/svg/DOMSVGAnimatedTransformList.cpp +++ b/dom/svg/DOMSVGAnimatedTransformList.cpp @@ -13,8 +13,8 @@ namespace mozilla::dom { -MOZ_RUNINIT static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGAnimatedTransformListTearoffTable; NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(DOMSVGAnimatedTransformList, diff --git a/dom/svg/DOMSVGLength.cpp b/dom/svg/DOMSVGLength.cpp index 17b25d4cc3a2..3146dfb58de9 100644 --- a/dom/svg/DOMSVGLength.cpp +++ b/dom/svg/DOMSVGLength.cpp @@ -22,7 +22,7 @@ namespace mozilla::dom { -MOZ_RUNINIT static SVGAttrTearoffTable +static SVGAttrTearoffTable sBaseSVGLengthTearOffTable, sAnimSVGLengthTearOffTable; // We could use NS_IMPL_CYCLE_COLLECTION(, except that in Unlink() we need to diff --git a/dom/svg/DOMSVGPoint.cpp b/dom/svg/DOMSVGPoint.cpp index fa07150b69d1..465f4e28a55b 100644 --- a/dom/svg/DOMSVGPoint.cpp +++ b/dom/svg/DOMSVGPoint.cpp @@ -37,8 +37,7 @@ class MOZ_RAII AutoChangePointNotifier { DOMSVGPoint* const mValue; }; -MOZ_RUNINIT static SVGAttrTearoffTable - sSVGTranslateTearOffTable; +static SVGAttrTearoffTable sSVGTranslateTearOffTable; // We could use NS_IMPL_CYCLE_COLLECTION(, except that in Unlink() we need to // clear our list's weak ref to us to be safe. (The other option would be to diff --git a/dom/svg/SVGAnimatedClassOrString.cpp b/dom/svg/SVGAnimatedClassOrString.cpp index dc9bd4de2d02..25a89f15ae42 100644 --- a/dom/svg/SVGAnimatedClassOrString.cpp +++ b/dom/svg/SVGAnimatedClassOrString.cpp @@ -11,8 +11,7 @@ namespace mozilla { -MOZ_RUNINIT static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGAnimatedClassOrStringTearoffTable; already_AddRefed diff --git a/dom/svg/SVGAnimatedEnumeration.cpp b/dom/svg/SVGAnimatedEnumeration.cpp index b2a9ac99196a..52ea0f215fda 100644 --- a/dom/svg/SVGAnimatedEnumeration.cpp +++ b/dom/svg/SVGAnimatedEnumeration.cpp @@ -44,8 +44,8 @@ class MOZ_RAII AutoChangeEnumNotifier { bool mDoSetAttr; }; -MOZ_RUNINIT static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGAnimatedEnumTearoffTable; const SVGEnumMapping* SVGAnimatedEnumeration::GetMapping( diff --git a/dom/svg/SVGAnimatedInteger.cpp b/dom/svg/SVGAnimatedInteger.cpp index 08bc2e10adfa..b14a32ce1c8c 100644 --- a/dom/svg/SVGAnimatedInteger.cpp +++ b/dom/svg/SVGAnimatedInteger.cpp @@ -45,8 +45,8 @@ class MOZ_RAII AutoChangeIntegerNotifier { bool mDoSetAttr; }; -MOZ_RUNINIT static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGAnimatedIntegerTearoffTable; nsresult SVGAnimatedInteger::SetBaseValueString(const nsAString& aValueAsString, diff --git a/dom/svg/SVGAnimatedIntegerPair.cpp b/dom/svg/SVGAnimatedIntegerPair.cpp index 0ec0be2313d3..cf13fdaf4b22 100644 --- a/dom/svg/SVGAnimatedIntegerPair.cpp +++ b/dom/svg/SVGAnimatedIntegerPair.cpp @@ -58,11 +58,11 @@ class MOZ_RAII AutoChangeIntegerPairNotifier { bool mDoSetAttr; }; -MOZ_RUNINIT static SVGAttrTearoffTable< - SVGAnimatedIntegerPair, SVGAnimatedIntegerPair::DOMAnimatedInteger> +static SVGAttrTearoffTable sSVGFirstAnimatedIntegerTearoffTable; -MOZ_RUNINIT static SVGAttrTearoffTable< - SVGAnimatedIntegerPair, SVGAnimatedIntegerPair::DOMAnimatedInteger> +static SVGAttrTearoffTable sSVGSecondAnimatedIntegerTearoffTable; /* Implementation */ diff --git a/dom/svg/SVGAnimatedLength.cpp b/dom/svg/SVGAnimatedLength.cpp index 8109afc17439..b31f739282a6 100644 --- a/dom/svg/SVGAnimatedLength.cpp +++ b/dom/svg/SVGAnimatedLength.cpp @@ -68,7 +68,7 @@ class MOZ_RAII AutoChangeLengthNotifier { bool mDoSetAttr; }; -MOZ_RUNINIT static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGAnimatedLengthTearoffTable; /* Helper functions */ diff --git a/dom/svg/SVGAnimatedNumber.cpp b/dom/svg/SVGAnimatedNumber.cpp index 55a2f134bf7a..f8a56f9e26b6 100644 --- a/dom/svg/SVGAnimatedNumber.cpp +++ b/dom/svg/SVGAnimatedNumber.cpp @@ -42,8 +42,8 @@ class MOZ_RAII AutoChangeNumberNotifier { SVGElement* const mSVGElement; }; -MOZ_RUNINIT static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGAnimatedNumberTearoffTable; static bool GetValueFromString(const nsAString& aString, diff --git a/dom/svg/SVGAnimatedNumberPair.cpp b/dom/svg/SVGAnimatedNumberPair.cpp index 7922593edc9a..7bb09a966a21 100644 --- a/dom/svg/SVGAnimatedNumberPair.cpp +++ b/dom/svg/SVGAnimatedNumberPair.cpp @@ -54,11 +54,11 @@ class MOZ_RAII AutoChangeNumberPairNotifier { bool mDoSetAttr; }; -MOZ_RUNINIT static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGFirstAnimatedNumberTearoffTable; -MOZ_RUNINIT static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGSecondAnimatedNumberTearoffTable; static nsresult ParseNumberOptionalNumber(const nsAString& aValue, diff --git a/dom/svg/SVGAnimatedOrient.cpp b/dom/svg/SVGAnimatedOrient.cpp index 5993d2b08bdc..c6339b644ce9 100644 --- a/dom/svg/SVGAnimatedOrient.cpp +++ b/dom/svg/SVGAnimatedOrient.cpp @@ -27,14 +27,13 @@ using namespace mozilla::dom::SVGMarkerElement_Binding; namespace mozilla { -MOZ_RUNINIT static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGAnimatedEnumTearoffTable; -MOZ_RUNINIT static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGAnimatedAngleTearoffTable; -MOZ_RUNINIT static SVGAttrTearoffTable +static SVGAttrTearoffTable sBaseSVGAngleTearoffTable; -MOZ_RUNINIT static SVGAttrTearoffTable +static SVGAttrTearoffTable sAnimSVGAngleTearoffTable; /* Helper functions */ diff --git a/dom/svg/SVGAnimatedPreserveAspectRatio.cpp b/dom/svg/SVGAnimatedPreserveAspectRatio.cpp index 76d27fe6e9cd..7b9b2aa13676 100644 --- a/dom/svg/SVGAnimatedPreserveAspectRatio.cpp +++ b/dom/svg/SVGAnimatedPreserveAspectRatio.cpp @@ -70,14 +70,14 @@ class MOZ_RAII AutoChangePreserveAspectRatioNotifier { bool mDoSetAttr; }; -MOZ_RUNINIT static SVGAttrTearoffTable +static SVGAttrTearoffTable sSVGAnimatedPAspectRatioTearoffTable; -MOZ_RUNINIT static SVGAttrTearoffTable +static SVGAttrTearoffTable sBaseSVGPAspectRatioTearoffTable; -MOZ_RUNINIT static SVGAttrTearoffTable +static SVGAttrTearoffTable sAnimSVGPAspectRatioTearoffTable; already_AddRefed diff --git a/dom/svg/SVGAnimatedViewBox.cpp b/dom/svg/SVGAnimatedViewBox.cpp index 80350cbfee62..aa5d07990928 100644 --- a/dom/svg/SVGAnimatedViewBox.cpp +++ b/dom/svg/SVGAnimatedViewBox.cpp @@ -66,11 +66,11 @@ nsresult SVGViewBox::FromString(const nsAString& aStr, SVGViewBox* aViewBox) { return NS_OK; } -MOZ_RUNINIT static SVGAttrTearoffTable +static SVGAttrTearoffTable sBaseSVGViewBoxTearoffTable; -MOZ_RUNINIT static SVGAttrTearoffTable +static SVGAttrTearoffTable sAnimSVGViewBoxTearoffTable; -MOZ_RUNINIT SVGAttrTearoffTable +SVGAttrTearoffTable SVGAnimatedViewBox::sSVGAnimatedRectTearoffTable; //---------------------------------------------------------------------- diff --git a/dom/system/IOUtils.cpp b/dom/system/IOUtils.cpp index cf50e8056634..4b989c6c0cf6 100644 --- a/dom/system/IOUtils.cpp +++ b/dom/system/IOUtils.cpp @@ -301,7 +301,7 @@ static void AssertParentProcessWithCallerLocation(GlobalObject& aGlobal) { // IOUtils implementation /* static */ -MOZ_RUNINIT IOUtils::StateMutex IOUtils::sState{"IOUtils::sState"}; +IOUtils::StateMutex IOUtils::sState{"IOUtils::sState"}; /* static */ template diff --git a/dom/system/PathUtils.cpp b/dom/system/PathUtils.cpp index 1d4fee8df163..24d7b648db8c 100644 --- a/dom/system/PathUtils.cpp +++ b/dom/system/PathUtils.cpp @@ -90,8 +90,8 @@ nsresult PathUtils::InitFileWithPath(nsIFile* aFile, const nsAString& aPath) { return aFile->InitWithPath(aPath); } -MOZ_RUNINIT StaticDataMutex> - PathUtils::sDirCache{"sDirCache"}; +StaticDataMutex> PathUtils::sDirCache{ + "sDirCache"}; /** * Return the leaf name, including leading path separators in the case of diff --git a/editor/libeditor/HTMLEditor.cpp b/editor/libeditor/HTMLEditor.cpp index 7f1c8b7d812a..66b41cc80505 100644 --- a/editor/libeditor/HTMLEditor.cpp +++ b/editor/libeditor/HTMLEditor.cpp @@ -135,27 +135,25 @@ HTMLEditor::InsertNodeIntoProperAncestorWithTransaction( Text& aContentToInsert, const EditorDOMPoint& aPointToInsert, SplitAtEdges aSplitAtEdges); -MOZ_RUNINIT HTMLEditor::InitializeInsertingElement - HTMLEditor::DoNothingForNewElement = - [](HTMLEditor&, Element&, const EditorDOMPoint&) { return NS_OK; }; +HTMLEditor::InitializeInsertingElement HTMLEditor::DoNothingForNewElement = + [](HTMLEditor&, Element&, const EditorDOMPoint&) { return NS_OK; }; -MOZ_RUNINIT HTMLEditor::InitializeInsertingElement - HTMLEditor::InsertNewBRElement = - [](HTMLEditor& aHTMLEditor, Element& aNewElement, const EditorDOMPoint&) - MOZ_CAN_RUN_SCRIPT_BOUNDARY { - MOZ_ASSERT(!aNewElement.IsInComposedDoc()); - Result createBRElementResult = - aHTMLEditor.InsertBRElement(WithTransaction::No, - EditorDOMPoint(&aNewElement, 0u)); - if (MOZ_UNLIKELY(createBRElementResult.isErr())) { - NS_WARNING_ASSERTION( - createBRElementResult.isOk(), - "HTMLEditor::InsertBRElement(WithTransaction::No) failed"); - return createBRElementResult.unwrapErr(); - } - createBRElementResult.unwrap().IgnoreCaretPointSuggestion(); - return NS_OK; - }; +HTMLEditor::InitializeInsertingElement HTMLEditor::InsertNewBRElement = + [](HTMLEditor& aHTMLEditor, Element& aNewElement, const EditorDOMPoint&) + MOZ_CAN_RUN_SCRIPT_BOUNDARY { + MOZ_ASSERT(!aNewElement.IsInComposedDoc()); + Result createBRElementResult = + aHTMLEditor.InsertBRElement(WithTransaction::No, + EditorDOMPoint(&aNewElement, 0u)); + if (MOZ_UNLIKELY(createBRElementResult.isErr())) { + NS_WARNING_ASSERTION( + createBRElementResult.isOk(), + "HTMLEditor::InsertBRElement(WithTransaction::No) failed"); + return createBRElementResult.unwrapErr(); + } + createBRElementResult.unwrap().IgnoreCaretPointSuggestion(); + return NS_OK; + }; // static Result @@ -188,27 +186,25 @@ HTMLEditor::AppendNewElementWithBRToInsertingElement( return createNewElementWithBRResult; } -MOZ_RUNINIT HTMLEditor::AttributeFilter HTMLEditor::CopyAllAttributes = +HTMLEditor::AttributeFilter HTMLEditor::CopyAllAttributes = [](HTMLEditor&, const Element&, const Element&, int32_t, const nsAtom&, nsString&) { return true; }; -MOZ_RUNINIT HTMLEditor::AttributeFilter HTMLEditor::CopyAllAttributesExceptId = +HTMLEditor::AttributeFilter HTMLEditor::CopyAllAttributesExceptId = [](HTMLEditor&, const Element&, const Element&, int32_t aNamespaceID, const nsAtom& aAttrName, nsString&) { return aNamespaceID != kNameSpaceID_None || &aAttrName != nsGkAtoms::id; }; -MOZ_RUNINIT HTMLEditor::AttributeFilter HTMLEditor::CopyAllAttributesExceptDir = +HTMLEditor::AttributeFilter HTMLEditor::CopyAllAttributesExceptDir = [](HTMLEditor&, const Element&, const Element&, int32_t aNamespaceID, const nsAtom& aAttrName, nsString&) { return aNamespaceID != kNameSpaceID_None || &aAttrName != nsGkAtoms::dir; }; -MOZ_RUNINIT HTMLEditor::AttributeFilter - HTMLEditor::CopyAllAttributesExceptIdAndDir = - [](HTMLEditor&, const Element&, const Element&, int32_t aNamespaceID, - const nsAtom& aAttrName, nsString&) { - return !( - aNamespaceID == kNameSpaceID_None && - (&aAttrName == nsGkAtoms::id || &aAttrName == nsGkAtoms::dir)); - }; +HTMLEditor::AttributeFilter HTMLEditor::CopyAllAttributesExceptIdAndDir = + [](HTMLEditor&, const Element&, const Element&, int32_t aNamespaceID, + const nsAtom& aAttrName, nsString&) { + return !(aNamespaceID == kNameSpaceID_None && + (&aAttrName == nsGkAtoms::id || &aAttrName == nsGkAtoms::dir)); + }; HTMLEditor::HTMLEditor(const Document& aDocument) : EditorBase(EditorBase::EditorType::HTML), diff --git a/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp b/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp index 456e4fb23d62..00813392f110 100644 --- a/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp +++ b/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp @@ -30,8 +30,8 @@ using mozilla::dom::AutoJSAPI; //***************************************************************************** -MOZ_RUNINIT static JS::PersistentRooted autoconfigSystemSb; -MOZ_RUNINIT static JS::PersistentRooted autoconfigSb; +static JS::PersistentRooted autoconfigSystemSb; +static JS::PersistentRooted autoconfigSb; bool sandboxEnabled; nsresult CentralizedAdminPrefManagerInit(bool aSandboxEnabled) { diff --git a/extensions/spellcheck/hunspell/glue/mozHunspellRLBoxHost.cpp b/extensions/spellcheck/hunspell/glue/mozHunspellRLBoxHost.cpp index 7397fbcafeaa..61d2f50887ec 100644 --- a/extensions/spellcheck/hunspell/glue/mozHunspellRLBoxHost.cpp +++ b/extensions/spellcheck/hunspell/glue/mozHunspellRLBoxHost.cpp @@ -77,10 +77,10 @@ uint32_t mozHunspellCallbacks::sCurrentFreshId = 0; /* static */ mozilla::StaticRWLock mozHunspellCallbacks::sFileMgrMapLock; /* static */ -MOZ_RUNINIT std::map> +std::map> mozHunspellCallbacks::sFileMgrMap; /* static */ -MOZ_RUNINIT std::set mozHunspellCallbacks::sFileMgrAllowList; +std::set mozHunspellCallbacks::sFileMgrAllowList; /* static */ void mozHunspellCallbacks::AllowFile(const nsCString& aFilename) { diff --git a/gfx/gl/GLContextProviderEGL.cpp b/gfx/gl/GLContextProviderEGL.cpp index aec50c6c5a9e..2959e10cd5b6 100644 --- a/gfx/gl/GLContextProviderEGL.cpp +++ b/gfx/gl/GLContextProviderEGL.cpp @@ -106,7 +106,7 @@ class WaylandOffscreenGLSurface { struct wl_egl_window* mEGLWindow = nullptr; }; -MOZ_RUNINIT static nsTHashMap, WaylandOffscreenGLSurface*> +static nsTHashMap, WaylandOffscreenGLSurface*> sWaylandOffscreenGLSurfaces; void DeleteWaylandOffscreenGLSurface(EGLSurface surface) { diff --git a/gfx/gl/GLContextProviderGLX.cpp b/gfx/gl/GLContextProviderGLX.cpp index ab1e59f44449..07b7a8e91508 100644 --- a/gfx/gl/GLContextProviderGLX.cpp +++ b/gfx/gl/GLContextProviderGLX.cpp @@ -51,7 +51,7 @@ namespace mozilla::gl { using namespace mozilla::gfx; using namespace mozilla::widget; -MOZ_RUNINIT GLXLibrary sGLXLibrary; +GLXLibrary sGLXLibrary; static inline bool HasExtension(const char* aExtensions, const char* aRequiredExtension) { diff --git a/gfx/gl/GLLibraryEGL.cpp b/gfx/gl/GLLibraryEGL.cpp index c724f96ba5be..0caaa8647648 100644 --- a/gfx/gl/GLLibraryEGL.cpp +++ b/gfx/gl/GLLibraryEGL.cpp @@ -389,7 +389,7 @@ class AngleErrorReporting { nsACString* mFailureId; }; -MOZ_RUNINIT AngleErrorReporting gAngleErrorReporter; +AngleErrorReporting gAngleErrorReporter; static std::shared_ptr GetAndInitDisplayForAccelANGLE( GLLibraryEGL& egl, nsACString* const out_failureId, diff --git a/gfx/ipc/CanvasManagerParent.cpp b/gfx/ipc/CanvasManagerParent.cpp index 61f0b03d18d2..f8edd515a581 100644 --- a/gfx/ipc/CanvasManagerParent.cpp +++ b/gfx/ipc/CanvasManagerParent.cpp @@ -23,7 +23,7 @@ namespace mozilla::gfx { -MOZ_RUNINIT CanvasManagerParent::ManagerSet CanvasManagerParent::sManagers; +CanvasManagerParent::ManagerSet CanvasManagerParent::sManagers; /* static */ void CanvasManagerParent::Init( Endpoint&& aEndpoint, diff --git a/gfx/ipc/CanvasShutdownManager.cpp b/gfx/ipc/CanvasShutdownManager.cpp index dc0f61025008..ac970b93204d 100644 --- a/gfx/ipc/CanvasShutdownManager.cpp +++ b/gfx/ipc/CanvasShutdownManager.cpp @@ -17,7 +17,7 @@ using namespace mozilla::dom; namespace mozilla::gfx { StaticMutex CanvasShutdownManager::sManagersMutex; -MOZ_RUNINIT std::set CanvasShutdownManager::sManagers; +std::set CanvasShutdownManager::sManagers; // The owning thread will tell us to close when it is shutdown, either via // CanvasShutdownManager::Shutdown for the main thread, or via a shutdown diff --git a/gfx/layers/GLImages.cpp b/gfx/layers/GLImages.cpp index c1bb10405259..90c817f6a62c 100644 --- a/gfx/layers/GLImages.cpp +++ b/gfx/layers/GLImages.cpp @@ -20,7 +20,7 @@ using namespace mozilla::gl; namespace mozilla::layers { -MOZ_RUNINIT static RefPtr sSnapshotContext; +static RefPtr sSnapshotContext; nsresult GLImage::ReadIntoBuffer(uint8_t* aData, int32_t aStride, const gfx::IntSize& aSize, diff --git a/gfx/layers/apz/src/OvershootDetector.cpp b/gfx/layers/apz/src/OvershootDetector.cpp index 2f2b59cb7d4f..c713ce8d1aa0 100644 --- a/gfx/layers/apz/src/OvershootDetector.cpp +++ b/gfx/layers/apz/src/OvershootDetector.cpp @@ -12,8 +12,7 @@ namespace mozilla { namespace layers { -MOZ_RUNINIT const TimeDuration kOvershootInterval = - TimeDuration::FromMilliseconds(500); +const TimeDuration kOvershootInterval = TimeDuration::FromMilliseconds(500); static Maybe GetScrollDirection(const ScrollWheelInput& aInput) { // If the wheel input is scrolling on both axes, we just take the y-axis. diff --git a/gfx/layers/apz/src/SimpleVelocityTracker.cpp b/gfx/layers/apz/src/SimpleVelocityTracker.cpp index bb73ed1ac104..87cae10d51f9 100644 --- a/gfx/layers/apz/src/SimpleVelocityTracker.cpp +++ b/gfx/layers/apz/src/SimpleVelocityTracker.cpp @@ -21,8 +21,7 @@ namespace layers { // delta can be really small, which can make the velocity computation very // volatile. To avoid this we impose a minimum time delta below which we do // not recompute the velocity. -MOZ_RUNINIT const TimeDuration MIN_VELOCITY_SAMPLE_TIME = - TimeDuration::FromMilliseconds(5); +const TimeDuration MIN_VELOCITY_SAMPLE_TIME = TimeDuration::FromMilliseconds(5); extern StaticAutoPtr gVelocityCurveFunction; diff --git a/gfx/layers/apz/util/InputAPZContext.cpp b/gfx/layers/apz/util/InputAPZContext.cpp index 2cb5b16357a3..b1af5c31183c 100644 --- a/gfx/layers/apz/util/InputAPZContext.cpp +++ b/gfx/layers/apz/util/InputAPZContext.cpp @@ -9,7 +9,7 @@ namespace mozilla { namespace layers { -MOZ_RUNINIT ScrollableLayerGuid InputAPZContext::sGuid; +ScrollableLayerGuid InputAPZContext::sGuid; uint64_t InputAPZContext::sBlockId = 0; nsEventStatus InputAPZContext::sApzResponse = nsEventStatus_eSentinel; bool InputAPZContext::sPendingLayerization = false; diff --git a/gfx/layers/ipc/CompositorBridgeParent.cpp b/gfx/layers/ipc/CompositorBridgeParent.cpp index cb6652976123..9e7c01b11aa2 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.cpp +++ b/gfx/layers/ipc/CompositorBridgeParent.cpp @@ -108,9 +108,8 @@ using mozilla::Telemetry::LABELS_CONTENT_FRAME_TIME_REASON; StaticMonitor CompositorBridgeParent::sIndirectLayerTreesLock; /* static */ -MOZ_RUNINIT CompositorBridgeParent::LayerTreeMap - CompositorBridgeParent::sIndirectLayerTrees MOZ_GUARDED_BY( - CompositorBridgeParent::sIndirectLayerTreesLock); +CompositorBridgeParent::LayerTreeMap CompositorBridgeParent::sIndirectLayerTrees + MOZ_GUARDED_BY(CompositorBridgeParent::sIndirectLayerTreesLock); CompositorBridgeParentBase::CompositorBridgeParentBase( CompositorManagerParent* aManager) diff --git a/gfx/layers/ipc/CompositorManagerParent.cpp b/gfx/layers/ipc/CompositorManagerParent.cpp index 719c4ba998b7..35784541e24e 100644 --- a/gfx/layers/ipc/CompositorManagerParent.cpp +++ b/gfx/layers/ipc/CompositorManagerParent.cpp @@ -24,8 +24,7 @@ namespace layers { StaticMonitor CompositorManagerParent::sMonitor; StaticRefPtr CompositorManagerParent::sInstance; -MOZ_RUNINIT CompositorManagerParent::ManagerMap - CompositorManagerParent::sManagers; +CompositorManagerParent::ManagerMap CompositorManagerParent::sManagers; /* static */ already_AddRefed diff --git a/gfx/layers/ipc/ImageBridgeParent.cpp b/gfx/layers/ipc/ImageBridgeParent.cpp index 851449161307..5942e7782fb3 100644 --- a/gfx/layers/ipc/ImageBridgeParent.cpp +++ b/gfx/layers/ipc/ImageBridgeParent.cpp @@ -47,7 +47,7 @@ using namespace mozilla::ipc; using namespace mozilla::gfx; using namespace mozilla::media; -MOZ_RUNINIT ImageBridgeParent::ImageBridgeMap ImageBridgeParent::sImageBridges; +ImageBridgeParent::ImageBridgeMap ImageBridgeParent::sImageBridges; StaticAutoPtr sImageBridgesLock; diff --git a/gfx/layers/ipc/VideoBridgeParent.cpp b/gfx/layers/ipc/VideoBridgeParent.cpp index f46c33371fbc..4f5009bac93b 100644 --- a/gfx/layers/ipc/VideoBridgeParent.cpp +++ b/gfx/layers/ipc/VideoBridgeParent.cpp @@ -21,7 +21,7 @@ using namespace mozilla::gfx; using VideoBridgeTable = EnumeratedArray; -MOZ_RUNINIT static StaticDataMutex sVideoBridgeFromProcess( +static StaticDataMutex sVideoBridgeFromProcess( "VideoBridges"); static Atomic sVideoBridgeParentShutDown(false); diff --git a/gfx/thebes/gfxFontMissingGlyphs.cpp b/gfx/thebes/gfxFontMissingGlyphs.cpp index a268b7700e78..949a71228c0b 100644 --- a/gfx/thebes/gfxFontMissingGlyphs.cpp +++ b/gfx/thebes/gfxFontMissingGlyphs.cpp @@ -196,8 +196,8 @@ static void DestroyImageKey(void* aClosure) { delete key; } -MOZ_RUNINIT static RefPtr gWRGlyphAtlas[8]; -MOZ_RUNINIT static LinkedList gWRUsers; +static RefPtr gWRGlyphAtlas[8]; +static LinkedList gWRUsers; UserDataKey WRUserData::sWRUserDataKey; /** diff --git a/gfx/thebes/gfxFontUtils.cpp b/gfx/thebes/gfxFontUtils.cpp index 7f4517454d5a..46f33f4696cd 100644 --- a/gfx/thebes/gfxFontUtils.cpp +++ b/gfx/thebes/gfxFontUtils.cpp @@ -1294,7 +1294,7 @@ nsresult gfxFontUtils::ReadCanonicalName(const char* aNameData, // on the first search. const uint16_t ANY = 0xffff; -MOZ_RUNINIT const gfxFontUtils::MacFontNameCharsetMapping +const gfxFontUtils::MacFontNameCharsetMapping gfxFontUtils::gMacFontNameCharsets[] = { {ENCODING_ID_MAC_ROMAN, LANG_ID_MAC_ENGLISH, MACINTOSH_ENCODING}, {ENCODING_ID_MAC_ROMAN, LANG_ID_MAC_ICELANDIC, X_USER_DEFINED_ENCODING}, @@ -1325,14 +1325,14 @@ MOZ_RUNINIT const gfxFontUtils::MacFontNameCharsetMapping GB18030_ENCODING}, {ENCODING_ID_MAC_SIMP_CHINESE, ANY, GB18030_ENCODING}}; -MOZ_RUNINIT const Encoding* gfxFontUtils::gISOFontNameCharsets[] = { +const Encoding* gfxFontUtils::gISOFontNameCharsets[] = { /* 0 */ WINDOWS_1252_ENCODING, /* US-ASCII */ /* 1 */ nullptr, /* spec says "ISO 10646" but does not specify encoding form! */ /* 2 */ WINDOWS_1252_ENCODING /* ISO-8859-1 */ }; -MOZ_RUNINIT const Encoding* gfxFontUtils::gMSFontNameCharsets[] = { +const Encoding* gfxFontUtils::gMSFontNameCharsets[] = { /* [0] ENCODING_ID_MICROSOFT_SYMBOL */ UTF_16BE_ENCODING, /* [1] ENCODING_ID_MICROSOFT_UNICODEBMP */ UTF_16BE_ENCODING, /* [2] ENCODING_ID_MICROSOFT_SHIFTJIS */ SHIFT_JIS_ENCODING, diff --git a/gfx/thebes/gfxGradientCache.cpp b/gfx/thebes/gfxGradientCache.cpp index 98c6349566d2..c2a1682a7d9e 100644 --- a/gfx/thebes/gfxGradientCache.cpp +++ b/gfx/thebes/gfxGradientCache.cpp @@ -255,7 +255,7 @@ class GradientCache final nsTArray> mRemovedGradientData; }; -MOZ_RUNINIT GradientCacheMutex GradientCache::sInstanceMutex("GradientCache"); +GradientCacheMutex GradientCache::sInstanceMutex("GradientCache"); void gfxGradientCache::Init() { MOZ_RELEASE_ASSERT(GradientCache::EnsureInstance(), diff --git a/gfx/thebes/gfxHarfBuzzShaper.cpp b/gfx/thebes/gfxHarfBuzzShaper.cpp index ef819fb4aa50..18bc08a6bf2c 100644 --- a/gfx/thebes/gfxHarfBuzzShaper.cpp +++ b/gfx/thebes/gfxHarfBuzzShaper.cpp @@ -1200,7 +1200,7 @@ static void AddOpenTypeFeature(uint32_t aTag, uint32_t aValue, void* aUserArg) { static hb_font_funcs_t* sHBFontFuncs = nullptr; static hb_font_funcs_t* sNominalGlyphFunc = nullptr; static hb_unicode_funcs_t* sHBUnicodeFuncs = nullptr; -MOZ_RUNINIT static const hb_script_t sMathScript = +static const hb_script_t sMathScript = hb_ot_tag_to_script(HB_TAG('m', 'a', 't', 'h')); bool gfxHarfBuzzShaper::Initialize() { diff --git a/gfx/thebes/gfxUtils.cpp b/gfx/thebes/gfxUtils.cpp index c0d7d6683e80..98e68ae86255 100644 --- a/gfx/thebes/gfxUtils.cpp +++ b/gfx/thebes/gfxUtils.cpp @@ -1775,7 +1775,7 @@ bool gfxUtils::DumpDisplayList() { XRE_IsContentProcess()); } -MOZ_RUNINIT FILE* gfxUtils::sDumpPaintFile = stderr; +FILE* gfxUtils::sDumpPaintFile = stderr; namespace mozilla { namespace gfx { diff --git a/gfx/webrender_bindings/Moz2DImageRenderer.cpp b/gfx/webrender_bindings/Moz2DImageRenderer.cpp index adb3c66d631b..66f61d719e78 100644 --- a/gfx/webrender_bindings/Moz2DImageRenderer.cpp +++ b/gfx/webrender_bindings/Moz2DImageRenderer.cpp @@ -78,9 +78,8 @@ struct FontInstanceData { }; StaticMutex sFontDataTableLock; -MOZ_RUNINIT std::unordered_map sFontDataTable; -MOZ_RUNINIT std::unordered_map - sBlobFontTable; +std::unordered_map sFontDataTable; +std::unordered_map sBlobFontTable; // Fixed-size ring buffer logging font deletion events to aid debugging. static struct FontDeleteLog { diff --git a/ipc/chromium/src/base/process_util_linux.cc b/ipc/chromium/src/base/process_util_linux.cc index 6db47612c4de..25939622fa11 100644 --- a/ipc/chromium/src/base/process_util_linux.cc +++ b/ipc/chromium/src/base/process_util_linux.cc @@ -39,7 +39,7 @@ namespace { -MOZ_RUNINIT static mozilla::EnvironmentLog gProcessLog("MOZ_PROCESS_LOG"); +static mozilla::EnvironmentLog gProcessLog("MOZ_PROCESS_LOG"); } // namespace diff --git a/ipc/glue/BackgroundImpl.cpp b/ipc/glue/BackgroundImpl.cpp index eb247b93585e..3a47087d1952 100644 --- a/ipc/glue/BackgroundImpl.cpp +++ b/ipc/glue/BackgroundImpl.cpp @@ -746,8 +746,7 @@ bool ParentImpl::sShutdownHasStarted = false; // ChildImpl Static Members // ----------------------------------------------------------------------------- -MOZ_RUNINIT ChildImpl::ThreadInfoWrapper - ChildImpl::sParentAndContentProcessThreadInfo; +ChildImpl::ThreadInfoWrapper ChildImpl::sParentAndContentProcessThreadInfo; bool ChildImpl::sShutdownHasStarted = false; diff --git a/ipc/glue/ForkServiceChild.cpp b/ipc/glue/ForkServiceChild.cpp index 8e46bce304ee..c4dc1e7cab60 100644 --- a/ipc/glue/ForkServiceChild.cpp +++ b/ipc/glue/ForkServiceChild.cpp @@ -24,8 +24,7 @@ namespace ipc { extern LazyLogModule gForkServiceLog; -MOZ_RUNINIT mozilla::UniquePtr - ForkServiceChild::sForkServiceChild; +mozilla::UniquePtr ForkServiceChild::sForkServiceChild; Atomic ForkServiceChild::sForkServiceUsed; #ifndef SOCK_CLOEXEC diff --git a/ipc/glue/IdleSchedulerParent.cpp b/ipc/glue/IdleSchedulerParent.cpp index ad92193a6a35..7f91e9e754b1 100644 --- a/ipc/glue/IdleSchedulerParent.cpp +++ b/ipc/glue/IdleSchedulerParent.cpp @@ -20,8 +20,7 @@ namespace mozilla::ipc { base::SharedMemory* IdleSchedulerParent::sActiveChildCounter = nullptr; std::bitset IdleSchedulerParent::sInUseChildCounters; -MOZ_RUNINIT LinkedList - IdleSchedulerParent::sIdleAndGCRequests; +LinkedList IdleSchedulerParent::sIdleAndGCRequests; int32_t IdleSchedulerParent::sMaxConcurrentIdleTasksInChildProcesses = 1; uint32_t IdleSchedulerParent::sMaxConcurrentGCs = 1; uint32_t IdleSchedulerParent::sActiveGCs = 0; diff --git a/ipc/glue/ProcessChild.cpp b/ipc/glue/ProcessChild.cpp index 035d86475a30..44c0b26684d0 100644 --- a/ipc/glue/ProcessChild.cpp +++ b/ipc/glue/ProcessChild.cpp @@ -29,7 +29,7 @@ namespace ipc { ProcessChild* ProcessChild::gProcessChild; StaticMutex ProcessChild::gIPCShutdownStateLock; -MOZ_RUNINIT nsCString ProcessChild::gIPCShutdownStateAnnotation; +nsCString ProcessChild::gIPCShutdownStateAnnotation; static Atomic sExpectingShutdown(false); diff --git a/js/src/frontend/ParserAtom.cpp b/js/src/frontend/ParserAtom.cpp index 482b3e92c63a..129052850125 100644 --- a/js/src/frontend/ParserAtom.cpp +++ b/js/src/frontend/ParserAtom.cpp @@ -1214,7 +1214,7 @@ bool InstantiateMarkedAtomsAsPermanent(JSContext* cx, FrontendContext* fc, } /* static */ -MOZ_RUNINIT WellKnownParserAtoms WellKnownParserAtoms::singleton_; +WellKnownParserAtoms WellKnownParserAtoms::singleton_; template TaggedParserAtomIndex WellKnownParserAtoms::lookupChar16Seq( diff --git a/js/src/jit/CacheIRSpewer.cpp b/js/src/jit/CacheIRSpewer.cpp index e86c74049d22..fbc8a50b044a 100644 --- a/js/src/jit/CacheIRSpewer.cpp +++ b/js/src/jit/CacheIRSpewer.cpp @@ -297,7 +297,7 @@ class MOZ_RAII CacheIROpsJSONSpewer { } }; -MOZ_RUNINIT CacheIRSpewer CacheIRSpewer::cacheIRspewer; +CacheIRSpewer CacheIRSpewer::cacheIRspewer; CacheIRSpewer::CacheIRSpewer() : outputLock_(mutexid::CacheIRSpewer), guardCount_(0) { diff --git a/js/src/jit/JitOptions.cpp b/js/src/jit/JitOptions.cpp index f0d2db08d43e..81defb1ce20d 100644 --- a/js/src/jit/JitOptions.cpp +++ b/js/src/jit/JitOptions.cpp @@ -19,7 +19,7 @@ using mozilla::Maybe; namespace js { namespace jit { -MOZ_RUNINIT DefaultJitOptions JitOptions; +DefaultJitOptions JitOptions; static void Warn(const char* env, const char* value) { fprintf(stderr, "Warning: I didn't understand %s=\"%s\"\n", env, value); diff --git a/js/src/jit/JitSpewer.cpp b/js/src/jit/JitSpewer.cpp index d92e6bf29e6a..694844ce49ea 100644 --- a/js/src/jit/JitSpewer.cpp +++ b/js/src/jit/JitSpewer.cpp @@ -63,7 +63,7 @@ class IonSpewer { }; // IonSpewer singleton. -MOZ_RUNINIT static IonSpewer ionspewer; +static IonSpewer ionspewer; bool jitspew::detail::LoggingChecked = false; static_assert(JitSpew_Terminator <= 64, diff --git a/js/src/jit/PerfSpewer.cpp b/js/src/jit/PerfSpewer.cpp index 9da743291403..8f20d995dca7 100644 --- a/js/src/jit/PerfSpewer.cpp +++ b/js/src/jit/PerfSpewer.cpp @@ -104,12 +104,11 @@ static std::atomic PerfMode = PerfModeType::None; // Mutex to guard access to the profiler vectors and jitdump file if perf // profiling is enabled. -MOZ_RUNINIT static js::Mutex PerfMutex(mutexid::PerfSpewer); +static js::Mutex PerfMutex(mutexid::PerfSpewer); -MOZ_RUNINIT static PersistentRooted< - GCVector> +static PersistentRooted> jitCodeVector; -MOZ_RUNINIT static ProfilerJitCodeVector profilerData; +static ProfilerJitCodeVector profilerData; static bool IsGeckoProfiling() { return geckoProfiling; } #ifdef JS_ION_PERF diff --git a/js/src/jit/ProcessExecutableMemory.cpp b/js/src/jit/ProcessExecutableMemory.cpp index 1565ba5e22af..0c00b17c73be 100644 --- a/js/src/jit/ProcessExecutableMemory.cpp +++ b/js/src/jit/ProcessExecutableMemory.cpp @@ -884,7 +884,7 @@ void ProcessExecutableMemory::deallocate(void* addr, size_t bytes, } } -MOZ_RUNINIT static ProcessExecutableMemory execMemory; +static ProcessExecutableMemory execMemory; void* js::jit::AllocateExecutableMemory(size_t bytes, ProtectionSetting protection, diff --git a/js/src/proxy/Wrapper.cpp b/js/src/proxy/Wrapper.cpp index a9c2849801b8..0c31a11d3867 100644 --- a/js/src/proxy/Wrapper.cpp +++ b/js/src/proxy/Wrapper.cpp @@ -422,7 +422,7 @@ void js::ReportAccessDenied(JSContext* cx) { const char Wrapper::family = 0; const Wrapper Wrapper::singleton((unsigned)0); const Wrapper Wrapper::singletonWithPrototype((unsigned)0, true); -MOZ_RUNINIT JSObject* const Wrapper::defaultProto = TaggedProto::LazyProto; +JSObject* const Wrapper::defaultProto = TaggedProto::LazyProto; /* Compartments. */ diff --git a/js/src/vm/HelperThreads.cpp b/js/src/vm/HelperThreads.cpp index c247c3befd52..63c341bbcbc3 100644 --- a/js/src/vm/HelperThreads.cpp +++ b/js/src/vm/HelperThreads.cpp @@ -56,7 +56,7 @@ static void CancelOffThreadWasmPartialTier2CompileLocked( namespace js { -MOZ_RUNINIT Mutex gHelperThreadLock(mutexid::GlobalHelperThreadState); +Mutex gHelperThreadLock(mutexid::GlobalHelperThreadState); GlobalHelperThreadState* gHelperThreadState = nullptr; } // namespace js diff --git a/js/src/vm/NativeObject.cpp b/js/src/vm/NativeObject.cpp index 43f9b07ffffb..be6100264a23 100644 --- a/js/src/vm/NativeObject.cpp +++ b/js/src/vm/NativeObject.cpp @@ -86,7 +86,7 @@ static constexpr EmptyObjectSlots emptyObjectSlotsHeaders[17] = { static_assert(std::size(emptyObjectSlotsHeaders) == NativeObject::MAX_FIXED_SLOTS + 1); -MOZ_RUNINIT HeapSlot* const js::emptyObjectSlotsForDictionaryObject[17] = { +HeapSlot* const js::emptyObjectSlotsForDictionaryObject[17] = { emptyObjectSlotsHeaders[0].slots(), emptyObjectSlotsHeaders[1].slots(), emptyObjectSlotsHeaders[2].slots(), emptyObjectSlotsHeaders[3].slots(), emptyObjectSlotsHeaders[4].slots(), emptyObjectSlotsHeaders[5].slots(), @@ -100,8 +100,7 @@ MOZ_RUNINIT HeapSlot* const js::emptyObjectSlotsForDictionaryObject[17] = { static_assert(std::size(emptyObjectSlotsForDictionaryObject) == NativeObject::MAX_FIXED_SLOTS + 1); -MOZ_RUNINIT HeapSlot* const js::emptyObjectSlots = - emptyObjectSlotsForDictionaryObject[0]; +HeapSlot* const js::emptyObjectSlots = emptyObjectSlotsForDictionaryObject[0]; #ifdef DEBUG diff --git a/js/src/vm/SavedStacks.cpp b/js/src/vm/SavedStacks.cpp index d53cffc47b61..bbba18ca963f 100644 --- a/js/src/vm/SavedStacks.cpp +++ b/js/src/vm/SavedStacks.cpp @@ -1989,10 +1989,9 @@ JSObject* SavedStacks::MetadataBuilder::build( const SavedStacks::MetadataBuilder SavedStacks::metadataBuilder; /* static */ -MOZ_RUNINIT ReconstructedSavedFramePrincipals - ReconstructedSavedFramePrincipals::IsSystem; +ReconstructedSavedFramePrincipals ReconstructedSavedFramePrincipals::IsSystem; /* static */ -MOZ_RUNINIT ReconstructedSavedFramePrincipals +ReconstructedSavedFramePrincipals ReconstructedSavedFramePrincipals::IsNotSystem; UniqueChars BuildUTF8StackString(JSContext* cx, JSPrincipals* principals, diff --git a/js/src/vm/SharedScriptDataTableHolder.cpp b/js/src/vm/SharedScriptDataTableHolder.cpp index 6e64dda1611b..8575b6695d12 100644 --- a/js/src/vm/SharedScriptDataTableHolder.cpp +++ b/js/src/vm/SharedScriptDataTableHolder.cpp @@ -10,11 +10,10 @@ using namespace js; -MOZ_RUNINIT js::Mutex AutoLockGlobalScriptData::mutex_( - mutexid::SharedImmutableScriptData); +js::Mutex AutoLockGlobalScriptData::mutex_(mutexid::SharedImmutableScriptData); AutoLockGlobalScriptData::AutoLockGlobalScriptData() { mutex_.lock(); } AutoLockGlobalScriptData::~AutoLockGlobalScriptData() { mutex_.unlock(); } -MOZ_RUNINIT SharedScriptDataTableHolder js::globalSharedScriptDataTableHolder; +SharedScriptDataTableHolder js::globalSharedScriptDataTableHolder; diff --git a/js/src/vm/StencilCache.cpp b/js/src/vm/StencilCache.cpp index c9252e8fea51..1bf138c63ee6 100644 --- a/js/src/vm/StencilCache.cpp +++ b/js/src/vm/StencilCache.cpp @@ -66,5 +66,4 @@ void js::StencilCache::clearAndDisable() { enabled = false; } -MOZ_RUNINIT /* static */ js::DelazificationCache - js::DelazificationCache::singleton; +/* static */ js::DelazificationCache js::DelazificationCache::singleton; diff --git a/js/src/wasm/WasmBuiltins.cpp b/js/src/wasm/WasmBuiltins.cpp index 39d075f5035e..715e1174f38b 100644 --- a/js/src/wasm/WasmBuiltins.cpp +++ b/js/src/wasm/WasmBuiltins.cpp @@ -1979,7 +1979,7 @@ struct BuiltinThunks { } }; -MOZ_RUNINIT Mutex initBuiltinThunks(mutexid::WasmInitBuiltinThunks); +Mutex initBuiltinThunks(mutexid::WasmInitBuiltinThunks); mozilla::Atomic builtinThunks; bool wasm::EnsureBuiltinThunksInitialized() { diff --git a/js/src/wasm/WasmModuleTypes.cpp b/js/src/wasm/WasmModuleTypes.cpp index 4a59684a21c7..45d6b64909c2 100644 --- a/js/src/wasm/WasmModuleTypes.cpp +++ b/js/src/wasm/WasmModuleTypes.cpp @@ -52,7 +52,7 @@ bool CacheableName::fromUTF8Chars(const char* utf8Chars, CacheableName* name) { return true; } -MOZ_RUNINIT BranchHintVector BranchHintCollection::invalidVector_; +BranchHintVector BranchHintCollection::invalidVector_; JSString* CacheableName::toJSString(JSContext* cx) const { return NewStringCopyUTF8N(cx, JS::UTF8Chars(begin(), length())); diff --git a/js/src/wasm/WasmProcess.cpp b/js/src/wasm/WasmProcess.cpp index ee3fdf22c319..1d42681ae353 100644 --- a/js/src/wasm/WasmProcess.cpp +++ b/js/src/wasm/WasmProcess.cpp @@ -154,9 +154,9 @@ static const size_t MinVirtualMemoryLimitForHugeMemory = size_t(1) << MinAddressBitsForHugeMemory; #endif -MOZ_RUNINIT ExclusiveData sHugeMemoryEnabled32( +ExclusiveData sHugeMemoryEnabled32( mutexid::WasmHugeMemoryEnabled); -MOZ_RUNINIT ExclusiveData sHugeMemoryEnabled64( +ExclusiveData sHugeMemoryEnabled64( mutexid::WasmHugeMemoryEnabled); static MOZ_NEVER_INLINE bool IsHugeMemoryEnabledHelper32() { diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp index d5cbd731bfb1..13bb9d9eac9a 100644 --- a/js/src/wasm/WasmSignalHandlers.cpp +++ b/js/src/wasm/WasmSignalHandlers.cpp @@ -802,7 +802,7 @@ struct InstallState { InstallState() : tried(false), success(false) {} }; -MOZ_RUNINIT static ExclusiveData sEagerInstallState( +static ExclusiveData sEagerInstallState( mutexid::WasmSignalInstallState); #endif // !(JS_CODEGEN_NONE) @@ -884,7 +884,7 @@ void wasm::EnsureEagerProcessSignalHandlers() { } #ifndef JS_CODEGEN_NONE -MOZ_RUNINIT static ExclusiveData sLazyInstallState( +static ExclusiveData sLazyInstallState( mutexid::WasmSignalInstallState); static bool EnsureLazyProcessSignalHandlers() { diff --git a/js/src/wasm/WasmTypeDef.cpp b/js/src/wasm/WasmTypeDef.cpp index 996b89d235d4..d1bb8a31d15b 100644 --- a/js/src/wasm/WasmTypeDef.cpp +++ b/js/src/wasm/WasmTypeDef.cpp @@ -582,7 +582,7 @@ class TypeIdSet { } }; -MOZ_RUNINIT ExclusiveData typeIdSet(mutexid::WasmTypeIdSet); +ExclusiveData typeIdSet(mutexid::WasmTypeIdSet); void wasm::PurgeCanonicalTypes() { ExclusiveData::Guard locked = typeIdSet.lock(); diff --git a/js/xpconnect/loader/ChromeScriptLoader.cpp b/js/xpconnect/loader/ChromeScriptLoader.cpp index 405c5f7e3049..3564c186798e 100644 --- a/js/xpconnect/loader/ChromeScriptLoader.cpp +++ b/js/xpconnect/loader/ChromeScriptLoader.cpp @@ -197,7 +197,7 @@ class AsyncScriptCompileTask final : public Task { }; /* static */ mozilla::StaticMutex AsyncScriptCompileTask::sOngoingTasksMutex; -MOZ_RUNINIT /* static */ Vector +/* static */ Vector AsyncScriptCompileTask::sOngoingTasks; /* static */ bool AsyncScriptCompileTask::sIsShutdownRegistered = false; diff --git a/js/xpconnect/loader/JSMEnvironmentProxy.cpp b/js/xpconnect/loader/JSMEnvironmentProxy.cpp index 27fbe886437a..cb21151033fd 100644 --- a/js/xpconnect/loader/JSMEnvironmentProxy.cpp +++ b/js/xpconnect/loader/JSMEnvironmentProxy.cpp @@ -116,8 +116,7 @@ struct JSMEnvironmentProxyHandler : public js::BaseProxyHandler { static const JSMEnvironmentProxyHandler gHandler; }; -MOZ_RUNINIT const JSMEnvironmentProxyHandler - JSMEnvironmentProxyHandler::gHandler; +const JSMEnvironmentProxyHandler JSMEnvironmentProxyHandler::gHandler; const char JSMEnvironmentProxyHandler::gFamily = 0; JSObject* ResolveModuleObjectPropertyById(JSContext* aCx, diff --git a/js/xpconnect/loader/ModuleEnvironmentProxy.cpp b/js/xpconnect/loader/ModuleEnvironmentProxy.cpp index 70238ddc3f36..e70fcb38656c 100644 --- a/js/xpconnect/loader/ModuleEnvironmentProxy.cpp +++ b/js/xpconnect/loader/ModuleEnvironmentProxy.cpp @@ -124,8 +124,7 @@ struct ModuleEnvironmentProxyHandler : public js::BaseProxyHandler { static const ModuleEnvironmentProxyHandler gHandler; }; -MOZ_RUNINIT const ModuleEnvironmentProxyHandler - ModuleEnvironmentProxyHandler::gHandler; +const ModuleEnvironmentProxyHandler ModuleEnvironmentProxyHandler::gHandler; const char ModuleEnvironmentProxyHandler::gFamily = 0; bool ModuleEnvironmentProxyHandler::getOwnPropertyDescriptor( diff --git a/js/xpconnect/wrappers/XrayWrapper.cpp b/js/xpconnect/wrappers/XrayWrapper.cpp index d5a5a401cbba..80e7719c6304 100644 --- a/js/xpconnect/wrappers/XrayWrapper.cpp +++ b/js/xpconnect/wrappers/XrayWrapper.cpp @@ -2333,8 +2333,8 @@ bool XrayWrapper::getPropertyKeys( */ template -MOZ_RUNINIT MOZ_GENERATED const xpc::XrayWrapper - xpc::XrayWrapper::singleton(0); +const xpc::XrayWrapper xpc::XrayWrapper::singleton( + 0); template class PermissiveXrayDOM; template class PermissiveXrayJS; diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index addcdbfccc96..278dea87ccbb 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -227,7 +227,7 @@ using namespace mozilla::layout; using PaintFrameFlags = nsLayoutUtils::PaintFrameFlags; typedef ScrollableLayerGuid::ViewID ViewID; -MOZ_RUNINIT PresShell::CapturingContentInfo PresShell::sCapturingContentInfo; +PresShell::CapturingContentInfo PresShell::sCapturingContentInfo; // RangePaintInfo is used to paint ranges to offscreen buffers struct RangePaintInfo { diff --git a/layout/painting/DashedCornerFinder.cpp b/layout/painting/DashedCornerFinder.cpp index b91c3b2f09ed..c892179df9cc 100644 --- a/layout/painting/DashedCornerFinder.cpp +++ b/layout/painting/DashedCornerFinder.cpp @@ -29,7 +29,7 @@ struct BestDashLength { }; static const size_t DashedCornerCacheSize = 256; -MOZ_RUNINIT nsTHashMap DashedCornerCache; +nsTHashMap DashedCornerCache; DashedCornerFinder::DashedCornerFinder(const Bezier& aOuterBezier, const Bezier& aInnerBezier, diff --git a/layout/painting/DottedCornerFinder.cpp b/layout/painting/DottedCornerFinder.cpp index 4c9411e86607..2e8408d80b08 100644 --- a/layout/painting/DottedCornerFinder.cpp +++ b/layout/painting/DottedCornerFinder.cpp @@ -31,7 +31,7 @@ struct BestOverlap { }; static const size_t DottedCornerCacheSize = 256; -MOZ_RUNINIT nsTHashMap DottedCornerCache; +nsTHashMap DottedCornerCache; DottedCornerFinder::DottedCornerFinder(const Bezier& aOuterBezier, const Bezier& aInnerBezier, diff --git a/layout/style/SharedSubResourceCache.h b/layout/style/SharedSubResourceCache.h index ecbae69e9286..be0710d650b9 100644 --- a/layout/style/SharedSubResourceCache.h +++ b/layout/style/SharedSubResourceCache.h @@ -261,7 +261,7 @@ class SharedSubResourceCache { protected: // Lazily created in the first Get() call. // The singleton should be deleted by DeleteSingleton() during shutdown. - inline static MOZ_RUNINIT MOZ_GENERATED StaticRefPtr sSingleton; + inline static StaticRefPtr sSingleton; }; template diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index 4fb6a0ae32f4..e82825b8f086 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -51,8 +51,7 @@ using namespace mozilla; using namespace mozilla::dom; -MOZ_RUNINIT static const nscoord kMediumBorderWidth = - nsPresContext::CSSPixelsToAppUnits(3); +static const nscoord kMediumBorderWidth = nsPresContext::CSSPixelsToAppUnits(3); // We set the size limit of style structs to 504 bytes so that when they // are allocated by Servo side with Arc, the total size doesn't exceed diff --git a/memory/build/mozjemalloc.cpp b/memory/build/mozjemalloc.cpp index c5b0604fa96c..9c5012cb150b 100644 --- a/memory/build/mozjemalloc.cpp +++ b/memory/build/mozjemalloc.cpp @@ -1427,7 +1427,7 @@ class ArenaCollection { Maybe mMainThreadId; }; -MOZ_RUNINIT static ArenaCollection gArenas; +static ArenaCollection gArenas; // ****** // Chunks. diff --git a/memory/replace/dmd/test/SmokeDMD.cpp b/memory/replace/dmd/test/SmokeDMD.cpp index 9d9fdcdf423a..c72e92a543d6 100644 --- a/memory/replace/dmd/test/SmokeDMD.cpp +++ b/memory/replace/dmd/test/SmokeDMD.cpp @@ -31,7 +31,7 @@ using mozilla::MakeUnique; using namespace mozilla::dmd; -MOZ_RUNINIT DMDFuncs::Singleton DMDFuncs::sSingleton; +DMDFuncs::Singleton DMDFuncs::sSingleton; class FpWriteFunc final : public mozilla::JSONWriteFunc { public: diff --git a/memory/replace/logalloc/replay/Replay.cpp b/memory/replace/logalloc/replay/Replay.cpp index b0d846361e28..191a192bb81f 100644 --- a/memory/replace/logalloc/replay/Replay.cpp +++ b/memory/replace/logalloc/replay/Replay.cpp @@ -38,7 +38,7 @@ static void die(const char* message) { } #ifdef XP_LINUX -MOZ_RUNINIT static size_t sPageSize = []() { return sysconf(_SC_PAGESIZE); }(); +static size_t sPageSize = []() { return sysconf(_SC_PAGESIZE); }(); #endif /* We don't want to be using malloc() to allocate our internal tracking @@ -1077,7 +1077,7 @@ class Replay { #endif // XP_LINUX }; -MOZ_RUNINIT static Replay replay; +static Replay replay; int main(int argc, const char* argv[]) { size_t first_pid = 0; diff --git a/mfbt/Attributes.h b/mfbt/Attributes.h index cad505dfe94d..4aaa3fc88986 100644 --- a/mfbt/Attributes.h +++ b/mfbt/Attributes.h @@ -861,13 +861,9 @@ # ifndef XGILL_PLUGIN # define MOZ_UNANNOTATED __attribute__((annotate("moz_unannotated"))) # define MOZ_ANNOTATED __attribute__((annotate("moz_annotated"))) -# define MOZ_RUNINIT __attribute__((annotate("moz_global_var"))) -# define MOZ_GENERATED __attribute__((annotate("moz_generated"))) # else # define MOZ_UNANNOTATED /* nothing */ # define MOZ_ANNOTATED /* nothing */ -# define MOZ_RUNINIT /* nothing */ -# define MOZ_GENERATED /* nothing */ # endif /* @@ -889,8 +885,6 @@ # define MOZ_CAN_RUN_SCRIPT_BOUNDARY /* nothing */ # define MOZ_MUST_OVERRIDE /* nothing */ # define MOZ_STATIC_CLASS /* nothing */ -# define MOZ_RUNINIT /* nothing */ -# define MOZ_GENERATED /* nothing */ # define MOZ_STATIC_LOCAL_CLASS /* nothing */ # define MOZ_STACK_CLASS /* nothing */ # define MOZ_NONHEAP_CLASS /* nothing */ diff --git a/mfbt/Poison.cpp b/mfbt/Poison.cpp index d70774e4087b..d4ec08e7039e 100644 --- a/mfbt/Poison.cpp +++ b/mfbt/Poison.cpp @@ -198,9 +198,8 @@ static uintptr_t GetPoisonValue(uintptr_t aBase, uintptr_t aSize) { // specifically comes before libxul, so nearly all gecko code runs strictly // after this.) extern "C" { -MOZ_RUNINIT uintptr_t gMozillaPoisonSize = GetDesiredRegionSize(); -MOZ_RUNINIT uintptr_t gMozillaPoisonBase = - ReservePoisonArea(gMozillaPoisonSize); -MOZ_RUNINIT uintptr_t gMozillaPoisonValue = +uintptr_t gMozillaPoisonSize = GetDesiredRegionSize(); +uintptr_t gMozillaPoisonBase = ReservePoisonArea(gMozillaPoisonSize); +uintptr_t gMozillaPoisonValue = GetPoisonValue(gMozillaPoisonBase, gMozillaPoisonSize); } diff --git a/mfbt/tests/TestCompactPair.cpp b/mfbt/tests/TestCompactPair.cpp index f72df581b731..66300c338a19 100644 --- a/mfbt/tests/TestCompactPair.cpp +++ b/mfbt/tests/TestCompactPair.cpp @@ -16,7 +16,7 @@ using mozilla::MakeCompactPair; // verify our attempts at compactness through EBO are moderately functional, // *somewhere*. #define INSTANTIATE(T1, T2, name, size) \ - MOZ_RUNINIT MOZ_GENERATED CompactPair name##_1(T1(0), T2(0)); \ + CompactPair name##_1(T1(0), T2(0)); \ static_assert(sizeof(name##_1.first()) > 0, \ "first method should work on CompactPair<" #T1 ", " #T2 ">"); \ \ @@ -26,7 +26,7 @@ using mozilla::MakeCompactPair; static_assert(sizeof(name##_1) == (size), \ "CompactPair<" #T1 ", " #T2 "> has an unexpected size"); \ \ - MOZ_RUNINIT MOZ_GENERATED CompactPair name##_2(T2(0), T1(0)); \ + CompactPair name##_2(T2(0), T1(0)); \ static_assert(sizeof(name##_2.first()) > 0, \ "first method should work on CompactPair<" #T2 ", " #T1 ">"); \ \ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp index 08956796093a..9b76f3b66237 100644 --- a/modules/libpref/Preferences.cpp +++ b/modules/libpref/Preferences.cpp @@ -2062,7 +2062,7 @@ static void TestParseErrorHandlePref(const char* aPrefName, PrefType aType, PrefValueKind aKind, PrefValue aValue, bool aIsSticky, bool aIsLocked) {} -MOZ_RUNINIT static nsCString gTestParseErrorMsgs; +static nsCString gTestParseErrorMsgs; static void TestParseErrorHandleError(const char* aMsg) { gTestParseErrorMsgs.Append(aMsg); @@ -5794,7 +5794,7 @@ void MaybeInitOncePrefs() { #define ALWAYS_PREF(name, base_id, full_id, cpp_type, default_value) \ cpp_type sMirror_##full_id(default_value); #define ALWAYS_DATAMUTEX_PREF(name, base_id, full_id, cpp_type, default_value) \ - MOZ_RUNINIT cpp_type sMirror_##full_id("DataMutexString"); + cpp_type sMirror_##full_id("DataMutexString"); #define ONCE_PREF(name, base_id, full_id, cpp_type, default_value) \ cpp_type sMirror_##full_id(default_value); #include "mozilla/StaticPrefListAll.h" diff --git a/mozglue/baseprofiler/core/platform.cpp b/mozglue/baseprofiler/core/platform.cpp index f33cea2ba253..6080ba88c61f 100644 --- a/mozglue/baseprofiler/core/platform.cpp +++ b/mozglue/baseprofiler/core/platform.cpp @@ -278,8 +278,7 @@ class MOZ_RAII PSAutoLock { detail::BaseProfilerAutoLock mLock; }; -MOZ_RUNINIT detail::BaseProfilerMutex PSAutoLock::gPSMutex{ - "Base Profiler mutex"}; +detail::BaseProfilerMutex PSAutoLock::gPSMutex{"Base Profiler mutex"}; // Only functions that take a PSLockRef arg can access CorePS's and ActivePS's // fields. diff --git a/mozglue/baseprofiler/lul/LulCommonExt.h b/mozglue/baseprofiler/lul/LulCommonExt.h index 8ecc1ee8ff7f..b20a7321ff2a 100644 --- a/mozglue/baseprofiler/lul/LulCommonExt.h +++ b/mozglue/baseprofiler/lul/LulCommonExt.h @@ -374,7 +374,7 @@ class scoped_ptr_malloc { }; template -MOZ_RUNINIT FP const scoped_ptr_malloc::free_ = FP(); +FP const scoped_ptr_malloc::free_ = FP(); template inline void swap(scoped_ptr_malloc& a, scoped_ptr_malloc& b) { diff --git a/mozglue/misc/AutoProfilerLabel.cpp b/mozglue/misc/AutoProfilerLabel.cpp index c6d01c2700e2..5fd820cc5ba2 100644 --- a/mozglue/misc/AutoProfilerLabel.cpp +++ b/mozglue/misc/AutoProfilerLabel.cpp @@ -53,8 +53,7 @@ class MOZ_RAII AutoProfilerLabelData { static uint32_t sGeneration; }; -MOZ_RUNINIT /* static */ AutoProfilerLabelData::Mutex - AutoProfilerLabelData::sAPLMutex; +/* static */ AutoProfilerLabelData::Mutex AutoProfilerLabelData::sAPLMutex; /* static */ ProfilerLabelEnter AutoProfilerLabelData::sEnter = nullptr; /* static */ ProfilerLabelExit AutoProfilerLabelData::sExit = nullptr; /* static */ uint32_t AutoProfilerLabelData::sGeneration = 0; diff --git a/mozglue/misc/SSE.cpp b/mozglue/misc/SSE.cpp index 61060e46e600..74f3917788d0 100644 --- a/mozglue/misc/SSE.cpp +++ b/mozglue/misc/SSE.cpp @@ -7,8 +7,6 @@ #include "SSE.h" -#include "mozilla/Attributes.h" - #ifdef HAVE_CPUID_H // cpuid.h is available on gcc 4.3 and higher on i386 and x86_64 # include @@ -171,39 +169,39 @@ namespace sse_private { #if defined(MOZILLA_SSE_HAVE_CPUID_DETECTION) # if !defined(MOZILLA_PRESUME_MMX) -MOZ_RUNINIT bool mmx_enabled = has_cpuid_bits(1u, edx, (1u << 23)); +bool mmx_enabled = has_cpuid_bits(1u, edx, (1u << 23)); # endif # if !defined(MOZILLA_PRESUME_SSE) -MOZ_RUNINIT bool sse_enabled = has_cpuid_bits(1u, edx, (1u << 25)); +bool sse_enabled = has_cpuid_bits(1u, edx, (1u << 25)); # endif # if !defined(MOZILLA_PRESUME_SSE2) -MOZ_RUNINIT bool sse2_enabled = has_cpuid_bits(1u, edx, (1u << 26)); +bool sse2_enabled = has_cpuid_bits(1u, edx, (1u << 26)); # endif # if !defined(MOZILLA_PRESUME_SSE3) -MOZ_RUNINIT bool sse3_enabled = has_cpuid_bits(1u, ecx, (1u << 0)); +bool sse3_enabled = has_cpuid_bits(1u, ecx, (1u << 0)); # endif # if !defined(MOZILLA_PRESUME_SSSE3) -MOZ_RUNINIT bool ssse3_enabled = has_cpuid_bits(1u, ecx, (1u << 9)); +bool ssse3_enabled = has_cpuid_bits(1u, ecx, (1u << 9)); # endif # if !defined(MOZILLA_PRESUME_SSE4A) -MOZ_RUNINIT bool sse4a_enabled = has_cpuid_bits(0x80000001u, ecx, (1u << 6)); +bool sse4a_enabled = has_cpuid_bits(0x80000001u, ecx, (1u << 6)); # endif # if !defined(MOZILLA_PRESUME_SSE4_1) -MOZ_RUNINIT bool sse4_1_enabled = has_cpuid_bits(1u, ecx, (1u << 19)); +bool sse4_1_enabled = has_cpuid_bits(1u, ecx, (1u << 19)); # endif # if !defined(MOZILLA_PRESUME_SSE4_2) -MOZ_RUNINIT bool sse4_2_enabled = has_cpuid_bits(1u, ecx, (1u << 20)); +bool sse4_2_enabled = has_cpuid_bits(1u, ecx, (1u << 20)); # endif # if !defined(MOZILLA_PRESUME_FMA3) -MOZ_RUNINIT bool fma3_enabled = has_cpuid_bits(1u, ecx, (1u << 12)); +bool fma3_enabled = has_cpuid_bits(1u, ecx, (1u << 12)); # endif # if !defined(MOZILLA_PRESUME_AVX) || !defined(MOZILLA_PRESUME_AVX2) @@ -227,22 +225,22 @@ static bool has_avx() { # endif // !MOZILLA_PRESUME_AVX || !MOZILLA_PRESUME_AVX2 # if !defined(MOZILLA_PRESUME_AVX) -MOZ_RUNINIT bool avx_enabled = has_avx(); +bool avx_enabled = has_avx(); # endif # if !defined(MOZILLA_PRESUME_AVX2) -MOZ_RUNINIT bool avx2_enabled = has_avx() && has_cpuid_bits(7u, ebx, (1u << 5)); +bool avx2_enabled = has_avx() && has_cpuid_bits(7u, ebx, (1u << 5)); # endif # if !defined(MOZILLA_PRESUME_AVXVNNI) -MOZ_RUNINIT bool avxvnni_enabled = has_cpuid_bits_ex(7u, eax, (1u << 4)); +bool avxvnni_enabled = has_cpuid_bits_ex(7u, eax, (1u << 4)); # endif # if !defined(MOZILLA_PRESUME_AES) -MOZ_RUNINIT bool aes_enabled = has_cpuid_bits(1u, ecx, (1u << 25)); +bool aes_enabled = has_cpuid_bits(1u, ecx, (1u << 25)); # endif -MOZ_RUNINIT bool has_constant_tsc = has_cpuid_bits(0x80000007u, edx, (1u << 8)); +bool has_constant_tsc = has_cpuid_bits(0x80000007u, edx, (1u << 8)); #endif diff --git a/mozglue/misc/TimeStamp.cpp b/mozglue/misc/TimeStamp.cpp index 3f2da17c80e9..f77cf631323b 100644 --- a/mozglue/misc/TimeStamp.cpp +++ b/mozglue/misc/TimeStamp.cpp @@ -43,7 +43,7 @@ struct TimeStampInitialization { ~TimeStampInitialization() { TimeStamp::Shutdown(); } }; -MOZ_RUNINIT static TimeStampInitialization sInitOnce; +static TimeStampInitialization sInitOnce; MFBT_API TimeStamp TimeStamp::ProcessCreation() { if (sInitOnce.mProcessCreation.IsNull()) { diff --git a/netwerk/base/nsNetUtil.cpp b/netwerk/base/nsNetUtil.cpp index cf706105b316..33ccf6cce1bb 100644 --- a/netwerk/base/nsNetUtil.cpp +++ b/netwerk/base/nsNetUtil.cpp @@ -1806,7 +1806,7 @@ class TlsAutoIncrement { T& mVar; }; -MOZ_RUNINIT static nsTHashSet sSimpleURISchemes; +static nsTHashSet sSimpleURISchemes; static StaticRWLock sSchemeLock; namespace mozilla::net { diff --git a/netwerk/base/nsStandardURL.cpp b/netwerk/base/nsStandardURL.cpp index 6b56dde7f7e4..78a5603f6feb 100644 --- a/netwerk/base/nsStandardURL.cpp +++ b/netwerk/base/nsStandardURL.cpp @@ -202,7 +202,7 @@ const nsACString& nsStandardURL::nsSegmentEncoder::EncodeSegment( #ifdef DEBUG_DUMP_URLS_AT_SHUTDOWN static StaticMutex gAllURLsMutex MOZ_UNANNOTATED; -MOZ_RUNINIT static LinkedList gAllURLs; +static LinkedList gAllURLs; #endif nsStandardURL::nsStandardURL(bool aSupportsFileURL, bool aTrackURL) diff --git a/netwerk/cache2/CacheFileUtils.cpp b/netwerk/cache2/CacheFileUtils.cpp index cdf2f0ae2cdf..fd1a8665e481 100644 --- a/netwerk/cache2/CacheFileUtils.cpp +++ b/netwerk/cache2/CacheFileUtils.cpp @@ -354,7 +354,7 @@ ValidityPair& ValidityMap::operator[](uint32_t aIdx) { StaticMutex DetailedCacheHitTelemetry::sLock; uint32_t DetailedCacheHitTelemetry::sRecordCnt = 0; -MOZ_RUNINIT DetailedCacheHitTelemetry::HitRate +DetailedCacheHitTelemetry::HitRate DetailedCacheHitTelemetry::sHRStats[kNumOfRanges]; DetailedCacheHitTelemetry::HitRate::HitRate() { Reset(); } @@ -452,8 +452,7 @@ void DetailedCacheHitTelemetry::AddRecord(ERecType aType, } StaticMutex CachePerfStats::sLock; -MOZ_RUNINIT CachePerfStats::PerfData - CachePerfStats::sData[CachePerfStats::LAST]; +CachePerfStats::PerfData CachePerfStats::sData[CachePerfStats::LAST]; uint32_t CachePerfStats::sCacheSlowCnt = 0; uint32_t CachePerfStats::sCacheNotSlowCnt = 0; diff --git a/netwerk/protocol/http/HttpConnectionMgrParent.cpp b/netwerk/protocol/http/HttpConnectionMgrParent.cpp index 83d44d28b4e9..594fea20ece9 100644 --- a/netwerk/protocol/http/HttpConnectionMgrParent.cpp +++ b/netwerk/protocol/http/HttpConnectionMgrParent.cpp @@ -21,7 +21,7 @@ namespace mozilla::net { -MOZ_RUNINIT nsTHashMap> +nsTHashMap> HttpConnectionMgrParent::sHttpUpgradeListenerMap; uint32_t HttpConnectionMgrParent::sListenerId = 0; StaticMutex HttpConnectionMgrParent::sLock; diff --git a/netwerk/protocol/http/nsHttp.cpp b/netwerk/protocol/http/nsHttp.cpp index 5bf38dbf9fb3..74c9aaaed631 100644 --- a/netwerk/protocol/http/nsHttp.cpp +++ b/netwerk/protocol/http/nsHttp.cpp @@ -49,8 +49,7 @@ enum { }; #undef HTTP_ATOM -MOZ_RUNINIT static StaticDataMutex< - nsTHashtable> +static StaticDataMutex> sAtomTable("nsHttp::sAtomTable"); // This is set to true in DestroyAtomTable so we don't try to repopulate the diff --git a/netwerk/url-classifier/UrlClassifierFeaturePhishingProtection.cpp b/netwerk/url-classifier/UrlClassifierFeaturePhishingProtection.cpp index d347624fca52..d03f9c790bc6 100644 --- a/netwerk/url-classifier/UrlClassifierFeaturePhishingProtection.cpp +++ b/netwerk/url-classifier/UrlClassifierFeaturePhishingProtection.cpp @@ -21,8 +21,8 @@ struct UrlClassifierFeaturePhishingProtection::PhishingProtectionFeature { namespace { -MOZ_RUNINIT struct UrlClassifierFeaturePhishingProtection:: - PhishingProtectionFeature sPhishingProtectionFeaturesMap[] = { +struct UrlClassifierFeaturePhishingProtection::PhishingProtectionFeature + sPhishingProtectionFeaturesMap[] = { {"malware", "urlclassifier.malwareTable", StaticPrefs::browser_safebrowsing_malware_enabled}, {"phishing", "urlclassifier.phishTable", diff --git a/security/ct/CTPolicyEnforcer.cpp b/security/ct/CTPolicyEnforcer.cpp index 440d3e7aaa1c..4e932e5884ca 100644 --- a/security/ct/CTPolicyEnforcer.cpp +++ b/security/ct/CTPolicyEnforcer.cpp @@ -19,7 +19,7 @@ using namespace mozilla::pkix; // Returns the number of embedded SCTs required to be present in a certificate. // For certificates with a lifetime of less than or equal to 180 days, only 2 // embedded SCTs are required. Otherwise 3 are required. -MOZ_RUNINIT const Duration ONE_HUNDRED_AND_EIGHTY_DAYS = +const Duration ONE_HUNDRED_AND_EIGHTY_DAYS = Duration(180 * Time::ONE_DAY_IN_SECONDS); size_t GetRequiredEmbeddedSctsCount(Duration certLifetime) { // pkix::Duration doesn't define operator<=, hence phrasing this comparison diff --git a/security/manager/ssl/nsNSSComponent.cpp b/security/manager/ssl/nsNSSComponent.cpp index 7ac79bcefc3f..3fc1fd49b411 100644 --- a/security/manager/ssl/nsNSSComponent.cpp +++ b/security/manager/ssl/nsNSSComponent.cpp @@ -630,7 +630,7 @@ nsresult nsNSSComponent::BlockUntilLoadableCertsLoaded() { #ifndef MOZ_NO_SMART_CARDS static StaticMutex sCheckForSmartCardChangesMutex MOZ_UNANNOTATED; -MOZ_RUNINIT static TimeStamp sLastCheckedForSmartCardChanges = TimeStamp::Now(); +static TimeStamp sLastCheckedForSmartCardChanges = TimeStamp::Now(); #endif nsresult nsNSSComponent::CheckForSmartCardChanges() { diff --git a/security/manager/ssl/tests/unit/tlsserver/cmd/EncryptedClientHelloServer.cpp b/security/manager/ssl/tests/unit/tlsserver/cmd/EncryptedClientHelloServer.cpp index 2101b09c1b47..fd284874b3ad 100644 --- a/security/manager/ssl/tests/unit/tlsserver/cmd/EncryptedClientHelloServer.cpp +++ b/security/manager/ssl/tests/unit/tlsserver/cmd/EncryptedClientHelloServer.cpp @@ -23,7 +23,7 @@ struct EchHost { const char* mCertName; }; -MOZ_RUNINIT const std::vector kSuiteChaCha = { +const std::vector kSuiteChaCha = { (static_cast(HpkeKdfHkdfSha256) << 16) | HpkeAeadChaCha20Poly1305}; diff --git a/security/manager/ssl/tests/unit/tlsserver/cmd/FaultyServer.cpp b/security/manager/ssl/tests/unit/tlsserver/cmd/FaultyServer.cpp index 3c7b547df7c0..ba48016f5847 100644 --- a/security/manager/ssl/tests/unit/tlsserver/cmd/FaultyServer.cpp +++ b/security/manager/ssl/tests/unit/tlsserver/cmd/FaultyServer.cpp @@ -49,7 +49,7 @@ const char* kCertWildcard = "default-ee"; * the "default-ee" cert has a SAN for *.example.com * the "no-san-ee" cert is signed by the test-ca, but it doesn't have any SANs. */ -MOZ_RUNINIT const FaultyServerHost sFaultyServerHosts[]{ +const FaultyServerHost sFaultyServerHosts[]{ {kHostOk, kCertWildcard, None}, {kHostUnknown, kCertWildcard, UnknownSNI}, {kHostZeroRttAlertBadMac, kCertWildcard, ZeroRtt}, diff --git a/security/manager/ssl/tests/unit/tlsserver/cmd/OCSPStaplingServer.cpp b/security/manager/ssl/tests/unit/tlsserver/cmd/OCSPStaplingServer.cpp index 1defc524374b..b7dbabe0c262 100644 --- a/security/manager/ssl/tests/unit/tlsserver/cmd/OCSPStaplingServer.cpp +++ b/security/manager/ssl/tests/unit/tlsserver/cmd/OCSPStaplingServer.cpp @@ -112,7 +112,7 @@ struct CTHost { SCTsVia mSCTsVia; }; -MOZ_RUNINIT const CTHost sCTHosts[] = { +const CTHost sCTHosts[] = { {"ct-via-ocsp.example.com", {"test_ct/ct-via-ocsp-1.sct", "test_ct/ct-via-ocsp-2.sct"}, SCTsVia::OCSP}, diff --git a/security/sandbox/linux/SandboxInfo.cpp b/security/sandbox/linux/SandboxInfo.cpp index 8278bcdd1176..b060961cb995 100644 --- a/security/sandbox/linux/SandboxInfo.cpp +++ b/security/sandbox/linux/SandboxInfo.cpp @@ -175,7 +175,7 @@ static bool CanCreateUserNamespace() { } /* static */ -MOZ_RUNINIT const SandboxInfo SandboxInfo::sSingleton = SandboxInfo(); +const SandboxInfo SandboxInfo::sSingleton = SandboxInfo(); SandboxInfo::SandboxInfo() { int flags = 0; diff --git a/testing/mochitest/ssltunnel/ssltunnel.cpp b/testing/mochitest/ssltunnel/ssltunnel.cpp index 78832694e665..53b9822bf71a 100644 --- a/testing/mochitest/ssltunnel/ssltunnel.cpp +++ b/testing/mochitest/ssltunnel/ssltunnel.cpp @@ -204,8 +204,8 @@ const uint32_t MAX_THREADS = 100; const uint32_t DEFAULT_STACKSIZE = (512 * 1024); // global data -MOZ_RUNINIT string nssconfigdir; -MOZ_RUNINIT vector servers; +string nssconfigdir; +vector servers; PRNetAddr remote_addr; PRNetAddr websocket_server; PRThreadPool* threads = nullptr; diff --git a/third_party/rlbox/include/rlbox_sandbox.hpp b/third_party/rlbox/include/rlbox_sandbox.hpp index 5d193ce565c7..63995c89adf2 100644 --- a/third_party/rlbox/include/rlbox_sandbox.hpp +++ b/third_party/rlbox/include/rlbox_sandbox.hpp @@ -104,7 +104,7 @@ private: // The actual type of the vector is std::vector*> // However clang 5, 6 have bugs where compilation seg-faults on this type // So we just use this std::vector - static inline MOZ_RUNINIT std::vector sandbox_list; + static inline std::vector sandbox_list; RLBOX_SHARED_LOCK(func_ptr_cache_lock); std::map func_ptr_map; diff --git a/toolkit/components/antitracking/SettingsChangeObserver.cpp b/toolkit/components/antitracking/SettingsChangeObserver.cpp index 138016c6abe8..eb2ba5bbd334 100644 --- a/toolkit/components/antitracking/SettingsChangeObserver.cpp +++ b/toolkit/components/antitracking/SettingsChangeObserver.cpp @@ -17,8 +17,7 @@ using namespace mozilla; namespace { -MOZ_RUNINIT UniquePtr< - nsTArray> +UniquePtr> gSettingsChangedCallbacks; } diff --git a/toolkit/components/mediasniffer/nsMediaSniffer.cpp b/toolkit/components/mediasniffer/nsMediaSniffer.cpp index f97332ccd8f6..e1851d3276d1 100644 --- a/toolkit/components/mediasniffer/nsMediaSniffer.cpp +++ b/toolkit/components/mediasniffer/nsMediaSniffer.cpp @@ -75,7 +75,7 @@ struct nsMediaSnifferFtypEntry : nsMediaSnifferEntry { }; // For a complete list of file types, see http://www.ftyps.com/index.html -MOZ_RUNINIT nsMediaSnifferFtypEntry sFtypEntries[] = { +nsMediaSnifferFtypEntry sFtypEntries[] = { {PATTERN_ENTRY("\xFF\xFF\xFF", "mp4", VIDEO_MP4), PatternLabel::ftyp_mp4}, // Could be mp41 or mp42. {PATTERN_ENTRY("\xFF\xFF\xFF", "avc", VIDEO_MP4), diff --git a/toolkit/components/nimbus/lib/NimbusFeatures.cpp b/toolkit/components/nimbus/lib/NimbusFeatures.cpp index ce2dee2eca52..39140be20597 100644 --- a/toolkit/components/nimbus/lib/NimbusFeatures.cpp +++ b/toolkit/components/nimbus/lib/NimbusFeatures.cpp @@ -15,7 +15,7 @@ namespace mozilla { -MOZ_RUNINIT static nsTHashSet sExposureFeatureSet; +static nsTHashSet sExposureFeatureSet; void NimbusFeatures::GetPrefName(const nsACString& branchPrefix, const nsACString& aFeatureId, diff --git a/toolkit/components/telemetry/build_scripts/gen_scalar_data.py b/toolkit/components/telemetry/build_scripts/gen_scalar_data.py index 25af9be14d18..6ef1f457b54b 100644 --- a/toolkit/components/telemetry/build_scripts/gen_scalar_data.py +++ b/toolkit/components/telemetry/build_scripts/gen_scalar_data.py @@ -91,7 +91,7 @@ def write_scalar_tables(scalars, output): keys_table = [] total_key_count = 0 - print("MOZ_RUNINIT const ScalarInfo gScalars[] = {", file=output) + print("const ScalarInfo gScalars[] = {", file=output) for s in scalars: # We add both the scalar label and the expiration string to the strings # table. diff --git a/toolkit/components/telemetry/core/Telemetry.cpp b/toolkit/components/telemetry/core/Telemetry.cpp index 72550a10be3a..b3f030a55f14 100644 --- a/toolkit/components/telemetry/core/Telemetry.cpp +++ b/toolkit/components/telemetry/core/Telemetry.cpp @@ -185,8 +185,7 @@ class TelemetryImpl final : public nsITelemetry, public nsIMemoryReporter { friend class nsFetchTelemetryData; }; -MOZ_RUNINIT StaticDataMutex TelemetryImpl::sTelemetry(nullptr, - nullptr); +StaticDataMutex TelemetryImpl::sTelemetry(nullptr, nullptr); MOZ_DEFINE_MALLOC_SIZE_OF(TelemetryMallocSizeOf) diff --git a/toolkit/components/telemetry/core/TelemetryEvent.cpp b/toolkit/components/telemetry/core/TelemetryEvent.cpp index 6204b805856f..b032fff5212f 100644 --- a/toolkit/components/telemetry/core/TelemetryEvent.cpp +++ b/toolkit/components/telemetry/core/TelemetryEvent.cpp @@ -329,13 +329,13 @@ bool gCanRecordBase; bool gCanRecordExtended; // The EventName -> EventKey cache map. -MOZ_RUNINIT nsTHashMap gEventNameIDMap(kEventCount); +nsTHashMap gEventNameIDMap(kEventCount); // The CategoryName set. -MOZ_RUNINIT nsTHashSet gCategoryNames; +nsTHashSet gCategoryNames; // This tracks the IDs of the categories for which recording is enabled. -MOZ_RUNINIT nsTHashSet gEnabledCategories; +nsTHashSet gEnabledCategories; // The main event storage. Events are inserted here, keyed by process id and // in recording order. @@ -344,7 +344,7 @@ typedef nsTArray EventRecordArray; typedef nsClassHashtable EventRecordsMapType; -MOZ_RUNINIT EventRecordsMapType gEventRecords; +EventRecordsMapType gEventRecords; // The details on dynamic events that are recorded from addons are registered // here. diff --git a/toolkit/components/telemetry/core/TelemetryScalar.cpp b/toolkit/components/telemetry/core/TelemetryScalar.cpp index 065360996ce5..9864a536520e 100644 --- a/toolkit/components/telemetry/core/TelemetryScalar.cpp +++ b/toolkit/components/telemetry/core/TelemetryScalar.cpp @@ -1186,18 +1186,18 @@ bool gCanRecordBase; bool gCanRecordExtended; // The Name -> ID cache map. -MOZ_RUNINIT ScalarMapType gScalarNameIDMap(kScalarCount); +ScalarMapType gScalarNameIDMap(kScalarCount); // The (Process Id -> (Scalar ID -> Scalar Object)) map. This is a // nsClassHashtable, it owns the scalar instances and takes care of deallocating // them when they are removed from the map. -MOZ_RUNINIT ProcessesScalarsMapType gScalarStorageMap; +ProcessesScalarsMapType gScalarStorageMap; // As above, for the keyed scalars. -MOZ_RUNINIT ProcessesKeyedScalarsMapType gKeyedScalarStorageMap; +ProcessesKeyedScalarsMapType gKeyedScalarStorageMap; // Provide separate storage for "dynamic builtin" plain and keyed scalars, // needed to support "build faster" in local developer builds. -MOZ_RUNINIT ProcessesScalarsMapType gDynamicBuiltinScalarStorageMap; -MOZ_RUNINIT ProcessesKeyedScalarsMapType gDynamicBuiltinKeyedScalarStorageMap; +ProcessesScalarsMapType gDynamicBuiltinScalarStorageMap; +ProcessesKeyedScalarsMapType gDynamicBuiltinKeyedScalarStorageMap; } // namespace //////////////////////////////////////////////////////////////////////// diff --git a/toolkit/components/telemetry/other/TelemetryIOInterposeObserver.cpp b/toolkit/components/telemetry/other/TelemetryIOInterposeObserver.cpp index c201d90fe714..c0792bb48c2d 100644 --- a/toolkit/components/telemetry/other/TelemetryIOInterposeObserver.cpp +++ b/toolkit/components/telemetry/other/TelemetryIOInterposeObserver.cpp @@ -29,7 +29,7 @@ void TelemetryIOInterposeObserver::AddPath(const nsAString& aPath, } // Threshold for reporting slow main-thread I/O (50 milliseconds). -MOZ_RUNINIT const TimeDuration kTelemetryReportThreshold = +const TimeDuration kTelemetryReportThreshold = TimeDuration::FromMilliseconds(50); void TelemetryIOInterposeObserver::Observe(Observation& aOb) { diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp index 1d4a9477a93c..14334dbecc0f 100644 --- a/toolkit/crashreporter/nsExceptionHandler.cpp +++ b/toolkit/crashreporter/nsExceptionHandler.cpp @@ -138,7 +138,7 @@ using namespace mozilla; namespace mozilla::phc { // Global instance that is retrieved by the process generating the crash report -MOZ_RUNINIT mozilla::phc::AddrInfo gAddrInfo; +mozilla::phc::AddrInfo gAddrInfo; } // namespace mozilla::phc @@ -201,20 +201,20 @@ static const XP_CHAR dumpFileExtension[] = XP_TEXT(".dmp"); static const XP_CHAR extraFileExtension[] = XP_TEXT(".extra"); static const XP_CHAR memoryReportExtension[] = XP_TEXT(".memory.json.gz"); -MOZ_RUNINIT static std::optional defaultMemoryReportPath = {}; +static std::optional defaultMemoryReportPath = {}; static const char kCrashMainID[] = "crash.main.3\n"; static google_breakpad::ExceptionHandler* gExceptionHandler = nullptr; static mozilla::Atomic gEncounteredChildException(false); -MOZ_RUNINIT static nsCString gServerURL; +static nsCString gServerURL; -MOZ_RUNINIT static xpstring pendingDirectory; -MOZ_RUNINIT static xpstring crashReporterPath; -MOZ_RUNINIT static xpstring memoryReportPath; +static xpstring pendingDirectory; +static xpstring crashReporterPath; +static xpstring memoryReportPath; // Where crash events should go. -MOZ_RUNINIT static xpstring eventsDirectory; +static xpstring eventsDirectory; // If this is false, we don't launch the crash reporter static bool doReport = true; @@ -369,7 +369,7 @@ static void SetJitExceptionHandler() { # endif #endif // defined(XP_WIN) -MOZ_RUNINIT static struct ReservedResources { +static struct ReservedResources { #if defined(XP_WIN) && !defined(HAVE_64BIT_BUILD) // This should be bigger than xul.dll plus a bit of extra space for // MinidumpWriteDump allocations. diff --git a/toolkit/mozapps/update/updater/progressui_gtk.cpp b/toolkit/mozapps/update/updater/progressui_gtk.cpp index 78c0c17dd3b9..cfdcd5587c63 100644 --- a/toolkit/mozapps/update/updater/progressui_gtk.cpp +++ b/toolkit/mozapps/update/updater/progressui_gtk.cpp @@ -24,7 +24,7 @@ static GtkWidget* sLabel; static GtkWidget* sProgressBar; static GdkPixbuf* sPixbuf; -MOZ_RUNINIT StringTable sStrings; +StringTable sStrings; static gboolean UpdateDialog(gpointer data) { if (sQuit) { diff --git a/toolkit/mozapps/update/updater/updater.cpp b/toolkit/mozapps/update/updater/updater.cpp index b9860081058a..f490a8a4524d 100644 --- a/toolkit/mozapps/update/updater/updater.cpp +++ b/toolkit/mozapps/update/updater/updater.cpp @@ -278,7 +278,7 @@ class Thread { static NS_tchar gPatchDirPath[MAXPATHLEN]; static NS_tchar gInstallDirPath[MAXPATHLEN]; static NS_tchar gWorkingDirPath[MAXPATHLEN]; -MOZ_RUNINIT static ArchiveReader gArchiveReader; +static ArchiveReader gArchiveReader; static bool gSucceeded = false; static bool sStagedUpdate = false; static bool sReplaceRequest = false; @@ -290,7 +290,7 @@ static bool gIsElevated = false; // This string contains the MAR channel IDs that are later extracted by one of // the `ReadMARChannelIDsFrom` variants. -MOZ_RUNINIT static MARChannelStringTable gMARStrings; +static MARChannelStringTable gMARStrings; // Normally, we run updates as a result of user action (the user started Firefox // or clicked a "Restart to Update" button). But there are some cases when diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index e7666fe47eb5..61e55fd41801 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -310,7 +310,7 @@ extern const char gToolkitBuildID[]; static nsIProfileLock* gProfileLock; #if defined(MOZ_HAS_REMOTE) -MOZ_RUNINIT static RefPtr gRemoteService; +static RefPtr gRemoteService; #endif int gRestartArgc; @@ -326,7 +326,7 @@ int gKioskMonitor = -1; bool gAllowContentAnalysisArgPresent = false; -MOZ_RUNINIT nsString gAbsoluteArgv0Path; +nsString gAbsoluteArgv0Path; #if defined(XP_WIN) nsString gProcessStartupShortcut; @@ -347,7 +347,7 @@ nsString gProcessStartupShortcut; #endif #if defined(MOZ_WAYLAND) -MOZ_RUNINIT std::unique_ptr gWaylandProxy; +std::unique_ptr gWaylandProxy; #endif #include "BinaryPath.h" @@ -1285,8 +1285,8 @@ nsXULAppInfo::GetRemoteType(nsACString& aRemoteType) { return NS_OK; } -MOZ_RUNINIT static nsCString gLastAppVersion; -MOZ_RUNINIT static nsCString gLastAppBuildID; +static nsCString gLastAppVersion; +static nsCString gLastAppBuildID; NS_IMETHODIMP nsXULAppInfo::GetLastAppVersion(nsACString& aResult) { @@ -2903,7 +2903,7 @@ static ReturnAbortOnError ShowProfileSelector( static bool gDoMigration = false; static bool gDoProfileReset = false; -MOZ_RUNINIT static nsCOMPtr gResetOldProfile; +static nsCOMPtr gResetOldProfile; static nsresult LockProfile(nsINativeAppSupport* aNative, nsIFile* aRootDir, nsIFile* aLocalDir, nsIToolkitProfile* aProfile, @@ -6310,7 +6310,7 @@ struct InstallRustHooks { InstallRustHooks() { install_rust_hooks(); } }; -MOZ_RUNINIT InstallRustHooks sInstallRustHooks; +InstallRustHooks sInstallRustHooks; #ifdef MOZ_ASAN_REPORTER void setASanReporterPath(nsIFile* aDir) { diff --git a/toolkit/xre/nsX11ErrorHandler.cpp b/toolkit/xre/nsX11ErrorHandler.cpp index ab5a18852515..77f71db8f9d8 100644 --- a/toolkit/xre/nsX11ErrorHandler.cpp +++ b/toolkit/xre/nsX11ErrorHandler.cpp @@ -24,7 +24,7 @@ struct XExtension { XExtension(const char* aName, int aCode) : name(aName), major_opcode(aCode) {} }; -MOZ_RUNINIT static nsTArray sXExtensions; +static nsTArray sXExtensions; // man XSetErrorHandler says "the error handler should not call any // functions (directly or indirectly) on the display that will generate diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp index d67d5aeeeeb6..988da8e20b85 100644 --- a/toolkit/xre/nsXREDirProvider.cpp +++ b/toolkit/xre/nsXREDirProvider.cpp @@ -93,8 +93,8 @@ nsXREDirProvider* gDirServiceProvider = nullptr; nsIFile* gDataDirHomeLocal = nullptr; nsIFile* gDataDirHome = nullptr; -MOZ_RUNINIT nsCOMPtr gDataDirProfileLocal = nullptr; -MOZ_RUNINIT nsCOMPtr gDataDirProfile = nullptr; +nsCOMPtr gDataDirProfileLocal = nullptr; +nsCOMPtr gDataDirProfile = nullptr; // These are required to allow nsXREDirProvider to be usable in xpcshell tests. // where gAppData is null. diff --git a/tools/power/rapl.cpp b/tools/power/rapl.cpp index 5c39f9287746..1aa5fcf6eedd 100644 --- a/tools/power/rapl.cpp +++ b/tools/power/rapl.cpp @@ -48,8 +48,6 @@ #include #include -#define MOZ_RUNINIT __attribute__((annotate("moz_global_var"))) - //--------------------------------------------------------------------------- // Utilities //--------------------------------------------------------------------------- @@ -606,7 +604,7 @@ static double gSampleInterval_sec; static RAPL* gRapl; // All the sampled "total" values, in Watts. -MOZ_RUNINIT static std::vector gTotals_W; +static std::vector gTotals_W; // Power = Energy / Time, where power is measured in Watts, Energy is measured // in Joules, and Time is measured in seconds. diff --git a/tools/profiler/core/ProfilerThreadRegistry.cpp b/tools/profiler/core/ProfilerThreadRegistry.cpp index a7eb700ef3ea..cb456471d975 100644 --- a/tools/profiler/core/ProfilerThreadRegistry.cpp +++ b/tools/profiler/core/ProfilerThreadRegistry.cpp @@ -9,11 +9,10 @@ namespace mozilla::profiler { /* static */ -MOZ_RUNINIT ThreadRegistry::RegistryContainer - ThreadRegistry::sRegistryContainer; +ThreadRegistry::RegistryContainer ThreadRegistry::sRegistryContainer; /* static */ -MOZ_RUNINIT ThreadRegistry::RegistryMutex ThreadRegistry::sRegistryMutex; +ThreadRegistry::RegistryMutex ThreadRegistry::sRegistryMutex; #if !defined(MOZ_GECKO_PROFILER) // When MOZ_GECKO_PROFILER is not defined, the function definitions in diff --git a/tools/profiler/core/platform.cpp b/tools/profiler/core/platform.cpp index e79977d4e466..ba59390339a5 100644 --- a/tools/profiler/core/platform.cpp +++ b/tools/profiler/core/platform.cpp @@ -461,9 +461,9 @@ Json::String ToCompactString(const Json::Value& aJsonValue) { return Json::writeString(builder, aJsonValue); } -MOZ_RUNINIT /* static */ mozilla::baseprofiler::detail::BaseProfilerMutex +/* static */ mozilla::baseprofiler::detail::BaseProfilerMutex ProfilingLog::gMutex; -MOZ_RUNINIT /* static */ mozilla::UniquePtr ProfilingLog::gLog; +/* static */ mozilla::UniquePtr ProfilingLog::gLog; /* static */ void ProfilingLog::Init() { mozilla::baseprofiler::detail::BaseProfilerAutoLock lock{gMutex}; @@ -515,7 +515,7 @@ class MOZ_RAII PSAutoLock { mozilla::baseprofiler::detail::BaseProfilerAutoLock mLock; }; -MOZ_RUNINIT /* static */ mozilla::baseprofiler::detail::BaseProfilerMutex +/* static */ mozilla::baseprofiler::detail::BaseProfilerMutex PSAutoLock::gPSMutex{"Gecko Profiler mutex"}; // Only functions that take a PSLockRef arg can access CorePS's and ActivePS's @@ -1879,7 +1879,7 @@ using ProfilerStateChangeMutex = mozilla::baseprofiler::detail::BaseProfilerMutex; using ProfilerStateChangeLock = mozilla::baseprofiler::detail::BaseProfilerAutoLock; -MOZ_RUNINIT static ProfilerStateChangeMutex gProfilerStateChangeMutex; +static ProfilerStateChangeMutex gProfilerStateChangeMutex; struct IdentifiedProfilingStateChangeCallback { ProfilingStateSet mProfilingStateSet; @@ -1897,7 +1897,7 @@ struct IdentifiedProfilingStateChangeCallback { using IdentifiedProfilingStateChangeCallbackUPtr = UniquePtr; -MOZ_RUNINIT static Vector +static Vector mIdentifiedProfilingStateChangeCallbacks; void profiler_add_state_change_callback( diff --git a/tools/profiler/gecko/ProfilerChild.cpp b/tools/profiler/gecko/ProfilerChild.cpp index b5deda29b9cc..db7ef9942381 100644 --- a/tools/profiler/gecko/ProfilerChild.cpp +++ b/tools/profiler/gecko/ProfilerChild.cpp @@ -20,8 +20,8 @@ namespace mozilla { -MOZ_RUNINIT /* static */ DataMutexBase +/* static */ DataMutexBase ProfilerChild::sPendingChunkManagerUpdate{ "ProfilerChild::sPendingChunkManagerUpdate"}; diff --git a/tools/profiler/gecko/ProfilerParent.cpp b/tools/profiler/gecko/ProfilerParent.cpp index eff0898e3829..122017392d9d 100644 --- a/tools/profiler/gecko/ProfilerParent.cpp +++ b/tools/profiler/gecko/ProfilerParent.cpp @@ -154,9 +154,8 @@ class ProfileBufferGlobalController final { }; /* static */ -MOZ_RUNINIT DataMutexBase< - ProfileBufferGlobalController::ParentChunkManagerAndPendingUpdate, - baseprofiler::detail::BaseProfilerMutex> +DataMutexBase ProfileBufferGlobalController::sParentChunkManagerAndPendingUpdate{ "ProfileBufferGlobalController::sParentChunkManagerAndPendingUpdate"}; diff --git a/tools/profiler/lul/LulCommonExt.h b/tools/profiler/lul/LulCommonExt.h index 8ecc1ee8ff7f..b20a7321ff2a 100644 --- a/tools/profiler/lul/LulCommonExt.h +++ b/tools/profiler/lul/LulCommonExt.h @@ -374,7 +374,7 @@ class scoped_ptr_malloc { }; template -MOZ_RUNINIT FP const scoped_ptr_malloc::free_ = FP(); +FP const scoped_ptr_malloc::free_ = FP(); template inline void swap(scoped_ptr_malloc& a, scoped_ptr_malloc& b) { diff --git a/widget/GfxInfoBase.cpp b/widget/GfxInfoBase.cpp index f9487adae5f3..c84cce340625 100644 --- a/widget/GfxInfoBase.cpp +++ b/widget/GfxInfoBase.cpp @@ -1208,7 +1208,7 @@ nsresult GfxInfoBase::GetInfo(JSContext* aCx, return NS_OK; } -MOZ_RUNINIT nsAutoCString gBaseAppVersion; +nsAutoCString gBaseAppVersion; const nsCString& GfxInfoBase::GetApplicationVersion() { static bool versionInitialized = false; diff --git a/widget/gtk/DMABufSurface.cpp b/widget/gtk/DMABufSurface.cpp index ddffdb21616b..a2337bb16891 100644 --- a/widget/gtk/DMABufSurface.cpp +++ b/widget/gtk/DMABufSurface.cpp @@ -79,7 +79,7 @@ static LazyLogModule gDmabufRefLog("DmabufRef"); #define BUFFER_FLAGS 0 -MOZ_RUNINIT static RefPtr sSnapshotContext; +static RefPtr sSnapshotContext; static StaticMutex sSnapshotContextMutex MOZ_UNANNOTATED; static Atomic gNewSurfaceUID(1); diff --git a/widget/gtk/MPRISServiceHandler.cpp b/widget/gtk/MPRISServiceHandler.cpp index 4fdb1e1b845d..1ce4aa519a7e 100644 --- a/widget/gtk/MPRISServiceHandler.cpp +++ b/widget/gtk/MPRISServiceHandler.cpp @@ -874,8 +874,7 @@ struct InterfaceProperty { const char* interface; const char* property; }; -MOZ_RUNINIT static const std::unordered_map +static const std::unordered_map gKeyProperty = { {dom::MediaControlKey::Focus, {DBUS_MPRIS_INTERFACE, "CanRaise"}}, {dom::MediaControlKey::Nexttrack, diff --git a/widget/gtk/WaylandBuffer.cpp b/widget/gtk/WaylandBuffer.cpp index c90f7d43c254..f3fc4093623f 100644 --- a/widget/gtk/WaylandBuffer.cpp +++ b/widget/gtk/WaylandBuffer.cpp @@ -37,10 +37,9 @@ namespace mozilla::widget { gfx::SurfaceFormat WaylandBuffer::mFormat = gfx::SurfaceFormat::B8G8R8A8; #ifdef MOZ_LOGGING -MOZ_RUNINIT int WaylandBufferSHM::mDumpSerial = +int WaylandBufferSHM::mDumpSerial = PR_GetEnv("MOZ_WAYLAND_DUMP_WL_BUFFERS") ? 1 : 0; -MOZ_RUNINIT char* WaylandBufferSHM::mDumpDir = - PR_GetEnv("MOZ_WAYLAND_DUMP_DIR"); +char* WaylandBufferSHM::mDumpDir = PR_GetEnv("MOZ_WAYLAND_DUMP_DIR"); #endif /* static */ diff --git a/widget/gtk/WaylandVsyncSource.cpp b/widget/gtk/WaylandVsyncSource.cpp index 685a39491b43..5512987e3b09 100644 --- a/widget/gtk/WaylandVsyncSource.cpp +++ b/widget/gtk/WaylandVsyncSource.cpp @@ -55,7 +55,7 @@ static float GetFPS(TimeDuration aVsyncRate) { return 1000.0f / float(aVsyncRate.ToMilliseconds()); } -MOZ_RUNINIT static nsTArray gWaylandVsyncSources; +static nsTArray gWaylandVsyncSources; Maybe WaylandVsyncSource::GetFastestVsyncRate() { Maybe retVal; diff --git a/widget/gtk/nsClipboard.cpp b/widget/gtk/nsClipboard.cpp index 8749fa228da0..630cc848ed9f 100644 --- a/widget/gtk/nsClipboard.cpp +++ b/widget/gtk/nsClipboard.cpp @@ -66,8 +66,8 @@ static const char kHTMLMarkupPrefix[] = static const char kURIListMime[] = "text/uri-list"; -MOZ_CONSTINIT ClipboardTargets nsRetrievalContext::sClipboardTargets; -MOZ_CONSTINIT ClipboardTargets nsRetrievalContext::sPrimaryTargets; +ClipboardTargets nsRetrievalContext::sClipboardTargets; +ClipboardTargets nsRetrievalContext::sPrimaryTargets; // Callback when someone asks us for the data static void clipboard_get_cb(GtkClipboard* aGtkClipboard, diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index 89110eed4e71..1d5fa25f2734 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -347,7 +347,7 @@ static uint32_t gLastTouchID = 0; // event is a correct one when we get it. // Store it and issue it later from enter notify event if it's correct, // throw it away otherwise. -MOZ_RUNINIT static GUniquePtr sStoredLeaveNotifyEvent; +static GUniquePtr sStoredLeaveNotifyEvent; #define NS_WINDOW_TITLE_MAX_LENGTH 4095 diff --git a/widget/nsBaseWidget.cpp b/widget/nsBaseWidget.cpp index 9ef34b879291..428ca3cb40d8 100644 --- a/widget/nsBaseWidget.cpp +++ b/widget/nsBaseWidget.cpp @@ -116,7 +116,7 @@ int32_t nsIWidget::sPointerIdCounter = 0; // Some statics from nsIWidget.h /*static*/ uint64_t AutoObserverNotifier::sObserverId = 0; -MOZ_RUNINIT /*static*/ nsTHashMap> +/*static*/ nsTHashMap> AutoObserverNotifier::sSavedObservers; // The maximum amount of time to let the EnableDragDrop runnable wait in the diff --git a/widget/nsXPLookAndFeel.cpp b/widget/nsXPLookAndFeel.cpp index 44d3cd7fffb5..da71b8a5abdf 100644 --- a/widget/nsXPLookAndFeel.cpp +++ b/widget/nsXPLookAndFeel.cpp @@ -114,8 +114,7 @@ static ColorCaches sColorCaches; static EnumeratedCache, FloatID::End> sFloatCache; static EnumeratedCache, IntID::End> sIntCache; -MOZ_RUNINIT static EnumeratedCache - sFontCache; +static EnumeratedCache sFontCache; // To make one of these prefs toggleable from a reftest add a user // pref in testing/profiles/reftest/user.js. For example, to make diff --git a/xpcom/base/nsIClassInfoImpl.h b/xpcom/base/nsIClassInfoImpl.h index bb2591793e3b..045e75e5aff9 100644 --- a/xpcom/base/nsIClassInfoImpl.h +++ b/xpcom/base/nsIClassInfoImpl.h @@ -118,12 +118,11 @@ class GenericClassInfo : public nsIClassInfo { #define NS_IMPL_CLASSINFO(_class, _getscriptablehelper, _flags, _cid) \ NS_DECL_CI_INTERFACE_GETTER(_class) \ - MOZ_RUNINIT MOZ_GENERATED static const GenericClassInfo::ClassInfoData \ - k##_class##ClassInfoData = { \ - NS_CI_INTERFACE_GETTER_NAME(_class), \ - _getscriptablehelper, \ - _flags | nsIClassInfo::SINGLETON_CLASSINFO, \ - _cid, \ + static const GenericClassInfo::ClassInfoData k##_class##ClassInfoData = { \ + NS_CI_INTERFACE_GETTER_NAME(_class), \ + _getscriptablehelper, \ + _flags | nsIClassInfo::SINGLETON_CLASSINFO, \ + _cid, \ }; \ mozilla::AlignedStorage2 k##_class##ClassInfoDataPlace; \ nsIClassInfo* NS_CLASSINFO_NAME(_class) = nullptr; diff --git a/xpcom/base/nsMemoryInfoDumper.cpp b/xpcom/base/nsMemoryInfoDumper.cpp index dbbdeeeb1e66..433919146aa1 100644 --- a/xpcom/base/nsMemoryInfoDumper.cpp +++ b/xpcom/base/nsMemoryInfoDumper.cpp @@ -690,7 +690,7 @@ nsMemoryInfoDumper::DumpMemoryInfoToTempDir(const nsAString& aIdentifier, } #ifdef MOZ_DMD -MOZ_RUNINIT dmd::DMDFuncs::Singleton dmd::DMDFuncs::sSingleton; +dmd::DMDFuncs::Singleton dmd::DMDFuncs::sSingleton; nsresult nsMemoryInfoDumper::OpenDMDFile(const nsAString& aIdentifier, int aPid, FILE** aOutFile) { diff --git a/xpcom/base/nsTraceRefcnt.cpp b/xpcom/base/nsTraceRefcnt.cpp index d359c9e98295..36fede4b5a0a 100644 --- a/xpcom/base/nsTraceRefcnt.cpp +++ b/xpcom/base/nsTraceRefcnt.cpp @@ -81,7 +81,7 @@ class MOZ_CAPABILITY("mutex") TraceLogMutex } }; -MOZ_RUNINIT static TraceLogMutex gTraceLog; +static TraceLogMutex gTraceLog; class MOZ_RAII AutoTraceLogLock { public: diff --git a/xpfe/appshell/AppWindow.cpp b/xpfe/appshell/AppWindow.cpp index 52f682b8a9ef..7927d27a384f 100644 --- a/xpfe/appshell/AppWindow.cpp +++ b/xpfe/appshell/AppWindow.cpp @@ -2868,7 +2868,7 @@ static bool sWaitingForHiddenWindowToLoadNativeMenus = # endif ; -MOZ_RUNINIT static nsTArray sLoadNativeMenusListeners; +static nsTArray sLoadNativeMenusListeners; static void BeginLoadNativeMenus(Document* aDoc, nsIWidget* aParentWindow);