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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 2398763002: Add font substitution metric for Linux (Closed)
Patch Set: 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
Index: pdf/pdfium/pdfium_engine.cc
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index f3ae32c109488f52f10438a9ddf030c339d2c431..5cb8cfd67551d424d9e772cfea634cbc75764470 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -110,6 +110,8 @@ const int32_t kMaxProgressivePaintTimeMs = 300;
// process.
const int32_t kMaxInitialProgressivePaintTimeMs = 250;
+PDFEngine::Client* g_client_for_fontmapper = nullptr;
+
std::vector<uint32_t> GetPageNumbersFromPrintPageNumberRange(
const PP_PrintPageNumberRange_Dev* page_ranges,
uint32_t page_range_count) {
@@ -259,6 +261,9 @@ void* MapFont(struct _FPDF_SYSFONTINFO*, int weight, int italic,
return nullptr;
}
+ if (g_client_for_fontmapper)
+ g_client_for_fontmapper->FontSubstituted();
+
PP_Resource font_resource = pp::PDF::GetFontFileWithFallback(
pp::InstanceHandle(g_last_instance_id),
&description.pp_font_description(),
@@ -2447,6 +2452,7 @@ void PDFiumEngine::LoadDocument() {
return;
ScopedUnsupportedFeature scoped_unsupported_feature(this);
+ g_client_for_fontmapper = client_;
bool needs_password = false;
if (TryLoadingDoc(std::string(), &needs_password)) {
ContinueLoadingDocument(std::string());

Powered by Google App Engine
This is Rietveld 408576698