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

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

Issue 2384883003: Remove CPDF_Object::Release() in favor of direct delete (Closed)
Patch Set: Remove ScopedDict typedefs 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
Index: core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp
diff --git a/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp b/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp
index 32a75f98da9549d13827dfe534486ab646b86109..42fd1669a5432514fd196eb01e8b3317d5afa106 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp
@@ -441,8 +441,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())
@@ -546,8 +545,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);
@@ -560,8 +558,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);
@@ -580,7 +577,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;
@@ -708,7 +705,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;
}
@@ -734,7 +731,7 @@ CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict,
}
if (len < 0) {
- pDict->Release();
+ delete pDict;
return nullptr;
}
pDict->SetIntegerFor("Length", len);
@@ -743,7 +740,7 @@ CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict,
}
if (len < 0) {
- pDict->Release();
+ delete pDict;
return nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698