summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cfdf_document.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/parser/cfdf_document.cpp')
-rw-r--r--core/fpdfapi/parser/cfdf_document.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/fpdfapi/parser/cfdf_document.cpp b/core/fpdfapi/parser/cfdf_document.cpp
index cfed11b9cd..d37c8d5457 100644
--- a/core/fpdfapi/parser/cfdf_document.cpp
+++ b/core/fpdfapi/parser/cfdf_document.cpp
@@ -16,6 +16,7 @@
#include "core/fpdfapi/parser/fpdf_parser_utility.h"
#include "core/fxcrt/cfx_readonlymemorystream.h"
#include "third_party/base/ptr_util.h"
+#include "third_party/base/span.h"
CFDF_Document::CFDF_Document() = default;
@@ -28,10 +29,11 @@ std::unique_ptr<CFDF_Document> CFDF_Document::CreateNewDoc() {
return pDoc;
}
-std::unique_ptr<CFDF_Document> CFDF_Document::ParseMemory(const uint8_t* pData,
- uint32_t size) {
+std::unique_ptr<CFDF_Document> CFDF_Document::ParseMemory(
+ pdfium::span<const uint8_t> span) {
auto pDoc = pdfium::MakeUnique<CFDF_Document>();
- pDoc->ParseStream(pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(pData, size));
+ pDoc->ParseStream(
+ pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(span.data(), span.size()));
return pDoc->m_pRootDict ? std::move(pDoc) : nullptr;
}