[webkit-dev] Reflections on FontPlatformData, FontCache

Holger Freyther zecke at selfish.org
Sat Jun 30 08:35:04 PDT 2007


is it right that FontData owns the FontPlatformData it gets assigned?  
And that FontData::platformInit and ::platformDestroy define the  
lifetime of the FontDataPlatform. So if I destroy the "platform  
specific objects" created by FontPlatformData I will not interact  
badly with the cache? This ownerhip in the Gdk port was wrong and I  
needed some time to figure that out.

While reading the code I think I have found a oversight in the  
FontPlatformData of the Mac port. The FontCache uses a HashMap. This  
HashMap will use the (implicit) Copy-Constructor and the (implicit)  
Assignment-Operator of the FontPlatformData to store objects in the  

I'm not that familiar with CoreFoundations reference counting, but  
CFRetain is called in the explicit Copy-Constructor for the NSFont*  
and I wonder why there isn't an explicit assignment operator  
increasing the reference on the other font and decreasing it on the  
current one.

Why does this implicit  copy operator work here?

Comments would be appreciated.

More information about the webkit-dev mailing list