Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Issue 2031363002: Use a FontPlatformData pointer for FontDataCache's key (Closed)

Created:
4 years, 6 months ago by drott
Modified:
4 years, 6 months ago
Reviewers:
kojii, eae, tzik
CC:
ajuma+watch_chromium.org, blink-reviews, blink-reviews-platform-graphics_chromium.org, Rik, chromium-reviews, danakj+watch_chromium.org, dshwang, drott+blinkwatch_chromium.org, krit, f(malita), jbroman, Justin Novosad, pdr+graphicswatchlist_chromium.org, rwlbuis, Stephen Chennney
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use 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
Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -32 lines) Patch
M third_party/WebKit/Source/platform/fonts/FontDataCache.h View 2 chunks +17 lines, -23 lines 1 comment Download
M third_party/WebKit/Source/platform/fonts/FontDataCache.cpp View 1 3 chunks +8 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/fonts/linux/FontCacheLinux.cpp View 1 1 chunk +5 lines, -4 lines 0 comments Download

Messages

Total messages: 21 (10 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2031363002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2031363002/1
4 years, 6 months ago (2016-06-03 15:52:07 UTC) #2
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/81624)
4 years, 6 months ago (2016-06-03 16:23:37 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2031363002/20001
4 years, 6 months ago (2016-06-06 11:11:21 UTC) #6
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-06 12:45:32 UTC) #9
drott
PTAL, I think this is ready for review and discussion now.
4 years, 6 months ago (2016-06-06 12:59:01 UTC) #11
eae
Thanks for tackling this drott! https://codereview.chromium.org/2031363002/diff/20001/third_party/WebKit/Source/platform/fonts/FontDataCache.h File third_party/WebKit/Source/platform/fonts/FontDataCache.h (right): https://codereview.chromium.org/2031363002/diff/20001/third_party/WebKit/Source/platform/fonts/FontDataCache.h#newcode54 third_party/WebKit/Source/platform/fonts/FontDataCache.h:54: if (a == emptyValue) ...
4 years, 6 months ago (2016-06-06 17:26:53 UTC) #14
drott
On 2016/06/06 at 17:26:53, eae wrote: > Thanks for tackling this drott! > > https://codereview.chromium.org/2031363002/diff/20001/third_party/WebKit/Source/platform/fonts/FontDataCache.h ...
4 years, 6 months ago (2016-06-06 18:39:15 UTC) #15
eae
LGTM
4 years, 6 months ago (2016-06-06 18:39:46 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2031363002/20001
4 years, 6 months ago (2016-06-06 18:41:44 UTC) #18
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 6 months ago (2016-06-06 18:47:22 UTC) #19
commit-bot: I haz the power
4 years, 6 months ago (2016-06-06 18:49:27 UTC) #21
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/414107a81fdf7231eebc30c45aa14a437561bbbd
Cr-Commit-Position: refs/heads/master@{#398079}

Powered by Google App Engine
This is Rietveld 408576698