RESOLVED FIXED 99430
hb_face_t instances should not depend on FontPlatformData
https://bugs.webkit.org/show_bug.cgi?id=99430
Summary hb_face_t instances should not depend on FontPlatformData
Kenichi Ishibashi
Reported 2012-10-16 00:50:14 PDT
The lifetime of hb_face_t instances should correspond with the lifetime of underlying font data(e.g. SkTypeface and CTFont). HarfBuzzNGFace has its cache mechanism to allow hb_face_t instances live as long as underlying font data live. Since the lifetime of underlying font data and FontPlatformData are different, hb_face_t instances should not depend on FontPlatformData. harfbuzzSkiaGetTable(), harfbuzzCoreTextGetTable() and harfbuzzCairoGetTable() violate this restriction. These functions uses FontPlatformData to get font tables. We should pass underlying font data (or handle of underlying font data) to these functions instead. Otherwise, these functions can access freed FontPlatformData objects (http://crbug.com/156015 is an instance). Note: we can use FontPlatformData in HarfBuzzNGFace::createFont(). This should be safe. Note: we need not add a reference to underlying font data because the cache mechanism takes care of it.
Attachments
Patch (5.65 KB, patch)
2012-10-16 01:19 PDT, Kenichi Ishibashi
no flags
Kenichi Ishibashi
Comment 1 2012-10-16 01:19:09 PDT
Kenichi Ishibashi
Comment 2 2012-10-16 01:25:53 PDT
Kent-san, could you take a look? The change itself is trivial. I'm ccing you on crbug.com. I confirmed the fix on chromium linux, and compiled the patch for chromium mac. I'll wait and see whether efl port can compile the patch. (for changes of harfbuzzCairoGetTable())
Kent Tamura
Comment 3 2012-10-16 01:30:47 PDT
Comment on attachment 168886 [details] Patch rubber-stamped
Kenichi Ishibashi
Comment 4 2012-10-16 02:06:41 PDT
Comment on attachment 168886 [details] Patch Thanks!
WebKit Review Bot
Comment 5 2012-10-16 02:28:09 PDT
Comment on attachment 168886 [details] Patch Clearing flags on attachment: 168886 Committed r131432: <http://trac.webkit.org/changeset/131432>
WebKit Review Bot
Comment 6 2012-10-16 02:28:12 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.