mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-09 08:48:07 +00:00
Bug 838105 - don't rely on key lookup to remove items from the user font cache, as the principal could have changed. r=jdaggett
This commit is contained in:
parent
1069bab4a7
commit
bdfea7f41f
@ -810,6 +810,14 @@ gfxUserFontSet::UserFontCache::Entry::RemoveIfPrivate(Entry* aEntry,
|
||||
return aEntry->mPrivate ? PL_DHASH_REMOVE : PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
PLDHashOperator
|
||||
gfxUserFontSet::UserFontCache::Entry::RemoveIfMatches(Entry* aEntry,
|
||||
void* aUserData)
|
||||
{
|
||||
return aEntry->GetFontEntry() == static_cast<gfxFontEntry*>(aUserData) ?
|
||||
PL_DHASH_REMOVE : PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
PLDHashOperator
|
||||
gfxUserFontSet::UserFontCache::Entry::DisconnectSVG(Entry* aEntry,
|
||||
void* aUserData)
|
||||
@ -902,11 +910,11 @@ gfxUserFontSet::UserFontCache::ForgetFont(gfxFontEntry *aFontEntry)
|
||||
return;
|
||||
}
|
||||
|
||||
gfxUserFontData *data = aFontEntry->mUserFontData;
|
||||
if (data) {
|
||||
sUserFonts->RemoveEntry(Key(data->mURI, data->mPrincipal, aFontEntry,
|
||||
data->mPrivate));
|
||||
}
|
||||
// We can't simply use RemoveEntry here because it's possible the principal
|
||||
// may have changed since the font was cached, in which case the lookup
|
||||
// would no longer find the entry (bug 838105).
|
||||
sUserFonts->EnumerateEntries(
|
||||
gfxUserFontSet::UserFontCache::Entry::RemoveIfMatches, aFontEntry);
|
||||
}
|
||||
|
||||
gfxFontEntry*
|
||||
|
@ -346,6 +346,7 @@ public:
|
||||
gfxFontEntry* GetFontEntry() const { return mFontEntry; }
|
||||
|
||||
static PLDHashOperator RemoveIfPrivate(Entry* aEntry, void* aUserData);
|
||||
static PLDHashOperator RemoveIfMatches(Entry* aEntry, void* aUserData);
|
||||
static PLDHashOperator DisconnectSVG(Entry* aEntry, void* aUserData);
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user