mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 872678: Mark nsStaticNameTable immutable after initialization to fix assertions r=dbaron
This commit is contained in:
parent
4a039e4a6e
commit
d2ab636b5e
@ -26,7 +26,7 @@ struct NameTableKey
|
||||
{
|
||||
mKeyStr.m1b = aKeyStr;
|
||||
}
|
||||
|
||||
|
||||
NameTableKey(const nsAFlatString* aKeyStr)
|
||||
: mIsUnichar(true)
|
||||
{
|
||||
@ -56,7 +56,7 @@ matchNameKeysCaseInsensitive(PLDHashTable*, const PLDHashEntryHdr* aHdr,
|
||||
const NameTableKey *keyValue = static_cast<const NameTableKey*>(key);
|
||||
|
||||
const nsAFlatCString* entryKey = entry->mString;
|
||||
|
||||
|
||||
if (keyValue->mIsUnichar) {
|
||||
return keyValue->mKeyStr.m2b->
|
||||
LowerCaseEqualsASCII(entryKey->get(), entryKey->Length());
|
||||
@ -127,7 +127,7 @@ nsStaticCaseInsensitiveNameTable::~nsStaticCaseInsensitiveNameTable()
|
||||
MOZ_COUNT_DTOR(nsStaticCaseInsensitiveNameTable);
|
||||
}
|
||||
|
||||
bool
|
||||
bool
|
||||
nsStaticCaseInsensitiveNameTable::Init(const char* const aNames[], int32_t Count)
|
||||
{
|
||||
NS_ASSERTION(!mNameArray, "double Init");
|
||||
@ -179,6 +179,9 @@ nsStaticCaseInsensitiveNameTable::Init(const char* const aNames[], int32_t Count
|
||||
entry->mString = strPtr; // not owned!
|
||||
entry->mIndex = index;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
PL_DHashMarkTableImmutable(&mNameTable);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user