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
authorJonathan Kew <jkew@mozilla.com>
Mon, 19 Jun 2017 13:29:22 +0100
changeset 596630 e9ae77f67a673945cc08b80b0cce36a66707d867
parent 596629 34d68a6a1382283bfe95d32cdf8b0fee28ed69bd
child 596631 699ca92b32489325344a644f8081200276c50611
push id64704
push userbmo:rail@mozilla.com
push dateMon, 19 Jun 2017 15:14:27 +0000
reviewersjrmuizel
bugs1364465
milestone56.0a1
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
gfx/thebes/gfxFont.cpp
--- 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();