[Webkit-unassigned] [Bug 95866] Refactor WebCore::FontData handling to clarify pointer ownership

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 6 08:17:23 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=95866





--- Comment #3 from Stephen Chenney <schenney at chromium.org>  2012-09-06 08:17:37 PST ---
Here's my analysis of FontData ownership and other class that hold pointers to it:

FontData allocated in CSSFontFaceSource either comes from the cache or is only custom.

All SegmentedFontData are custom fonts.

FontCache.cpp has a hash table with SimpleFontData in the value field. Note that this rules out SegmentedFontData from storage in the cache. If the font is retained, it adds it to the cache and will not remove it unless it's use count goes to zero. Otherwise, it puts it in the cache but also adds it to the inactive font list. The inactive font list is not cleared until purgeInactiveFontDataIfNeeded or purgeInactiveFontData, at which point the SimpleFontData is deleted. The FontCachePurgeProtector triggers font cache purging upon destruction.

However, FontCache::getFontData only puts FontData in the cache when the FontSelector::getFontData method returns 0. But, the CSSFontSelector code uses FontCache::getCachedFontData for all non-custom fonts. FontCache::getCachedFontData always adds the FontData to the cache and it's never custom data.



More information about the webkit-unassigned mailing list