Rename CPDF_{Array,Dictionary}::GetCount() to size().

Make them compatible with pdfium::CollectionSize().

Change-Id: Ibef3b182e35a7eca7c656cf590462782de0cc157
Reviewed-on: https://pdfium-review.googlesource.com/c/43937
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/edit/cpdf_pagecontentmanager.cpp b/core/fpdfapi/edit/cpdf_pagecontentmanager.cpp
index b3fe4ae..f9057db 100644
--- a/core/fpdfapi/edit/cpdf_pagecontentmanager.cpp
+++ b/core/fpdfapi/edit/cpdf_pagecontentmanager.cpp
@@ -80,7 +80,7 @@
   // If there is an array, just add the new stream to it, at the last position.
   if (contents_array_) {
     contents_array_->Add(new_stream->MakeReference(doc_.Get()));
-    return contents_array_->GetCount() - 1;
+    return contents_array_->size() - 1;
   }
 
   // There were no Contents, so add the new stream as the single Content stream.
@@ -113,7 +113,7 @@
   } else if (contents_array_) {
     // Initialize a vector with the old stream indexes. This will be used to
     // build a map from the old to the new indexes.
-    std::vector<size_t> streams_left(contents_array_->GetCount());
+    std::vector<size_t> streams_left(contents_array_->size());
     std::iota(streams_left.begin(), streams_left.end(), 0);
 
     // In reverse order so as to not change the indexes in the middle of the
diff --git a/core/fpdfapi/font/cpdf_cidfont.cpp b/core/fpdfapi/font/cpdf_cidfont.cpp
index 03442b5..41627c0 100644
--- a/core/fpdfapi/font/cpdf_cidfont.cpp
+++ b/core/fpdfapi/font/cpdf_cidfont.cpp
@@ -333,7 +333,7 @@
   }
 
   const CPDF_Array* pFonts = m_pFontDict->GetArrayFor("DescendantFonts");
-  if (!pFonts || pFonts->GetCount() != 1)
+  if (!pFonts || pFonts->size() != 1)
     return false;
 
   const CPDF_Dictionary* pCIDFontDict = pFonts->GetDictAt(0);
@@ -771,7 +771,7 @@
   int iCurElement = 0;
   uint32_t first_code = 0;
   uint32_t last_code = 0;
-  for (size_t i = 0; i < pArray->GetCount(); i++) {
+  for (size_t i = 0; i < pArray->size(); i++) {
     const CPDF_Object* pObj = pArray->GetDirectObjectAt(i);
     if (!pObj)
       continue;
@@ -780,12 +780,12 @@
       if (width_status != 1)
         return;
       if (first_code >
-          std::numeric_limits<uint32_t>::max() - pObjArray->GetCount()) {
+          std::numeric_limits<uint32_t>::max() - pObjArray->size()) {
         width_status = 0;
         continue;
       }
 
-      for (size_t j = 0; j < pObjArray->GetCount(); j += nElements) {
+      for (size_t j = 0; j < pObjArray->size(); j += nElements) {
         result->push_back(first_code);
         result->push_back(first_code);
         for (int k = 0; k < nElements; k++)
diff --git a/core/fpdfapi/font/cpdf_simplefont.cpp b/core/fpdfapi/font/cpdf_simplefont.cpp
index dd1a1f3..38deef7 100644
--- a/core/fpdfapi/font/cpdf_simplefont.cpp
+++ b/core/fpdfapi/font/cpdf_simplefont.cpp
@@ -146,7 +146,7 @@
 
   m_CharNames.resize(256);
   uint32_t cur_code = 0;
-  for (uint32_t i = 0; i < pDiffs->GetCount(); i++) {
+  for (uint32_t i = 0; i < pDiffs->size(); i++) {
     const CPDF_Object* pElement = pDiffs->GetDirectObjectAt(i);
     if (!pElement)
       continue;
@@ -202,8 +202,8 @@
     size_t width_start = m_pFontDict->GetIntegerFor("FirstChar", 0);
     size_t width_end = m_pFontDict->GetIntegerFor("LastChar", 0);
     if (width_start <= 255) {
-      if (width_end == 0 || width_end >= width_start + pWidthArray->GetCount())
-        width_end = width_start + pWidthArray->GetCount() - 1;
+      if (width_end == 0 || width_end >= width_start + pWidthArray->size())
+        width_end = width_start + pWidthArray->size() - 1;
       if (width_end > 255)
         width_end = 255;
       for (size_t i = width_start; i <= width_end; i++)
diff --git a/core/fpdfapi/font/cpdf_type3font.cpp b/core/fpdfapi/font/cpdf_type3font.cpp
index 5993c1c..1d70c8b 100644
--- a/core/fpdfapi/font/cpdf_type3font.cpp
+++ b/core/fpdfapi/font/cpdf_type3font.cpp
@@ -69,7 +69,7 @@
   if (StartChar >= 0 && static_cast<size_t>(StartChar) < kCharLimit) {
     const CPDF_Array* pWidthArray = m_pFontDict->GetArrayFor("Widths");
     if (pWidthArray) {
-      size_t count = std::min(pWidthArray->GetCount(), kCharLimit);
+      size_t count = std::min(pWidthArray->size(), kCharLimit);
       count = std::min(count, kCharLimit - StartChar);
       for (size_t i = 0; i < count; i++) {
         m_CharWidthL[StartChar + i] =
diff --git a/core/fpdfapi/page/cpdf_colorspace.cpp b/core/fpdfapi/page/cpdf_colorspace.cpp
index 882b565..2266dec 100644
--- a/core/fpdfapi/page/cpdf_colorspace.cpp
+++ b/core/fpdfapi/page/cpdf_colorspace.cpp
@@ -80,7 +80,7 @@
 
 void GetBlackPoint(const CPDF_Dictionary* pDict, float* pPoints) {
   const CPDF_Array* pParam = pDict->GetArrayFor("BlackPoint");
-  if (!pParam || pParam->GetCount() != kBlackWhitePointCount) {
+  if (!pParam || pParam->size() != kBlackWhitePointCount) {
     GetDefaultBlackPoint(pPoints);
     return;
   }
@@ -97,7 +97,7 @@
 
 bool GetWhitePoint(const CPDF_Dictionary* pDict, float* pPoints) {
   const CPDF_Array* pParam = pDict->GetArrayFor("WhitePoint");
-  if (!pParam || pParam->GetCount() != kBlackWhitePointCount)
+  if (!pParam || pParam->size() != kBlackWhitePointCount)
     return false;
 
   for (size_t i = 0; i < kBlackWhitePointCount; ++i)
@@ -481,7 +481,7 @@
     return nullptr;
 
   ByteString familyname = pFamilyObj->GetString();
-  if (pArray->GetCount() == 1)
+  if (pArray->size() == 1)
     return pdfium::WrapUnique(ColorspaceFromName(familyname));
 
   std::unique_ptr<CPDF_ColorSpace> pCS;
@@ -1101,7 +1101,7 @@
 uint32_t CPDF_IndexedCS::v_Load(CPDF_Document* pDoc,
                                 const CPDF_Array* pArray,
                                 std::set<const CPDF_Object*>* pVisited) {
-  if (pArray->GetCount() < 4)
+  if (pArray->size() < 4)
     return 0;
 
   const CPDF_Object* pBaseObj = pArray->GetDirectObjectAt(1);
@@ -1299,7 +1299,7 @@
   if (m_pFunc->CountOutputs() < m_pAltCS->CountComponents())
     return 0;
 
-  return pObj->GetCount();
+  return pObj->size();
 }
 
 bool CPDF_DeviceNCS::GetRGB(const float* pBuf,
diff --git a/core/fpdfapi/page/cpdf_contentparser.cpp b/core/fpdfapi/page/cpdf_contentparser.cpp
index 3427fe5..cf31447 100644
--- a/core/fpdfapi/page/cpdf_contentparser.cpp
+++ b/core/fpdfapi/page/cpdf_contentparser.cpp
@@ -52,7 +52,7 @@
     return;
   }
 
-  m_nStreams = pArray->GetCount();
+  m_nStreams = pArray->size();
   if (m_nStreams == 0) {
     m_CurrentStage = Stage::kComplete;
     return;
diff --git a/core/fpdfapi/page/cpdf_docpagedata.cpp b/core/fpdfapi/page/cpdf_docpagedata.cpp
index bc1c1c5..b41a846 100644
--- a/core/fpdfapi/page/cpdf_docpagedata.cpp
+++ b/core/fpdfapi/page/cpdf_docpagedata.cpp
@@ -278,7 +278,7 @@
   if (!pArray || pArray->IsEmpty())
     return nullptr;
 
-  if (pArray->GetCount() == 1) {
+  if (pArray->size() == 1) {
     return GetColorSpaceInternal(pArray->GetDirectObjectAt(0), pResources,
                                  pVisited, pVisitedInternal);
   }
diff --git a/core/fpdfapi/page/cpdf_expintfunc.cpp b/core/fpdfapi/page/cpdf_expintfunc.cpp
index cb83ac2..e04ce12 100644
--- a/core/fpdfapi/page/cpdf_expintfunc.cpp
+++ b/core/fpdfapi/page/cpdf_expintfunc.cpp
@@ -30,7 +30,7 @@
 
   const CPDF_Array* pArray0 = pDict->GetArrayFor("C0");
   if (pArray0 && m_nOutputs == 0)
-    m_nOutputs = pArray0->GetCount();
+    m_nOutputs = pArray0->size();
   if (m_nOutputs == 0)
     m_nOutputs = 1;
 
diff --git a/core/fpdfapi/page/cpdf_function.cpp b/core/fpdfapi/page/cpdf_function.cpp
index def7299..fc8eb46 100644
--- a/core/fpdfapi/page/cpdf_function.cpp
+++ b/core/fpdfapi/page/cpdf_function.cpp
@@ -85,7 +85,7 @@
   if (!pDomains)
     return false;
 
-  m_nInputs = pDomains->GetCount() / 2;
+  m_nInputs = pDomains->size() / 2;
   if (m_nInputs == 0)
     return false;
 
@@ -95,7 +95,7 @@
     m_Domains[i] = pDomains->GetFloatAt(i);
 
   const CPDF_Array* pRanges = pDict->GetArrayFor("Range");
-  m_nOutputs = pRanges ? pRanges->GetCount() / 2 : 0;
+  m_nOutputs = pRanges ? pRanges->size() / 2 : 0;
 
   // Ranges are required for type 0 and type 4 functions. A non-zero
   // |m_nOutputs| here implied Ranges meets the requirements.
diff --git a/core/fpdfapi/page/cpdf_meshstream.cpp b/core/fpdfapi/page/cpdf_meshstream.cpp
index 5d8e1f2..dce4c8a 100644
--- a/core/fpdfapi/page/cpdf_meshstream.cpp
+++ b/core/fpdfapi/page/cpdf_meshstream.cpp
@@ -142,7 +142,7 @@
 
   m_nComponents = m_funcs.empty() ? nComponents : 1;
   const CPDF_Array* pDecode = pDict->GetArrayFor("Decode");
-  if (!pDecode || pDecode->GetCount() != 4 + m_nComponents * 2)
+  if (!pDecode || pDecode->size() != 4 + m_nComponents * 2)
     return false;
 
   m_xmin = pDecode->GetNumberAt(0);
diff --git a/core/fpdfapi/page/cpdf_shadingpattern.cpp b/core/fpdfapi/page/cpdf_shadingpattern.cpp
index 52f4e1e..79ea6f8 100644
--- a/core/fpdfapi/page/cpdf_shadingpattern.cpp
+++ b/core/fpdfapi/page/cpdf_shadingpattern.cpp
@@ -72,7 +72,7 @@
   const CPDF_Object* pFunc = pShadingDict->GetDirectObjectFor("Function");
   if (pFunc) {
     if (const CPDF_Array* pArray = pFunc->AsArray()) {
-      m_pFunctions.resize(std::min<size_t>(pArray->GetCount(), 4));
+      m_pFunctions.resize(std::min<size_t>(pArray->size(), 4));
       for (size_t i = 0; i < m_pFunctions.size(); ++i)
         m_pFunctions[i] = CPDF_Function::Load(pArray->GetDirectObjectAt(i));
     } else {
diff --git a/core/fpdfapi/page/cpdf_stitchfunc.cpp b/core/fpdfapi/page/cpdf_stitchfunc.cpp
index b400a98..40f7c44 100644
--- a/core/fpdfapi/page/cpdf_stitchfunc.cpp
+++ b/core/fpdfapi/page/cpdf_stitchfunc.cpp
@@ -43,14 +43,14 @@
   if (!pEncodeArray)
     return false;
 
-  const uint32_t nSubs = pFunctionsArray->GetCount();
+  const uint32_t nSubs = pFunctionsArray->size();
   if (nSubs == 0)
     return false;
 
   // Check array sizes. The checks are slightly relaxed to allow the "Bounds"
   // and "Encode" arrays to have more than the required number of elements.
   {
-    if (pBoundsArray->GetCount() < nSubs - 1)
+    if (pBoundsArray->size() < nSubs - 1)
       return false;
 
     FX_SAFE_UINT32 nExpectedEncodeSize = nSubs;
@@ -58,7 +58,7 @@
     if (!nExpectedEncodeSize.IsValid())
       return false;
 
-    if (pEncodeArray->GetCount() < nExpectedEncodeSize.ValueOrDie())
+    if (pEncodeArray->size() < nExpectedEncodeSize.ValueOrDie())
       return false;
   }
 
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index d84d4d6..79fa3d2 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -216,7 +216,7 @@
     }
     case CPDF_Object::ARRAY: {
       CPDF_Array* pArray = pObj->AsArray();
-      for (size_t i = 0; i < pArray->GetCount(); i++) {
+      for (size_t i = 0; i < pArray->size(); i++) {
         CPDF_Object* pElement = pArray->GetObjectAt(i);
         if (pElement->IsName()) {
           ByteString name = pElement->GetString();
@@ -1286,7 +1286,7 @@
   if (!pArray)
     return;
 
-  size_t n = pArray->GetCount();
+  size_t n = pArray->size();
   size_t nsegs = 0;
   for (size_t i = 0; i < n; i++) {
     if (pArray->GetDirectObjectAt(i)->IsString())
diff --git a/core/fpdfapi/parser/cpdf_array.cpp b/core/fpdfapi/parser/cpdf_array.cpp
index 79be0c8..f2eca1b 100644
--- a/core/fpdfapi/parser/cpdf_array.cpp
+++ b/core/fpdfapi/parser/cpdf_array.cpp
@@ -236,7 +236,7 @@
   if (!archive->WriteString("["))
     return false;
 
-  for (size_t i = 0; i < GetCount(); ++i) {
+  for (size_t i = 0; i < size(); ++i) {
     if (!GetObjectAt(i)->WriteTo(archive, encryptor))
       return false;
   }
diff --git a/core/fpdfapi/parser/cpdf_array.h b/core/fpdfapi/parser/cpdf_array.h
index c4686c0..0905251 100644
--- a/core/fpdfapi/parser/cpdf_array.h
+++ b/core/fpdfapi/parser/cpdf_array.h
@@ -37,7 +37,7 @@
                const CPDF_Encryptor* encryptor) const override;
 
   bool IsEmpty() const { return m_Objects.empty(); }
-  size_t GetCount() const { return m_Objects.size(); }
+  size_t size() const { return m_Objects.size(); }
   CPDF_Object* GetObjectAt(size_t index);
   const CPDF_Object* GetObjectAt(size_t index) const;
   CPDF_Object* GetDirectObjectAt(size_t index);
diff --git a/core/fpdfapi/parser/cpdf_array_unittest.cpp b/core/fpdfapi/parser/cpdf_array_unittest.cpp
index 4ce66dc..a70f991 100644
--- a/core/fpdfapi/parser/cpdf_array_unittest.cpp
+++ b/core/fpdfapi/parser/cpdf_array_unittest.cpp
@@ -21,13 +21,13 @@
     for (size_t i = 0; i < 3; ++i)
       arr->RemoveAt(3);
     const int expected[] = {1, 2, 3, 7, 8, 9, 10};
-    ASSERT_EQ(FX_ArraySize(expected), arr->GetCount());
+    ASSERT_EQ(FX_ArraySize(expected), arr->size());
     for (size_t i = 0; i < FX_ArraySize(expected); ++i)
       EXPECT_EQ(expected[i], arr->GetIntegerAt(i));
     arr->RemoveAt(4);
     arr->RemoveAt(4);
     const int expected2[] = {1, 2, 3, 7, 10};
-    ASSERT_EQ(FX_ArraySize(expected2), arr->GetCount());
+    ASSERT_EQ(FX_ArraySize(expected2), arr->size());
     for (size_t i = 0; i < FX_ArraySize(expected2); ++i)
       EXPECT_EQ(expected2[i], arr->GetIntegerAt(i));
   }
@@ -38,19 +38,19 @@
     for (size_t i = 0; i < FX_ArraySize(elems); ++i)
       arr->AddNew<CPDF_Number>(elems[i]);
     arr->RemoveAt(11);
-    EXPECT_EQ(FX_ArraySize(elems), arr->GetCount());
+    EXPECT_EQ(FX_ArraySize(elems), arr->size());
   }
 }
 
 TEST(cpdf_array, Clear) {
   const int elems[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
   auto arr = pdfium::MakeUnique<CPDF_Array>();
-  EXPECT_EQ(0U, arr->GetCount());
+  EXPECT_EQ(0U, arr->size());
   for (size_t i = 0; i < FX_ArraySize(elems); ++i)
     arr->AddNew<CPDF_Number>(elems[i]);
-  EXPECT_EQ(FX_ArraySize(elems), arr->GetCount());
+  EXPECT_EQ(FX_ArraySize(elems), arr->size());
   arr->Clear();
-  EXPECT_EQ(0U, arr->GetCount());
+  EXPECT_EQ(0U, arr->size());
 }
 
 TEST(cpdf_array, InsertAt) {
@@ -59,14 +59,14 @@
     auto arr = pdfium::MakeUnique<CPDF_Array>();
     for (size_t i = 0; i < FX_ArraySize(elems); ++i)
       arr->InsertNewAt<CPDF_Number>(i, elems[i]);
-    ASSERT_EQ(FX_ArraySize(elems), arr->GetCount());
+    ASSERT_EQ(FX_ArraySize(elems), arr->size());
     for (size_t i = 0; i < FX_ArraySize(elems); ++i)
       EXPECT_EQ(elems[i], arr->GetIntegerAt(i));
     arr->InsertNewAt<CPDF_Number>(3, 33);
     arr->InsertNewAt<CPDF_Number>(6, 55);
     arr->InsertNewAt<CPDF_Number>(12, 12);
     const int expected[] = {1, 2, 3, 33, 4, 5, 55, 6, 7, 8, 9, 10, 12};
-    ASSERT_EQ(FX_ArraySize(expected), arr->GetCount());
+    ASSERT_EQ(FX_ArraySize(expected), arr->size());
     for (size_t i = 0; i < FX_ArraySize(expected); ++i)
       EXPECT_EQ(expected[i], arr->GetIntegerAt(i));
   }
@@ -79,7 +79,7 @@
     for (size_t i = 0; i < FX_ArraySize(elems); ++i)
       arr->InsertNewAt<CPDF_Number>(i, elems[i]);
     arr->InsertNewAt<CPDF_Number>(10, 10);
-    ASSERT_EQ(11u, arr->GetCount());
+    ASSERT_EQ(11u, arr->size());
     for (size_t i = 0; i < FX_ArraySize(elems); ++i)
       EXPECT_EQ(elems[i], arr->GetIntegerAt(i));
     for (size_t i = FX_ArraySize(elems); i < 10; ++i)
@@ -96,7 +96,7 @@
     for (size_t i = 0; i < FX_ArraySize(elems); ++i)
       arr->InsertNewAt<CPDF_Number>(i, elems[i]);
     std::unique_ptr<CPDF_Array> arr2 = ToArray(arr->Clone());
-    ASSERT_EQ(arr->GetCount(), arr2->GetCount());
+    ASSERT_EQ(arr->size(), arr2->size());
     for (size_t i = 0; i < FX_ArraySize(elems); ++i) {
       // Clone() always create new objects.
       EXPECT_NE(arr->GetObjectAt(i), arr2->GetObjectAt(i));
@@ -124,14 +124,14 @@
       }
       arr->InsertAt(i, std::move(arr_elem));
     }
-    ASSERT_EQ(kNumOfRows, arr->GetCount());
+    ASSERT_EQ(kNumOfRows, arr->size());
     // Not dereferencing reference objects means just creating new references
     // instead of new copies of direct objects.
     std::unique_ptr<CPDF_Array> arr1 = ToArray(arr->Clone());
-    ASSERT_EQ(arr->GetCount(), arr1->GetCount());
+    ASSERT_EQ(arr->size(), arr1->size());
     // Dereferencing reference objects creates new copies of direct objects.
     std::unique_ptr<CPDF_Array> arr2 = ToArray(arr->CloneDirectObject());
-    ASSERT_EQ(arr->GetCount(), arr2->GetCount());
+    ASSERT_EQ(arr->size(), arr2->size());
     for (size_t i = 0; i < kNumOfRows; ++i) {
       CPDF_Array* arr_elem = arr->GetObjectAt(i)->AsArray();
       CPDF_Array* arr1_elem = arr1->GetObjectAt(i)->AsArray();
@@ -156,7 +156,7 @@
       }
     }
     arr.reset();
-    ASSERT_EQ(kNumOfRows, arr1->GetCount());
+    ASSERT_EQ(kNumOfRows, arr1->size());
     for (size_t i = 0; i < kNumOfRows; ++i) {
       for (size_t j = 0; j < kNumOfRowElems; ++j) {
         // Results from not deferencing reference objects.
diff --git a/core/fpdfapi/parser/cpdf_data_avail.cpp b/core/fpdfapi/parser/cpdf_data_avail.cpp
index 904b0ad..c046996 100644
--- a/core/fpdfapi/parser/cpdf_data_avail.cpp
+++ b/core/fpdfapi/parser/cpdf_data_avail.cpp
@@ -357,7 +357,7 @@
       break;
     case CPDF_Object::ARRAY: {
       CPDF_Array* pKidsArray = pKids->AsArray();
-      for (size_t i = 0; i < pKidsArray->GetCount(); ++i) {
+      for (size_t i = 0; i < pKidsArray->size(); ++i) {
         if (CPDF_Reference* pRef = ToReference(pKidsArray->GetObjectAt(i)))
           m_PageObjList.push_back(pRef->GetRefObjNum());
       }
@@ -545,7 +545,7 @@
   }
 
   pPageNode->m_type = PDF_PAGENODE_PAGES;
-  for (size_t i = 0; i < pArray->GetCount(); ++i) {
+  for (size_t i = 0; i < pArray->size(); ++i) {
     CPDF_Reference* pKid = ToReference(pArray->GetObjectAt(i));
     if (!pKid)
       continue;
@@ -610,7 +610,7 @@
     }
     case CPDF_Object::ARRAY: {
       CPDF_Array* pKidsArray = pKids->AsArray();
-      for (size_t i = 0; i < pKidsArray->GetCount(); ++i) {
+      for (size_t i = 0; i < pKidsArray->size(); ++i) {
         CPDF_Reference* pKid = ToReference(pKidsArray->GetObjectAt(i));
         if (!pKid)
           continue;
diff --git a/core/fpdfapi/parser/cpdf_dictionary.h b/core/fpdfapi/parser/cpdf_dictionary.h
index a0e678c..2e972d0 100644
--- a/core/fpdfapi/parser/cpdf_dictionary.h
+++ b/core/fpdfapi/parser/cpdf_dictionary.h
@@ -41,7 +41,7 @@
   bool WriteTo(IFX_ArchiveStream* archive,
                const CPDF_Encryptor* encryptor) const override;
 
-  size_t GetCount() const { return m_Map.size(); }
+  size_t size() const { return m_Map.size(); }
   const CPDF_Object* GetObjectFor(const ByteString& key) const;
   CPDF_Object* GetObjectFor(const ByteString& key);
   const CPDF_Object* GetDirectObjectFor(const ByteString& key) const;
diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp
index c82112e..c2ad8b7 100644
--- a/core/fpdfapi/parser/cpdf_document.cpp
+++ b/core/fpdfapi/parser/cpdf_document.cpp
@@ -46,7 +46,7 @@
       break;
   }
   if (i == widths.size()) {
-    int first = pWidthArray->GetIntegerAt(pWidthArray->GetCount() - 1);
+    int first = pWidthArray->GetIntegerAt(pWidthArray->size() - 1);
     pWidthArray->AddNew<CPDF_Number>(first + static_cast<int>(widths.size()) -
                                      1);
     pWidthArray->AddNew<CPDF_Number>(widths[0]);
@@ -99,7 +99,7 @@
   if (!pKidList)
     return 0;
   count = 0;
-  for (size_t i = 0; i < pKidList->GetCount(); i++) {
+  for (size_t i = 0; i < pKidList->size(); i++) {
     CPDF_Dictionary* pKid = pKidList->GetDictAt(i);
     if (!pKid || pdfium::ContainsKey(*visited_pages, pKid))
       continue;
@@ -259,8 +259,7 @@
     return nullptr;
   }
   CPDF_Dictionary* page = nullptr;
-  for (size_t i = m_pTreeTraversal[level].second; i < pKidList->GetCount();
-       i++) {
+  for (size_t i = m_pTreeTraversal[level].second; i < pKidList->size(); i++) {
     if (*nPagesToGo == 0)
       break;
     pKidList->ConvertToIndirectObjectAt(i, this);
@@ -299,7 +298,7 @@
       }
     }
   }
-  if (m_pTreeTraversal[level].second == pKidList->GetCount())
+  if (m_pTreeTraversal[level].second == pKidList->size())
     m_pTreeTraversal.pop_back();
   return page;
 }
@@ -388,7 +387,7 @@
     return -1;
   }
 
-  if (count && count == pKidList->GetCount()) {
+  if (count && count == pKidList->size()) {
     for (size_t i = 0; i < count; i++) {
       const CPDF_Reference* pKid = ToReference(pKidList->GetObjectAt(i));
       if (pKid && pKid->GetRefObjNum() == objnum)
@@ -396,7 +395,7 @@
     }
   }
 
-  for (size_t i = 0; i < pKidList->GetCount(); i++) {
+  for (size_t i = 0; i < pKidList->size(); i++) {
     const CPDF_Dictionary* pKid = pKidList->GetDictAt(i);
     if (!pKid || pKid == pNode)
       continue;
@@ -527,7 +526,7 @@
   if (!pKidList)
     return false;
 
-  for (size_t i = 0; i < pKidList->GetCount(); i++) {
+  for (size_t i = 0; i < pKidList->size(); i++) {
     CPDF_Dictionary* pKid = pKidList->GetDictAt(i);
     if (pKid->GetStringFor("Type") == "Page") {
       if (nPagesToGo != 0) {
diff --git a/core/fpdfapi/parser/cpdf_document_unittest.cpp b/core/fpdfapi/parser/cpdf_document_unittest.cpp
index daaab5d..fd726f0 100644
--- a/core/fpdfapi/parser/cpdf_document_unittest.cpp
+++ b/core/fpdfapi/parser/cpdf_document_unittest.cpp
@@ -33,7 +33,7 @@
   pageNode->SetNewFor<CPDF_String>("Type", "Pages", false);
   pageNode->SetNewFor<CPDF_Reference>("Kids", pDoc, pUnowned->GetObjNum());
   pageNode->SetNewFor<CPDF_Number>("Count", count);
-  for (size_t i = 0; i < pUnowned->GetCount(); i++) {
+  for (size_t i = 0; i < pUnowned->size(); i++) {
     pUnowned->GetDictAt(i)->SetNewFor<CPDF_Reference>("Parent", pDoc,
                                                       pageNode->GetObjNum());
   }
diff --git a/core/fpdfapi/parser/cpdf_linearized_header.cpp b/core/fpdfapi/parser/cpdf_linearized_header.cpp
index da7a7ad..467d7c6 100644
--- a/core/fpdfapi/parser/cpdf_linearized_header.cpp
+++ b/core/fpdfapi/parser/cpdf_linearized_header.cpp
@@ -93,7 +93,7 @@
       m_szLastXRefOffset(szLastXRefOffset) {
   const CPDF_Array* pHintStreamRange = pDict->GetArrayFor("H");
   const size_t nHintStreamSize =
-      pHintStreamRange ? pHintStreamRange->GetCount() : 0;
+      pHintStreamRange ? pHintStreamRange->size() : 0;
   if (nHintStreamSize == 2 || nHintStreamSize == 4) {
     m_szHintStart = std::max(pHintStreamRange->GetIntegerAt(0), 0);
     const FX_SAFE_UINT32 safe_hint_length = pHintStreamRange->GetIntegerAt(1);
diff --git a/core/fpdfapi/parser/cpdf_object_unittest.cpp b/core/fpdfapi/parser/cpdf_object_unittest.cpp
index ca01949..e5b322f 100644
--- a/core/fpdfapi/parser/cpdf_object_unittest.cpp
+++ b/core/fpdfapi/parser/cpdf_object_unittest.cpp
@@ -125,9 +125,9 @@
       case CPDF_Object::ARRAY: {
         const CPDF_Array* array1 = obj1->AsArray();
         const CPDF_Array* array2 = obj2->AsArray();
-        if (array1->GetCount() != array2->GetCount())
+        if (array1->size() != array2->size())
           return false;
-        for (size_t i = 0; i < array1->GetCount(); ++i) {
+        for (size_t i = 0; i < array1->size(); ++i) {
           if (!Equal(array1->GetObjectAt(i), array2->GetObjectAt(i)))
             return false;
         }
@@ -136,7 +136,7 @@
       case CPDF_Object::DICTIONARY: {
         const CPDF_Dictionary* dict1 = obj1->AsDictionary();
         const CPDF_Dictionary* dict2 = obj2->AsDictionary();
-        if (dict1->GetCount() != dict2->GetCount())
+        if (dict1->size() != dict2->size())
           return false;
         for (CPDF_Dictionary::const_iterator it = dict1->begin();
              it != dict1->end(); ++it) {
@@ -667,7 +667,7 @@
                                 0, 0, 0, 0,     0,    0, 0};
     const float expected_float[] = {0, 0, 0, -1234, 2345, 0.05f, 0,
                                     0, 0, 0, 0,     0,    0,     0};
-    for (size_t i = 0; i < arr->GetCount(); ++i) {
+    for (size_t i = 0; i < arr->size(); ++i) {
       EXPECT_STREQ(expected_str[i], arr->GetStringAt(i).c_str());
       EXPECT_EQ(expected_int[i], arr->GetIntegerAt(i));
       EXPECT_EQ(expected_float[i], arr->GetNumberAt(i));
@@ -756,8 +756,8 @@
   for (size_t i = 0; i < FX_ArraySize(obj_nums); ++i)
     EXPECT_EQ(indirect_objs[i], holder->GetOrParseIndirectObject(obj_nums[i]));
   // Check arrays.
-  EXPECT_EQ(arr->GetCount(), arr1->GetCount());
-  for (size_t i = 0; i < arr->GetCount(); ++i) {
+  EXPECT_EQ(arr->size(), arr1->size());
+  for (size_t i = 0; i < arr->size(); ++i) {
     EXPECT_EQ(CPDF_Object::REFERENCE, arr->GetObjectAt(i)->GetType());
     EXPECT_EQ(indirect_objs[i], arr->GetObjectAt(i)->GetDirect());
     EXPECT_EQ(indirect_objs[i], arr->GetDirectObjectAt(i));
@@ -771,7 +771,7 @@
   CPDF_IndirectObjectHolder objects_holder;
   auto array = pdfium::MakeUnique<CPDF_Array>();
   array->AddNew<CPDF_Reference>(&objects_holder, 1234);
-  ASSERT_EQ(1U, array->GetCount());
+  ASSERT_EQ(1U, array->size());
   CPDF_Object* obj = array->GetObjectAt(0);
   ASSERT_TRUE(obj);
   EXPECT_TRUE(obj->IsReference());
@@ -782,7 +782,7 @@
 
   std::unique_ptr<CPDF_Array> cloned_array =
       ToArray(std::move(cloned_array_object));
-  ASSERT_EQ(0U, cloned_array->GetCount());
+  ASSERT_EQ(0U, cloned_array->size());
   CPDF_Object* cloned_obj = cloned_array->GetObjectAt(0);
   EXPECT_FALSE(cloned_obj);
 }
@@ -878,7 +878,7 @@
   CPDF_IndirectObjectHolder objects_holder;
   auto dict = pdfium::MakeUnique<CPDF_Dictionary>();
   dict->SetNewFor<CPDF_Reference>("foo", &objects_holder, 1234);
-  ASSERT_EQ(1U, dict->GetCount());
+  ASSERT_EQ(1U, dict->size());
   CPDF_Object* obj = dict->GetObjectFor("foo");
   ASSERT_TRUE(obj);
   EXPECT_TRUE(obj->IsReference());
@@ -889,7 +889,7 @@
 
   std::unique_ptr<CPDF_Dictionary> cloned_dict =
       ToDictionary(std::move(cloned_dict_object));
-  ASSERT_EQ(0U, cloned_dict->GetCount());
+  ASSERT_EQ(0U, cloned_dict->size());
   CPDF_Object* cloned_obj = cloned_dict->GetObjectFor("foo");
   EXPECT_FALSE(cloned_obj);
 }
@@ -906,7 +906,7 @@
     std::unique_ptr<CPDF_Array> cloned_array = ToArray(arr_obj->Clone());
     // Cloned object should be the same as the original.
     ASSERT_TRUE(cloned_array);
-    EXPECT_EQ(1u, cloned_array->GetCount());
+    EXPECT_EQ(1u, cloned_array->size());
     CPDF_Object* cloned_dict = cloned_array->GetObjectAt(0);
     ASSERT_TRUE(cloned_dict);
     ASSERT_TRUE(cloned_dict->IsDictionary());
@@ -953,7 +953,7 @@
     CPDF_Object* cloned_arr = cloned_dict->GetObjectFor("arr");
     ASSERT_TRUE(cloned_arr);
     ASSERT_TRUE(cloned_arr->IsArray());
-    EXPECT_EQ(0U, cloned_arr->AsArray()->GetCount());
+    EXPECT_EQ(0U, cloned_arr->AsArray()->size());
     // Recursively referenced object is not cloned.
     EXPECT_EQ(nullptr, cloned_arr->AsArray()->GetObjectAt(0));
   }
diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp
index 32629bc..08d5a33 100644
--- a/core/fpdfapi/parser/cpdf_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_parser.cpp
@@ -688,7 +688,7 @@
   std::vector<std::pair<int32_t, int32_t>> arrIndex;
   CPDF_Array* pArray = pDict->GetArrayFor("Index");
   if (pArray) {
-    for (size_t i = 0; i < pArray->GetCount() / 2; i++) {
+    for (size_t i = 0; i < pArray->size() / 2; i++) {
       CPDF_Object* pStartNumObj = pArray->GetObjectAt(i * 2);
       CPDF_Object* pCountObj = pArray->GetObjectAt(i * 2 + 1);
 
@@ -710,7 +710,7 @@
 
   std::vector<uint32_t> WidthArray;
   FX_SAFE_UINT32 dwAccWidth = 0;
-  for (size_t i = 0; i < pArray->GetCount(); ++i) {
+  for (size_t i = 0; i < pArray->size(); ++i) {
     WidthArray.push_back(pArray->GetIntegerAt(i));
     dwAccWidth += WidthArray[i];
   }
diff --git a/core/fpdfapi/parser/fpdf_parser_decode.cpp b/core/fpdfapi/parser/fpdf_parser_decode.cpp
index a581dcc..99b6154 100644
--- a/core/fpdfapi/parser/fpdf_parser_decode.cpp
+++ b/core/fpdfapi/parser/fpdf_parser_decode.cpp
@@ -89,7 +89,7 @@
     0x00fc, 0x00fd, 0x00fe, 0x00ff};
 
 bool ValidateDecoderPipeline(const CPDF_Array* pDecoders) {
-  size_t count = pDecoders->GetCount();
+  size_t count = pDecoders->size();
   if (count <= 1)
     return true;
 
@@ -379,7 +379,7 @@
       return false;
 
     const CPDF_Array* pParamsArray = ToArray(pParams);
-    for (size_t i = 0; i < pDecoders->GetCount(); ++i) {
+    for (size_t i = 0; i < pDecoders->size(); ++i) {
       DecoderArray.push_back(
           {pDecoders->GetStringAt(i),
            pParamsArray ? pParamsArray->GetDictAt(i) : nullptr});
diff --git a/core/fpdfapi/parser/fpdf_parser_utility.cpp b/core/fpdfapi/parser/fpdf_parser_utility.cpp
index 83c967d..4cd02f0 100644
--- a/core/fpdfapi/parser/fpdf_parser_utility.cpp
+++ b/core/fpdfapi/parser/fpdf_parser_utility.cpp
@@ -180,7 +180,7 @@
     case CPDF_Object::ARRAY: {
       const CPDF_Array* p = pObj->AsArray();
       buf << "[";
-      for (size_t i = 0; i < p->GetCount(); i++) {
+      for (size_t i = 0; i < p->size(); i++) {
         const CPDF_Object* pElement = p->GetObjectAt(i);
         if (pElement && !pElement->IsInline()) {
           buf << " " << pElement->GetObjNum() << " 0 R";
diff --git a/core/fpdfapi/render/cpdf_dibbase.cpp b/core/fpdfapi/render/cpdf_dibbase.cpp
index 3557672..b95c14b 100644
--- a/core/fpdfapi/render/cpdf_dibbase.cpp
+++ b/core/fpdfapi/render/cpdf_dibbase.cpp
@@ -357,7 +357,7 @@
         if (pFilter->IsName()) {
           filter = pFilter->GetString();
         } else if (const CPDF_Array* pArray = pFilter->AsArray()) {
-          filter = pArray->GetStringAt(pArray->GetCount() - 1);
+          filter = pArray->GetStringAt(pArray->size() - 1);
         }
 
         if (filter == "JPXDecode") {
@@ -441,7 +441,7 @@
     return true;
 
   if (const CPDF_Array* pArray = pMask->AsArray()) {
-    if (pArray->GetCount() >= m_nComponents * 2) {
+    if (pArray->size() >= m_nComponents * 2) {
       for (uint32_t i = 0; i < m_nComponents; i++) {
         int min_num = pArray->GetIntegerAt(i * 2);
         int max_num = pArray->GetIntegerAt(i * 2 + 1);
@@ -825,7 +825,7 @@
         m_bpc = 8;
       }
     } else if (const CPDF_Array* pArray = pFilter->AsArray()) {
-      ByteString filter = pArray->GetStringAt(pArray->GetCount() - 1);
+      ByteString filter = pArray->GetStringAt(pArray->size() - 1);
       if (filter == "CCITTFaxDecode" || filter == "JBIG2Decode") {
         m_bpc = 1;
         m_nComponents = 1;
diff --git a/core/fpdfapi/render/cpdf_docrenderdata.cpp b/core/fpdfapi/render/cpdf_docrenderdata.cpp
index c86eb9b..fb54e14 100644
--- a/core/fpdfapi/render/cpdf_docrenderdata.cpp
+++ b/core/fpdfapi/render/cpdf_docrenderdata.cpp
@@ -75,7 +75,7 @@
   bool bIdentity = true;
   if (const CPDF_Array* pArray = pObj->AsArray()) {
     bUniTransfer = false;
-    if (pArray->GetCount() < 3)
+    if (pArray->size() < 3)
       return nullptr;
 
     for (uint32_t i = 0; i < 3; ++i) {
diff --git a/core/fpdfapi/render/cpdf_imagerenderer.cpp b/core/fpdfapi/render/cpdf_imagerenderer.cpp
index affe12d..da63f55 100644
--- a/core/fpdfapi/render/cpdf_imagerenderer.cpp
+++ b/core/fpdfapi/render/cpdf_imagerenderer.cpp
@@ -565,7 +565,7 @@
   if (!pArray)
     return;
 
-  for (size_t i = 0; i < pArray->GetCount(); i++) {
+  for (size_t i = 0; i < pArray->size(); i++) {
     ByteString bsDecodeType = pArray->GetStringAt(i);
     if (bsDecodeType == "DCTDecode" || bsDecodeType == "JPXDecode") {
       m_Flags |= FXRENDER_IMAGE_LOSSY;
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index f77b6c6..842272b 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -2028,8 +2028,7 @@
   FX_ARGB background = 0;
   if (!pPattern->IsShadingObject() && pDict->KeyExist("Background")) {
     const CPDF_Array* pBackColor = pDict->GetArrayFor("Background");
-    if (pBackColor &&
-        pBackColor->GetCount() >= pColorSpace->CountComponents()) {
+    if (pBackColor && pBackColor->size() >= pColorSpace->CountComponents()) {
       std::vector<float> comps(pColorSpace->CountComponents());
       for (uint32_t i = 0; i < pColorSpace->CountComponents(); i++)
         comps[i] = pBackColor->GetNumberAt(i);
@@ -2638,7 +2637,7 @@
 
   uint32_t comps = std::max(8u, pCS->CountComponents());
   std::vector<float> floats(comps);
-  size_t count = std::min<size_t>(8, pBC->GetCount());
+  size_t count = std::min<size_t>(8, pBC->size());
   for (size_t i = 0; i < count; i++)
     floats[i] = pBC->GetNumberAt(i);
 
diff --git a/core/fpdfdoc/cpdf_action.cpp b/core/fpdfdoc/cpdf_action.cpp
index 6e9e9f7..ed5f46b 100644
--- a/core/fpdfdoc/cpdf_action.cpp
+++ b/core/fpdfdoc/cpdf_action.cpp
@@ -131,7 +131,7 @@
   if (pNext->IsDictionary())
     return 1;
   const CPDF_Array* pArray = pNext->AsArray();
-  return pArray ? pArray->GetCount() : 0;
+  return pArray ? pArray->size() : 0;
 }
 
 CPDF_Action CPDF_Action::GetSubAction(size_t iIndex) const {
diff --git a/core/fpdfdoc/cpdf_actionfields.cpp b/core/fpdfdoc/cpdf_actionfields.cpp
index 4db5bc5..f6a73fd 100644
--- a/core/fpdfdoc/cpdf_actionfields.cpp
+++ b/core/fpdfdoc/cpdf_actionfields.cpp
@@ -36,7 +36,7 @@
   if (pFields->IsDictionary() || pFields->IsString()) {
     fields.push_back(pFields);
   } else if (const CPDF_Array* pArray = pFields->AsArray()) {
-    for (size_t i = 0; i < pArray->GetCount(); ++i) {
+    for (size_t i = 0; i < pArray->size(); ++i) {
       const CPDF_Object* pObj = pArray->GetDirectObjectAt(i);
       if (pObj)
         fields.push_back(pObj);
diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp
index 89268d4..8e703d5 100644
--- a/core/fpdfdoc/cpdf_annot.cpp
+++ b/core/fpdfdoc/cpdf_annot.cpp
@@ -211,7 +211,7 @@
 CFX_FloatRect CPDF_Annot::RectFromQuadPointsArray(const CPDF_Array* pArray,
                                                   size_t nIndex) {
   ASSERT(pArray);
-  ASSERT(nIndex < pArray->GetCount() / 8);
+  ASSERT(nIndex < pArray->size() / 8);
 
   // QuadPoints are defined with 4 pairs of numbers
   // ([ pair0, pair1, pair2, pair3 ]), where
@@ -381,7 +381,7 @@
 
 // static
 size_t CPDF_Annot::QuadPointCount(const CPDF_Array* pArray) {
-  return pArray->GetCount() / 8;
+  return pArray->size() / 8;
 }
 
 bool CPDF_Annot::DrawAppearance(CPDF_Page* pPage,
@@ -460,12 +460,12 @@
     style_char = 'S';
     if (pBorderArray) {
       width = pBorderArray->GetNumberAt(2);
-      if (pBorderArray->GetCount() == 4) {
+      if (pBorderArray->size() == 4) {
         pDashArray = pBorderArray->GetArrayAt(3);
         if (!pDashArray) {
           return;
         }
-        size_t nLen = pDashArray->GetCount();
+        size_t nLen = pDashArray->size();
         size_t i = 0;
         for (; i < nLen; ++i) {
           CPDF_Object* pObj = pDashArray->GetDirectObjectAt(i);
@@ -502,13 +502,13 @@
   graph_state.m_LineWidth = width;
   if (style_char == 'D') {
     if (pDashArray) {
-      size_t dash_count = pDashArray->GetCount();
+      size_t dash_count = pDashArray->size();
       if (dash_count % 2) {
         dash_count++;
       }
       graph_state.m_DashArray.resize(dash_count);
       size_t i;
-      for (i = 0; i < pDashArray->GetCount(); ++i) {
+      for (i = 0; i < pDashArray->size(); ++i) {
         graph_state.m_DashArray[i] = pDashArray->GetNumberAt(i);
       }
       if (i < dash_count) {
diff --git a/core/fpdfdoc/cpdf_annotlist.cpp b/core/fpdfdoc/cpdf_annotlist.cpp
index 909431c..61ba6e9 100644
--- a/core/fpdfdoc/cpdf_annotlist.cpp
+++ b/core/fpdfdoc/cpdf_annotlist.cpp
@@ -172,7 +172,7 @@
   const CPDF_Dictionary* pAcroForm = pRoot->GetDictFor("AcroForm");
   bool bRegenerateAP =
       pAcroForm && pAcroForm->GetBooleanFor("NeedAppearances", false);
-  for (size_t i = 0; i < pAnnots->GetCount(); ++i) {
+  for (size_t i = 0; i < pAnnots->size(); ++i) {
     CPDF_Dictionary* pDict = ToDictionary(pAnnots->GetDirectObjectAt(i));
     if (!pDict)
       continue;
diff --git a/core/fpdfdoc/cpdf_apsettings.cpp b/core/fpdfdoc/cpdf_apsettings.cpp
index 0f09892..341764f 100644
--- a/core/fpdfdoc/cpdf_apsettings.cpp
+++ b/core/fpdfdoc/cpdf_apsettings.cpp
@@ -38,7 +38,7 @@
     return 0;
 
   FX_ARGB color = 0;
-  size_t dwCount = pEntry->GetCount();
+  size_t dwCount = pEntry->size();
   if (dwCount == 1) {
     iColorType = CFX_Color::kGray;
     float g = pEntry->GetNumberAt(0) * 255;
@@ -88,7 +88,7 @@
   if (!pEntry)
     return;
 
-  size_t dwCount = pEntry->GetCount();
+  size_t dwCount = pEntry->size();
   if (dwCount == 1) {
     iColorType = CFX_Color::kGray;
     fc[0] = pEntry->GetNumberAt(0);
diff --git a/core/fpdfdoc/cpdf_dest.cpp b/core/fpdfdoc/cpdf_dest.cpp
index f7aa98f..1a373b6 100644
--- a/core/fpdfdoc/cpdf_dest.cpp
+++ b/core/fpdfdoc/cpdf_dest.cpp
@@ -85,7 +85,7 @@
   if (!m_pArray)
     return false;
 
-  if (m_pArray->GetCount() < 5)
+  if (m_pArray->size() < 5)
     return false;
 
   const CPDF_Name* xyz = ToName(m_pArray->GetDirectObjectAt(1));
@@ -119,11 +119,11 @@
 }
 
 unsigned long CPDF_Dest::GetNumParams() const {
-  if (!m_pArray || m_pArray->GetCount() < 2)
+  if (!m_pArray || m_pArray->size() < 2)
     return 0;
 
   unsigned long maxParamsForFitType = g_sZoomModeMaxParamCount[GetZoomMode()];
-  unsigned long numParamsInArray = m_pArray->GetCount() - 2;
+  unsigned long numParamsInArray = m_pArray->size() - 2;
   return std::min(maxParamsForFitType, numParamsInArray);
 }
 
diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp
index 8399e79..a96e49b0c 100644
--- a/core/fpdfdoc/cpdf_formfield.cpp
+++ b/core/fpdfdoc/cpdf_formfield.cpp
@@ -443,7 +443,7 @@
   if (pValue->IsString() || pValue->IsNumber())
     return pValue->GetString().IsEmpty() ? 0 : 1;
   const CPDF_Array* pArray = pValue->AsArray();
-  return pArray ? pArray->GetCount() : 0;
+  return pArray ? pArray->size() : 0;
 }
 
 int CPDF_FormField::GetSelectedIndex(int index) const {
@@ -533,7 +533,7 @@
       break;
     }
   }
-  for (int i = 0; i < static_cast<int>(pArray->GetCount()); i++)
+  for (int i = 0; i < static_cast<int>(pArray->size()); i++)
     if (pArray->GetDirectObjectAt(i)->GetUnicodeText() == opt_value &&
         i == iPos) {
       return true;
@@ -588,7 +588,7 @@
               pArray->AddNew<CPDF_String>(PDF_EncodeText(opt_value), false);
             }
           }
-          if (pArray->GetCount() > 0)
+          if (pArray->size() > 0)
             m_pDict->SetFor("V", std::move(pArray));
         }
       } else {
@@ -627,7 +627,7 @@
 
 int CPDF_FormField::CountOptions() const {
   const CPDF_Array* pArray = ToArray(FPDF_GetFieldAttr(m_pDict.Get(), "Opt"));
-  return pArray ? pArray->GetCount() : 0;
+  return pArray ? pArray->size() : 0;
 }
 
 WideString CPDF_FormField::GetOptionText(int index, int sub_index) const {
@@ -767,7 +767,7 @@
 
 int CPDF_FormField::CountSelectedOptions() const {
   const CPDF_Array* pArray = ToArray(FPDF_GetFieldAttr(m_pDict.Get(), "I"));
-  return pArray ? pArray->GetCount() : 0;
+  return pArray ? pArray->size() : 0;
 }
 
 int CPDF_FormField::GetSelectedOptionIndex(int index) const {
@@ -775,7 +775,7 @@
   if (!pArray)
     return -1;
 
-  int iCount = pArray->GetCount();
+  int iCount = pArray->size();
   if (iCount < 0 || index >= iCount)
     return -1;
   return pArray->GetIntegerAt(index);
@@ -805,7 +805,7 @@
   }
 
   bool bReturn = false;
-  for (size_t i = 0; i < pArray->GetCount(); i++) {
+  for (size_t i = 0; i < pArray->size(); i++) {
     int iFind = pArray->GetIntegerAt(i);
     if (iFind == iOptIndex) {
       if (bSelected)
diff --git a/core/fpdfdoc/cpdf_iconfit.cpp b/core/fpdfdoc/cpdf_iconfit.cpp
index 8b8fa4e..801e908 100644
--- a/core/fpdfdoc/cpdf_iconfit.cpp
+++ b/core/fpdfdoc/cpdf_iconfit.cpp
@@ -50,7 +50,7 @@
   if (!pA)
     return {fLeft, fBottom};
 
-  size_t dwCount = pA->GetCount();
+  size_t dwCount = pA->size();
   if (dwCount > 0)
     fLeft = pA->GetNumberAt(0);
   if (dwCount > 1)
diff --git a/core/fpdfdoc/cpdf_interactiveform.cpp b/core/fpdfdoc/cpdf_interactiveform.cpp
index 58b1a61..347fd55 100644
--- a/core/fpdfdoc/cpdf_interactiveform.cpp
+++ b/core/fpdfdoc/cpdf_interactiveform.cpp
@@ -591,7 +591,7 @@
   if (!pFields)
     return;
 
-  for (size_t i = 0; i < pFields->GetCount(); ++i)
+  for (size_t i = 0; i < pFields->size(); ++i)
     LoadField(pFields->GetDictAt(i), 0);
 }
 
@@ -715,7 +715,7 @@
   if (!pAnnotList)
     return nullptr;
 
-  for (size_t i = pAnnotList->GetCount(); i > 0; --i) {
+  for (size_t i = pAnnotList->size(); i > 0; --i) {
     size_t annot_index = i - 1;
     CPDF_Dictionary* pAnnot = pAnnotList->GetDictAt(annot_index);
     if (!pAnnot)
@@ -751,7 +751,7 @@
     return 0;
 
   CPDF_Array* pArray = m_pFormDict->GetArrayFor("CO");
-  return pArray ? pArray->GetCount() : 0;
+  return pArray ? pArray->size() : 0;
 }
 
 CPDF_FormField* CPDF_InteractiveForm::GetFieldInCalculationOrder(int index) {
@@ -775,7 +775,7 @@
   if (!pArray)
     return -1;
 
-  for (size_t i = 0; i < pArray->GetCount(); i++) {
+  for (size_t i = 0; i < pArray->size(); i++) {
     CPDF_Object* pElement = pArray->GetDirectObjectAt(i);
     if (pElement == pField->GetDict())
       return i;
@@ -844,7 +844,7 @@
     return;
 
   if (pFirstKid->KeyExist("T") || pFirstKid->KeyExist("Kids")) {
-    for (size_t i = 0; i < pKids->GetCount(); i++) {
+    for (size_t i = 0; i < pKids->size(); i++) {
       CPDF_Dictionary* pChildDict = pKids->GetDictAt(i);
       if (pChildDict) {
         if (pChildDict->GetObjNum() != dwParentObjNum)
@@ -869,7 +869,7 @@
   if (!pAnnots)
     return;
 
-  for (size_t i = 0; i < pAnnots->GetCount(); i++) {
+  for (size_t i = 0; i < pAnnots->size(); i++) {
     CPDF_Dictionary* pAnnot = pAnnots->GetDictAt(i);
     if (pAnnot && pAnnot->GetStringFor("Subtype") == "Widget")
       LoadField(pAnnot, 0);
@@ -930,7 +930,7 @@
 
   CPDF_Array* pKids = pFieldDict->GetArrayFor("Kids");
   if (pKids) {
-    for (size_t i = 0; i < pKids->GetCount(); i++) {
+    for (size_t i = 0; i < pKids->size(); i++) {
       CPDF_Dictionary* pKid = pKids->GetDictAt(i);
       if (!pKid)
         continue;
diff --git a/core/fpdfdoc/cpdf_linklist.cpp b/core/fpdfdoc/cpdf_linklist.cpp
index 43b4d45..746bbab 100644
--- a/core/fpdfdoc/cpdf_linklist.cpp
+++ b/core/fpdfdoc/cpdf_linklist.cpp
@@ -60,7 +60,7 @@
   if (!pAnnotList)
     return;
 
-  for (size_t i = 0; i < pAnnotList->GetCount(); ++i) {
+  for (size_t i = 0; i < pAnnotList->size(); ++i) {
     CPDF_Dictionary* pAnnot = pAnnotList->GetDictAt(i);
     bool add_link = (pAnnot && pAnnot->GetStringFor("Subtype") == "Link");
     // Add non-links as nullptrs to preserve z-order.
diff --git a/core/fpdfdoc/cpdf_nametree.cpp b/core/fpdfdoc/cpdf_nametree.cpp
index 92b37f1..3e13c85 100644
--- a/core/fpdfdoc/cpdf_nametree.cpp
+++ b/core/fpdfdoc/cpdf_nametree.cpp
@@ -52,7 +52,7 @@
   if (!pKids)
     return false;
 
-  for (size_t i = 0; i < pKids->GetCount(); ++i) {
+  for (size_t i = 0; i < pKids->size(); ++i) {
     CPDF_Dictionary* pKid = pKids->GetDictAt(i);
     if (!pKid)
       continue;
@@ -94,7 +94,7 @@
     // names to find the new lower and upper limits.
     WideString csNewLeft = csRight;
     WideString csNewRight = csLeft;
-    for (size_t i = 0; i < pNames->GetCount() / 2; ++i) {
+    for (size_t i = 0; i < pNames->size() / 2; ++i) {
       WideString wsName = pNames->GetUnicodeTextAt(i * 2);
       if (wsName.Compare(csNewLeft) < 0)
         csNewLeft = wsName;
@@ -111,7 +111,7 @@
     return false;
 
   // Loop through the kids to find the leaf array |pFind|.
-  for (size_t i = 0; i < pKids->GetCount(); ++i) {
+  for (size_t i = 0; i < pKids->size(); ++i) {
     CPDF_Dictionary* pKid = pKids->GetDictAt(i);
     if (!pKid)
       continue;
@@ -132,7 +132,7 @@
     // kids to find the new lower and upper limits.
     WideString csNewLeft = csRight;
     WideString csNewRight = csLeft;
-    for (size_t j = 0; j < pKids->GetCount(); ++j) {
+    for (size_t j = 0; j < pKids->size(); ++j) {
       CPDF_Array* pKidLimits = pKids->GetDictAt(j)->GetArrayFor("Limits");
       ASSERT(pKidLimits);
       if (pKidLimits->GetUnicodeTextAt(0).Compare(csNewLeft) < 0)
@@ -178,7 +178,7 @@
       if (ppFind)
         *ppFind = pNames;
       if (pFindIndex)
-        *pFindIndex = pNames->GetCount() / 2 - 1;
+        *pFindIndex = pNames->size() / 2 - 1;
 
       return nullptr;
     }
@@ -186,7 +186,7 @@
 
   // If the node is a leaf node, look for the name in its names array.
   if (pNames) {
-    size_t dwCount = pNames->GetCount() / 2;
+    size_t dwCount = pNames->size() / 2;
     for (size_t i = 0; i < dwCount; i++) {
       WideString csValue = pNames->GetUnicodeTextAt(i * 2);
       int32_t iCompare = csValue.Compare(csName);
@@ -211,7 +211,7 @@
   if (!pKids)
     return nullptr;
 
-  for (size_t i = 0; i < pKids->GetCount(); i++) {
+  for (size_t i = 0; i < pKids->size(); i++) {
     CPDF_Dictionary* pKid = pKids->GetDictAt(i);
     if (!pKid)
       continue;
@@ -240,7 +240,7 @@
 
   CPDF_Array* pNames = pNode->GetArrayFor("Names");
   if (pNames) {
-    size_t nCount = pNames->GetCount() / 2;
+    size_t nCount = pNames->size() / 2;
     if (nIndex >= *nCurIndex + nCount) {
       *nCurIndex += nCount;
       return nullptr;
@@ -258,7 +258,7 @@
   if (!pKids)
     return nullptr;
 
-  for (size_t i = 0; i < pKids->GetCount(); i++) {
+  for (size_t i = 0; i < pKids->size(); i++) {
     CPDF_Dictionary* pKid = pKids->GetDictAt(i);
     if (!pKid)
       continue;
@@ -277,14 +277,14 @@
 
   CPDF_Array* pNames = pNode->GetArrayFor("Names");
   if (pNames)
-    return pNames->GetCount() / 2;
+    return pNames->size() / 2;
 
   CPDF_Array* pKids = pNode->GetArrayFor("Kids");
   if (!pKids)
     return 0;
 
   size_t nCount = 0;
-  for (size_t i = 0; i < pKids->GetCount(); i++) {
+  for (size_t i = 0; i < pKids->size(); i++) {
     CPDF_Dictionary* pKid = pKids->GetDictAt(i);
     if (!pKid)
       continue;
diff --git a/core/fpdfdoc/cpdf_nametree_unittest.cpp b/core/fpdfdoc/cpdf_nametree_unittest.cpp
index 0ceab24..39e9dea 100644
--- a/core/fpdfdoc/cpdf_nametree_unittest.cpp
+++ b/core/fpdfdoc/cpdf_nametree_unittest.cpp
@@ -238,9 +238,9 @@
   EXPECT_EQ(999, nameTree.LookupValue(L"9.txt")->GetInteger());
   EXPECT_TRUE(nameTree.LookupValueAndName(4, &csName));
   EXPECT_STREQ(L"9.txt", csName.c_str());
-  EXPECT_EQ(2u, pKid1->GetArrayFor("Kids")->GetCount());
+  EXPECT_EQ(2u, pKid1->GetArrayFor("Kids")->size());
   EXPECT_TRUE(nameTree.DeleteValueAndName(4));
-  EXPECT_EQ(1u, pKid1->GetArrayFor("Kids")->GetCount());
+  EXPECT_EQ(1u, pKid1->GetArrayFor("Kids")->size());
   CheckLimitsArray(pKid1, "1.txt", "5.txt");
 
   // Delete the name "2.txt", and check that its node does not get deleted, its
@@ -249,9 +249,9 @@
   EXPECT_EQ(222, nameTree.LookupValue(L"2.txt")->GetInteger());
   EXPECT_TRUE(nameTree.LookupValueAndName(1, &csName));
   EXPECT_STREQ(L"2.txt", csName.c_str());
-  EXPECT_EQ(4u, pKid4->GetArrayFor("Names")->GetCount());
+  EXPECT_EQ(4u, pKid4->GetArrayFor("Names")->size());
   EXPECT_TRUE(nameTree.DeleteValueAndName(1));
-  EXPECT_EQ(2u, pKid4->GetArrayFor("Names")->GetCount());
+  EXPECT_EQ(2u, pKid4->GetArrayFor("Names")->size());
   CheckLimitsArray(pKid4, "1.txt", "1.txt");
   CheckLimitsArray(pKid2, "1.txt", "5.txt");
   CheckLimitsArray(pKid1, "1.txt", "5.txt");
@@ -262,9 +262,9 @@
   EXPECT_EQ(111, nameTree.LookupValue(L"1.txt")->GetInteger());
   EXPECT_TRUE(nameTree.LookupValueAndName(0, &csName));
   EXPECT_STREQ(L"1.txt", csName.c_str());
-  EXPECT_EQ(2u, pKid2->GetArrayFor("Kids")->GetCount());
+  EXPECT_EQ(2u, pKid2->GetArrayFor("Kids")->size());
   EXPECT_TRUE(nameTree.DeleteValueAndName(0));
-  EXPECT_EQ(1u, pKid2->GetArrayFor("Kids")->GetCount());
+  EXPECT_EQ(1u, pKid2->GetArrayFor("Kids")->size());
   CheckLimitsArray(pKid2, "3.txt", "5.txt");
   CheckLimitsArray(pKid1, "3.txt", "5.txt");
 
@@ -274,9 +274,9 @@
   EXPECT_EQ(333, nameTree.LookupValue(L"3.txt")->GetInteger());
   EXPECT_TRUE(nameTree.LookupValueAndName(0, &csName));
   EXPECT_STREQ(L"3.txt", csName.c_str());
-  EXPECT_EQ(4u, pKid5->GetArrayFor("Names")->GetCount());
+  EXPECT_EQ(4u, pKid5->GetArrayFor("Names")->size());
   EXPECT_TRUE(nameTree.DeleteValueAndName(0));
-  EXPECT_EQ(2u, pKid5->GetArrayFor("Names")->GetCount());
+  EXPECT_EQ(2u, pKid5->GetArrayFor("Names")->size());
   CheckLimitsArray(pKid5, "5.txt", "5.txt");
   CheckLimitsArray(pKid2, "5.txt", "5.txt");
   CheckLimitsArray(pKid1, "5.txt", "5.txt");
@@ -287,9 +287,9 @@
   EXPECT_EQ(555, nameTree.LookupValue(L"5.txt")->GetInteger());
   EXPECT_TRUE(nameTree.LookupValueAndName(0, &csName));
   EXPECT_STREQ(L"5.txt", csName.c_str());
-  EXPECT_EQ(1u, nameTree.GetRoot()->GetArrayFor("Kids")->GetCount());
+  EXPECT_EQ(1u, nameTree.GetRoot()->GetArrayFor("Kids")->size());
   EXPECT_TRUE(nameTree.DeleteValueAndName(0));
-  EXPECT_EQ(0u, nameTree.GetRoot()->GetArrayFor("Kids")->GetCount());
+  EXPECT_EQ(0u, nameTree.GetRoot()->GetArrayFor("Kids")->size());
 
   // Check that the tree is now empty.
   EXPECT_EQ(0u, nameTree.GetCount());
diff --git a/core/fpdfdoc/cpdf_numbertree.cpp b/core/fpdfdoc/cpdf_numbertree.cpp
index 74aeb67..46257c8 100644
--- a/core/fpdfdoc/cpdf_numbertree.cpp
+++ b/core/fpdfdoc/cpdf_numbertree.cpp
@@ -19,7 +19,7 @@
   }
   const CPDF_Array* pNumbers = pNode->GetArrayFor("Nums");
   if (pNumbers) {
-    for (size_t i = 0; i < pNumbers->GetCount() / 2; i++) {
+    for (size_t i = 0; i < pNumbers->size() / 2; i++) {
       int index = pNumbers->GetIntegerAt(i * 2);
       if (num == index)
         return pNumbers->GetDirectObjectAt(i * 2 + 1);
@@ -33,7 +33,7 @@
   if (!pKids)
     return nullptr;
 
-  for (size_t i = 0; i < pKids->GetCount(); i++) {
+  for (size_t i = 0; i < pKids->size(); i++) {
     const CPDF_Dictionary* pKid = pKids->GetDictAt(i);
     if (!pKid)
       continue;
diff --git a/core/fpdfdoc/cpdf_occontext.cpp b/core/fpdfdoc/cpdf_occontext.cpp
index 4116fdb..1cfa29c 100644
--- a/core/fpdfdoc/cpdf_occontext.cpp
+++ b/core/fpdfdoc/cpdf_occontext.cpp
@@ -17,7 +17,7 @@
   if (!pArray || !pGroupDict)
     return -1;
 
-  for (size_t i = 0; i < pArray->GetCount(); i++) {
+  for (size_t i = 0; i < pArray->size(); i++) {
     if (pArray->GetDictAt(i) == pGroupDict)
       return i;
   }
@@ -33,7 +33,7 @@
 
   ByteString bsIntent;
   if (const CPDF_Array* pArray = pIntent->AsArray()) {
-    for (size_t i = 0; i < pArray->GetCount(); i++) {
+    for (size_t i = 0; i < pArray->size(); i++) {
       bsIntent = pArray->GetStringAt(i);
       if (bsIntent == "All" || bsIntent == csElement)
         return true;
@@ -63,7 +63,7 @@
   if (!pConfigs)
     return pConfig;
 
-  for (size_t i = 0; i < pConfigs->GetCount(); i++) {
+  for (size_t i = 0; i < pConfigs->size(); i++) {
     CPDF_Dictionary* pFind = pConfigs->GetDictAt(i);
     if (pFind && HasIntent(pFind, "View", "View"))
       return pFind;
@@ -122,7 +122,7 @@
     return bState;
 
   ByteString csFind = csConfig + "State";
-  for (size_t i = 0; i < pArray->GetCount(); i++) {
+  for (size_t i = 0; i < pArray->size(); i++) {
     CPDF_Dictionary* pUsage = pArray->GetDictAt(i);
     if (!pUsage)
       continue;
@@ -213,7 +213,7 @@
     return false;
 
   bool bValue = false;
-  for (size_t i = 1; i < pExpression->GetCount(); i++) {
+  for (size_t i = 1; i < pExpression->size(); i++) {
     const CPDF_Object* pOCGObj = pExpression->GetDirectObjectAt(1);
     if (!pOCGObj)
       continue;
@@ -258,7 +258,7 @@
   // At least one entry of OCGs needs to be a valid dictionary for it to be
   // considered present. See "OCGs" in table 4.49 in the PDF 1.7 spec.
   bool bValidEntrySeen = false;
-  for (size_t i = 0; i < pArray->GetCount(); i++) {
+  for (size_t i = 0; i < pArray->size(); i++) {
     bool bItem = true;
     const CPDF_Dictionary* pItemDict = pArray->GetDictAt(i);
     if (!pItemDict)
diff --git a/core/fpdfdoc/cpdf_structelement.cpp b/core/fpdfdoc/cpdf_structelement.cpp
index d8fc0d8..c42faa3 100644
--- a/core/fpdfdoc/cpdf_structelement.cpp
+++ b/core/fpdfdoc/cpdf_structelement.cpp
@@ -67,8 +67,8 @@
 
   m_Kids.clear();
   if (const CPDF_Array* pArray = pKids->AsArray()) {
-    m_Kids.resize(pArray->GetCount());
-    for (uint32_t i = 0; i < pArray->GetCount(); i++) {
+    m_Kids.resize(pArray->size());
+    for (uint32_t i = 0; i < pArray->size(); i++) {
       const CPDF_Object* pKid = pArray->GetDirectObjectAt(i);
       LoadKid(PageObjNum, pKid, &m_Kids[i]);
     }
diff --git a/core/fpdfdoc/cpdf_structtree.cpp b/core/fpdfdoc/cpdf_structtree.cpp
index 04b074f..1b72a53 100644
--- a/core/fpdfdoc/cpdf_structtree.cpp
+++ b/core/fpdfdoc/cpdf_structtree.cpp
@@ -56,7 +56,7 @@
   if (pKids->IsDictionary())
     dwKids = 1;
   else if (const CPDF_Array* pArray = pKids->AsArray())
-    dwKids = pArray->GetCount();
+    dwKids = pArray->size();
   else
     return;
 
@@ -76,7 +76,7 @@
     return;
 
   StructElementMap element_map;
-  for (size_t i = 0; i < pParentArray->GetCount(); i++) {
+  for (size_t i = 0; i < pParentArray->size(); i++) {
     if (const CPDF_Dictionary* pParent = pParentArray->GetDictAt(i))
       AddPageNode(pParent, &element_map, 0);
   }
@@ -135,7 +135,7 @@
     return true;
 
   bool bSave = false;
-  for (size_t i = 0; i < pTopKids->GetCount(); i++) {
+  for (size_t i = 0; i < pTopKids->size(); i++) {
     const CPDF_Reference* pKidRef = ToReference(pTopKids->GetObjectAt(i));
     if (pKidRef && pKidRef->GetRefObjNum() == pDict->GetObjNum()) {
       m_Kids[i] = pElement;
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp
index dc2f22d..734173f 100644
--- a/core/fpdfdoc/cpvt_generateap.cpp
+++ b/core/fpdfdoc/cpvt_generateap.cpp
@@ -319,7 +319,7 @@
   }
 
   if (const CPDF_Array* pBorderArray = pAnnotDict.GetArrayFor("Border")) {
-    if (pBorderArray->GetCount() > 2)
+    if (pBorderArray->size() > 2)
       return pBorderArray->GetNumberAt(2);
   }
 
@@ -333,7 +333,7 @@
   }
 
   if (const CPDF_Array* pBorderArray = pAnnotDict.GetArrayFor("Border")) {
-    if (pBorderArray->GetCount() == 4)
+    if (pBorderArray->size() == 4)
       return pBorderArray->GetArrayAt(3);
   }
 
@@ -346,7 +346,7 @@
     return ByteString();
 
   // Support maximum of ten elements in the dash array.
-  size_t pDashArrayCount = std::min<size_t>(pDashArray->GetCount(), 10);
+  size_t pDashArrayCount = std::min<size_t>(pDashArray->size(), 10);
   std::ostringstream sDashStream;
 
   sDashStream << "[";
@@ -657,15 +657,15 @@
   rect.Inflate(fBorderWidth / 2, fBorderWidth / 2);
   pAnnotDict->SetRectFor("Rect", rect);
 
-  for (size_t i = 0; i < pInkList->GetCount(); i++) {
+  for (size_t i = 0; i < pInkList->size(); i++) {
     CPDF_Array* pInkCoordList = pInkList->GetArrayAt(i);
-    if (!pInkCoordList || pInkCoordList->GetCount() < 2)
+    if (!pInkCoordList || pInkCoordList->size() < 2)
       continue;
 
     sAppStream << pInkCoordList->GetNumberAt(0) << " "
                << pInkCoordList->GetNumberAt(1) << " m ";
 
-    for (size_t j = 0; j < pInkCoordList->GetCount() - 1; j += 2) {
+    for (size_t j = 0; j < pInkCoordList->size() - 1; j += 2) {
       sAppStream << pInkCoordList->GetNumberAt(j) << " "
                  << pInkCoordList->GetNumberAt(j + 1) << " l ";
     }
@@ -803,7 +803,7 @@
     rect.Deflate(fBorderWidth / 2, fBorderWidth / 2);
   }
 
-  bool bIsFillRect = pInteriorColor && (pInteriorColor->GetCount() > 0);
+  bool bIsFillRect = pInteriorColor && (pInteriorColor->size() > 0);
 
   sAppStream << rect.left << " " << rect.bottom << " " << rect.Width() << " "
              << rect.Height() << " re "
@@ -1230,7 +1230,7 @@
       std::ostringstream sBody;
       if (pOpts) {
         float fy = rcBody.top;
-        for (size_t i = nTop, sz = pOpts->GetCount(); i < sz; i++) {
+        for (size_t i = nTop, sz = pOpts->size(); i < sz; i++) {
           if (IsFloatSmaller(fy, rcBody.bottom))
             break;
 
@@ -1243,7 +1243,7 @@
 
             bool bSelected = false;
             if (pSels) {
-              for (size_t s = 0, ssz = pSels->GetCount(); s < ssz; s++) {
+              for (size_t s = 0, ssz = pSels->size(); s < ssz; s++) {
                 int value = pSels->GetIntegerAt(s);
                 if (value >= 0 && i == static_cast<size_t>(value)) {
                   bSelected = true;
diff --git a/core/fxge/cfx_color.cpp b/core/fxge/cfx_color.cpp
index 19d1d4f..e4d89dc 100644
--- a/core/fxge/cfx_color.cpp
+++ b/core/fxge/cfx_color.cpp
@@ -66,7 +66,7 @@
 // Static.
 CFX_Color CFX_Color::ParseColor(const CPDF_Array& array) {
   CFX_Color rt;
-  switch (array.GetCount()) {
+  switch (array.size()) {
     case 1:
       rt = CFX_Color(CFX_Color::kGray, array.GetFloatAt(0));
       break;
diff --git a/core/fxge/cfx_graphstate.cpp b/core/fxge/cfx_graphstate.cpp
index 919faa3..929abe1 100644
--- a/core/fxge/cfx_graphstate.cpp
+++ b/core/fxge/cfx_graphstate.cpp
@@ -22,8 +22,8 @@
 void CFX_GraphState::SetLineDash(CPDF_Array* pArray, float phase, float scale) {
   CFX_GraphStateData* pData = m_Ref.GetPrivateCopy();
   pData->m_DashPhase = phase * scale;
-  pData->m_DashArray.resize(pArray->GetCount());
-  for (size_t i = 0; i < pArray->GetCount(); i++)
+  pData->m_DashArray.resize(pArray->size());
+  for (size_t i = 0; i < pArray->size(); i++)
     pData->m_DashArray[i] = pArray->GetNumberAt(i) * scale;
 }
 
diff --git a/fpdfsdk/cpdfsdk_actionhandler.cpp b/fpdfsdk/cpdfsdk_actionhandler.cpp
index 6d7fb9f..c9ef6bc 100644
--- a/fpdfsdk/cpdfsdk_actionhandler.cpp
+++ b/fpdfsdk/cpdfsdk_actionhandler.cpp
@@ -374,7 +374,7 @@
   const CPDF_Array* pMyArray = MyDest.GetArray();
   std::vector<float> posArray;
   if (pMyArray) {
-    for (size_t i = 2; i < pMyArray->GetCount(); i++)
+    for (size_t i = 2; i < pMyArray->size(); i++)
       posArray.push_back(pMyArray->GetFloatAt(i));
   }
   pFormFillEnv->DoGoToAction(nPageIndex, nFitType, posArray.data(),
diff --git a/fpdfsdk/cpdfsdk_baannot.cpp b/fpdfsdk/cpdfsdk_baannot.cpp
index 5fe3411..dc4f3f9 100644
--- a/fpdfsdk/cpdfsdk_baannot.cpp
+++ b/fpdfsdk/cpdfsdk_baannot.cpp
@@ -192,9 +192,9 @@
 
   CPDF_Array* pBorder = GetAnnotDict()->GetArrayFor("Border");
   if (pBorder) {
-    if (pBorder->GetCount() >= 4) {
+    if (pBorder->size() >= 4) {
       CPDF_Array* pDP = pBorder->GetArrayAt(3);
-      if (pDP && pDP->GetCount() > 0)
+      if (pDP && pDP->size() > 0)
         return BorderStyle::DASH;
     }
   }
diff --git a/fpdfsdk/cpdfsdk_helpers.cpp b/fpdfsdk/cpdfsdk_helpers.cpp
index cc16cf4..b2ef675 100644
--- a/fpdfsdk/cpdfsdk_helpers.cpp
+++ b/fpdfsdk/cpdfsdk_helpers.cpp
@@ -218,7 +218,7 @@
         const CPDF_Array* pArray =
             pJSDict ? pJSDict->GetArrayFor("Names") : nullptr;
         if (pArray) {
-          for (size_t i = 0; i < pArray->GetCount(); i++) {
+          for (size_t i = 0; i < pArray->size(); i++) {
             ByteString cbStr = pArray->GetStringAt(i);
             if (cbStr.Compare("com.adobe.acrobat.SharedReview.Register") == 0) {
               RaiseUnSupportError(FPDF_UNSP_DOC_SHAREDREVIEW);
@@ -353,7 +353,7 @@
 }
 
 bool IsValidQuadPointsIndex(const CPDF_Array* array, size_t index) {
-  return array && index < array->GetCount() / 8;
+  return array && index < array->size() / 8;
 }
 
 bool GetQuadPointsAtIndex(const CPDF_Array* array,
@@ -383,7 +383,7 @@
   ASSERT(quad_points);
 
   const CPDF_Array* pArray = GetQuadPointsArrayFromDictionary(dict);
-  if (!pArray || quad_index >= pArray->GetCount() / 8)
+  if (!pArray || quad_index >= pArray->size() / 8)
     return false;
 
   quad_index *= 8;
diff --git a/fpdfsdk/cpdfsdk_interactiveform.cpp b/fpdfsdk/cpdfsdk_interactiveform.cpp
index b224b0e..31be320 100644
--- a/fpdfsdk/cpdfsdk_interactiveform.cpp
+++ b/fpdfsdk/cpdfsdk_interactiveform.cpp
@@ -94,7 +94,7 @@
     return false;
 
   std::ostringstream fdfEncodedData;
-  for (uint32_t i = 0; i < pFields->GetCount(); i++) {
+  for (uint32_t i = 0; i < pFields->size(); i++) {
     CPDF_Dictionary* pField = pFields->GetDictAt(i);
     if (!pField)
       continue;
@@ -105,7 +105,7 @@
     WideString csWValue = PDF_DecodeText(csBValue);
     ByteString csValue_b = csWValue.ToDefANSI();
     fdfEncodedData << name_b << "=" << csValue_b;
-    if (i != pFields->GetCount() - 1)
+    if (i != pFields->size() - 1)
       fdfEncodedData << "&";
   }
 
@@ -208,7 +208,7 @@
   for (int i = 0, sz = pDocument->GetPageCount(); i < sz; i++) {
     if (CPDF_Dictionary* pPageDict = pDocument->GetPageDictionary(i)) {
       if (CPDF_Array* pAnnots = pPageDict->GetArrayFor("Annots")) {
-        for (int j = 0, jsz = pAnnots->GetCount(); j < jsz; j++) {
+        for (int j = 0, jsz = pAnnots->size(); j < jsz; j++) {
           CPDF_Object* pDict = pAnnots->GetDirectObjectAt(j);
           if (pAnnotDict == pDict)
             return i;
diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp
index 757bb96..c4623bb 100644
--- a/fpdfsdk/fpdf_annot.cpp
+++ b/fpdfsdk/fpdf_annot.cpp
@@ -245,7 +245,7 @@
     return 0;
 
   CPDF_Array* pAnnots = pPage->GetDict()->GetArrayFor("Annots");
-  return pAnnots ? pAnnots->GetCount() : 0;
+  return pAnnots ? pAnnots->size() : 0;
 }
 
 FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV FPDFPage_GetAnnot(FPDF_PAGE page,
@@ -255,7 +255,7 @@
     return nullptr;
 
   CPDF_Array* pAnnots = pPage->GetDict()->GetArrayFor("Annots");
-  if (!pAnnots || static_cast<size_t>(index) >= pAnnots->GetCount())
+  if (!pAnnots || static_cast<size_t>(index) >= pAnnots->size())
     return nullptr;
 
   CPDF_Dictionary* pDict = ToDictionary(pAnnots->GetDirectObjectAt(index));
@@ -300,7 +300,7 @@
     return false;
 
   CPDF_Array* pAnnots = pPage->GetDict()->GetArrayFor("Annots");
-  if (!pAnnots || static_cast<size_t>(index) >= pAnnots->GetCount())
+  if (!pAnnots || static_cast<size_t>(index) >= pAnnots->size())
     return false;
 
   pAnnots->RemoveAt(index);
@@ -630,7 +630,7 @@
   CPDF_Dictionary* pAnnotDict =
       CPDFAnnotContextFromFPDFAnnotation(annot)->GetAnnotDict();
   const CPDF_Array* pArray = GetQuadPointsArrayFromDictionary(pAnnotDict);
-  return pArray ? pArray->GetCount() / 8 : 0;
+  return pArray ? pArray->size() / 8 : 0;
 }
 
 FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
diff --git a/fpdfsdk/fpdf_doc.cpp b/fpdfsdk/fpdf_doc.cpp
index 28c670c..0a2f589 100644
--- a/fpdfsdk/fpdf_doc.cpp
+++ b/fpdfsdk/fpdf_doc.cpp
@@ -340,7 +340,7 @@
   CPDF_Array* pAnnots = pPage->GetDict()->GetArrayFor("Annots");
   if (!pAnnots)
     return false;
-  for (size_t i = *start_pos; i < pAnnots->GetCount(); i++) {
+  for (size_t i = *start_pos; i < pAnnots->size(); i++) {
     CPDF_Dictionary* pDict = ToDictionary(pAnnots->GetDirectObjectAt(i));
     if (!pDict)
       continue;
@@ -365,7 +365,7 @@
 FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountQuadPoints(FPDF_LINK link_annot) {
   const CPDF_Array* pArray =
       GetQuadPointsArrayFromDictionary(CPDFDictionaryFromFPDFLink(link_annot));
-  return pArray ? static_cast<int>(pArray->GetCount() / 8) : 0;
+  return pArray ? static_cast<int>(pArray->size() / 8) : 0;
 }
 
 FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
diff --git a/fpdfsdk/fpdf_edit_embeddertest.cpp b/fpdfsdk/fpdf_edit_embeddertest.cpp
index 4250091..9cd7dbf 100644
--- a/fpdfsdk/fpdf_edit_embeddertest.cpp
+++ b/fpdfsdk/fpdf_edit_embeddertest.cpp
@@ -58,7 +58,7 @@
 
     const CPDF_Array* fontBBox = font_desc->GetArrayFor("FontBBox");
     ASSERT_TRUE(fontBBox);
-    EXPECT_EQ(4u, fontBBox->GetCount());
+    EXPECT_EQ(4u, fontBBox->size());
     // Check that the coordinates are in the preferred order according to spec
     // 1.7 Section 3.8.4
     EXPECT_TRUE(fontBBox->GetIntegerAt(0) < fontBBox->GetIntegerAt(2));
@@ -97,18 +97,18 @@
     // Check that W array is in a format that conforms to PDF spec 1.7 section
     // "Glyph Metrics in CIDFonts" (these checks are not
     // implementation-specific).
-    EXPECT_GT(widths_array->GetCount(), 1u);
+    EXPECT_GT(widths_array->size(), 1u);
     int num_cids_checked = 0;
     int cur_cid = 0;
-    for (size_t idx = 0; idx < widths_array->GetCount(); idx++) {
+    for (size_t idx = 0; idx < widths_array->size(); idx++) {
       int cid = widths_array->GetNumberAt(idx);
       EXPECT_GE(cid, cur_cid);
-      ASSERT_FALSE(++idx == widths_array->GetCount());
+      ASSERT_FALSE(++idx == widths_array->size());
       const CPDF_Object* next = widths_array->GetObjectAt(idx);
       if (next->IsArray()) {
         // We are in the c [w1 w2 ...] case
         const CPDF_Array* arr = next->AsArray();
-        int cnt = static_cast<int>(arr->GetCount());
+        int cnt = static_cast<int>(arr->size());
         size_t inner_idx = 0;
         for (cur_cid = cid; cur_cid < cid + cnt; cur_cid++) {
           uint32_t width = arr->GetNumberAt(inner_idx++);
@@ -121,7 +121,7 @@
       // Otherwise, are in the c_first c_last w case.
       ASSERT_TRUE(next->IsNumber());
       int last_cid = next->AsNumber()->GetInteger();
-      ASSERT_FALSE(++idx == widths_array->GetCount());
+      ASSERT_FALSE(++idx == widths_array->size());
       uint32_t width = widths_array->GetNumberAt(idx);
       for (cur_cid = cid; cur_cid <= last_cid; cur_cid++) {
         EXPECT_EQ(width, typed_font->GetCharWidthF(cur_cid))
@@ -2053,7 +2053,7 @@
   CPDF_Page* cpage = CPDFPageFromFPDFPage(page.get());
   CPDF_Dictionary* graphics_dict = cpage->m_pResources->GetDictFor("ExtGState");
   ASSERT_TRUE(graphics_dict);
-  EXPECT_EQ(2u, graphics_dict->GetCount());
+  EXPECT_EQ(2u, graphics_dict->size());
 
   // Add a text object causing no change to the graphics dictionary
   FPDF_PAGEOBJECT text1 = FPDFPageObj_NewTextObj(document(), "Arial", 12.0f);
@@ -2062,7 +2062,7 @@
   EXPECT_TRUE(FPDFText_SetFillColor(text1, 100, 100, 100, 255));
   FPDFPage_InsertObject(page.get(), text1);
   EXPECT_TRUE(FPDFPage_GenerateContent(page.get()));
-  EXPECT_EQ(2u, graphics_dict->GetCount());
+  EXPECT_EQ(2u, graphics_dict->size());
 
   // Add a text object increasing the size of the graphics dictionary
   FPDF_PAGEOBJECT text2 =
@@ -2071,7 +2071,7 @@
   FPDFPageObj_SetBlendMode(text2, "Darken");
   EXPECT_TRUE(FPDFText_SetFillColor(text2, 0, 0, 255, 150));
   EXPECT_TRUE(FPDFPage_GenerateContent(page.get()));
-  EXPECT_EQ(3u, graphics_dict->GetCount());
+  EXPECT_EQ(3u, graphics_dict->size());
 
   // Add a path that should reuse graphics
   FPDF_PAGEOBJECT path = FPDFPageObj_CreateNewPath(400, 100);
@@ -2079,7 +2079,7 @@
   EXPECT_TRUE(FPDFPath_SetFillColor(path, 200, 200, 100, 150));
   FPDFPage_InsertObject(page.get(), path);
   EXPECT_TRUE(FPDFPage_GenerateContent(page.get()));
-  EXPECT_EQ(3u, graphics_dict->GetCount());
+  EXPECT_EQ(3u, graphics_dict->size());
 
   // Add a rect increasing the size of the graphics dictionary
   FPDF_PAGEOBJECT rect2 = FPDFPageObj_CreateNewRect(10, 10, 100, 100);
@@ -2088,7 +2088,7 @@
   EXPECT_TRUE(FPDFPath_SetStrokeColor(rect2, 0, 0, 0, 200));
   FPDFPage_InsertObject(page.get(), rect2);
   EXPECT_TRUE(FPDFPage_GenerateContent(page.get()));
-  EXPECT_EQ(4u, graphics_dict->GetCount());
+  EXPECT_EQ(4u, graphics_dict->size());
 }
 
 TEST_F(FPDFEditEmbeddertest, DoubleGenerating) {
@@ -2106,7 +2106,7 @@
   CPDF_Page* cpage = CPDFPageFromFPDFPage(page);
   CPDF_Dictionary* graphics_dict = cpage->m_pResources->GetDictFor("ExtGState");
   ASSERT_TRUE(graphics_dict);
-  EXPECT_EQ(2u, graphics_dict->GetCount());
+  EXPECT_EQ(2u, graphics_dict->size());
 
   // Check the bitmap
   {
@@ -2118,7 +2118,7 @@
   // Never mind, my new favorite color is blue, increase alpha
   EXPECT_TRUE(FPDFPath_SetFillColor(rect, 0, 0, 255, 180));
   EXPECT_TRUE(FPDFPage_GenerateContent(page));
-  EXPECT_EQ(3u, graphics_dict->GetCount());
+  EXPECT_EQ(3u, graphics_dict->size());
 
   // Check that bitmap displays changed content
   {
@@ -2129,7 +2129,7 @@
 
   // And now generate, without changes
   EXPECT_TRUE(FPDFPage_GenerateContent(page));
-  EXPECT_EQ(3u, graphics_dict->GetCount());
+  EXPECT_EQ(3u, graphics_dict->size());
   {
     ScopedFPDFBitmap page_bitmap = RenderPageWithFlags(page, nullptr, 0);
     CompareBitmap(page_bitmap.get(), 612, 792,
@@ -2147,12 +2147,12 @@
   EXPECT_TRUE(FPDFPage_GenerateContent(page));
   CPDF_Dictionary* font_dict = cpage->m_pResources->GetDictFor("Font");
   ASSERT_TRUE(font_dict);
-  EXPECT_EQ(1u, font_dict->GetCount());
+  EXPECT_EQ(1u, font_dict->size());
 
   // Generate yet again, check dicts are reasonably sized
   EXPECT_TRUE(FPDFPage_GenerateContent(page));
-  EXPECT_EQ(3u, graphics_dict->GetCount());
-  EXPECT_EQ(1u, font_dict->GetCount());
+  EXPECT_EQ(3u, graphics_dict->size());
+  EXPECT_EQ(1u, font_dict->size());
   FPDF_ClosePage(page);
 }
 
@@ -2179,7 +2179,7 @@
 
   const CPDF_Array* widths_array = font_dict->GetArrayFor("Widths");
   ASSERT_TRUE(widths_array);
-  ASSERT_EQ(224u, widths_array->GetCount());
+  ASSERT_EQ(224u, widths_array->size());
   EXPECT_EQ(250, widths_array->GetNumberAt(0));
   EXPECT_EQ(569, widths_array->GetNumberAt(11));
   EXPECT_EQ(500, widths_array->GetNumberAt(223));
@@ -2207,7 +2207,7 @@
 
   const CPDF_Array* widths_array = font_dict->GetArrayFor("Widths");
   ASSERT_TRUE(widths_array);
-  ASSERT_EQ(224u, widths_array->GetCount());
+  ASSERT_EQ(224u, widths_array->size());
   EXPECT_EQ(600, widths_array->GetNumberAt(33));
   EXPECT_EQ(600, widths_array->GetNumberAt(74));
   EXPECT_EQ(600, widths_array->GetNumberAt(223));
@@ -2234,7 +2234,7 @@
   const CPDF_Array* descendant_array =
       font_dict->GetArrayFor("DescendantFonts");
   ASSERT_TRUE(descendant_array);
-  EXPECT_EQ(1u, descendant_array->GetCount());
+  EXPECT_EQ(1u, descendant_array->size());
 
   // Check the CIDFontDict
   const CPDF_Dictionary* cidfont_dict = descendant_array->GetDictAt(0);
@@ -2252,7 +2252,7 @@
   // Check widths
   const CPDF_Array* widths_array = cidfont_dict->GetArrayFor("W");
   ASSERT_TRUE(widths_array);
-  EXPECT_GT(widths_array->GetCount(), 1u);
+  EXPECT_GT(widths_array->size(), 1u);
   CheckCompositeFontWidths(widths_array, typed_font);
 }
 
@@ -2276,7 +2276,7 @@
   const CPDF_Array* descendant_array =
       font_dict->GetArrayFor("DescendantFonts");
   ASSERT_TRUE(descendant_array);
-  EXPECT_EQ(1u, descendant_array->GetCount());
+  EXPECT_EQ(1u, descendant_array->size());
 
   // Check the CIDFontDict
   const CPDF_Dictionary* cidfont_dict = descendant_array->GetDictAt(0);
diff --git a/fpdfsdk/fpdf_editimg.cpp b/fpdfsdk/fpdf_editimg.cpp
index aaa1c46..be7e571 100644
--- a/fpdfsdk/fpdf_editimg.cpp
+++ b/fpdfsdk/fpdf_editimg.cpp
@@ -250,7 +250,7 @@
     return 0;
 
   if (pFilter->IsArray())
-    return pFilter->AsArray()->GetCount();
+    return pFilter->AsArray()->size();
   if (pFilter->IsName())
     return 1;
 
diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp
index 77d0305..8c9a33d 100644
--- a/fpdfsdk/fpdf_editpage.cpp
+++ b/fpdfsdk/fpdf_editpage.cpp
@@ -373,7 +373,7 @@
       CPDFContentMarkItemFromFPDFPageObjectMark(mark);
 
   const CPDF_Dictionary* pParams = pMarkItem->GetParam();
-  return pParams ? pParams->GetCount() : 0;
+  return pParams ? pParams->size() : 0;
 }
 
 FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp
index 29d81c2..93490ad 100644
--- a/fpdfsdk/fpdf_flatten.cpp
+++ b/fpdfsdk/fpdf_flatten.cpp
@@ -341,7 +341,7 @@
       if (!sAnnotState.IsEmpty()) {
         pAPStream = pAPDic->GetStreamFor(sAnnotState);
       } else {
-        if (pAPDic->GetCount() > 0) {
+        if (pAPDic->size() > 0) {
           CPDF_Object* pFirstObj = pAPDic->begin()->second.get();
           if (pFirstObj) {
             if (pFirstObj->IsReference())
diff --git a/fpdfsdk/fpdf_ppo.cpp b/fpdfsdk/fpdf_ppo.cpp
index 1d093a1..b3d4ff5 100644
--- a/fpdfsdk/fpdf_ppo.cpp
+++ b/fpdfsdk/fpdf_ppo.cpp
@@ -383,7 +383,7 @@
     }
     case CPDF_Object::ARRAY: {
       CPDF_Array* pArray = pObj->AsArray();
-      for (size_t i = 0; i < pArray->GetCount(); ++i) {
+      for (size_t i = 0; i < pArray->size(); ++i) {
         CPDF_Object* pNextObj = pArray->GetObjectAt(i);
         if (!pNextObj)
           return false;
@@ -708,7 +708,7 @@
 
   if (const CPDF_Array* pSrcContentArray = ToArray(pSrcContentObj)) {
     ByteString bsSrcContentStream;
-    for (size_t i = 0; i < pSrcContentArray->GetCount(); ++i) {
+    for (size_t i = 0; i < pSrcContentArray->size(); ++i) {
       const CPDF_Stream* pStream = pSrcContentArray->GetStreamAt(i);
       auto pAcc = pdfium::MakeRetain<CPDF_StreamAcc>(pStream);
       pAcc->LoadAllDataFiltered();
diff --git a/fpdfsdk/fpdf_save.cpp b/fpdfsdk/fpdf_save.cpp
index 16d7da2..237c262 100644
--- a/fpdfsdk/fpdf_save.cpp
+++ b/fpdfsdk/fpdf_save.cpp
@@ -78,7 +78,7 @@
   if (!pArray)
     return false;
 
-  int size = pArray->GetCount();
+  int size = pArray->size();
   int iFormIndex = -1;
   int iDataSetsIndex = -1;
   int iLast = size - 2;
@@ -139,7 +139,7 @@
       } else {
         CPDF_Stream* pData = pPDFDocument->NewIndirect<CPDF_Stream>();
         pData->InitStreamFromFile(pDsfileWrite, std::move(pDataDict));
-        iLast = pArray->GetCount() - 2;
+        iLast = pArray->size() - 2;
         pArray->InsertNewAt<CPDF_String>(iLast, "datasets", false);
         pArray->InsertAt(iLast + 1, pData->MakeReference(pPDFDocument));
       }
@@ -164,7 +164,7 @@
       } else {
         CPDF_Stream* pData = pPDFDocument->NewIndirect<CPDF_Stream>();
         pData->InitStreamFromFile(pfileWrite, std::move(pDataDict));
-        iLast = pArray->GetCount() - 2;
+        iLast = pArray->size() - 2;
         pArray->InsertNewAt<CPDF_String>(iLast, "form", false);
         pArray->InsertAt(iLast + 1, pData->MakeReference(pPDFDocument));
       }
diff --git a/fpdfsdk/fpdf_view.cpp b/fpdfsdk/fpdf_view.cpp
index 247a902..83d7e4a 100644
--- a/fpdfsdk/fpdf_view.cpp
+++ b/fpdfsdk/fpdf_view.cpp
@@ -985,14 +985,14 @@
 FPDF_EXPORT size_t FPDF_CALLCONV
 FPDF_VIEWERREF_GetPrintPageRangeCount(FPDF_PAGERANGE pagerange) {
   const CPDF_Array* pArray = CPDFArrayFromFPDFPageRange(pagerange);
-  return pArray ? pArray->GetCount() : 0;
+  return pArray ? pArray->size() : 0;
 }
 
 FPDF_EXPORT int FPDF_CALLCONV
 FPDF_VIEWERREF_GetPrintPageRangeElement(FPDF_PAGERANGE pagerange,
                                         size_t index) {
   const CPDF_Array* pArray = CPDFArrayFromFPDFPageRange(pagerange);
-  if (!pArray || index >= pArray->GetCount())
+  if (!pArray || index >= pArray->size())
     return -1;
   return pArray->GetIntegerAt(index);
 }
@@ -1047,7 +1047,7 @@
   pdfium::base::CheckedNumeric<FPDF_DWORD> count = nameTree.GetCount();
   const CPDF_Dictionary* pDest = pRoot->GetDictFor("Dests");
   if (pDest)
-    count += pDest->GetCount();
+    count += pDest->size();
 
   if (!count.IsValid())
     return 0;
@@ -1145,7 +1145,7 @@
       return nullptr;
 
     pdfium::base::CheckedNumeric<int> checked_count = count;
-    checked_count += pDest->GetCount();
+    checked_count += pDest->size();
     if (!checked_count.IsValid() || index >= checked_count.ValueOrDie())
       return nullptr;
 
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
index 6cf4bff..e9cd2f6 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
@@ -467,7 +467,7 @@
     if (!pArray)
       return;
 
-    for (size_t i = 1; i < pArray->GetCount(); i += 2) {
+    for (size_t i = 1; i < pArray->size(); i += 2) {
       const CPDF_Object* pPDFObj = pArray->GetObjectAt(i);
       const CPDF_Object* pPrePDFObj = pArray->GetObjectAt(i - 1);
       if (!pPrePDFObj->IsString())
@@ -492,7 +492,7 @@
             fileWrite);
         continue;
       }
-      if (i == pArray->GetCount() - 1) {
+      if (i == pArray->size() - 1) {
         WideString wPath = WideString::FromUTF16LE(
             reinterpret_cast<const unsigned short*>(bs.c_str()),
             bs.GetLength() / sizeof(unsigned short));
@@ -763,7 +763,7 @@
     return false;
   }
 
-  for (size_t i = 1; i < pArray->GetCount(); i += 2) {
+  for (size_t i = 1; i < pArray->size(); i += 2) {
     const CPDF_Object* pPDFObj = pArray->GetObjectAt(i);
     const CPDF_Object* pPrePDFObj = pArray->GetObjectAt(i - 1);
     if (!pPrePDFObj->IsString())
diff --git a/fpdfsdk/pwl/cpwl_icon.cpp b/fpdfsdk/pwl/cpwl_icon.cpp
index f0232c4..407e866 100644
--- a/fpdfsdk/pwl/cpwl_icon.cpp
+++ b/fpdfsdk/pwl/cpwl_icon.cpp
@@ -55,7 +55,7 @@
   if (!pA)
     return {0.0f, 0.0f};
 
-  size_t dwCount = pA->GetCount();
+  size_t dwCount = pA->size();
   return {dwCount > 0 ? pA->GetNumberAt(0) : 0.0f,
           dwCount > 1 ? pA->GetNumberAt(1) : 0.0f};
 }
diff --git a/fxjs/cjs_document.cpp b/fxjs/cjs_document.cpp
index 7f81a37..9899deb 100644
--- a/fxjs/cjs_document.cpp
+++ b/fxjs/cjs_document.cpp
@@ -1443,7 +1443,7 @@
   const CPDF_Array* arrayObject = dest.GetArray();
   std::vector<float> scrollPositionArray;
   if (arrayObject) {
-    for (size_t i = 2; i < arrayObject->GetCount(); i++)
+    for (size_t i = 2; i < arrayObject->size(); i++)
       scrollPositionArray.push_back(arrayObject->GetFloatAt(i));
   }
   pRuntime->BeginBlock();
diff --git a/xfa/fxfa/cxfa_ffdoc.cpp b/xfa/fxfa/cxfa_ffdoc.cpp
index 47c8215..030883b 100644
--- a/xfa/fxfa/cxfa_ffdoc.cpp
+++ b/xfa/fxfa/cxfa_ffdoc.cpp
@@ -50,7 +50,7 @@
   std::vector<const CPDF_Stream*> xfaStreams;
   if (pElementXFA->IsArray()) {
     const CPDF_Array* pXFAArray = pElementXFA->AsArray();
-    for (size_t i = 0; i < pXFAArray->GetCount() / 2; i++) {
+    for (size_t i = 0; i < pXFAArray->size() / 2; i++) {
       if (const CPDF_Stream* pStream = pXFAArray->GetStreamAt(i * 2 + 1))
         xfaStreams.push_back(pStream);
     }