New issue
Advanced search Search tips

Issue 617637 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Jun 2016
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 617568



Sign in to add a comment

Break RefPtr cycle in HarfBuzzFace

Project Member Reported by drott@chromium.org, Jun 6 2016

Issue description

Storing a RefPtr<SimpleFontData> in HarfBuzzFontData creates a refptr cycle FontPlatformData->HarfBuzzFace->SimpleFontData->FontPlatformData.


 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 6 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b6d1c182819aece33f03b138092445440d2f0adf

commit b6d1c182819aece33f03b138092445440d2f0adf
Author: drott <drott@chromium.org>
Date: Mon Jun 06 17:51:35 2016

Avoid RefPtr cycle between FontPlatformData and HarfBuzzFace

When retrieving getScaledFont() from HarfBuzzFace we were creating a
SimpleFontData and assigning it to the HarfBuzzFontData object that is
kept as the user data pointer for HarfBuzz callbacks. This introduces a
reference counting cycle since SimpleFontData owns the FontPlatformData
it was created from, and harfBuzzFace() is retrieved from
FontPlatformData itself.

Since getScaledFont() is called on a HarfBuzzFace instance that is
retrieved from FontPlatformData and only used for one shaping iteration,
reducing the link to SimpleFontData to a non owning pointer should be
acceptable.

BUG= 617637 
R=eae,tzik,kojii

Review-Url: https://codereview.chromium.org/2039263002
Cr-Commit-Position: refs/heads/master@{#398059}

[modify] https://crrev.com/b6d1c182819aece33f03b138092445440d2f0adf/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp

Comment 2 by drott@chromium.org, Jun 7 2016

Status: Fixed (was: Untriaged)

Sign in to add a comment