Commit 349a4d65 authored by Alex Turner's avatar Alex Turner Committed by Commit Bot

Fix font metrics recording to only include font data in output digest

Currently in FontMatchingMetrics, the check_type and is_loading_fallback
flag are included as part of the output digest. However, these do not
represent an output. Instead, they represent different kinds of lookup
or a temporary state. By including them in the output digest, we cannot
determine if two lookups at different points in the font matching
process resulted in the same font or not.

We remove check_type and instead split the IdentifiableSurface::Type to
account for different kinds of lookup, including splitting lookups that
can match only unique font names (i.e. src:local specifiers) and lookups
that can also match family names (i.e. font-family specifiers). We adapt
FontMatchingMetrics' HashMaps accordingly.

We also ensure other lookup values are appropriate by:
 - including FontFallbackPriority for lookups by fallback character,
 - handling FontDescription::GenericFamilyType properly,
 - considering font names to be case-insensitive, and
 - ignoring any lookups where is_loading_fallback is true.

Bug: 1121669
Change-Id: I398ad1359c5c6bae51b8bb8b4f236c1944c3e000
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2376037
Commit-Queue: Alex Turner <alexmt@chromium.org>
Reviewed-by: default avatarDominik Röttsches <drott@chromium.org>
Reviewed-by: default avatarAsanka Herath <asanka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804957}
parent dd3966af
......@@ -81,10 +81,12 @@ class IdentifiableSurface {
// CanvasRenderingContextType.
kCanvasReadback = 2,
// Represents loading a font locally. Input is the combination of font style
// and either the family name, fallback character or neither (for a last-
// resort fallback).
kLocalFontLookup = 3,
// Represents loading a font locally based on a name lookup that is allowed
// to match either a unique name or a family name. This occurs when a
// font-family CSS rule doesn't match any @font-face rule. Input is the
// combination of the lookup name and the FontSelectionRequest (i.e. weight,
// width and slope).
kLocalFontLookupByUniqueOrFamilyName = 3,
// Represents looking up the family name of a generic font. Input is the
// combination of the generic font family name, script code and
......@@ -120,6 +122,21 @@ class IdentifiableSurface {
// the mime type supplied to the method.
kHTMLMediaElement_CanPlayType = 11,
// Represents loading a font locally based on a name lookup that is only
// allowed to match a unique name. This occurs in @font-face CSS rules with
// a src:local attribute. Input is the combination of the lookup name and
// the FontSelectionRequest (i.e. weight, width and slope).
kLocalFontLookupByUniqueNameOnly = 12,
// Represents loading a font locally based on a fallback character. Input is
// the combination of the fallback character, FallbackPriority and the
// FontSelectionRequest (i.e. weight, width and slope).
kLocalFontLookupByFallbackCharacter = 13,
// Represents loading a font locally as a last resort. Input is the
// FontSelectionRequest (i.e. weight, width and slope).
kLocalFontLookupAsLastResort = 14,
// We can use values up to and including |kMax|.
kMax = (1 << kTypeBits) - 1
};
......
......@@ -120,14 +120,8 @@ scoped_refptr<FontData> CSSFontSelector::GetFontData(
FontCache::GetFontCache()->GetFontData(font_description,
settings_family_name);
// This does not distinguish between the family_name being "-webkit-standard"
// and falling back to the standard font.
LocalFontLookupType check_type =
family_name == font_family_names::kWebkitStandard
? LocalFontLookupType::kPreferredStandardFont
: LocalFontLookupType::kGenericFontFamilyName;
document_->GetFontMatchingMetrics()->ReportFontLookupByUniqueOrFamilyName(
settings_family_name, font_description, check_type, font_data.get());
settings_family_name, font_description, font_data.get());
return font_data;
}
......@@ -202,32 +196,39 @@ void CSSFontSelector::ReportFailedLocalFontMatch(
void CSSFontSelector::ReportFontLookupByUniqueOrFamilyName(
const AtomicString& name,
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) {
DCHECK(document_);
document_->GetFontMatchingMetrics()->ReportFontLookupByUniqueOrFamilyName(
name, font_description, resulting_font_data);
}
void CSSFontSelector::ReportFontLookupByUniqueNameOnly(
const AtomicString& name,
const FontDescription& font_description,
SimpleFontData* resulting_font_data,
bool is_loading_fallback) {
DCHECK(document_);
document_->GetFontMatchingMetrics()->ReportFontLookupByUniqueOrFamilyName(
name, font_description, check_type, resulting_font_data,
is_loading_fallback);
document_->GetFontMatchingMetrics()->ReportFontLookupByUniqueNameOnly(
name, font_description, resulting_font_data, is_loading_fallback);
}
void CSSFontSelector::ReportFontLookupByFallbackCharacter(
UChar32 fallback_character,
FontFallbackPriority fallback_priority,
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) {
DCHECK(document_);
document_->GetFontMatchingMetrics()->ReportFontLookupByFallbackCharacter(
fallback_character, font_description, check_type, resulting_font_data);
fallback_character, fallback_priority, font_description,
resulting_font_data);
}
void CSSFontSelector::ReportLastResortFallbackFontLookup(
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) {
DCHECK(document_);
document_->GetFontMatchingMetrics()->ReportLastResortFallbackFontLookup(
font_description, check_type, resulting_font_data);
font_description, resulting_font_data);
}
void CSSFontSelector::Trace(Visitor* visitor) const {
......
......@@ -62,19 +62,22 @@ class CORE_EXPORT CSSFontSelector : public FontSelector {
void ReportFontLookupByUniqueOrFamilyName(
const AtomicString& name,
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) override;
void ReportFontLookupByUniqueNameOnly(
const AtomicString& name,
const FontDescription& font_description,
SimpleFontData* resulting_font_data,
bool is_loading_fallback = false) override;
void ReportFontLookupByFallbackCharacter(
UChar32 fallback_character,
FontFallbackPriority fallback_priority,
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) override;
void ReportLastResortFallbackFontLookup(
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) override;
scoped_refptr<FontData> GetFontData(const FontDescription&,
......
......@@ -167,9 +167,8 @@ void LocalFontFaceSource::ReportFontLookup(
const FontDescription& font_description,
SimpleFontData* font_data,
bool is_loading_fallback) {
font_selector_->ReportFontLookupByUniqueOrFamilyName(
font_name_, font_description, LocalFontLookupType::kAtFontFaceLocalSrc,
font_data, is_loading_fallback);
font_selector_->ReportFontLookupByUniqueNameOnly(
font_name_, font_description, font_data, is_loading_fallback);
}
} // namespace blink
......@@ -102,19 +102,22 @@ void OffscreenFontSelector::ReportFailedLocalFontMatch(
void OffscreenFontSelector::ReportFontLookupByUniqueOrFamilyName(
const AtomicString& name,
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) {}
void OffscreenFontSelector::ReportFontLookupByUniqueNameOnly(
const AtomicString& name,
const FontDescription& font_description,
SimpleFontData* resulting_font_data,
bool is_loading_fallback) {}
void OffscreenFontSelector::ReportFontLookupByFallbackCharacter(
UChar32 fallback_character,
FontFallbackPriority fallback_priority,
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) {}
void OffscreenFontSelector::ReportLastResortFallbackFontLookup(
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) {}
void OffscreenFontSelector::FontCacheInvalidated() {
......
......@@ -41,19 +41,22 @@ class CORE_EXPORT OffscreenFontSelector : public FontSelector {
void ReportFontLookupByUniqueOrFamilyName(
const AtomicString& name,
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) override;
void ReportFontLookupByUniqueNameOnly(
const AtomicString& name,
const FontDescription& font_description,
SimpleFontData* resulting_font_data,
bool is_loading_fallback = false) override;
void ReportFontLookupByFallbackCharacter(
UChar32 fallback_character,
FontFallbackPriority fallback_priority,
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) override;
void ReportLastResortFallbackFontLookup(
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) override;
scoped_refptr<FontData> GetFontData(const FontDescription&,
......
......@@ -140,7 +140,6 @@ scoped_refptr<FontDataForRangeSet> FontFallbackIterator::Next(
if (FontSelector* font_selector = font_fallback_list_->GetFontSelector()) {
font_selector->ReportLastResortFallbackFontLookup(
font_description_,
LocalFontLookupType::kLastResortInFontFallbackIterator,
last_resort.get());
}
......@@ -232,8 +231,7 @@ scoped_refptr<SimpleFontData> FontFallbackIterator::FallbackPriorityFont(
if (FontSelector* font_selector = font_fallback_list_->GetFontSelector()) {
font_selector->ReportFontLookupByFallbackCharacter(
hint, font_description_, LocalFontLookupType::kFallbackPriorityFont,
font_data.get());
hint, font_fallback_priority_, font_description_, font_data.get());
}
return font_data;
}
......@@ -280,8 +278,7 @@ scoped_refptr<SimpleFontData> FontFallbackIterator::UniqueSystemFontForHintList(
if (FontSelector* font_selector = font_fallback_list_->GetFontSelector()) {
font_selector->ReportFontLookupByFallbackCharacter(
hint, font_description_, LocalFontLookupType::kSystemFallbackFont,
font_data.get());
hint, FontFallbackPriority::kText, font_description_, font_data.get());
}
return font_data;
}
......
......@@ -187,7 +187,6 @@ scoped_refptr<FontData> FontFallbackList::GetFontData(
if (font_selector_) {
font_selector_->ReportFontLookupByUniqueOrFamilyName(
curr_family->Family(), font_description,
LocalFontLookupType::kLocalFontFamilyName,
DynamicTo<SimpleFontData>(result.get()));
}
}
......@@ -216,9 +215,8 @@ scoped_refptr<FontData> FontFallbackList::GetFontData(
auto last_resort =
FontCache::GetFontCache()->GetLastResortFallbackFont(font_description);
if (font_selector_) {
font_selector_->ReportLastResortFallbackFontLookup(
font_description, LocalFontLookupType::kLastResortInFontFallbackList,
last_resort.get());
font_selector_->ReportLastResortFallbackFontLookup(font_description,
last_resort.get());
}
return last_resort;
}
......
......@@ -88,30 +88,54 @@ void FontMatchingMetrics::ReportFailedLocalFontMatch(
void FontMatchingMetrics::ReportFontLookupByUniqueOrFamilyName(
const AtomicString& name,
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) {
if (!identifiability_study_enabled_) {
return;
}
OnFontLookup();
IdentifiableTokenBuilder builder;
// Font name lookups are case-insensitive.
builder.AddToken(IdentifiabilityBenignCaseFoldingStringToken(name))
.AddValue(font_description.GetFontSelectionRequest().GetHash());
IdentifiableTokenKey input_key(builder.GetToken());
if (font_lookups_by_unique_or_family_name_.Contains(input_key))
return;
IdentifiableToken output_token(GetHashForFontData(resulting_font_data));
font_lookups_by_unique_or_family_name_.insert(input_key, output_token);
}
void FontMatchingMetrics::ReportFontLookupByUniqueNameOnly(
const AtomicString& name,
const FontDescription& font_description,
SimpleFontData* resulting_font_data,
bool is_loading_fallback) {
if (!identifiability_study_enabled_) {
// We ignore lookups that result in loading fallbacks for now as they should
// only be temporary.
if (!identifiability_study_enabled_ || is_loading_fallback) {
return;
}
OnFontLookup();
IdentifiableTokenBuilder builder;
builder.AddToken(IdentifiabilityBenignStringToken(name))
// Font name lookups are case-insensitive.
builder.AddToken(IdentifiabilityBenignCaseFoldingStringToken(name))
.AddValue(font_description.GetFontSelectionRequest().GetHash());
IdentifiableTokenKey input_key(builder.GetToken());
if (font_lookups_.Contains(input_key))
if (font_lookups_by_unique_name_only_.Contains(input_key))
return;
IdentifiableToken output_token(GetHashForFontData(resulting_font_data),
check_type, is_loading_fallback);
font_lookups_.insert(input_key, output_token);
IdentifiableToken output_token(GetHashForFontData(resulting_font_data));
font_lookups_by_unique_name_only_.insert(input_key, output_token);
}
void FontMatchingMetrics::ReportFontLookupByFallbackCharacter(
UChar32 fallback_character,
FontFallbackPriority fallback_priority,
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) {
if (!identifiability_study_enabled_) {
return;
......@@ -120,19 +144,18 @@ void FontMatchingMetrics::ReportFontLookupByFallbackCharacter(
IdentifiableTokenBuilder builder;
builder.AddValue(fallback_character)
.AddToken(IdentifiableToken(fallback_priority))
.AddValue(font_description.GetFontSelectionRequest().GetHash());
IdentifiableTokenKey input_key(builder.GetToken());
if (font_lookups_.Contains(input_key))
if (font_lookups_by_fallback_character_.Contains(input_key))
return;
IdentifiableToken output_token(GetHashForFontData(resulting_font_data),
check_type, false);
font_lookups_.insert(input_key, output_token);
IdentifiableToken output_token(GetHashForFontData(resulting_font_data));
font_lookups_by_fallback_character_.insert(input_key, output_token);
}
void FontMatchingMetrics::ReportLastResortFallbackFontLookup(
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) {
if (!identifiability_study_enabled_) {
return;
......@@ -143,11 +166,10 @@ void FontMatchingMetrics::ReportLastResortFallbackFontLookup(
builder.AddValue(font_description.GetFontSelectionRequest().GetHash());
IdentifiableTokenKey input_key(builder.GetToken());
if (font_lookups_.Contains(input_key))
if (font_lookups_as_last_resort_.Contains(input_key))
return;
IdentifiableToken output_token(GetHashForFontData(resulting_font_data),
check_type, false);
font_lookups_.insert(input_key, output_token);
IdentifiableToken output_token(GetHashForFontData(resulting_font_data));
font_lookups_as_last_resort_.insert(input_key, output_token);
}
void FontMatchingMetrics::ReportFontFamilyLookupByGenericFamily(
......@@ -160,14 +182,24 @@ void FontMatchingMetrics::ReportFontFamilyLookupByGenericFamily(
}
OnFontLookup();
// kStandardFamily lookups override the |generic_font_family_name|. See
// FontSelector::FamilyNameFromSettings. No need to be case-insensitive as
// generic names should already be lowercase.
DCHECK(generic_family_type == FontDescription::kStandardFamily ||
generic_font_family_name == generic_font_family_name.LowerASCII());
IdentifiableToken lookup_name_token = IdentifiabilityBenignStringToken(
generic_family_type == FontDescription::kStandardFamily
? font_family_names::kWebkitStandard
: generic_font_family_name);
IdentifiableTokenBuilder builder;
builder.AddToken(IdentifiabilityBenignStringToken(generic_font_family_name))
.AddToken(IdentifiableToken(script))
.AddToken(IdentifiableToken(generic_family_type));
builder.AddToken(lookup_name_token).AddToken(IdentifiableToken(script));
IdentifiableTokenKey input_key(builder.GetToken());
// Font name lookups are case-insensitive.
generic_font_lookups_.insert(
input_key, IdentifiabilityBenignStringToken(resulting_font_name));
input_key,
IdentifiabilityBenignCaseFoldingStringToken(resulting_font_name));
}
void FontMatchingMetrics::PublishIdentifiabilityMetrics() {
......@@ -175,13 +207,40 @@ void FontMatchingMetrics::PublishIdentifiabilityMetrics() {
IdentifiabilityMetricBuilder builder(source_id_);
for (const auto& entry : font_lookups_) {
for (const auto& entry : font_lookups_by_unique_or_family_name_) {
builder.Set(
IdentifiableSurface::FromTypeAndToken(
IdentifiableSurface::Type::kLocalFontLookupByUniqueOrFamilyName,
entry.key.token),
entry.value);
}
font_lookups_by_unique_or_family_name_.clear();
for (const auto& entry : font_lookups_by_unique_name_only_) {
builder.Set(
IdentifiableSurface::FromTypeAndToken(
IdentifiableSurface::Type::kLocalFontLookup, entry.key.token),
IdentifiableSurface::Type::kLocalFontLookupByUniqueOrFamilyName,
entry.key.token),
entry.value);
}
font_lookups_.clear();
font_lookups_by_unique_name_only_.clear();
for (const auto& entry : font_lookups_by_fallback_character_) {
builder.Set(
IdentifiableSurface::FromTypeAndToken(
IdentifiableSurface::Type::kLocalFontLookupByFallbackCharacter,
entry.key.token),
entry.value);
}
font_lookups_by_fallback_character_.clear();
for (const auto& entry : font_lookups_as_last_resort_) {
builder.Set(IdentifiableSurface::FromTypeAndToken(
IdentifiableSurface::Type::kLocalFontLookupAsLastResort,
entry.key.token),
entry.value);
}
font_lookups_as_last_resort_.clear();
for (const auto& entry : generic_font_lookups_) {
builder.Set(
......
......@@ -8,6 +8,7 @@
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "third_party/blink/public/common/privacy_budget/identifiable_token.h"
#include "third_party/blink/renderer/platform/fonts/font_description.h"
#include "third_party/blink/renderer/platform/fonts/font_fallback_priority.h"
#include "third_party/blink/renderer/platform/fonts/simple_font_data.h"
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/timer.h"
......@@ -73,17 +74,6 @@ struct IdentifiableTokenKeyHashTraits
static IdentifiableTokenKey EmptyValue() { return IdentifiableTokenKey(); }
};
enum class LocalFontLookupType {
kAtFontFaceLocalSrc,
kGenericFontFamilyName,
kLocalFontFamilyName,
kPreferredStandardFont,
kLastResortInFontFallbackList,
kFallbackPriorityFont,
kSystemFallbackFont,
kLastResortInFontFallbackIterator,
};
// Tracks and reports UKM metrics of attempted font family match attempts (both
// successful and not successful) by the current frame.
//
......@@ -128,26 +118,32 @@ class PLATFORM_EXPORT FontMatchingMetrics {
void ReportFailedLocalFontMatch(const AtomicString& font_name);
// Reports a local font was looked up by a name and font description. This
// includes lookups by a family name, by a PostScript name and by a full font
// name.
// only includes lookups where the name is allowed to match family names,
// PostScript names and full font names.
void ReportFontLookupByUniqueOrFamilyName(
const AtomicString& name,
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data,
bool is_loading_fallback = false);
SimpleFontData* resulting_font_data);
// Reports a font was looked up by a fallback character and font description.
// Reports a local font was looked up by a name and font description. This
// only includes lookups where the name is allowed to match PostScript names
// and full font names, but not family names.
void ReportFontLookupByUniqueNameOnly(const AtomicString& name,
const FontDescription& font_description,
SimpleFontData* resulting_font_data,
bool is_loading_fallback = false);
// Reports a font was looked up by a fallback character, fallback priority,
// and a font description.
void ReportFontLookupByFallbackCharacter(
UChar32 fallback_character,
FontFallbackPriority fallback_priority,
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data);
// Reports a last-resort fallback font was looked up by a font description.
void ReportLastResortFallbackFontLookup(
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data);
// Reports a generic font family name was matched according to the script and
......@@ -211,7 +207,10 @@ class PLATFORM_EXPORT FontMatchingMetrics {
IdentifiableToken,
IdentifiableTokenKeyHash,
IdentifiableTokenKeyHashTraits>;
TokenToTokenHashMap font_lookups_;
TokenToTokenHashMap font_lookups_by_unique_or_family_name_;
TokenToTokenHashMap font_lookups_by_unique_name_only_;
TokenToTokenHashMap font_lookups_by_fallback_character_;
TokenToTokenHashMap font_lookups_as_last_resort_;
TokenToTokenHashMap generic_font_lookups_;
ukm::UkmRecorder* const ukm_recorder_;
......
......@@ -28,6 +28,7 @@
#include "base/memory/scoped_refptr.h"
#include "third_party/blink/renderer/platform/fonts/font_cache_client.h"
#include "third_party/blink/renderer/platform/fonts/font_fallback_priority.h"
#include "third_party/blink/renderer/platform/fonts/font_invalidation_reason.h"
#include "third_party/blink/renderer/platform/fonts/font_matching_metrics.h"
#include "third_party/blink/renderer/platform/fonts/segmented_font_data.h"
......@@ -84,12 +85,19 @@ class PLATFORM_EXPORT FontSelector : public FontCacheClient {
virtual void ReportFailedLocalFontMatch(const AtomicString& font_name) = 0;
// Called whenever a page attempts to find a local font based on a name. This
// includes lookups by a family name, by a PostScript name and by a full font
// name.
// only includes lookups where the name is allowed to match family names,
// PostScript names and full font names.
virtual void ReportFontLookupByUniqueOrFamilyName(
const AtomicString& name,
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) = 0;
// Called whenever a page attempts to find a local font based on a name. This
// only includes lookups where the name is allowed to match PostScript names
// and full font names, but not family names.
virtual void ReportFontLookupByUniqueNameOnly(
const AtomicString& name,
const FontDescription& font_description,
SimpleFontData* resulting_font_data,
bool is_loading_fallback = false) = 0;
......@@ -97,14 +105,13 @@ class PLATFORM_EXPORT FontSelector : public FontCacheClient {
// character.
virtual void ReportFontLookupByFallbackCharacter(
UChar32 fallback_character,
FontFallbackPriority fallback_priority,
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) = 0;
// Called whenever a page attempts to find a last-resort font.
virtual void ReportLastResortFallbackFontLookup(
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) = 0;
virtual void RegisterForInvalidationCallbacks(FontSelectorClient*) = 0;
......
......@@ -33,4 +33,24 @@ IdentifiableToken IdentifiabilitySensitiveStringToken(const String& in) {
(original_hash & 0xFFFF));
}
IdentifiableToken IdentifiabilityBenignCaseFoldingStringToken(
const String& in) {
if (in.IsNull())
return kNullStringDigest;
return IdentifiableToken(CaseFoldingHash::GetHash(in));
}
IdentifiableToken IdentifiabilitySensitiveCaseFoldingStringToken(
const String& in) {
if (in.IsNull())
return IdentifiableToken(kNullStringDigest);
// Take the 32-bit hash, and xor the top and bottom halves to produce a 16-bit
// hash.
const uint32_t original_hash = CaseFoldingHash::GetHash(in);
return IdentifiableToken(((original_hash & 0xFFFF0000) >> 16) ^
(original_hash & 0xFFFF));
}
} // namespace blink
......@@ -22,6 +22,16 @@ IdentifiabilityBenignStringToken(const String&);
PLATFORM_EXPORT IdentifiableToken
IdentifiabilitySensitiveStringToken(const String&);
// For benign strings only (i.e. those where the string is not sensitive). Token
// construction is additionally case-insensitive (using Unicode CaseFolding).
PLATFORM_EXPORT IdentifiableToken
IdentifiabilityBenignCaseFoldingStringToken(const String&);
// For sensitive strings, this function narrows the hash width to 16 bits. Token
// construction is additionally case-insensitive (using Unicode CaseFolding).
PLATFORM_EXPORT IdentifiableToken
IdentifiabilitySensitiveCaseFoldingStringToken(const String&);
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_PRIVACY_BUDGET_IDENTIFIABILITY_DIGEST_HELPERS_H_
......@@ -66,17 +66,19 @@ class TestFontSelector : public FontSelector {
void ReportFontLookupByUniqueOrFamilyName(
const AtomicString& name,
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) override {}
void ReportFontLookupByUniqueNameOnly(
const AtomicString& name,
const FontDescription& font_description,
SimpleFontData* resulting_font_data,
bool is_loading_fallback = false) override {}
void ReportFontLookupByFallbackCharacter(
UChar32 hint,
FontFallbackPriority fallback_priority,
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) override {}
void ReportLastResortFallbackFontLookup(
const FontDescription& font_description,
LocalFontLookupType check_type,
SimpleFontData* resulting_font_data) override {}
ExecutionContext* GetExecutionContext() const override { return nullptr; }
FontFaceCache* GetFontFaceCache() override { return nullptr; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment