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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 2398763002: Add font substitution metric for Linux (Closed)
Patch Set: Using Boolean 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..729b3e0afd4d77dfb16b7a7a853a85b3ab1b3d58 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_;
Lei Zhang 2016/10/11 22:35:59 I'm worried we set this but never unset it. There
npm 2016/10/12 18:19:52 I see that. But this is how g_last_instance_id wor
Lei Zhang 2016/10/12 18:46:58 However, |g_last_instance_id| is an int, and havin
bool needs_password = false;
if (TryLoadingDoc(std::string(), &needs_password)) {
ContinueLoadingDocument(std::string());

Powered by Google App Engine
This is Rietveld 408576698