mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1926565 - QM: Add a way to detect a closed CachingDatabaseConnection; r=dom-storage-reviewers,jstutte
Differential Revision: https://phabricator.services.mozilla.com/D226647
This commit is contained in:
parent
40c2d54381
commit
11b00c8709
@ -93,6 +93,8 @@ void CachingDatabaseConnection::Close() {
|
||||
|
||||
MOZ_ALWAYS_SUCCEEDS((*mStorageConnection)->Close());
|
||||
mStorageConnection.destroy();
|
||||
|
||||
mClosed = true;
|
||||
}
|
||||
|
||||
#if defined(DEBUG) || defined(NS_BUILD_REFCNT_LOGGING)
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsString.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/InitializedOnce.h"
|
||||
#include "mozilla/NotNull.h"
|
||||
@ -85,6 +86,8 @@ class CachingDatabaseConnection {
|
||||
return **mStorageConnection;
|
||||
}
|
||||
|
||||
bool Closed() const { return mClosed; }
|
||||
|
||||
Result<CachedStatement, nsresult> GetCachedStatement(
|
||||
const nsACString& aQuery);
|
||||
|
||||
@ -136,6 +139,7 @@ class CachingDatabaseConnection {
|
||||
mStorageConnection;
|
||||
nsInterfaceHashtable<nsCStringHashKey, mozIStorageStatement>
|
||||
mCachedStatements;
|
||||
Atomic<bool> mClosed;
|
||||
};
|
||||
|
||||
class CachingDatabaseConnection::CachedStatement final {
|
||||
|
Loading…
Reference in New Issue
Block a user