Commit de8d92e2 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Simplify some PDF annotation UMA code.

Change-Id: Ia0410a18633083e99f89f71e9787afc53ba7f475
Reviewed-on: https://chromium-review.googlesource.com/c/1489518Reviewed-by: default avatarHenrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635747}
parent d4b33e9b
...@@ -193,7 +193,7 @@ enum PDFFeatures { ...@@ -193,7 +193,7 @@ enum PDFFeatures {
}; };
// Used for UMA. Do not delete entries, and keep in sync with histograms.xml // Used for UMA. Do not delete entries, and keep in sync with histograms.xml
// and pdfium/public/fpdf_annot.h. // and third_party/pdfium/public/fpdf_annot.h.
constexpr int kAnnotationTypesCount = 28; constexpr int kAnnotationTypesCount = 28;
PP_Var GetLinkAtPosition(PP_Instance instance, PP_Point point) { PP_Var GetLinkAtPosition(PP_Instance instance, PP_Point point) {
...@@ -1403,16 +1403,15 @@ void OutOfProcessInstance::NotifyPageBecameVisible( ...@@ -1403,16 +1403,15 @@ void OutOfProcessInstance::NotifyPageBecameVisible(
} }
for (const int annotation_type : page_features->annotation_types) { for (const int annotation_type : page_features->annotation_types) {
DCHECK_GE(annotation_type, 0); if (annotation_type < 0 || annotation_type >= kAnnotationTypesCount) {
DCHECK_LT(annotation_type, kAnnotationTypesCount); NOTREACHED();
if (annotation_type < 0 || annotation_type >= kAnnotationTypesCount)
continue; continue;
}
if (annotation_types_counted_.find(annotation_type) == bool inserted = annotation_types_counted_.insert(annotation_type).second;
annotation_types_counted_.end()) { if (inserted) {
HistogramEnumeration("PDF.AnnotationType", annotation_type, HistogramEnumeration("PDF.AnnotationType", annotation_type,
kAnnotationTypesCount); kAnnotationTypesCount);
annotation_types_counted_.insert(annotation_type);
} }
} }
page_is_processed_[page_features->index] = true; page_is_processed_[page_features->index] = true;
......
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