DescriptionUse a FontPlatformData pointer for FontDataCache's key
FontDataCache's key data type was a full FontPlatformData object, not a
pointer to one The value type of that cache is a SimpleFontData object,
which in itself stores a FontPlatformData object type.
If we want to manage memory related to font blobs (OpenType tables, web
font file buffers) we need to come to a situation where the lifecycle of
FontPlatformData objects is absolutely clear.
Previously, adding to the FontDataCache meant one copy of
FontPlatformData for the cache key, and one for the value as an owned
member of SimpleFontData.
In this situation, it is much harder to keep track of where we keep
FontPlatformData objects.
FontPlatformData objects keep a RefPtr<HarfBuzzFace>, which in turn
keeps hb_font objects, which keep references to OpenType tables copied
from Skia. If we cannot destroy FontPlatformData objects after use, we
cannot free the corresponding copied OpenType tables - so over the
lifetime of the renderer we're leaking OpenType table data for stale
FontPlatformData objects.
This is a first step towards fixing this situation and gaining better
control over the lifecylce of FontPlatformData objects.
BUG=617568
R=eae,tzik,bashi
Committed: https://crrev.com/414107a81fdf7231eebc30c45aa14a437561bbbd
Cr-Commit-Position: refs/heads/master@{#398079}
Patch Set 1 #Patch Set 2 : Crashes, lifecycle issues fixed #
Total comments: 1
Messages
Total messages: 21 (10 generated)
|