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

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

Issue 2478303002: Reland "Remove CPDF_Object::Release() in favor of direct delete" (Closed)
Patch Set: Fix fuzzer build 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_string.h ('k') | core/fpdfdoc/cpdf_annot.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/parser/cpdf_syntax_parser.cpp
diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.cpp b/core/fpdfapi/parser/cpdf_syntax_parser.cpp
index 178af3bb9be13315a7bebad213f4c82b872f9b1f..da3c8b0c799b85183cff29974f62f456f2e0159c 100644
--- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_syntax_parser.cpp
@@ -425,8 +425,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjectHolder* pObjList,
int32_t nKeys = 0;
FX_FILESIZE dwSignValuePos = 0;
- std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>> pDict(
- new CPDF_Dictionary(m_pPool));
+ std::unique_ptr<CPDF_Dictionary> pDict(new CPDF_Dictionary(m_pPool));
while (1) {
CFX_ByteString key = GetNextWord(nullptr);
if (key.IsEmpty())
@@ -530,8 +529,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObjectForStrict(
}
if (word == "[") {
- std::unique_ptr<CPDF_Array, ReleaseDeleter<CPDF_Array>> pArray(
- new CPDF_Array);
+ std::unique_ptr<CPDF_Array> pArray(new CPDF_Array);
while (CPDF_Object* pObj = GetObject(pObjList, objnum, gennum, true))
pArray->Add(pObj);
@@ -544,8 +542,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObjectForStrict(
}
if (word == "<<") {
- std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>> pDict(
- new CPDF_Dictionary(m_pPool));
+ std::unique_ptr<CPDF_Dictionary> pDict(new CPDF_Dictionary(m_pPool));
while (1) {
FX_FILESIZE SavedPos = m_Pos;
CFX_ByteString key = GetNextWord(nullptr);
@@ -564,7 +561,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObjectForStrict(
continue;
key = PDF_NameDecode(key);
- std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>> obj(
+ std::unique_ptr<CPDF_Object> obj(
GetObject(pObjList, objnum, gennum, true));
if (!obj) {
uint8_t ch;
@@ -692,7 +689,7 @@ CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict,
// Can't find "endstream" or "endobj".
if (endStreamOffset < 0 && endObjOffset < 0) {
- pDict->Release();
+ delete pDict;
return nullptr;
}
@@ -718,7 +715,7 @@ CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict,
}
if (len < 0) {
- pDict->Release();
+ delete pDict;
return nullptr;
}
pDict->SetIntegerFor("Length", len);
@@ -727,7 +724,7 @@ CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict,
}
if (len < 0) {
- pDict->Release();
+ delete pDict;
return nullptr;
}
« no previous file with comments | « core/fpdfapi/parser/cpdf_string.h ('k') | core/fpdfdoc/cpdf_annot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698