Remove CPDF_Object::Release() in favor of direct delete

Follow-on once we prove Release always deletes in previous CL.

Review-Url: https://codereview.chromium.org/2384883003
diff --git a/core/fpdfapi/edit/cpdf_creator.h b/core/fpdfapi/edit/cpdf_creator.h
index f462115..c04db6e 100644
--- a/core/fpdfapi/edit/cpdf_creator.h
+++ b/core/fpdfapi/edit/cpdf_creator.h
@@ -94,7 +94,7 @@
   FX_FILESIZE m_XrefStart;
   CFX_FileSizeListArray m_ObjectOffset;
   CFX_ArrayTemplate<uint32_t> m_NewObjNumArray;
-  std::unique_ptr<CPDF_Array, ReleaseDeleter<CPDF_Array>> m_pIDArray;
+  std::unique_ptr<CPDF_Array> m_pIDArray;
   int32_t m_FileVersion;
 };
 
diff --git a/core/fpdfapi/edit/fpdf_edit_create.cpp b/core/fpdfapi/edit/fpdf_edit_create.cpp
index ed638d4..a578a0a 100644
--- a/core/fpdfapi/edit/fpdf_edit_create.cpp
+++ b/core/fpdfapi/edit/fpdf_edit_create.cpp
@@ -470,8 +470,8 @@
 }
 
 CPDF_FlateEncoder::~CPDF_FlateEncoder() {
-  if (m_bCloned && m_pDict)
-    m_pDict->Release();
+  if (m_bCloned)
+    delete m_pDict;
   if (m_bNewData)
     FX_Free(m_pData);
 }
@@ -902,8 +902,8 @@
 
 CPDF_Creator::~CPDF_Creator() {
   ResetStandardSecurity();
-  if (m_bEncryptCloned && m_pEncryptDict) {
-    m_pEncryptDict->Release();
+  if (m_bEncryptCloned) {
+    delete m_pEncryptDict;
     m_pEncryptDict = nullptr;
   }
   Clear();
@@ -1247,7 +1247,7 @@
       return -1;
     }
     if (!bExistInMap) {
-      m_pDocument->ReleaseIndirectObject(objnum);
+      m_pDocument->DeleteIndirectObject(objnum);
     }
   } else {
     uint8_t* pBuffer;
@@ -1934,7 +1934,7 @@
       m_pIDArray->Add(pID1->Clone());
     } else {
       std::vector<uint8_t> buffer =
-          PDF_GenerateFileID((uint32_t)(uintptr_t)this, m_dwLastObjNum);
+          PDF_GenerateFileID((uint32_t)(uintptr_t) this, m_dwLastObjNum);
       CFX_ByteString bsBuffer(buffer.data(), buffer.size());
       m_pIDArray->Add(new CPDF_String(bsBuffer, true));
     }
@@ -1949,7 +1949,7 @@
       return;
     }
     std::vector<uint8_t> buffer =
-        PDF_GenerateFileID((uint32_t)(uintptr_t)this, m_dwLastObjNum);
+        PDF_GenerateFileID((uint32_t)(uintptr_t) this, m_dwLastObjNum);
     CFX_ByteString bsBuffer(buffer.data(), buffer.size());
     m_pIDArray->Add(new CPDF_String(bsBuffer, true));
     return;
diff --git a/core/fpdfapi/font/fpdf_font.cpp b/core/fpdfapi/font/fpdf_font.cpp
index c827ea5..b681edf 100644
--- a/core/fpdfapi/font/fpdf_font.cpp
+++ b/core/fpdfapi/font/fpdf_font.cpp
@@ -47,11 +47,8 @@
 
 CFX_StockFontArray::~CFX_StockFontArray() {
   for (size_t i = 0; i < FX_ArraySize(m_StockFonts); ++i) {
-    if (!m_StockFonts[i])
-      continue;
-    CPDF_Dictionary* pFontDict = m_StockFonts[i]->GetFontDict();
-    if (pFontDict)
-      pFontDict->Release();
+    if (m_StockFonts[i])
+      delete m_StockFonts[i]->GetFontDict();
   }
 }
 
diff --git a/core/fpdfapi/page/cpdf_contentmark.cpp b/core/fpdfapi/page/cpdf_contentmark.cpp
index d60e144..a867409 100644
--- a/core/fpdfapi/page/cpdf_contentmark.cpp
+++ b/core/fpdfapi/page/cpdf_contentmark.cpp
@@ -110,8 +110,7 @@
   if (pDict) {
     if (bDirect) {
       item.SetDirectDict(
-          std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>>(
-              ToDictionary(pDict->Clone())));
+          std::unique_ptr<CPDF_Dictionary>(ToDictionary(pDict->Clone())));
     } else {
       item.SetPropertiesDict(pDict);
     }
diff --git a/core/fpdfapi/page/cpdf_contentmarkitem.cpp b/core/fpdfapi/page/cpdf_contentmarkitem.cpp
index 597f8a5..dffeada 100644
--- a/core/fpdfapi/page/cpdf_contentmarkitem.cpp
+++ b/core/fpdfapi/page/cpdf_contentmarkitem.cpp
@@ -39,7 +39,7 @@
 }
 
 void CPDF_ContentMarkItem::SetDirectDict(
-    std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>> pDict) {
+    std::unique_ptr<CPDF_Dictionary> pDict) {
   m_ParamType = DirectDict;
   m_pDirectDict = std::move(pDict);
 }
diff --git a/core/fpdfapi/page/cpdf_contentmarkitem.h b/core/fpdfapi/page/cpdf_contentmarkitem.h
index f1f06c3..ed27371 100644
--- a/core/fpdfapi/page/cpdf_contentmarkitem.h
+++ b/core/fpdfapi/page/cpdf_contentmarkitem.h
@@ -31,16 +31,14 @@
   bool HasMCID() const;
 
   void SetName(const CFX_ByteString& name) { m_MarkName = name; }
-  void SetDirectDict(
-      std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>> pDict);
+  void SetDirectDict(std::unique_ptr<CPDF_Dictionary> pDict);
   void SetPropertiesDict(CPDF_Dictionary* pDict);
 
  private:
   CFX_ByteString m_MarkName;
   ParamType m_ParamType;
   CPDF_Dictionary* m_pPropertiesDict;  // not owned.
-  std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>>
-      m_pDirectDict;
+  std::unique_ptr<CPDF_Dictionary> m_pDirectDict;
 };
 
 #endif  // CORE_FPDFAPI_PAGE_CPDF_CONTENTMARKITEM_H_
diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp
index 23c6e4f..976d6d8 100644
--- a/core/fpdfapi/page/cpdf_image.cpp
+++ b/core/fpdfapi/page/cpdf_image.cpp
@@ -25,14 +25,16 @@
 
 CPDF_Image::CPDF_Image(CPDF_Document* pDoc) : m_pDocument(pDoc) {}
 
-CPDF_Image::CPDF_Image(CPDF_Document* pDoc, UniqueStream pStream)
+CPDF_Image::CPDF_Image(CPDF_Document* pDoc,
+                       std::unique_ptr<CPDF_Stream> pStream)
     : m_pDocument(pDoc),
       m_pStream(pStream.get()),
       m_pOwnedStream(std::move(pStream)) {
   if (!m_pStream)
     return;
 
-  m_pOwnedDict = ToDictionary(UniqueObject(m_pStream->GetDict()->Clone()));
+  m_pOwnedDict =
+      ToDictionary(std::unique_ptr<CPDF_Object>(m_pStream->GetDict()->Clone()));
   m_pDict = m_pOwnedDict.get();
   FinishInitialization();
 }
@@ -61,13 +63,15 @@
 CPDF_Image* CPDF_Image::Clone() {
   CPDF_Image* pImage = new CPDF_Image(m_pDocument);
   if (m_pOwnedStream) {
-    pImage->m_pOwnedStream = ToStream(UniqueObject(m_pOwnedStream->Clone()));
+    pImage->m_pOwnedStream =
+        ToStream(std::unique_ptr<CPDF_Object>(m_pOwnedStream->Clone()));
     pImage->m_pStream = pImage->m_pOwnedStream.get();
   } else {
     pImage->m_pStream = m_pStream;
   }
   if (m_pOwnedDict) {
-    pImage->m_pOwnedDict = ToDictionary(UniqueObject(m_pOwnedDict->Clone()));
+    pImage->m_pOwnedDict =
+        ToDictionary(std::unique_ptr<CPDF_Object>(m_pOwnedDict->Clone()));
     pImage->m_pDict = pImage->m_pOwnedDict.get();
   } else {
     pImage->m_pDict = m_pDict;
@@ -289,10 +293,8 @@
         pNewBitmap->Copy(pBitmap);
         pNewBitmap->ConvertFormat(FXDIB_Rgb);
         SetImage(pNewBitmap, iCompress);
-        if (pDict) {
-          pDict->Release();
-          pDict = nullptr;
-        }
+        delete pDict;
+        pDict = nullptr;
         FX_Free(dest_buf);
         dest_buf = nullptr;
         dest_size = 0;
diff --git a/core/fpdfapi/page/cpdf_image.h b/core/fpdfapi/page/cpdf_image.h
index f619845..02308db 100644
--- a/core/fpdfapi/page/cpdf_image.h
+++ b/core/fpdfapi/page/cpdf_image.h
@@ -28,7 +28,7 @@
 class CPDF_Image {
  public:
   explicit CPDF_Image(CPDF_Document* pDoc);
-  CPDF_Image(CPDF_Document* pDoc, UniqueStream pStream);
+  CPDF_Image(CPDF_Document* pDoc, std::unique_ptr<CPDF_Stream> pStream);
   CPDF_Image(CPDF_Document* pDoc, uint32_t dwStreamObjNum);
   ~CPDF_Image();
 
@@ -84,8 +84,8 @@
   CPDF_Document* const m_pDocument;
   CPDF_Stream* m_pStream = nullptr;
   CPDF_Dictionary* m_pDict = nullptr;
-  UniqueStream m_pOwnedStream;
-  UniqueDictionary m_pOwnedDict;
+  std::unique_ptr<CPDF_Stream> m_pOwnedStream;
+  std::unique_ptr<CPDF_Dictionary> m_pOwnedDict;
   CPDF_Dictionary* m_pOC = nullptr;
 };
 
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index ed67013..7618f82 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -180,12 +180,8 @@
 CPDF_StreamContentParser::~CPDF_StreamContentParser() {
   ClearAllParams();
   FX_Free(m_pPathPoints);
-  if (m_pLastImageDict) {
-    m_pLastImageDict->Release();
-  }
-  if (m_pLastCloneImageDict) {
-    m_pLastCloneImageDict->Release();
-  }
+  delete m_pLastImageDict;
+  delete m_pLastCloneImageDict;
 }
 
 int CPDF_StreamContentParser::GetNextParamPos() {
@@ -194,10 +190,9 @@
     if (m_ParamStartPos == kParamBufSize) {
       m_ParamStartPos = 0;
     }
-    if (m_ParamBuf[m_ParamStartPos].m_Type == 0) {
-      if (CPDF_Object* pObject = m_ParamBuf[m_ParamStartPos].m_pObject)
-        pObject->Release();
-    }
+    if (m_ParamBuf[m_ParamStartPos].m_Type == 0)
+      delete m_ParamBuf[m_ParamStartPos].m_pObject;
+
     return m_ParamStartPos;
   }
   int index = m_ParamStartPos + m_ParamCount;
@@ -244,10 +239,9 @@
 void CPDF_StreamContentParser::ClearAllParams() {
   uint32_t index = m_ParamStartPos;
   for (uint32_t i = 0; i < m_ParamCount; i++) {
-    if (m_ParamBuf[index].m_Type == 0) {
-      if (CPDF_Object* pObject = m_ParamBuf[index].m_pObject)
-        pObject->Release();
-    }
+    if (m_ParamBuf[index].m_Type == 0)
+      delete m_ParamBuf[index].m_pObject;
+
     index++;
     if (index == kParamBufSize) {
       index = 0;
@@ -531,7 +525,7 @@
                                m_pSyntax->GetWordSize());
       if (bsKeyword != "ID") {
         m_pSyntax->SetPos(savePos);
-        pDict->Release();
+        delete pDict;
         return;
       }
     }
@@ -540,8 +534,7 @@
     }
     CFX_ByteString key((const FX_CHAR*)m_pSyntax->GetWordBuf() + 1,
                        m_pSyntax->GetWordSize() - 1);
-    std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>> pObj(
-        m_pSyntax->ReadNextObject(false, 0));
+    std::unique_ptr<CPDF_Object> pObj(m_pSyntax->ReadNextObject(false, 0));
     if (!key.IsEmpty()) {
       uint32_t dwObjNum = pObj ? pObj->GetObjNum() : 0;
       if (dwObjNum)
@@ -566,7 +559,8 @@
     }
   }
   pDict->SetNameFor("Subtype", "Image");
-  UniqueStream pStream(m_pSyntax->ReadInlineStream(m_pDocument, pDict, pCSObj));
+  std::unique_ptr<CPDF_Stream> pStream(
+      m_pSyntax->ReadInlineStream(m_pDocument, pDict, pCSObj));
   bool bGaveDictAway = !!pStream;
   while (1) {
     CPDF_StreamParser::SyntaxType type = m_pSyntax->ParseNextElement();
@@ -583,7 +577,7 @@
   }
   CPDF_ImageObject* pImgObj = AddImage(std::move(pStream));
   if (!pImgObj && !bGaveDictAway)
-    pDict->Release();
+    delete pDict;
 }
 
 void CPDF_StreamContentParser::Handle_BeginMarkedContent() {
@@ -669,10 +663,10 @@
     type = pXObject->GetDict()->GetStringFor("Subtype");
 
   if (type == "Image") {
-    CPDF_ImageObject* pObj =
-        pXObject->IsInline()
-            ? AddImage(UniqueStream(ToStream(pXObject->Clone())))
-            : AddImage(pXObject->GetObjNum());
+    CPDF_ImageObject* pObj = pXObject->IsInline()
+                                 ? AddImage(std::unique_ptr<CPDF_Stream>(
+                                       ToStream(pXObject->Clone())))
+                                 : AddImage(pXObject->GetObjNum());
 
     m_LastImageName = name;
     m_pLastImage = pObj->GetImage();
@@ -704,7 +698,8 @@
   m_pObjectHolder->GetPageObjectList()->push_back(std::move(pFormObj));
 }
 
-CPDF_ImageObject* CPDF_StreamContentParser::AddImage(UniqueStream pStream) {
+CPDF_ImageObject* CPDF_StreamContentParser::AddImage(
+    std::unique_ptr<CPDF_Stream> pStream) {
   if (!pStream)
     return nullptr;
 
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.h b/core/fpdfapi/page/cpdf_streamcontentparser.h
index 58008da..1ed2aaa 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.h
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.h
@@ -97,7 +97,7 @@
   void AddPathPoint(FX_FLOAT x, FX_FLOAT y, int flag);
   void AddPathRect(FX_FLOAT x, FX_FLOAT y, FX_FLOAT w, FX_FLOAT h);
   void AddPathObject(int FillType, bool bStroke);
-  CPDF_ImageObject* AddImage(UniqueStream pStream);
+  CPDF_ImageObject* AddImage(std::unique_ptr<CPDF_Stream> pStream);
   CPDF_ImageObject* AddImage(uint32_t streamObjNum);
   CPDF_ImageObject* AddImage(CPDF_Image* pImage);
 
diff --git a/core/fpdfapi/page/fpdf_page_parser_old.cpp b/core/fpdfapi/page/fpdf_page_parser_old.cpp
index 0d1db43..51ffc11 100644
--- a/core/fpdfapi/page/fpdf_page_parser_old.cpp
+++ b/core/fpdfapi/page/fpdf_page_parser_old.cpp
@@ -138,9 +138,7 @@
       m_pPool(pPool) {}
 
 CPDF_StreamParser::~CPDF_StreamParser() {
-  if (m_pLastObj) {
-    m_pLastObj->Release();
-  }
+  delete m_pLastObj;
 }
 
 CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc,
@@ -252,10 +250,8 @@
 }
 
 CPDF_StreamParser::SyntaxType CPDF_StreamParser::ParseNextElement() {
-  if (m_pLastObj) {
-    m_pLastObj->Release();
-    m_pLastObj = nullptr;
-  }
+  delete m_pLastObj;
+  m_pLastObj = nullptr;
 
   m_WordSize = 0;
   bool bIsNumber = true;
@@ -374,7 +370,7 @@
         break;
 
       if (!m_WordSize || m_WordBuffer[0] != '/') {
-        pDict->Release();
+        delete pDict;
         return nullptr;
       }
 
@@ -382,12 +378,12 @@
           PDF_NameDecode(CFX_ByteStringC(m_WordBuffer + 1, m_WordSize - 1));
       CPDF_Object* pObj = ReadNextObject(true, 0);
       if (!pObj) {
-        pDict->Release();
+        delete pDict;
         return nullptr;
       }
 
       if (key.IsEmpty())
-        pObj->Release();
+        delete pObj;
       else
         pDict->SetFor(key, pObj);
     }
diff --git a/core/fpdfapi/parser/cfdf_document.cpp b/core/fpdfapi/parser/cfdf_document.cpp
index d39ec31..dcd4b3c 100644
--- a/core/fpdfapi/parser/cfdf_document.cpp
+++ b/core/fpdfapi/parser/cfdf_document.cpp
@@ -81,7 +81,7 @@
       if (CPDF_Dictionary* pMainDict =
               ToDictionary(parser.GetObject(this, 0, 0, true))) {
         m_pRootDict = pMainDict->GetDictFor("Root");
-        pMainDict->Release();
+        delete pMainDict;
       }
       break;
     }
diff --git a/core/fpdfapi/parser/cpdf_array.cpp b/core/fpdfapi/parser/cpdf_array.cpp
index e118fd6..4000bbc 100644
--- a/core/fpdfapi/parser/cpdf_array.cpp
+++ b/core/fpdfapi/parser/cpdf_array.cpp
@@ -24,7 +24,7 @@
   m_ObjNum = kInvalidObjNum;
   for (auto& it : m_Objects) {
     if (it && it->GetObjNum() != kInvalidObjNum)
-      it->Release();
+      delete it;
   }
 }
 
@@ -139,10 +139,9 @@
   if (nCount <= 0 || nCount > m_Objects.size() - i)
     return;
 
-  for (size_t j = 0; j < nCount; ++j) {
-    if (CPDF_Object* p = m_Objects[i + j])
-      p->Release();
-  }
+  for (size_t j = 0; j < nCount; ++j)
+    delete m_Objects[i + j];
+
   m_Objects.erase(m_Objects.begin() + i, m_Objects.begin() + i + nCount);
 }
 
@@ -166,9 +165,7 @@
     ASSERT(false);
     return;
   }
-  if (CPDF_Object* pOld = m_Objects[i])
-    pOld->Release();
-
+  delete m_Objects[i];
   m_Objects[i] = pObj;
 }
 
diff --git a/core/fpdfapi/parser/cpdf_array.h b/core/fpdfapi/parser/cpdf_array.h
index 8cfa033..9deb478 100644
--- a/core/fpdfapi/parser/cpdf_array.h
+++ b/core/fpdfapi/parser/cpdf_array.h
@@ -21,6 +21,7 @@
   using const_iterator = std::vector<CPDF_Object*>::const_iterator;
 
   CPDF_Array();
+  ~CPDF_Array() override;
 
   // CPDF_Object.
   Type GetType() const override;
@@ -61,15 +62,12 @@
   const_iterator end() const { return m_Objects.end(); }
 
  protected:
-  ~CPDF_Array() override;
-
   CPDF_Object* CloneNonCyclic(
       bool bDirect,
       std::set<const CPDF_Object*>* pVisited) const override;
 
   std::vector<CPDF_Object*> m_Objects;
 };
-using UniqueArray = std::unique_ptr<CPDF_Array, ReleaseDeleter<CPDF_Object>>;
 
 inline CPDF_Array* ToArray(CPDF_Object* obj) {
   return obj ? obj->AsArray() : nullptr;
@@ -79,12 +77,12 @@
   return obj ? obj->AsArray() : nullptr;
 }
 
-inline UniqueArray ToArray(UniqueObject obj) {
+inline std::unique_ptr<CPDF_Array> ToArray(std::unique_ptr<CPDF_Object> obj) {
   CPDF_Array* pArray = ToArray(obj.get());
   if (!pArray)
     return nullptr;
   obj.release();
-  return UniqueArray(pArray);
+  return std::unique_ptr<CPDF_Array>(pArray);
 }
 
 #endif  // CORE_FPDFAPI_PARSER_CPDF_ARRAY_H_
diff --git a/core/fpdfapi/parser/cpdf_array_unittest.cpp b/core/fpdfapi/parser/cpdf_array_unittest.cpp
index bc9f578..800afb0 100644
--- a/core/fpdfapi/parser/cpdf_array_unittest.cpp
+++ b/core/fpdfapi/parser/cpdf_array_unittest.cpp
@@ -10,16 +10,10 @@
 
 #include "testing/gtest/include/gtest/gtest.h"
 
-namespace {
-
-using ScopedArray = std::unique_ptr<CPDF_Array, ReleaseDeleter<CPDF_Array>>;
-
-}  // namespace
-
 TEST(cpdf_array, RemoveAt) {
   {
     int elems[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
-    ScopedArray arr(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
     for (size_t i = 0; i < FX_ArraySize(elems); ++i)
       arr->AddInteger(elems[i]);
     arr->RemoveAt(3, 3);
@@ -36,7 +30,7 @@
   {
     // When the range is out of bound, RemoveAt has no effect.
     int elems[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
-    ScopedArray arr(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
     for (size_t i = 0; i < FX_ArraySize(elems); ++i)
       arr->AddInteger(elems[i]);
     arr->RemoveAt(8, 5);
@@ -53,7 +47,7 @@
 TEST(cpdf_array, InsertAt) {
   {
     int elems[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
-    ScopedArray arr(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
     for (size_t i = 0; i < FX_ArraySize(elems); ++i)
       arr->InsertAt(i, new CPDF_Number(elems[i]));
     EXPECT_EQ(FX_ArraySize(elems), arr->GetCount());
@@ -72,7 +66,7 @@
     // an element is inserted at that position while other unfilled
     // positions have nullptr.
     int elems[] = {1, 2};
-    ScopedArray arr(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
     for (size_t i = 0; i < FX_ArraySize(elems); ++i)
       arr->InsertAt(i, new CPDF_Number(elems[i]));
     arr->InsertAt(10, new CPDF_Number(10));
@@ -89,10 +83,10 @@
   {
     // Basic case.
     int elems[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
-    ScopedArray arr(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
     for (size_t i = 0; i < FX_ArraySize(elems); ++i)
       arr->InsertAt(i, new CPDF_Number(elems[i]));
-    ScopedArray arr2(arr->Clone()->AsArray());
+    std::unique_ptr<CPDF_Array> arr2(arr->Clone()->AsArray());
     EXPECT_EQ(arr->GetCount(), arr2->GetCount());
     for (size_t i = 0; i < FX_ArraySize(elems); ++i) {
       // Clone() always create new objects.
@@ -106,7 +100,7 @@
     static const size_t kNumOfRowElems = 5;
     int elems[kNumOfRows][kNumOfRowElems] = {
         {1, 2, 3, 4, 5}, {10, 9, 8, 7, 6}, {11, 12, 13, 14, 15}};
-    ScopedArray arr(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
     // Indirect references to indirect objects.
     std::unique_ptr<CPDF_IndirectObjectHolder> obj_holder(
         new CPDF_IndirectObjectHolder());
@@ -124,10 +118,10 @@
     ASSERT_EQ(kNumOfRows, arr->GetCount());
     // Not dereferencing reference objects means just creating new references
     // instead of new copies of direct objects.
-    ScopedArray arr1(arr->Clone()->AsArray());
+    std::unique_ptr<CPDF_Array> arr1(arr->Clone()->AsArray());
     EXPECT_EQ(arr->GetCount(), arr1->GetCount());
     // Dereferencing reference objects creates new copies of direct objects.
-    ScopedArray arr2(arr->CloneDirectObject()->AsArray());
+    std::unique_ptr<CPDF_Array> arr2(arr->CloneDirectObject()->AsArray());
     EXPECT_EQ(arr->GetCount(), arr2->GetCount());
     for (size_t i = 0; i < kNumOfRows; ++i) {
       CPDF_Array* arr_elem = arr->GetObjectAt(i)->AsArray();
@@ -171,7 +165,7 @@
 TEST(cpdf_array, Iterator) {
   int elems[] = {-23, -11,     3,         455,   2345877,
                  0,   7895330, -12564334, 10000, -100000};
-  ScopedArray arr(new CPDF_Array);
+  std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
   for (size_t i = 0; i < FX_ArraySize(elems); ++i)
     arr->InsertAt(i, new CPDF_Number(elems[i]));
   size_t index = 0;
diff --git a/core/fpdfapi/parser/cpdf_data_avail.cpp b/core/fpdfapi/parser/cpdf_data_avail.cpp
index a077ebb..eadbf1e 100644
--- a/core/fpdfapi/parser/cpdf_data_avail.cpp
+++ b/core/fpdfapi/parser/cpdf_data_avail.cpp
@@ -83,17 +83,12 @@
 
 CPDF_DataAvail::~CPDF_DataAvail() {
   m_pHintTables.reset();
-  if (m_pLinearized)
-    m_pLinearized->Release();
-
-  if (m_pRoot)
-    m_pRoot->Release();
-
-  if (m_pTrailer)
-    m_pTrailer->Release();
+  delete m_pLinearized;
+  delete m_pRoot;
+  delete m_pTrailer;
 
   for (CPDF_Object* pObject : m_arrayAcroforms)
-    pObject->Release();
+    delete pObject;
 }
 
 void CPDF_DataAvail::SetDocument(CPDF_Document* pDoc) {
@@ -230,7 +225,7 @@
   }
 
   for (CPDF_Object* pObject : m_arrayAcroforms)
-    pObject->Release();
+    delete pObject;
 
   m_arrayAcroforms.clear();
   return true;
@@ -400,9 +395,7 @@
     return false;
   }
 
-  if (pInfo)
-    pInfo->Release();
-
+  delete pInfo;
   m_docStatus =
       (m_bHaveAcroForm ? PDF_DATAAVAIL_ACROFORM : PDF_DATAAVAIL_PAGETREE);
 
@@ -499,7 +492,7 @@
     }
 
     if (!pObj->IsDictionary()) {
-      pObj->Release();
+      delete pObj;
       continue;
     }
 
@@ -508,7 +501,7 @@
       m_PagesArray.push_back(pObj);
       continue;
     }
-    pObj->Release();
+    delete pObj;
   }
 
   m_PageObjList.RemoveAll();
@@ -524,15 +517,15 @@
       continue;
 
     if (!GetPageKids(m_pCurrentParser, pPages)) {
-      pPages->Release();
+      delete pPages;
       while (++i < iPages)
-        m_PagesArray[i]->Release();
+        delete m_PagesArray[i];
 
       m_PagesArray.clear();
       m_docStatus = PDF_DATAAVAIL_ERROR;
       return false;
     }
-    pPages->Release();
+    delete pPages;
   }
 
   m_PagesArray.clear();
@@ -587,12 +580,12 @@
   }
 
   if (!GetPageKids(m_pCurrentParser, pPages)) {
-    pPages->Release();
+    delete pPages;
     m_docStatus = PDF_DATAAVAIL_ERROR;
     return false;
   }
 
-  pPages->Release();
+  delete pPages;
   m_docStatus = PDF_DATAAVAIL_PAGE;
   return true;
 }
@@ -763,7 +756,7 @@
 
   std::unique_ptr<CPDF_HintTables> pHintTables(
       new CPDF_HintTables(this, pDict));
-  std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>> pHintStream(
+  std::unique_ptr<CPDF_Object> pHintStream(
       ParseIndirectObjectAt(szHintStart, 0));
   CPDF_Stream* pStream = ToStream(pHintStream.get());
   if (pStream && pHintTables->LoadHintStream(pStream))
@@ -951,11 +944,11 @@
       if (pName->GetString() == "XRef") {
         m_Pos += m_parser.m_pSyntax->SavePos();
         xref_offset = pObj->GetDict()->GetIntegerFor("Prev");
-        pObj->Release();
+        delete pObj;
         return 1;
       }
     }
-    pObj->Release();
+    delete pObj;
     return -1;
   }
   pHints->AddSegment(m_Pos, req_size);
@@ -1181,7 +1174,7 @@
     ScopedFileStream file(FX_CreateMemoryStream(pBuf, (size_t)iSize, false));
     m_syntaxParser.InitParser(file.get(), 0);
 
-    std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>> pTrailer(
+    std::unique_ptr<CPDF_Object> pTrailer(
         m_syntaxParser.GetObject(nullptr, 0, 0, true));
     if (!pTrailer) {
       m_Pos += m_syntaxParser.SavePos();
@@ -1266,7 +1259,7 @@
 
   CPDF_Array* pArray = pPages->AsArray();
   if (!pArray) {
-    pPages->Release();
+    delete pPages;
     m_docStatus = PDF_DATAAVAIL_ERROR;
     return false;
   }
@@ -1281,7 +1274,7 @@
     pPageNode->m_childNode.Add(pNode);
     pNode->m_dwPageNo = pKid->GetRefObjNum();
   }
-  pPages->Release();
+  delete pPages;
   return true;
 }
 
@@ -1304,12 +1297,12 @@
   if (pPage->IsArray()) {
     pPageNode->m_dwPageNo = dwPageNo;
     pPageNode->m_type = PDF_PAGENODE_ARRAY;
-    pPage->Release();
+    delete pPage;
     return true;
   }
 
   if (!pPage->IsDictionary()) {
-    pPage->Release();
+    delete pPage;
     m_docStatus = PDF_DATAAVAIL_ERROR;
     return false;
   }
@@ -1350,11 +1343,11 @@
   } else if (type == "Page") {
     pPageNode->m_type = PDF_PAGENODE_PAGE;
   } else {
-    pPage->Release();
+    delete pPage;
     m_docStatus = PDF_DATAAVAIL_ERROR;
     return false;
   }
-  pPage->Release();
+  delete pPage;
   return true;
 }
 
@@ -1442,23 +1435,23 @@
 
   CPDF_Dictionary* pPagesDict = pPages->GetDict();
   if (!pPagesDict) {
-    pPages->Release();
+    delete pPages;
     m_docStatus = PDF_DATAAVAIL_ERROR;
     return false;
   }
 
   if (!pPagesDict->KeyExist("Kids")) {
-    pPages->Release();
+    delete pPages;
     return true;
   }
 
   int count = pPagesDict->GetIntegerFor("Count");
   if (count > 0) {
-    pPages->Release();
+    delete pPages;
     return true;
   }
 
-  pPages->Release();
+  delete pPages;
   return false;
 }
 
diff --git a/core/fpdfapi/parser/cpdf_dictionary.cpp b/core/fpdfapi/parser/cpdf_dictionary.cpp
index 75cb1e8..37efbbc 100644
--- a/core/fpdfapi/parser/cpdf_dictionary.cpp
+++ b/core/fpdfapi/parser/cpdf_dictionary.cpp
@@ -31,7 +31,7 @@
   m_ObjNum = kInvalidObjNum;
   for (const auto& it : m_Map) {
     if (it.second && it.second->GetObjNum() != kInvalidObjNum)
-      it.second->Release();
+      delete it.second;
   }
 }
 
@@ -184,7 +184,7 @@
 
   if (it->second == pObj)
     return;
-  it->second->Release();
+  delete it->second;
 
   if (pObj)
     it->second = pObj;
@@ -208,7 +208,7 @@
   if (it == m_Map.end())
     return;
 
-  it->second->Release();
+  delete it->second;
   m_Map.erase(it);
 }
 
@@ -223,7 +223,7 @@
     return;
 
   if (new_it != m_Map.end()) {
-    new_it->second->Release();
+    delete new_it->second;
     new_it->second = old_it->second;
   } else {
     m_Map.insert(std::make_pair(MaybeIntern(newkey), old_it->second));
diff --git a/core/fpdfapi/parser/cpdf_dictionary.h b/core/fpdfapi/parser/cpdf_dictionary.h
index fb8200f..4ef2f96 100644
--- a/core/fpdfapi/parser/cpdf_dictionary.h
+++ b/core/fpdfapi/parser/cpdf_dictionary.h
@@ -26,6 +26,7 @@
 
   CPDF_Dictionary();
   explicit CPDF_Dictionary(const CFX_WeakPtr<CFX_ByteStringPool>& pPool);
+  ~CPDF_Dictionary() override;
 
   // CPDF_Object.
   Type GetType() const override;
@@ -88,8 +89,6 @@
   CFX_WeakPtr<CFX_ByteStringPool> GetByteStringPool() const { return m_pPool; }
 
  protected:
-  ~CPDF_Dictionary() override;
-
   CFX_ByteString MaybeIntern(const CFX_ByteString& str);
   CPDF_Object* CloneNonCyclic(
       bool bDirect,
@@ -99,9 +98,6 @@
   std::map<CFX_ByteString, CPDF_Object*> m_Map;
 };
 
-using UniqueDictionary =
-    std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Object>>;
-
 inline CPDF_Dictionary* ToDictionary(CPDF_Object* obj) {
   return obj ? obj->AsDictionary() : nullptr;
 }
@@ -110,12 +106,13 @@
   return obj ? obj->AsDictionary() : nullptr;
 }
 
-inline UniqueDictionary ToDictionary(UniqueObject obj) {
+inline std::unique_ptr<CPDF_Dictionary> ToDictionary(
+    std::unique_ptr<CPDF_Object> obj) {
   CPDF_Dictionary* pDict = ToDictionary(obj.get());
   if (!pDict)
     return nullptr;
   obj.release();
-  return UniqueDictionary(pDict);
+  return std::unique_ptr<CPDF_Dictionary>(pDict);
 }
 
 #endif  // CORE_FPDFAPI_PARSER_CPDF_DICTIONARY_H_
diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp
index ad84a15..6457404 100644
--- a/core/fpdfapi/parser/cpdf_document.cpp
+++ b/core/fpdfapi/parser/cpdf_document.cpp
@@ -634,7 +634,7 @@
   pDict->SetNameFor("Type", "Page");
   uint32_t dwObjNum = AddIndirectObject(pDict);
   if (!InsertNewPage(iPage, pDict)) {
-    ReleaseIndirectObject(dwObjNum);
+    DeleteIndirectObject(dwObjNum);
     return nullptr;
   }
   return pDict;
diff --git a/core/fpdfapi/parser/cpdf_document_unittest.cpp b/core/fpdfapi/parser/cpdf_document_unittest.cpp
index 9336626..c09665b 100644
--- a/core/fpdfapi/parser/cpdf_document_unittest.cpp
+++ b/core/fpdfapi/parser/cpdf_document_unittest.cpp
@@ -76,8 +76,7 @@
   }
 
  private:
-  std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>>
-      m_pOwnedRootDict;
+  std::unique_ptr<CPDF_Dictionary> m_pOwnedRootDict;
 };
 }  // namespace
 
@@ -121,7 +120,7 @@
   // can be not exists in this case.
   // (case, when hint table is used to page check in CPDF_DataAvail).
   CPDF_Document document(pdfium::MakeUnique<CPDF_Parser>());
-  ScopedDictionary dict(new CPDF_Dictionary());
+  std::unique_ptr<CPDF_Dictionary> dict(new CPDF_Dictionary());
   const int page_count = 100;
   dict->SetIntegerFor("N", page_count);
   document.LoadLinearizedDoc(dict.get());
diff --git a/core/fpdfapi/parser/cpdf_indirect_object_holder.cpp b/core/fpdfapi/parser/cpdf_indirect_object_holder.cpp
index 6e549de..427fac6 100644
--- a/core/fpdfapi/parser/cpdf_indirect_object_holder.cpp
+++ b/core/fpdfapi/parser/cpdf_indirect_object_holder.cpp
@@ -70,7 +70,7 @@
   return true;
 }
 
-void CPDF_IndirectObjectHolder::ReleaseIndirectObject(uint32_t objnum) {
+void CPDF_IndirectObjectHolder::DeleteIndirectObject(uint32_t objnum) {
   CPDF_Object* pObj = GetIndirectObject(objnum);
   if (!pObj || pObj->GetObjNum() == CPDF_Object::kInvalidObjNum)
     return;
diff --git a/core/fpdfapi/parser/cpdf_indirect_object_holder.h b/core/fpdfapi/parser/cpdf_indirect_object_holder.h
index da4e942..83a3153 100644
--- a/core/fpdfapi/parser/cpdf_indirect_object_holder.h
+++ b/core/fpdfapi/parser/cpdf_indirect_object_holder.h
@@ -24,7 +24,7 @@
 
   CPDF_Object* GetIndirectObject(uint32_t objnum) const;
   CPDF_Object* GetOrParseIndirectObject(uint32_t objnum);
-  void ReleaseIndirectObject(uint32_t objnum);
+  void DeleteIndirectObject(uint32_t objnum);
 
   // Take ownership of |pObj|.
   uint32_t AddIndirectObject(CPDF_Object* pObj);
diff --git a/core/fpdfapi/parser/cpdf_object.cpp b/core/fpdfapi/parser/cpdf_object.cpp
index cc410d1..e9c215c 100644
--- a/core/fpdfapi/parser/cpdf_object.cpp
+++ b/core/fpdfapi/parser/cpdf_object.cpp
@@ -37,11 +37,6 @@
   return Clone();
 }
 
-void CPDF_Object::Release() {
-  CHECK(!m_ObjNum);
-  delete this;
-}
-
 CFX_ByteString CPDF_Object::GetString() const {
   return CFX_ByteString();
 }
diff --git a/core/fpdfapi/parser/cpdf_object.h b/core/fpdfapi/parser/cpdf_object.h
index c888605..8f6491e 100644
--- a/core/fpdfapi/parser/cpdf_object.h
+++ b/core/fpdfapi/parser/cpdf_object.h
@@ -38,6 +38,8 @@
     REFERENCE
   };
 
+  virtual ~CPDF_Object();
+
   virtual Type GetType() const = 0;
   uint32_t GetObjNum() const { return m_ObjNum; }
   uint32_t GetGenNum() const { return m_GenNum; }
@@ -50,8 +52,6 @@
   virtual CPDF_Object* CloneDirectObject() const;
   virtual CPDF_Object* GetDirect() const;
 
-  void Release();
-
   virtual CFX_ByteString GetString() const;
   virtual CFX_WideString GetUnicodeText() const;
   virtual FX_FLOAT GetNumber() const;
@@ -94,10 +94,8 @@
   friend class CPDF_Parser;
   friend class CPDF_Reference;
   friend class CPDF_Stream;
-  friend struct std::default_delete<CPDF_Object>;
 
   CPDF_Object() : m_ObjNum(0), m_GenNum(0) {}
-  virtual ~CPDF_Object();
 
   CPDF_Object* CloneObjectNonCyclic(bool bDirect) const;
 
@@ -118,6 +116,4 @@
   CPDF_Object(const CPDF_Object& src) {}
 };
 
-using UniqueObject = std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>>;
-
 #endif  // CORE_FPDFAPI_PARSER_CPDF_OBJECT_H_
diff --git a/core/fpdfapi/parser/cpdf_object_unittest.cpp b/core/fpdfapi/parser/cpdf_object_unittest.cpp
index 8215226..64dc8c6 100644
--- a/core/fpdfapi/parser/cpdf_object_unittest.cpp
+++ b/core/fpdfapi/parser/cpdf_object_unittest.cpp
@@ -22,11 +22,6 @@
 
 namespace {
 
-using ScopedArray = std::unique_ptr<CPDF_Array, ReleaseDeleter<CPDF_Array>>;
-using ScopedDict =
-    std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>>;
-using ScopedStream = std::unique_ptr<CPDF_Stream, ReleaseDeleter<CPDF_Stream>>;
-
 void TestArrayAccessors(const CPDF_Array* arr,
                         size_t index,
                         const char* str_val,
@@ -173,14 +168,12 @@
   }
 
  protected:
-  using ScopedObj = std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>>;
-
   // m_ObjHolder needs to be declared first and destructed last since it also
   // refers to some objects in m_DirectObjs.
   std::unique_ptr<CPDF_IndirectObjectHolder> m_ObjHolder;
-  std::vector<ScopedObj> m_DirectObjs;
+  std::vector<std::unique_ptr<CPDF_Object>> m_DirectObjs;
   std::vector<int> m_DirectObjTypes;
-  std::vector<ScopedObj> m_RefObjs;
+  std::vector<std::unique_ptr<CPDF_Object>> m_RefObjs;
   CPDF_Dictionary* m_DictObj;
   CPDF_Dictionary* m_StreamDictObj;
   CPDF_Array* m_ArrayObj;
@@ -275,13 +268,13 @@
 TEST_F(PDFObjectsTest, Clone) {
   // Check for direct objects.
   for (size_t i = 0; i < m_DirectObjs.size(); ++i) {
-    ScopedObj obj(m_DirectObjs[i]->Clone());
+    std::unique_ptr<CPDF_Object> obj(m_DirectObjs[i]->Clone());
     EXPECT_TRUE(Equal(m_DirectObjs[i].get(), obj.get()));
   }
 
   // Check indirect references.
   for (const auto& it : m_RefObjs) {
-    ScopedObj obj(it->Clone());
+    std::unique_ptr<CPDF_Object> obj(it->Clone());
     EXPECT_TRUE(Equal(it.get(), obj.get()));
   }
 }
@@ -393,7 +386,7 @@
                       {2.3f, 4.05f, 3, -2, -3, 0.0f},
                       {0.05f, 0.1f, 0.56f, 0.67f, 1.34f, 99.9f}};
   for (size_t i = 0; i < FX_ArraySize(elems); ++i) {
-    ScopedArray arr(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
     CFX_Matrix matrix(elems[i][0], elems[i][1], elems[i][2], elems[i][3],
                       elems[i][4], elems[i][5]);
     for (size_t j = 0; j < 6; ++j)
@@ -414,7 +407,7 @@
                       {2.3f, 4.05f, -3, 0.0f},
                       {0.05f, 0.1f, 1.34f, 99.9f}};
   for (size_t i = 0; i < FX_ArraySize(elems); ++i) {
-    ScopedArray arr(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
     CFX_FloatRect rect(elems[i]);
     for (size_t j = 0; j < 4; ++j)
       arr->AddNumber(elems[i][j]);
@@ -430,7 +423,7 @@
   {
     // Boolean array.
     const bool vals[] = {true, false, false, true, true};
-    ScopedArray arr(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
     for (size_t i = 0; i < FX_ArraySize(vals); ++i)
       arr->InsertAt(i, new CPDF_Boolean(vals[i]));
     for (size_t i = 0; i < FX_ArraySize(vals); ++i) {
@@ -447,7 +440,7 @@
   {
     // Integer array.
     const int vals[] = {10, 0, -345, 2089345456, -1000000000, 567, 93658767};
-    ScopedArray arr(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
     for (size_t i = 0; i < FX_ArraySize(vals); ++i)
       arr->InsertAt(i, new CPDF_Number(vals[i]));
     for (size_t i = 0; i < FX_ArraySize(vals); ++i) {
@@ -468,7 +461,7 @@
                           897.34f, -2.5f, -1.0f, -345.0f, -0.0f};
     const char* const expected_str[] = {
         "0", "0", "10", "10", "0.0345", "897.34", "-2.5", "-1", "-345", "0"};
-    ScopedArray arr(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
     for (size_t i = 0; i < FX_ArraySize(vals); ++i) {
       arr->InsertAt(i, new CPDF_Number(vals[i]));
     }
@@ -487,8 +480,8 @@
     // String and name array
     const char* const vals[] = {"this", "adsde$%^", "\r\t",           "\"012",
                                 ".",    "EYREW",    "It is a joke :)"};
-    ScopedArray string_array(new CPDF_Array);
-    ScopedArray name_array(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> string_array(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> name_array(new CPDF_Array);
     for (size_t i = 0; i < FX_ArraySize(vals); ++i) {
       string_array->InsertAt(i, new CPDF_String(vals[i], false));
       name_array->InsertAt(i, new CPDF_Name(vals[i]));
@@ -514,7 +507,7 @@
   }
   {
     // Null element array.
-    ScopedArray arr(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
     for (size_t i = 0; i < 3; ++i)
       arr->InsertAt(i, new CPDF_Null);
     for (size_t i = 0; i < 3; ++i) {
@@ -531,7 +524,7 @@
   {
     // Array of array.
     CPDF_Array* vals[3];
-    ScopedArray arr(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
     for (size_t i = 0; i < 3; ++i) {
       vals[i] = new CPDF_Array;
       for (size_t j = 0; j < 3; ++j) {
@@ -554,7 +547,7 @@
   {
     // Dictionary array.
     CPDF_Dictionary* vals[3];
-    ScopedArray arr(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
     for (size_t i = 0; i < 3; ++i) {
       vals[i] = new CPDF_Dictionary();
       for (size_t j = 0; j < 3; ++j) {
@@ -581,7 +574,7 @@
     // Stream array.
     CPDF_Dictionary* vals[3];
     CPDF_Stream* stream_vals[3];
-    ScopedArray arr(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
     for (size_t i = 0; i < 3; ++i) {
       vals[i] = new CPDF_Dictionary();
       for (size_t j = 0; j < 3; ++j) {
@@ -611,7 +604,7 @@
   }
   {
     // Mixed array.
-    ScopedArray arr(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
     // Array arr will take ownership of all the objects inserted.
     arr->InsertAt(0, new CPDF_Boolean(true));
     arr->InsertAt(1, new CPDF_Boolean(false));
@@ -676,7 +669,7 @@
 TEST(PDFArrayTest, AddNumber) {
   float vals[] = {1.0f,         -1.0f, 0,    0.456734f,
                   12345.54321f, 0.5f,  1000, 0.000045f};
-  ScopedArray arr(new CPDF_Array);
+  std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
   for (size_t i = 0; i < FX_ArraySize(vals); ++i)
     arr->AddNumber(vals[i]);
   for (size_t i = 0; i < FX_ArraySize(vals); ++i) {
@@ -687,7 +680,7 @@
 
 TEST(PDFArrayTest, AddInteger) {
   int vals[] = {0, 1, 934435456, 876, 10000, -1, -24354656, -100};
-  ScopedArray arr(new CPDF_Array);
+  std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
   for (size_t i = 0; i < FX_ArraySize(vals); ++i)
     arr->AddInteger(vals[i]);
   for (size_t i = 0; i < FX_ArraySize(vals); ++i) {
@@ -699,8 +692,8 @@
 TEST(PDFArrayTest, AddStringAndName) {
   const char* vals[] = {"",        "a", "ehjhRIOYTTFdfcdnv",  "122323",
                         "$#%^&**", " ", "This is a test.\r\n"};
-  ScopedArray string_array(new CPDF_Array);
-  ScopedArray name_array(new CPDF_Array);
+  std::unique_ptr<CPDF_Array> string_array(new CPDF_Array);
+  std::unique_ptr<CPDF_Array> name_array(new CPDF_Array);
   for (size_t i = 0; i < FX_ArraySize(vals); ++i) {
     string_array->AddString(vals[i]);
     name_array->AddName(vals[i]);
@@ -725,8 +718,8 @@
   CPDF_Object* indirect_objs[] = {boolean_obj, int_obj,  float_obj,
                                   str_obj,     name_obj, null_obj};
   unsigned int obj_nums[] = {2, 4, 7, 2345, 799887, 1};
-  ScopedArray arr(new CPDF_Array);
-  ScopedArray arr1(new CPDF_Array);
+  std::unique_ptr<CPDF_Array> arr(new CPDF_Array);
+  std::unique_ptr<CPDF_Array> arr1(new CPDF_Array);
   // Create two arrays of references by different AddReference() APIs.
   for (size_t i = 0; i < FX_ArraySize(indirect_objs); ++i) {
     // All the indirect objects inserted will be owned by holder.
@@ -752,7 +745,7 @@
 
 TEST(PDFArrayTest, CloneDirectObject) {
   CPDF_IndirectObjectHolder objects_holder;
-  ScopedArray array(new CPDF_Array);
+  std::unique_ptr<CPDF_Array> array(new CPDF_Array);
   array->AddReference(&objects_holder, 1234);
   ASSERT_EQ(1U, array->GetCount());
   CPDF_Object* obj = array->GetObjectAt(0);
@@ -763,7 +756,7 @@
   ASSERT_TRUE(cloned_array_object);
   ASSERT_TRUE(cloned_array_object->IsArray());
 
-  ScopedArray cloned_array(cloned_array_object->AsArray());
+  std::unique_ptr<CPDF_Array> cloned_array(cloned_array_object->AsArray());
   ASSERT_EQ(1U, cloned_array->GetCount());
   CPDF_Object* cloned_obj = cloned_array->GetObjectAt(0);
   EXPECT_FALSE(cloned_obj);
@@ -771,7 +764,7 @@
 
 TEST(PDFArrayTest, ConvertIndirect) {
   CPDF_IndirectObjectHolder objects_holder;
-  ScopedArray array(new CPDF_Array);
+  std::unique_ptr<CPDF_Array> array(new CPDF_Array);
   CPDF_Object* pObj = new CPDF_Number(42);
   array->Add(pObj);
   array->ConvertToIndirectObjectAt(0, &objects_holder);
@@ -786,7 +779,7 @@
 
 TEST(PDFDictionaryTest, CloneDirectObject) {
   CPDF_IndirectObjectHolder objects_holder;
-  ScopedDict dict(new CPDF_Dictionary());
+  std::unique_ptr<CPDF_Dictionary> dict(new CPDF_Dictionary());
   dict->SetReferenceFor("foo", &objects_holder, 1234);
   ASSERT_EQ(1U, dict->GetCount());
   CPDF_Object* obj = dict->GetObjectFor("foo");
@@ -797,7 +790,8 @@
   ASSERT_TRUE(cloned_dict_object);
   ASSERT_TRUE(cloned_dict_object->IsDictionary());
 
-  ScopedDict cloned_dict(cloned_dict_object->AsDictionary());
+  std::unique_ptr<CPDF_Dictionary> cloned_dict(
+      cloned_dict_object->AsDictionary());
   ASSERT_EQ(1U, cloned_dict->GetCount());
   CPDF_Object* cloned_obj = cloned_dict->GetObjectFor("foo");
   EXPECT_FALSE(cloned_obj);
@@ -807,12 +801,12 @@
   {
     // Create a dictionary/array pair with a reference loop.
     CPDF_Dictionary* dict_obj = new CPDF_Dictionary();
-    ScopedArray arr_obj(new CPDF_Array);
+    std::unique_ptr<CPDF_Array> arr_obj(new CPDF_Array);
     dict_obj->SetFor("arr", arr_obj.get());
     arr_obj->InsertAt(0, dict_obj);
 
     // Clone this object to see whether stack overflow will be triggered.
-    ScopedArray cloned_array(arr_obj->Clone()->AsArray());
+    std::unique_ptr<CPDF_Array> cloned_array(arr_obj->Clone()->AsArray());
     // Cloned object should be the same as the original.
     ASSERT_TRUE(cloned_array);
     EXPECT_EQ(1u, cloned_array->GetCount());
@@ -825,11 +819,12 @@
   {
     // Create a dictionary/stream pair with a reference loop.
     CPDF_Dictionary* dict_obj = new CPDF_Dictionary();
-    ScopedStream stream_obj(new CPDF_Stream(nullptr, 0, dict_obj));
+    std::unique_ptr<CPDF_Stream> stream_obj(
+        new CPDF_Stream(nullptr, 0, dict_obj));
     dict_obj->SetFor("stream", stream_obj.get());
 
     // Clone this object to see whether stack overflow will be triggered.
-    ScopedStream cloned_stream(stream_obj->Clone()->AsStream());
+    std::unique_ptr<CPDF_Stream> cloned_stream(stream_obj->Clone()->AsStream());
     // Cloned object should be the same as the original.
     ASSERT_TRUE(cloned_stream);
     CPDF_Object* cloned_dict = cloned_stream->GetDict();
@@ -855,7 +850,8 @@
     EXPECT_EQ(dict_obj, elem0->AsReference()->GetDirect());
 
     // Clone this object to see whether stack overflow will be triggered.
-    ScopedDict cloned_dict(ToDictionary(dict_obj->CloneDirectObject()));
+    std::unique_ptr<CPDF_Dictionary> cloned_dict(
+        ToDictionary(dict_obj->CloneDirectObject()));
     // Cloned object should be the same as the original.
     ASSERT_TRUE(cloned_dict);
     CPDF_Object* cloned_arr = cloned_dict->GetObjectFor("arr");
@@ -869,7 +865,7 @@
 
 TEST(PDFDictionaryTest, ConvertIndirect) {
   CPDF_IndirectObjectHolder objects_holder;
-  ScopedDict dict(new CPDF_Dictionary);
+  std::unique_ptr<CPDF_Dictionary> dict(new CPDF_Dictionary);
   CPDF_Object* pObj = new CPDF_Number(42);
   dict->SetFor("clams", pObj);
   dict->ConvertToIndirectObjectFor("clams", &objects_holder);
diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp
index cff0f77..da95cc5 100644
--- a/core/fpdfapi/parser/cpdf_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_parser.cpp
@@ -61,9 +61,7 @@
 }
 
 CPDF_Parser::~CPDF_Parser() {
-  if (m_pTrailer)
-    m_pTrailer->Release();
-
+  delete m_pTrailer;
   ReleaseEncryptHandler();
   SetEncryptDictionary(nullptr);
 
@@ -72,13 +70,10 @@
     m_pSyntax->m_pFileAccess = nullptr;
   }
 
-  for (CPDF_Dictionary* trailer : m_Trailers) {
-    if (trailer)
-      trailer->Release();
-  }
+  for (CPDF_Dictionary* trailer : m_Trailers)
+    delete trailer;
 
-  if (m_pLinearized)
-    m_pLinearized->Release();
+  delete m_pLinearized;
 }
 
 uint32_t CPDF_Parser::GetLastObjNum() const {
@@ -357,8 +352,7 @@
     CrossRefList.insert(CrossRefList.begin(), xrefpos);
     LoadCrossRefV4(xrefpos, 0, true);
 
-    std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>> pDict(
-        LoadTrailerV4());
+    std::unique_ptr<CPDF_Dictionary> pDict(LoadTrailerV4());
     if (!pDict)
       return false;
 
@@ -412,8 +406,7 @@
     CrossRefList.insert(CrossRefList.begin(), xrefpos);
     LoadCrossRefV4(xrefpos, 0, true);
 
-    std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>> pDict(
-        LoadTrailerV4());
+    std::unique_ptr<CPDF_Dictionary> pDict(LoadTrailerV4());
     if (!pDict)
       return false;
 
@@ -590,18 +583,14 @@
 bool CPDF_Parser::RebuildCrossRef() {
   m_ObjectInfo.clear();
   m_SortedOffset.clear();
-  if (m_pTrailer) {
-    m_pTrailer->Release();
-    m_pTrailer = nullptr;
-  }
+  delete m_pTrailer;
+  m_pTrailer = nullptr;
 
   ParserState state = ParserState::kDefault;
-
   int32_t inside_index = 0;
   uint32_t objnum = 0;
   uint32_t gennum = 0;
   int32_t depth = 0;
-
   const uint32_t kBufferSize = 4096;
   std::vector<uint8_t> buffer(kBufferSize);
 
@@ -755,8 +744,7 @@
                       CPDF_Object* pRoot = pDict->GetObjectFor("Root");
                       if (pRoot && pRoot->GetDict() &&
                           pRoot->GetDict()->GetObjectFor("Pages")) {
-                        if (m_pTrailer)
-                          m_pTrailer->Release();
+                        delete m_pTrailer;
                         m_pTrailer = ToDictionary(pDict->Clone());
                       }
                     }
@@ -794,8 +782,7 @@
                   m_ObjectInfo[objnum].gennum = gennum;
                 }
 
-                if (pObject)
-                  pObject->Release();
+                delete pObject;
               }
               --i;
               state = ParserState::kDefault;
@@ -812,7 +799,7 @@
               CPDF_Object* pObj = m_pSyntax->GetObject(m_pDocument, 0, 0, true);
               if (pObj) {
                 if (!pObj->IsDictionary() && !pObj->AsStream()) {
-                  pObj->Release();
+                  delete pObj;
                 } else {
                   CPDF_Stream* pStream = pObj->AsStream();
                   if (CPDF_Dictionary* pTrailer =
@@ -838,11 +825,11 @@
                           }
                         }
                       }
-                      pObj->Release();
+                      delete pObj;
                     } else {
                       if (pObj->IsStream()) {
                         m_pTrailer = ToDictionary(pTrailer->Clone());
-                        pObj->Release();
+                        delete pObj;
                       } else {
                         m_pTrailer = pTrailer;
                       }
@@ -859,7 +846,7 @@
                       m_pSyntax->RestorePos(dwSavePos);
                     }
                   } else {
-                    pObj->Release();
+                    delete pObj;
                   }
                 }
               }
@@ -1418,7 +1405,7 @@
   if (m_pSyntax->GetKeyword() != "trailer")
     return nullptr;
 
-  std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>> pObj(
+  std::unique_ptr<CPDF_Object> pObj(
       m_pSyntax->GetObject(m_pDocument, 0, 0, true));
   if (!ToDictionary(pObj.get()))
     return nullptr;
@@ -1470,7 +1457,7 @@
 
     CPDF_Object* pLen = pDict->GetObjectFor("L");
     if (!pLen) {
-      m_pLinearized->Release();
+      delete m_pLinearized;
       m_pLinearized = nullptr;
       return false;
     }
@@ -1486,7 +1473,7 @@
 
     return true;
   }
-  m_pLinearized->Release();
+  delete m_pLinearized;
   m_pLinearized = nullptr;
   return false;
 }
@@ -1595,12 +1582,11 @@
 CPDF_Parser::Error CPDF_Parser::LoadLinearizedMainXRefTable() {
   uint32_t dwSaveMetadataObjnum = m_pSyntax->m_MetadataObjnum;
   m_pSyntax->m_MetadataObjnum = 0;
-  if (m_pTrailer) {
-    m_pTrailer->Release();
-    m_pTrailer = nullptr;
-  }
 
+  delete m_pTrailer;
+  m_pTrailer = nullptr;
   m_pSyntax->RestorePos(m_LastXRefOffset - m_pSyntax->m_HeaderOffset);
+
   uint8_t ch = 0;
   uint32_t dwCount = 0;
   m_pSyntax->GetNextChar(ch);
diff --git a/core/fpdfapi/parser/cpdf_stream.cpp b/core/fpdfapi/parser/cpdf_stream.cpp
index c6e99c8..11ef1d2 100644
--- a/core/fpdfapi/parser/cpdf_stream.cpp
+++ b/core/fpdfapi/parser/cpdf_stream.cpp
@@ -15,7 +15,7 @@
 CPDF_Stream::CPDF_Stream() {}
 
 CPDF_Stream::CPDF_Stream(uint8_t* pData, uint32_t size, CPDF_Dictionary* pDict)
-    : m_pDict(pDict), m_dwSize(size), m_pDataBuf(pData) {}
+    : m_dwSize(size), m_pDict(pDict), m_pDataBuf(pData) {}
 
 CPDF_Stream::~CPDF_Stream() {
   m_ObjNum = kInvalidObjNum;
diff --git a/core/fpdfapi/parser/cpdf_stream.h b/core/fpdfapi/parser/cpdf_stream.h
index 73484d8..f0ba319 100644
--- a/core/fpdfapi/parser/cpdf_stream.h
+++ b/core/fpdfapi/parser/cpdf_stream.h
@@ -20,6 +20,7 @@
 
   // Takes ownership of |pData| and |pDict|.
   CPDF_Stream(uint8_t* pData, uint32_t size, CPDF_Dictionary* pDict);
+  ~CPDF_Stream() override;
 
   // CPDF_Object.
   Type GetType() const override;
@@ -47,20 +48,17 @@
   bool IsMemoryBased() const { return m_bMemoryBased; }
 
  protected:
-  ~CPDF_Stream() override;
   CPDF_Object* CloneNonCyclic(
       bool bDirect,
       std::set<const CPDF_Object*>* pVisited) const override;
 
-  std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>> m_pDict;
   bool m_bMemoryBased = true;
   uint32_t m_dwSize = 0;
+  std::unique_ptr<CPDF_Dictionary> m_pDict;
   std::unique_ptr<uint8_t, FxFreeDeleter> m_pDataBuf;
   IFX_SeekableReadStream* m_pFile = nullptr;
 };
 
-using UniqueStream = std::unique_ptr<CPDF_Stream, ReleaseDeleter<CPDF_Object>>;
-
 inline CPDF_Stream* ToStream(CPDF_Object* obj) {
   return obj ? obj->AsStream() : nullptr;
 }
@@ -69,12 +67,12 @@
   return obj ? obj->AsStream() : nullptr;
 }
 
-inline UniqueStream ToStream(UniqueObject obj) {
+inline std::unique_ptr<CPDF_Stream> ToStream(std::unique_ptr<CPDF_Object> obj) {
   CPDF_Stream* pStream = ToStream(obj.get());
   if (!pStream)
     return nullptr;
   obj.release();
-  return UniqueStream(pStream);
+  return std::unique_ptr<CPDF_Stream>(pStream);
 }
 
 #endif  // CORE_FPDFAPI_PARSER_CPDF_STREAM_H_
diff --git a/core/fpdfapi/parser/cpdf_string.h b/core/fpdfapi/parser/cpdf_string.h
index efc6d07..49834c0 100644
--- a/core/fpdfapi/parser/cpdf_string.h
+++ b/core/fpdfapi/parser/cpdf_string.h
@@ -16,6 +16,7 @@
   CPDF_String();
   CPDF_String(const CFX_ByteString& str, bool bHex);
   explicit CPDF_String(const CFX_WideString& str);
+  ~CPDF_String() override;
 
   // CPDF_Object.
   Type GetType() const override;
@@ -30,8 +31,6 @@
   bool IsHex() const { return m_bHex; }
 
  protected:
-  ~CPDF_String() override;
-
   CFX_ByteString m_String;
   bool m_bHex;
 };
diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.cpp b/core/fpdfapi/parser/cpdf_syntax_parser.cpp
index 178af3b..da3c8b0 100644
--- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_syntax_parser.cpp
@@ -425,8 +425,7 @@
     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 @@
   }
 
   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 @@
   }
 
   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 @@
         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 @@
 
       // Can't find "endstream" or "endobj".
       if (endStreamOffset < 0 && endObjOffset < 0) {
-        pDict->Release();
+        delete pDict;
         return nullptr;
       }
 
@@ -718,7 +715,7 @@
       }
 
       if (len < 0) {
-        pDict->Release();
+        delete pDict;
         return nullptr;
       }
       pDict->SetIntegerFor("Length", len);
@@ -727,7 +724,7 @@
   }
 
   if (len < 0) {
-    pDict->Release();
+    delete pDict;
     return nullptr;
   }
 
diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp
index 80edde8..2f3fc80 100644
--- a/core/fpdfdoc/cpdf_annot.cpp
+++ b/core/fpdfdoc/cpdf_annot.cpp
@@ -57,7 +57,7 @@
 
 CPDF_Annot::~CPDF_Annot() {
   if (m_bOwnedAnnotDict)
-    m_pAnnotDict->Release();
+    delete m_pAnnotDict;
   ClearCachedAP();
 }
 
diff --git a/core/fpdfdoc/cpdf_filespec_unittest.cpp b/core/fpdfdoc/cpdf_filespec_unittest.cpp
index 72b0735..01989ee 100644
--- a/core/fpdfdoc/cpdf_filespec_unittest.cpp
+++ b/core/fpdfdoc/cpdf_filespec_unittest.cpp
@@ -12,13 +12,6 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "testing/test_support.h"
 
-namespace {
-
-using ScopedObj = std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>>;
-using ScopedDict =
-    std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>>;
-}
-
 TEST(cpdf_filespec, EncodeDecodeFileName) {
   std::vector<pdfium::NullTermWstrFuncTestData> test_data = {
     // Empty src string.
@@ -74,7 +67,7 @@
       L"/docs/test.pdf"
 #endif
     };
-    ScopedObj str_obj(new CPDF_String(test_data.input));
+    std::unique_ptr<CPDF_Object> str_obj(new CPDF_String(test_data.input));
     CPDF_FileSpec file_spec(str_obj.get());
     CFX_WideString file_name;
     EXPECT_TRUE(file_spec.GetFileName(&file_name));
@@ -105,7 +98,7 @@
     };
     // Keyword fields in reverse order of precedence to retrieve the file name.
     const char* const keywords[5] = {"Unix", "Mac", "DOS", "F", "UF"};
-    ScopedDict dict_obj(new CPDF_Dictionary());
+    std::unique_ptr<CPDF_Dictionary> dict_obj(new CPDF_Dictionary());
     CPDF_FileSpec file_spec(dict_obj.get());
     CFX_WideString file_name;
     for (int i = 0; i < 5; ++i) {
@@ -122,7 +115,7 @@
   }
   {
     // Invalid object.
-    ScopedObj name_obj(new CPDF_Name("test.pdf"));
+    std::unique_ptr<CPDF_Object> name_obj(new CPDF_Name("test.pdf"));
     CPDF_FileSpec file_spec(name_obj.get());
     CFX_WideString file_name;
     EXPECT_FALSE(file_spec.GetFileName(&file_name));
@@ -143,7 +136,7 @@
 #endif
   };
   // String object.
-  ScopedObj str_obj(new CPDF_String(L"babababa"));
+  std::unique_ptr<CPDF_Object> str_obj(new CPDF_String(L"babababa"));
   CPDF_FileSpec file_spec1(str_obj.get());
   file_spec1.SetFileName(test_data.input);
   // Check internal object value.
@@ -155,7 +148,7 @@
   EXPECT_TRUE(file_name == test_data.input);
 
   // Dictionary object.
-  ScopedDict dict_obj(new CPDF_Dictionary());
+  std::unique_ptr<CPDF_Dictionary> dict_obj(new CPDF_Dictionary());
   CPDF_FileSpec file_spec2(dict_obj.get());
   file_spec2.SetFileName(test_data.input);
   // Check internal object value.
diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp
index e82ef78..e2240c9 100644
--- a/core/fpdfdoc/cpdf_formfield.cpp
+++ b/core/fpdfdoc/cpdf_formfield.cpp
@@ -575,8 +575,7 @@
           if (pValue->GetUnicodeText() == opt_value)
             m_pDict->RemoveFor("V");
         } else if (pValue->IsArray()) {
-          std::unique_ptr<CPDF_Array, ReleaseDeleter<CPDF_Array>> pArray(
-              new CPDF_Array);
+          std::unique_ptr<CPDF_Array> pArray(new CPDF_Array);
           for (int i = 0; i < CountOptions(); i++) {
             if (i != index && IsItemSelected(i)) {
               opt_value = GetOptionValue(i);
diff --git a/core/fxge/dib/fx_dib_engine_unittest.cpp b/core/fxge/dib/fx_dib_engine_unittest.cpp
index 3f8abe1..57e829e 100644
--- a/core/fxge/dib/fx_dib_engine_unittest.cpp
+++ b/core/fxge/dib/fx_dib_engine_unittest.cpp
@@ -12,15 +12,16 @@
 #include "core/fxge/dib/dib_int.h"
 #include "core/fxge/fx_dib.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/base/ptr_util.h"
 
 TEST(CStretchEngine, OverflowInCtor) {
   FX_RECT clip_rect;
-  std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>> dict_obj(
-      new CPDF_Dictionary());
+  std::unique_ptr<CPDF_Dictionary> dict_obj =
+      pdfium::MakeUnique<CPDF_Dictionary>();
   dict_obj->SetFor("Width", new CPDF_Number(71000));
   dict_obj->SetFor("Height", new CPDF_Number(12500));
-  std::unique_ptr<CPDF_Stream, ReleaseDeleter<CPDF_Stream>> stream(
-      new CPDF_Stream(nullptr, 0, dict_obj.release()));
+  std::unique_ptr<CPDF_Stream> stream =
+      pdfium::MakeUnique<CPDF_Stream>(nullptr, 0, dict_obj.release());
   CPDF_DIBSource dib_source;
   dib_source.Load(nullptr, stream.get(), nullptr, nullptr, nullptr, nullptr,
                   false, 0, false);
diff --git a/fpdfsdk/fpdfdoc_unittest.cpp b/fpdfsdk/fpdfdoc_unittest.cpp
index 408d2fa..39e81d5 100644
--- a/fpdfsdk/fpdfdoc_unittest.cpp
+++ b/fpdfsdk/fpdfdoc_unittest.cpp
@@ -87,7 +87,7 @@
  protected:
   std::unique_ptr<CPDF_TestPdfDocument> m_pDoc;
   CPDF_IndirectObjectHolder* m_pIndirectObjs;
-  std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>> m_pRootObj;
+  std::unique_ptr<CPDF_Dictionary> m_pRootObj;
 };
 
 TEST_F(PDFDocTest, FindBookmark) {
diff --git a/fpdfsdk/fpdfppo.cpp b/fpdfsdk/fpdfppo.cpp
index 22b23d1..ccfd141 100644
--- a/fpdfsdk/fpdfppo.cpp
+++ b/fpdfsdk/fpdfppo.cpp
@@ -285,11 +285,11 @@
     if (pDictClone->KeyExist("Type")) {
       CFX_ByteString strType = pDictClone->GetStringFor("Type");
       if (!FXSYS_stricmp(strType.c_str(), "Pages")) {
-        pDictClone->Release();
+        delete pDictClone;
         return 4;
       }
       if (!FXSYS_stricmp(strType.c_str(), "Page")) {
-        pDictClone->Release();
+        delete pDictClone;
         return 0;
       }
     }
@@ -297,7 +297,7 @@
   dwNewObjNum = pDoc->AddIndirectObject(pClone);
   (*pObjNumberMap)[dwObjnum] = dwNewObjNum;
   if (!UpdateReference(pClone, pDoc, pObjNumberMap)) {
-    pClone->Release();
+    delete pClone;
     return 0;
   }
   return dwNewObjNum;