Commit 3d8e49e0 authored by Hui Yingst's avatar Hui Yingst Committed by Commit Bot

Roll src/third_party/pdfium/ cff6cfc61..4414ee21a (1 commit)

https://pdfium.googlesource.com/pdfium.git/+log/cff6cfc61523..4414ee21a06e

FPDFAttachment_GetFile() API has changed in PDFium and it no longer
returns the file size for attachments. Manually roll so we can create
a helper function GetAttachmentFileLengthInBytes(), which is the caller
of the newly updated FPDFAttachment_GetFile() API to return the file
size at the same time.

Created with:
  roll-dep src/third_party/pdfium

Change-Id: I4c169366ac790a2a010dc0bdd7021774dbf4b914
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2240347Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Reviewed-by: default avatarDaniel Hosseinian <dhoss@chromium.org>
Commit-Queue: Hui Yingst <nigi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#777202}
parent 6d701649
......@@ -202,7 +202,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling PDFium
# and whatever else without interference from each other.
'pdfium_revision': 'cff6cfc61523389959346693a0d3d46b05c7b8ed',
'pdfium_revision': '4414ee21a06e28144ea49dfd46f854a83aa81f44',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling BoringSSL
# and whatever else without interference from each other.
......
......@@ -361,6 +361,14 @@ base::string16 GetAttachmentAttribute(FPDF_ATTACHMENT attachment,
/*check_expected_size=*/true);
}
unsigned long GetAttachmentFileLengthInBytes(FPDF_ATTACHMENT attachment) {
unsigned long actual_length_bytes;
bool is_attachment_readable = FPDFAttachment_GetFile(
attachment, /*buffer=*/nullptr, /*buflen=*/0, &actual_length_bytes);
DCHECK(is_attachment_readable);
return actual_length_bytes;
}
base::string16 GetAttachmentName(FPDF_ATTACHMENT attachment) {
return CallPDFiumWideStringBufferApi(
base::BindRepeating(&FPDFAttachment_GetName, attachment),
......@@ -3840,7 +3848,7 @@ void PDFiumEngine::LoadDocumentAttachmentInfoList() {
doc_attachment_info_list_[i].name = GetAttachmentName(attachment);
doc_attachment_info_list_[i].size_bytes =
FPDFAttachment_GetFile(attachment, /*buffer=*/nullptr, /*buflen=*/0);
GetAttachmentFileLengthInBytes(attachment);
doc_attachment_info_list_[i].creation_date =
GetAttachmentAttribute(attachment, "CreationDate");
doc_attachment_info_list_[i].modified_date =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment