From 46bc8aab0009a1ac6763bbb4bc59d3201cefa7ce Mon Sep 17 00:00:00 2001 From: Jan Varga Date: Thu, 14 Mar 2024 07:04:30 +0000 Subject: [PATCH] Bug 1858989 - Change CachingDatabaseConnection to use serial event targets; r=dom-storage-reviewers,asuth Differential Revision: https://phabricator.services.mozilla.com/D203293 --- dom/quota/CachingDatabaseConnection.cpp | 4 ++-- dom/quota/CachingDatabaseConnection.h | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dom/quota/CachingDatabaseConnection.cpp b/dom/quota/CachingDatabaseConnection.cpp index 4805d4e685da..dfdf0f71da76 100644 --- a/dom/quota/CachingDatabaseConnection.cpp +++ b/dom/quota/CachingDatabaseConnection.cpp @@ -15,7 +15,7 @@ CachingDatabaseConnection::CachingDatabaseConnection( MovingNotNull> aStorageConnection) : #ifdef MOZ_THREAD_SAFETY_OWNERSHIP_CHECKS_SUPPORTED - mOwningThread{nsAutoOwningThread{}}, + mOwningEventTarget{nsAutoOwningEventTarget{}}, #endif mStorageConnection(std::move(aStorageConnection)) { } @@ -23,7 +23,7 @@ CachingDatabaseConnection::CachingDatabaseConnection( void CachingDatabaseConnection::LazyInit( MovingNotNull> aStorageConnection) { #ifdef MOZ_THREAD_SAFETY_OWNERSHIP_CHECKS_SUPPORTED - mOwningThread.init(); + mOwningEventTarget.init(); #endif mStorageConnection.init(std::move(aStorageConnection)); } diff --git a/dom/quota/CachingDatabaseConnection.h b/dom/quota/CachingDatabaseConnection.h index 64eeabe5c883..c9d7dbdd6bcc 100644 --- a/dom/quota/CachingDatabaseConnection.h +++ b/dom/quota/CachingDatabaseConnection.h @@ -14,6 +14,7 @@ #include "nscore.h" #include "nsHashKeys.h" #include "nsInterfaceHashtable.h" +#include "nsISupportsImpl.h" #include "nsString.h" #include "mozilla/Assertions.h" #include "mozilla/Attributes.h" @@ -68,7 +69,8 @@ class CachingDatabaseConnection { void AssertIsOnConnectionThread() const { #ifdef MOZ_THREAD_SAFETY_OWNERSHIP_CHECKS_SUPPORTED - mOwningThread->AssertOwnership("CachingDatabaseConnection not thread-safe"); + mOwningEventTarget->AssertOwnership( + "CachingDatabaseConnection not thread-safe"); #endif } @@ -126,7 +128,7 @@ class CachingDatabaseConnection { private: #ifdef MOZ_THREAD_SAFETY_OWNERSHIP_CHECKS_SUPPORTED - LazyInitializedOnce mOwningThread; + LazyInitializedOnce mOwningEventTarget; #endif LazyInitializedOnceEarlyDestructible<