0

Deprecate 2 PDF histograms.

Deprecate PDF.IsLinearized and PDF.FileSizeInKB because their numbers
are fairly steady. Developers have a good idea of what to expect, so
further data collection is not necessary.

Bug: 975629,975922
Change-Id: I6981d395910487bcc24b9d5c931ddad8583cee29
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1698994
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Steven Holte <holte@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#677567}
This commit is contained in:
Lei Zhang
2019-07-16 00:25:23 +00:00
committed by Commit Bot
parent c0e7936b6c
commit aa417f0f27
7 changed files with 13 additions and 22 deletions

@ -1625,8 +1625,7 @@ OutOfProcessInstance::SearchString(const base::char16* string,
}
void OutOfProcessInstance::DocumentLoadComplete(
const PDFEngine::DocumentFeatures& document_features,
uint32_t file_size) {
const PDFEngine::DocumentFeatures& document_features) {
// Clear focus state for OSK.
FormTextFieldFocusChange(false);
@ -1692,15 +1691,10 @@ void OutOfProcessInstance::DocumentLoadComplete(
}
pp::PDF::SetContentRestriction(this, content_restrictions);
static constexpr int32_t kMaxFileSizeInKB = 12 * 1024 * 1024;
HistogramCustomCounts("PDF.FileSizeInKB", file_size / 1024, 0,
kMaxFileSizeInKB, 50);
HistogramCustomCounts("PDF.PageCount", document_features.page_count, 1,
1000000, 50);
HistogramEnumeration("PDF.HasAttachment",
document_features.has_attachments ? 1 : 0, 2);
HistogramEnumeration("PDF.IsLinearized",
document_features.is_linearized ? 1 : 0, 2);
HistogramEnumeration("PDF.IsTagged", document_features.is_tagged ? 1 : 0, 2);
HistogramEnumeration("PDF.FormType",
static_cast<int32_t>(document_features.form_type),

@ -132,8 +132,7 @@ class OutOfProcessInstance : public pp::Instance,
const base::char16* term,
bool case_sensitive) override;
void DocumentLoadComplete(
const PDFEngine::DocumentFeatures& document_features,
uint32_t file_size) override;
const PDFEngine::DocumentFeatures& document_features) override;
void DocumentLoadFailed() override;
pp::Instance* GetPluginInstance() override;
void DocumentHasUnsupportedFeature(const std::string& feature) override;

@ -105,9 +105,6 @@ class PDFEngine {
// 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;
// Whether the PDF is Tagged (see 10.7 "Tagged PDF" in PDF Reference 1.7).
bool is_tagged = false;
// What type of form the document contains.
@ -236,8 +233,8 @@ class PDFEngine {
bool case_sensitive) = 0;
// Notifies the client that the document has finished loading.
virtual void DocumentLoadComplete(const DocumentFeatures& document_features,
uint32_t file_size) {}
virtual void DocumentLoadComplete(
const DocumentFeatures& document_features) {}
// Notifies the client that the document has failed to load.
virtual void DocumentLoadFailed() {}

@ -908,13 +908,10 @@ void PDFiumEngine::FinishLoadingDocument() {
DocumentFeatures document_features;
document_features.page_count = pages_.size();
document_features.has_attachments = (FPDFDoc_GetAttachmentCount(doc()) > 0);
document_features.is_linearized =
(FPDFAvail_IsLinearized(fpdf_availability()) == PDF_LINEARIZED);
document_features.is_tagged = FPDFCatalog_IsTagged(doc());
document_features.form_type =
static_cast<FormType>(FPDF_GetFormType(doc()));
client_->DocumentLoadComplete(document_features,
doc_loader_->BytesReceived());
client_->DocumentLoadComplete(document_features);
}
}

@ -118,8 +118,7 @@ PreviewModeClient::SearchString(const base::char16* string,
}
void PreviewModeClient::DocumentLoadComplete(
const PDFEngine::DocumentFeatures& document_features,
uint32_t file_size) {
const PDFEngine::DocumentFeatures& document_features) {
client_->PreviewDocumentLoadComplete();
}

@ -60,8 +60,7 @@ class PreviewModeClient : public PDFEngine::Client {
const base::char16* term,
bool case_sensitive) override;
void DocumentLoadComplete(
const PDFEngine::DocumentFeatures& document_features,
uint32_t file_size) override;
const PDFEngine::DocumentFeatures& document_features) override;
void DocumentLoadFailed() override;
pp::Instance* GetPluginInstance() override;
void DocumentHasUnsupportedFeature(const std::string& feature) override;

@ -96193,6 +96193,9 @@ uploading your change for review.
</histogram>
<histogram name="PDF.FileSizeInKB" units="KB" expires_after="M77">
<obsolete>
Removed in July 2019.
</obsolete>
<owner>thestig@chromium.org</owner>
<summary>The size of PDF documents opened in the PDF viewer.</summary>
</histogram>
@ -96225,6 +96228,9 @@ uploading your change for review.
</histogram>
<histogram name="PDF.IsLinearized" enum="Boolean" expires_after="M77">
<obsolete>
Removed in July 2019.
</obsolete>
<owner>hnakashima@chromium.org</owner>
<summary>
Measures if PDFs opened in the PDF viewer are Linearized PDFs. This is