mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 1858989 - Bring back owning thread assertions; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D203292
This commit is contained in:
parent
f5c399d83f
commit
80961933e1
@ -14,7 +14,7 @@ namespace mozilla::dom::quota {
|
||||
CachingDatabaseConnection::CachingDatabaseConnection(
|
||||
MovingNotNull<nsCOMPtr<mozIStorageConnection>> aStorageConnection)
|
||||
:
|
||||
#ifdef CACHING_DB_CONNECTION_CHECK_THREAD_OWNERSHIP
|
||||
#ifdef MOZ_THREAD_SAFETY_OWNERSHIP_CHECKS_SUPPORTED
|
||||
mOwningThread{nsAutoOwningThread{}},
|
||||
#endif
|
||||
mStorageConnection(std::move(aStorageConnection)) {
|
||||
@ -22,7 +22,7 @@ CachingDatabaseConnection::CachingDatabaseConnection(
|
||||
|
||||
void CachingDatabaseConnection::LazyInit(
|
||||
MovingNotNull<nsCOMPtr<mozIStorageConnection>> aStorageConnection) {
|
||||
#ifdef CACHING_DB_CONNECTION_CHECK_THREAD_OWNERSHIP
|
||||
#ifdef MOZ_THREAD_SAFETY_OWNERSHIP_CHECKS_SUPPORTED
|
||||
mOwningThread.init();
|
||||
#endif
|
||||
mStorageConnection.init(std::move(aStorageConnection));
|
||||
|
@ -67,7 +67,7 @@ class CachingDatabaseConnection {
|
||||
class LazyStatement;
|
||||
|
||||
void AssertIsOnConnectionThread() const {
|
||||
#ifdef CACHING_DB_CONNECTION_CHECK_THREAD_OWNERSHIP
|
||||
#ifdef MOZ_THREAD_SAFETY_OWNERSHIP_CHECKS_SUPPORTED
|
||||
mOwningThread->AssertOwnership("CachingDatabaseConnection not thread-safe");
|
||||
#endif
|
||||
}
|
||||
@ -125,7 +125,7 @@ class CachingDatabaseConnection {
|
||||
void Close();
|
||||
|
||||
private:
|
||||
#ifdef CACHING_DB_CONNECTION_CHECK_THREAD_OWNERSHIP
|
||||
#ifdef MOZ_THREAD_SAFETY_OWNERSHIP_CHECKS_SUPPORTED
|
||||
LazyInitializedOnce<const nsAutoOwningThread> mOwningThread;
|
||||
#endif
|
||||
|
||||
|
@ -33,14 +33,4 @@
|
||||
# define QM_COLLECTING_OPERATION_TELEMETRY
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The thread ownership checks in CachingDatabaseConnection assumes that the
|
||||
* object lives on a single thread, not any serial event target.
|
||||
* Defining CACHING_DB_CONNECTION_CHECK_THREAD_OWNERSHIP restores the checks.
|
||||
* See bug 1858989.
|
||||
*/
|
||||
#if 0
|
||||
# define CACHING_DB_CONNECTION_CHECK_THREAD_OWNERSHIP 1
|
||||
#endif
|
||||
|
||||
#endif // DOM_QUOTA_CONFIG_H_
|
||||
|
Loading…
Reference in New Issue
Block a user