mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Bug 1858989 - Change CachingDatabaseConnection to use serial event targets; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D203293
This commit is contained in:
parent
80961933e1
commit
46bc8aab00
@ -15,7 +15,7 @@ CachingDatabaseConnection::CachingDatabaseConnection(
|
||||
MovingNotNull<nsCOMPtr<mozIStorageConnection>> 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<nsCOMPtr<mozIStorageConnection>> aStorageConnection) {
|
||||
#ifdef MOZ_THREAD_SAFETY_OWNERSHIP_CHECKS_SUPPORTED
|
||||
mOwningThread.init();
|
||||
mOwningEventTarget.init();
|
||||
#endif
|
||||
mStorageConnection.init(std::move(aStorageConnection));
|
||||
}
|
||||
|
@ -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<const nsAutoOwningThread> mOwningThread;
|
||||
LazyInitializedOnce<const nsAutoOwningEventTarget> mOwningEventTarget;
|
||||
#endif
|
||||
|
||||
LazyInitializedOnceEarlyDestructible<
|
||||
|
Loading…
Reference in New Issue
Block a user