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

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

Issue 2384883003: Remove CPDF_Object::Release() in favor of direct delete (Closed)
Patch Set: rebase 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 c1ab1cf7682b959b0ce729aae95c1d7da627347f..45d97be771f8c27d54f33088019268d1f93e4b1e 100644
--- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp
+++ b/core/fpdfapi/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;
}
« 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