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

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

Issue 2424533003: Revert "Update CPDF_IndirectObjectHolder APIs for unique objects." (Closed)
Patch Set: Created 4 years, 2 months 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/page/cpdf_image.cpp ('k') | core/fpdfapi/parser/cpdf_array.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/parser/cfdf_document.cpp
diff --git a/core/fpdfapi/parser/cfdf_document.cpp b/core/fpdfapi/parser/cfdf_document.cpp
index 1239fcd3ce2d3706a5a805500616ef593dfa7ee6..a1518dfed099f6a69f6d389716232b840226441b 100644
--- a/core/fpdfapi/parser/cfdf_document.cpp
+++ b/core/fpdfapi/parser/cfdf_document.cpp
@@ -26,7 +26,8 @@ CFDF_Document::~CFDF_Document() {
CFDF_Document* CFDF_Document::CreateNewDoc() {
CFDF_Document* pDoc = new CFDF_Document;
- pDoc->m_pRootDict = pDoc->AddIndirectDictionary(pDoc->GetByteStringPool());
+ pDoc->m_pRootDict = new CPDF_Dictionary(pDoc->GetByteStringPool());
+ pDoc->AddIndirectObject(pDoc->m_pRootDict);
pDoc->m_pRootDict->SetFor("FDF",
new CPDF_Dictionary(pDoc->GetByteStringPool()));
return pDoc;
@@ -68,8 +69,7 @@ void CFDF_Document::ParseStream(IFX_FileRead* pFile, FX_BOOL bOwnFile) {
if (!pObj)
break;
- // TODO(tsepez): check |pObj| ownership.
- ReplaceIndirectObjectIfHigherGeneration(objnum, UniqueObject(pObj));
+ ReplaceIndirectObjectIfHigherGeneration(objnum, pObj);
word = parser.GetNextWord(nullptr);
if (word != "endobj")
break;
« no previous file with comments | « core/fpdfapi/page/cpdf_image.cpp ('k') | core/fpdfapi/parser/cpdf_array.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698