зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1172817 - Remove PL_DHashTableEnumerate() use from FontNameCache. r=jtd.
This commit is contained in:
Родитель
0b8c9d02bd
Коммит
aec584b5a8
|
@ -650,7 +650,21 @@ public:
|
|||
}
|
||||
|
||||
nsAutoCString buf;
|
||||
PL_DHashTableEnumerate(&mMap, WriteOutMap, &buf);
|
||||
for (auto iter = mMap.Iter(); !iter.Done(); iter.Next()) {
|
||||
auto entry = static_cast<FNCMapEntry*>(iter.Get());
|
||||
if (!entry->mFileExists) {
|
||||
// skip writing entries for files that are no longer present
|
||||
continue;
|
||||
}
|
||||
buf.Append(entry->mFilename);
|
||||
buf.Append(';');
|
||||
buf.Append(entry->mFaces);
|
||||
buf.Append(';');
|
||||
buf.AppendInt(entry->mTimestamp);
|
||||
buf.Append(';');
|
||||
buf.AppendInt(entry->mFilesize);
|
||||
buf.Append(';');
|
||||
}
|
||||
mCache->PutBuffer(CACHE_KEY, buf.get(), buf.Length() + 1);
|
||||
}
|
||||
|
||||
|
@ -748,28 +762,6 @@ private:
|
|||
|
||||
PLDHashTableOps mOps;
|
||||
|
||||
static PLDHashOperator WriteOutMap(PLDHashTable *aTable,
|
||||
PLDHashEntryHdr *aHdr,
|
||||
uint32_t aNumber, void *aData)
|
||||
{
|
||||
FNCMapEntry* entry = static_cast<FNCMapEntry*>(aHdr);
|
||||
if (!entry->mFileExists) {
|
||||
// skip writing entries for files that are no longer present
|
||||
return PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
nsAutoCString* buf = reinterpret_cast<nsAutoCString*>(aData);
|
||||
buf->Append(entry->mFilename);
|
||||
buf->Append(';');
|
||||
buf->Append(entry->mFaces);
|
||||
buf->Append(';');
|
||||
buf->AppendInt(entry->mTimestamp);
|
||||
buf->Append(';');
|
||||
buf->AppendInt(entry->mFilesize);
|
||||
buf->Append(';');
|
||||
return PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
typedef struct : public PLDHashEntryHdr {
|
||||
public:
|
||||
nsCString mFilename;
|
||||
|
|
Загрузка…
Ссылка в новой задаче