Measure % of PDFs with attachments and % of PDFs that are linearized.
Bug: chromium:768986 Change-Id: I255fb808efd17a48d9e3760f2d3ed3317196a2bc Reviewed-on: https://chromium-review.googlesource.com/716306 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Robert Kaplow <rkaplow@chromium.org> Reviewed-by: Jochen Eisinger <jochen@chromium.org> Cr-Commit-Position: refs/heads/master@{#509861}
This commit is contained in:

committed by
Commit Bot

parent
6350c27427
commit
fe4d6ac310
pdf
tools/metrics/histograms
@@ -1497,6 +1497,10 @@ void OutOfProcessInstance::DocumentLoadComplete(
|
|||||||
pp::PDF::SetContentRestriction(this, content_restrictions);
|
pp::PDF::SetContentRestriction(this, content_restrictions);
|
||||||
HistogramCustomCounts("PDF.PageCount", document_features.page_count, 1,
|
HistogramCustomCounts("PDF.PageCount", document_features.page_count, 1,
|
||||||
1000000, 50);
|
1000000, 50);
|
||||||
|
HistogramEnumeration("PDF.HasAttachment",
|
||||||
|
document_features.has_attachments ? 1 : 0, 2);
|
||||||
|
HistogramEnumeration("PDF.IsLinearized",
|
||||||
|
document_features.is_linearized ? 1 : 0, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutOfProcessInstance::RotateClockwise() {
|
void OutOfProcessInstance::RotateClockwise() {
|
||||||
|
@@ -61,6 +61,12 @@ class PDFEngine {
|
|||||||
struct DocumentFeatures {
|
struct DocumentFeatures {
|
||||||
// Number of pages in document.
|
// Number of pages in document.
|
||||||
size_t page_count = 0;
|
size_t page_count = 0;
|
||||||
|
// Whether any files are attached to document (see "File Attachment
|
||||||
|
// Annotations" on page 637 of PDF Reference 1.7).
|
||||||
|
bool has_attachments = false;
|
||||||
|
// Whether the document is linearized (see Appendix F "Linearized PDF" of
|
||||||
|
// PDF Reference 1.7).
|
||||||
|
bool is_linearized = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
// The interface that's provided to the rendering engine.
|
// The interface that's provided to the rendering engine.
|
||||||
|
@@ -51,6 +51,7 @@
|
|||||||
#include "printing/pdf_transform.h"
|
#include "printing/pdf_transform.h"
|
||||||
#include "printing/units.h"
|
#include "printing/units.h"
|
||||||
#include "third_party/pdfium/public/fpdf_annot.h"
|
#include "third_party/pdfium/public/fpdf_annot.h"
|
||||||
|
#include "third_party/pdfium/public/fpdf_attachment.h"
|
||||||
#include "third_party/pdfium/public/fpdf_edit.h"
|
#include "third_party/pdfium/public/fpdf_edit.h"
|
||||||
#include "third_party/pdfium/public/fpdf_ext.h"
|
#include "third_party/pdfium/public/fpdf_ext.h"
|
||||||
#include "third_party/pdfium/public/fpdf_flatten.h"
|
#include "third_party/pdfium/public/fpdf_flatten.h"
|
||||||
@@ -1281,6 +1282,9 @@ void PDFiumEngine::FinishLoadingDocument() {
|
|||||||
if (doc_) {
|
if (doc_) {
|
||||||
DocumentFeatures document_features;
|
DocumentFeatures document_features;
|
||||||
document_features.page_count = pages_.size();
|
document_features.page_count = pages_.size();
|
||||||
|
document_features.has_attachments = (FPDFDoc_GetAttachmentCount(doc_) > 0);
|
||||||
|
document_features.is_linearized =
|
||||||
|
(FPDFAvail_IsLinearized(fpdf_availability_) == PDF_LINEARIZED);
|
||||||
client_->DocumentLoadComplete(document_features);
|
client_->DocumentLoadComplete(document_features);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -58168,11 +58168,27 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
|
|||||||
</summary>
|
</summary>
|
||||||
</histogram>
|
</histogram>
|
||||||
|
|
||||||
|
<histogram name="PDF.HasAttachment" enum="Boolean">
|
||||||
|
<owner>hnakashima@chromium.org</owner>
|
||||||
|
<summary>
|
||||||
|
Measures if PDFs opened in the PDF viewer have attachments. This is logged
|
||||||
|
whenever a document is opened in the PDF viewer.
|
||||||
|
</summary>
|
||||||
|
</histogram>
|
||||||
|
|
||||||
<histogram name="PDF.IsFontSubstituted" enum="Boolean">
|
<histogram name="PDF.IsFontSubstituted" enum="Boolean">
|
||||||
<owner>npm@chromium.org</owner>
|
<owner>npm@chromium.org</owner>
|
||||||
<summary>
|
<summary>
|
||||||
Tracks documents opened in the PDF viewer where substitute fonts need to be
|
Measures if PDFs opened in the PDF viewer require fonts to be substituted.
|
||||||
used.
|
This is logged whenever a document is opened in the PDF viewer.
|
||||||
|
</summary>
|
||||||
|
</histogram>
|
||||||
|
|
||||||
|
<histogram name="PDF.IsLinearized" enum="Boolean">
|
||||||
|
<owner>hnakashima@chromium.org</owner>
|
||||||
|
<summary>
|
||||||
|
Measures if PDFs opened in the PDF viewer are Linearized PDFs. This is
|
||||||
|
logged whenever a document is opened in the PDF viewer.
|
||||||
</summary>
|
</summary>
|
||||||
</histogram>
|
</histogram>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user