Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Unified Diff: core/fpdfapi/parser/cpdf_data_avail.cpp

Issue 2477003002: Pass object to ReplaceIndirectObjectIfHigherGeneration() by unique_ptr. (Closed)
Patch Set: Fix issuse Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/parser/cpdf_array_unittest.cpp ('k') | core/fpdfapi/parser/cpdf_indirect_object_holder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/parser/cpdf_data_avail.cpp
diff --git a/core/fpdfapi/parser/cpdf_data_avail.cpp b/core/fpdfapi/parser/cpdf_data_avail.cpp
index eadbf1e8282c144c0e5f72c4f3783e18668bd033..c4ed95e17f27d344afdede77d2c756d91a43aa35 100644
--- a/core/fpdfapi/parser/cpdf_data_avail.cpp
+++ b/core/fpdfapi/parser/cpdf_data_avail.cpp
@@ -1763,13 +1763,11 @@ CPDF_Dictionary* CPDF_DataAvail::GetPage(int index) {
// We should say to the document, which object is the page.
m_pDocument->SetPageObjNum(index, dwObjNum);
// Page object already can be parsed in document.
- CPDF_Object* pPageDict = m_pDocument->GetIndirectObject(dwObjNum);
- if (!pPageDict) {
+ if (!m_pDocument->GetIndirectObject(dwObjNum)) {
m_syntaxParser.InitParser(m_pFileRead, (uint32_t)szPageStartPos);
- pPageDict = ParseIndirectObjectAt(0, dwObjNum, m_pDocument);
- if (pPageDict) {
- m_pDocument->ReplaceIndirectObjectIfHigherGeneration(dwObjNum, pPageDict);
- }
+ m_pDocument->ReplaceIndirectObjectIfHigherGeneration(
+ dwObjNum, pdfium::WrapUnique<CPDF_Object>(
+ ParseIndirectObjectAt(0, dwObjNum, m_pDocument)));
}
return m_pDocument->GetPage(index);
}
« no previous file with comments | « core/fpdfapi/parser/cpdf_array_unittest.cpp ('k') | core/fpdfapi/parser/cpdf_indirect_object_holder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698