Commit 14590151 authored by Alex Turner's avatar Alex Turner Committed by Commit Bot

End private class members with underscore in FontMatchingMetrics

Bug: 1102934
Change-Id: I8386dcf1887311e763441113ccf361282f7ac386
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2336299
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Reviewed-by: default avatarDominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#794993}
parent 02eb6180
......@@ -80,7 +80,7 @@ void FontMatchingMetrics::ReportFontLookupByUniqueOrFamilyName(
uint64_t hash = GetHashForFontData(resulting_font_data);
LocalFontLookupKey key(name, font_description.GetFontSelectionRequest());
LocalFontLookupResult result{hash, check_type, is_loading_fallback};
font_lookups.insert(key, result);
font_lookups_.insert(key, result);
}
void FontMatchingMetrics::ReportFontLookupByFallbackCharacter(
......@@ -94,7 +94,7 @@ void FontMatchingMetrics::ReportFontLookupByFallbackCharacter(
font_description.GetFontSelectionRequest());
LocalFontLookupResult result{hash, check_type,
false /* is_loading_fallback */};
font_lookups.insert(key, result);
font_lookups_.insert(key, result);
}
void FontMatchingMetrics::ReportLastResortFallbackFontLookup(
......@@ -106,7 +106,7 @@ void FontMatchingMetrics::ReportLastResortFallbackFontLookup(
LocalFontLookupKey key(font_description.GetFontSelectionRequest());
LocalFontLookupResult result{hash, check_type,
false /* is_loading_fallback */};
font_lookups.insert(key, result);
font_lookups_.insert(key, result);
}
void FontMatchingMetrics::ReportFontFamilyLookupByGenericFamily(
......@@ -117,11 +117,11 @@ void FontMatchingMetrics::ReportFontFamilyLookupByGenericFamily(
OnFontLookup();
GenericFontLookupKey key(generic_font_family_name, script,
generic_family_type);
generic_font_lookups.insert(key, resulting_font_name);
generic_font_lookups_.insert(key, resulting_font_name);
}
void FontMatchingMetrics::PublishIdentifiabilityMetrics() {
for (const auto& entry : font_lookups) {
for (const auto& entry : font_lookups_) {
const LocalFontLookupKey& key = entry.key;
const LocalFontLookupResult& result = entry.value;
......@@ -138,9 +138,9 @@ void FontMatchingMetrics::PublishIdentifiabilityMetrics() {
output_digest)
.Record(ukm_recorder_);
}
font_lookups.clear();
font_lookups_.clear();
for (const auto& entry : generic_font_lookups) {
for (const auto& entry : generic_font_lookups_) {
const GenericFontLookupKey& key = entry.key;
const AtomicString& result = entry.value;
......@@ -157,7 +157,7 @@ void FontMatchingMetrics::PublishIdentifiabilityMetrics() {
output_digest)
.Record(ukm_recorder_);
}
generic_font_lookups.clear();
generic_font_lookups_.clear();
}
void FontMatchingMetrics::PublishUkmMetrics() {
......@@ -184,15 +184,15 @@ void FontMatchingMetrics::PublishUkmMetrics() {
}
void FontMatchingMetrics::OnFontLookup() {
if (!time_of_earliest_unpublished_font_lookup) {
time_of_earliest_unpublished_font_lookup = base::Time::Now();
if (!time_of_earliest_unpublished_font_lookup_) {
time_of_earliest_unpublished_font_lookup_ = base::Time::Now();
return;
}
if (base::Time::Now() - *time_of_earliest_unpublished_font_lookup >=
if (base::Time::Now() - *time_of_earliest_unpublished_font_lookup_ >=
base::TimeDelta::FromMinutes(1)) {
PublishIdentifiabilityMetrics();
time_of_earliest_unpublished_font_lookup = base::Time::Now();
time_of_earliest_unpublished_font_lookup_ = base::Time::Now();
}
}
......
......@@ -271,19 +271,19 @@ class PLATFORM_EXPORT FontMatchingMetrics {
LocalFontLookupResult,
LocalFontLookupKeyHash,
LocalFontLookupKeyHashTraits>
font_lookups;
font_lookups_;
HashMap<GenericFontLookupKey,
AtomicString,
GenericFontLookupKeyHash,
GenericFontLookupKeyHashTraits>
generic_font_lookups;
generic_font_lookups_;
ukm::UkmRecorder* const ukm_recorder_;
const ukm::SourceId source_id_;
// Records when the first font lookup occurred since the last call to
// PublishIdentifiablityMetrics(), if any.
base::Optional<base::Time> time_of_earliest_unpublished_font_lookup;
base::Optional<base::Time> time_of_earliest_unpublished_font_lookup_;
};
} // namespace blink
......
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