summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_data_avail.cpp
diff options
context:
space:
mode:
authorArtem Strygin <art-snake@yandex-team.ru>2018-06-27 18:15:10 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-27 18:15:10 +0000
commit20eca1e383b7dce69cd791d42bda3558a3966301 (patch)
treed3fded7303e8326d3883ca51b6bed2ad2438b6da /core/fpdfapi/parser/cpdf_data_avail.cpp
parent00ba8bbea0ff57d6f11257736408e530e54ef642 (diff)
downloadpdfium-20eca1e383b7dce69cd791d42bda3558a3966301.tar.xz
Rework of loading of CPDF_Document.
Improve CPDF_Document interface. Fix relationship between CPDF_Document and CPDF_Parser. This CL changes CPDF_Document to internally create the CPDF_Parser and removes the need for the CPDF_Parser to know about the CPDF_Document. Change-Id: Iec7aef19575c90f30b9a6c919dfd4f4417e4caf2 Reviewed-on: https://pdfium-review.googlesource.com/35630 Commit-Queue: Art Snake <art-snake@yandex-team.ru> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_data_avail.cpp')
-rw-r--r--core/fpdfapi/parser/cpdf_data_avail.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/fpdfapi/parser/cpdf_data_avail.cpp b/core/fpdfapi/parser/cpdf_data_avail.cpp
index acc01c65ed..3b39e3f54b 100644
--- a/core/fpdfapi/parser/cpdf_data_avail.cpp
+++ b/core/fpdfapi/parser/cpdf_data_avail.cpp
@@ -214,7 +214,7 @@ std::unique_ptr<CPDF_Object> CPDF_DataAvail::GetObject(uint32_t objnum,
std::unique_ptr<CPDF_Object> pRet;
if (pParser) {
const CPDF_ReadValidator::Session read_session(GetValidator().Get());
- pRet = pParser->ParseIndirectObject(nullptr, objnum);
+ pRet = pParser->ParseIndirectObject(objnum);
if (GetValidator()->has_read_problems())
return nullptr;
}
@@ -233,7 +233,7 @@ bool CPDF_DataAvail::CheckInfo() {
}
const CPDF_ReadValidator::Session read_session(GetValidator().Get());
- m_parser.ParseIndirectObject(nullptr, dwInfoObjNum);
+ m_parser.ParseIndirectObject(dwInfoObjNum);
if (GetValidator()->has_read_problems())
return false;
@@ -249,7 +249,7 @@ bool CPDF_DataAvail::CheckRoot() {
}
const CPDF_ReadValidator::Session read_session(GetValidator().Get());
- m_pRoot = ToDictionary(m_parser.ParseIndirectObject(nullptr, dwRootObjNum));
+ m_pRoot = ToDictionary(m_parser.ParseIndirectObject(dwRootObjNum));
if (GetValidator()->has_read_problems())
return false;
@@ -1011,11 +1011,11 @@ CPDF_DataAvail::ParseDocument(const char* password) {
}
auto parser = pdfium::MakeUnique<CPDF_Parser>();
parser->SetPassword(password);
- auto document = pdfium::MakeUnique<CPDF_Document>(std::move(parser));
+ auto document = pdfium::MakeUnique<CPDF_Document>();
CPDF_ReadValidator::Session read_session(GetValidator().Get());
- CPDF_Parser::Error error = document->GetParser()->StartLinearizedParse(
- GetValidator(), document.get());
+ CPDF_Parser::Error error =
+ document->LoadLinearizedDoc(GetValidator(), password);
// Additional check, that all ok.
if (GetValidator()->has_read_problems()) {