Bug 1364465 - Make shaped-word caches in gfxFont instances use fallible allocation, for a less drastic failure mode in the event of allocation failure. r=jrmuizel
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -2592,17 +2592,17 @@ gfxFont::GetShapedWord(DrawTarget *aDraw
}
// if there's a cached entry for this word, just return it
CacheHashKey key(aText, aLength, aHash,
aRunScript,
aAppUnitsPerDevUnit,
aFlags, aRounding);
- CacheHashEntry *entry = mWordCache->PutEntry(key);
+ CacheHashEntry* entry = mWordCache->PutEntry(key, fallible);
if (!entry) {
NS_WARNING("failed to create word cache entry - expect missing text");
return nullptr;
}
gfxShapedWord* sw = entry->mShapedWord.get();
if (sw) {
sw->ResetAge();