tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 1bacc90000e4476dfd8ddec95052fb4720f50ada
parent 23ba459f0e6e152794cde6d4ca9b250f88718a90
Author: Chris Peterson <cpeterson@mozilla.com>
Date:   Tue,  9 Dec 2025 00:01:27 +0000

Bug 2002864 - Replace MOZ_CONSTINIT with C++20 constinit in Android code. r=geckoview-reviewers,nalexander

Differential Revision: https://phabricator.services.mozilla.com/D274496

Diffstat:
Mmozglue/android/APKOpen.cpp | 3++-
Mwidget/android/OhttpHelper.h | 4++--
Mwidget/android/nsAppShell.cpp | 2+-
Mwidget/android/nsWindow.cpp | 2+-
4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/mozglue/android/APKOpen.cpp b/mozglue/android/APKOpen.cpp @@ -135,7 +135,8 @@ void abortThroughJava(const char* msg) { env->PopLocalFrame(nullptr); } -MOZ_CONSTINIT Bootstrap::UniquePtr gBootstrap; +constinit Bootstrap::UniquePtr gBootstrap; + #ifndef MOZ_FOLD_LIBS static void* sqlite_handle = nullptr; static void* nspr_handle = nullptr; diff --git a/widget/android/OhttpHelper.h b/widget/android/OhttpHelper.h @@ -61,8 +61,8 @@ class OhttpHelper final { static inline uint8_t sInitializationBitset = 0; static inline StaticAutoPtr<nsTArray<uint8_t>> sConfigData; - MOZ_CONSTINIT static inline nsCString sConfigUrl; - MOZ_CONSTINIT static inline nsCString sRelayUrl; + constinit static inline nsCString sConfigUrl; + constinit static inline nsCString sRelayUrl; static inline StaticAutoPtr<nsTArray<RefPtr<OhttpRequest>>> sPendingRequests; }; diff --git a/widget/android/nsAppShell.cpp b/widget/android/nsAppShell.cpp @@ -112,7 +112,7 @@ class WakeLockListener final : public nsIDOMMozWakeLockListener { }; NS_IMPL_ISUPPORTS(WakeLockListener, nsIDOMMozWakeLockListener) -MOZ_CONSTINIT nsCOMPtr<nsIPowerManagerService> sPowerManagerService{}; +constinit nsCOMPtr<nsIPowerManagerService> sPowerManagerService{}; StaticRefPtr<WakeLockListener> sWakeLockListener; class GeckoThreadSupport final diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp @@ -131,7 +131,7 @@ static mozilla::LazyLogModule sGVSupportLog("GeckoViewSupport"); // All the toplevel windows that have been created; these are in // stacking order, so the window at gTopLevelWindows[0] is the topmost // one. -MOZ_CONSTINIT static nsTArray<nsWindow*> gTopLevelWindows; +constinit static nsTArray<nsWindow*> gTopLevelWindows; static const double kTouchResampleVsyncAdjustMs = 5.0;