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

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

Issue 2479303002: Use unique_ptr return from CPDF_Parser::ParseIndirectObject() (Closed)
Patch Set: Work around android 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 | « no previous file | core/fpdfapi/parser/cpdf_boolean.h » ('j') | core/fpdfapi/parser/cpdf_parser.cpp » ('J')
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 a0f3e1490daa16c12ddeba85e4ac98fc9cf83daf..f54e59850694682514499cd5470fa11ece4b1466 100644
--- a/core/fpdfapi/parser/cfdf_document.cpp
+++ b/core/fpdfapi/parser/cfdf_document.cpp
@@ -69,8 +69,8 @@ void CFDF_Document::ParseStream(IFX_SeekableReadStream* pFile, bool bOwnFile) {
if (word != "obj")
break;
- auto pObj = pdfium::WrapUnique<CPDF_Object>(
- parser.GetObject(this, objnum, 0, true));
+ std::unique_ptr<CPDF_Object> pObj =
+ parser.GetObject(this, objnum, 0, true);
if (!pObj)
break;
@@ -82,11 +82,11 @@ void CFDF_Document::ParseStream(IFX_SeekableReadStream* pFile, bool bOwnFile) {
if (word != "trailer")
break;
- if (CPDF_Dictionary* pMainDict =
- ToDictionary(parser.GetObject(this, 0, 0, true))) {
+ std::unique_ptr<CPDF_Dictionary> pMainDict =
+ ToDictionary(parser.GetObject(this, 0, 0, true));
+ if (pMainDict)
m_pRootDict = pMainDict->GetDictFor("Root");
- delete pMainDict;
- }
+
break;
}
}
« no previous file with comments | « no previous file | core/fpdfapi/parser/cpdf_boolean.h » ('j') | core/fpdfapi/parser/cpdf_parser.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698