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

Unified Diff: pdf/out_of_process_instance.cc

Issue 2398763002: Add font substitution metric for Linux (Closed)
Patch Set: No ScopedSubstFont in PDFiumEngineExports Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pdf/out_of_process_instance.h ('k') | pdf/pdf_engine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/out_of_process_instance.cc
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index 92511185c9715dd610adc6353cae440616666284..981bfaf8d3753dd6b02736488506597bfaa72873 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -282,6 +282,9 @@ OutOfProcessInstance::OutOfProcessInstance(PP_Instance instance)
preview_document_load_state_(LOAD_STATE_COMPLETE),
uma_(this),
told_browser_about_unsupported_feature_(false),
+#if defined(OS_LINUX)
+ font_substitution_reported_(false),
+#endif
print_preview_page_count_(0),
last_progress_sent_(0),
recently_sent_find_update_(false),
@@ -1206,6 +1209,10 @@ void OutOfProcessInstance::DocumentLoadComplete(int page_count) {
UserMetricsRecordAction("PDF.LoadSuccess");
uma_.HistogramEnumeration("PDF.DocumentFeature", LOADED_DOCUMENT,
FEATURES_COUNT);
+#if defined(OS_LINUX)
+ if (!font_substitution_reported_)
+ uma_.HistogramEnumeration("PDF.IsFontSubstituted", 0, 2);
+#endif
// Note: If we are in print preview mode the scroll location is retained
// across document loads so we don't want to scroll again and override it.
@@ -1312,6 +1319,15 @@ void OutOfProcessInstance::DocumentLoadFailed() {
PostMessage(message);
}
+void OutOfProcessInstance::FontSubstituted() {
+#if defined(OS_LINUX)
+ if (font_substitution_reported_)
+ return;
+ font_substitution_reported_ = true;
+ uma_.HistogramEnumeration("PDF.IsFontSubstituted", 1, 2);
+#endif
+}
+
void OutOfProcessInstance::PreviewDocumentLoadFailed() {
UserMetricsRecordAction("PDF.PreviewDocumentLoadFailure");
if (preview_document_load_state_ != LOAD_STATE_LOADING ||
« no previous file with comments | « pdf/out_of_process_instance.h ('k') | pdf/pdf_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698