Bug 1866402 - Rename nsCStringHashKeyDM to nsCStringHashKeyWithDisabledMemmove; r=dom-storage-reviewers,jari

Differential Revision: https://phabricator.services.mozilla.com/D223302
This commit is contained in:
Jan Varga
2024-10-09 22:16:51 +00:00
parent c6c0142359
commit ad9dc689ee
3 changed files with 8 additions and 6 deletions

View File

@@ -56,7 +56,8 @@ namespace {
// The assertion type must be the same as the assertion type used for defining
// the base class for FileSystemDataManager in FileSystemDataManager.h!
using FileSystemDataManagerHashKey =
std::conditional<ReleaseAssertEnabled::value, quota::nsCStringHashKeyDM,
std::conditional<ReleaseAssertEnabled::value,
quota::nsCStringHashKeyWithDisabledMemmove,
nsCStringHashKey>::type;
// Raw (but checked when the diagnostic assert is enabled) references as we

View File

@@ -2757,9 +2757,9 @@ StaticAutoPtr<PrepareDatastoreOpArray> gPrepareDatastoreOps;
// When CheckedUnsafePtr's checking is enabled, it's necessary to ensure that
// the hashtable uses the copy constructor instead of memmove for moving entries
// since memmove will break CheckedUnsafePtr in a memory-corrupting way.
using DatastoreHashKey =
std::conditional<DiagnosticAssertEnabled::value, nsCStringHashKeyDM,
nsCStringHashKey>::type;
using DatastoreHashKey = std::conditional<DiagnosticAssertEnabled::value,
nsCStringHashKeyWithDisabledMemmove,
nsCStringHashKey>::type;
using DatastoreHashtable =
nsBaseHashtable<DatastoreHashKey, NotNull<CheckedUnsafePtr<Datastore>>,

View File

@@ -12,9 +12,10 @@
namespace mozilla::dom::quota {
// nsCStringHashKey with disabled memmove
class nsCStringHashKeyDM : public nsCStringHashKey {
class nsCStringHashKeyWithDisabledMemmove : public nsCStringHashKey {
public:
explicit nsCStringHashKeyDM(const nsCStringHashKey::KeyTypePointer aKey)
explicit nsCStringHashKeyWithDisabledMemmove(
const nsCStringHashKey::KeyTypePointer aKey)
: nsCStringHashKey(aKey) {}
enum { ALLOW_MEMMOVE = false };
};