commit c345fbc6a425f959a0fc86ba1434b27408d86461 parent 497e96799d2ebb4615e1f4bc8ecbb2257f0238e0 Author: Chris Peterson <cpeterson@mozilla.com> Date: Tue, 9 Dec 2025 00:01:28 +0000 Bug 2002864 - Replace MOZ_CONSTINIT with C++20 constinit in dom storage code. r=dom-storage-reviewers,jari Differential Revision: https://phabricator.services.mozilla.com/D274499 Diffstat:
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/dom/fs/test/gtest/parent/TestFileSystemOriginInitialization.cpp b/dom/fs/test/gtest/parent/TestFileSystemOriginInitialization.cpp @@ -114,7 +114,7 @@ class TestFileSystemOriginInitialization : public FileSystemParentTest { static RefPtr<MockFileSystemQuotaClient> sQuotaClient; }; -MOZ_CONSTINIT RefPtr<MockFileSystemQuotaClient> +constinit RefPtr<MockFileSystemQuotaClient> TestFileSystemOriginInitialization::sQuotaClient; TEST_F(TestFileSystemOriginInitialization, EmptyOriginDirectory) { diff --git a/dom/localstorage/ActorsParent.cpp b/dom/localstorage/ActorsParent.cpp @@ -2833,7 +2833,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_CONSTINIT UniquePtr<PrivateDatastoreHashtable> gPrivateDatastores; +constinit UniquePtr<PrivateDatastoreHashtable> gPrivateDatastores; using DatabaseArray = nsTArray<Database*>; diff --git a/dom/quota/test/gtest/QuotaManagerDependencyFixture.cpp b/dom/quota/test/gtest/QuotaManagerDependencyFixture.cpp @@ -594,7 +594,7 @@ void QuotaManagerDependencyFixture::EnsureQuotaManager() { [&resolver]() { return resolver->IsDone(); }); } -MOZ_CONSTINIT nsCOMPtr<nsISerialEventTarget> +constinit nsCOMPtr<nsISerialEventTarget> QuotaManagerDependencyFixture::sBackgroundTarget; } // namespace mozilla::dom::quota::test diff --git a/dom/quota/test/gtest/TestEncryptedStream.cpp b/dom/quota/test/gtest/TestEncryptedStream.cpp @@ -266,8 +266,8 @@ class DOM_Quota_EncryptedStream : public ::testing::Test { static std::unique_ptr<NSSInitContext, NSSInitContextDeleter> sNssContext; }; -MOZ_CONSTINIT std::unique_ptr<NSSInitContext, - DOM_Quota_EncryptedStream::NSSInitContextDeleter> +constinit std::unique_ptr<NSSInitContext, + DOM_Quota_EncryptedStream::NSSInitContextDeleter> DOM_Quota_EncryptedStream::sNssContext; enum struct FlushMode { AfterEachChunk, Never }; diff --git a/dom/quota/test/gtest/TestStorageConnection.cpp b/dom/quota/test/gtest/TestStorageConnection.cpp @@ -185,8 +185,8 @@ class TestStorageConnection : public QuotaManagerDependencyFixture { }; static std::unique_ptr<NSSInitContext, NSSInitContextDeleter> sNssContext; }; -MOZ_CONSTINIT std::unique_ptr<NSSInitContext, - TestStorageConnection::NSSInitContextDeleter> +constinit std::unique_ptr<NSSInitContext, + TestStorageConnection::NSSInitContextDeleter> TestStorageConnection::sNssContext; TEST_F(TestStorageConnection, BaseVFS) {