Put remaining uint16_t vectors into data partition

Change-Id: Ief79d0bd497ca5d3ea535a91b05b931cb080a501
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/68871
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfapi/font/cfx_cttgsubtable.cpp b/core/fpdfapi/font/cfx_cttgsubtable.cpp
index 49f93dc..60223e4 100644
--- a/core/fpdfapi/font/cfx_cttgsubtable.cpp
+++ b/core/fpdfapi/font/cfx_cttgsubtable.cpp
@@ -200,7 +200,8 @@
   FT_Bytes sp = raw;
   rec->LookupOrder = GetUInt16(sp);
   rec->ReqFeatureIndex = GetUInt16(sp);
-  rec->FeatureIndices = std::vector<uint16_t>(GetUInt16(sp));
+  rec->FeatureIndices =
+      std::vector<uint16_t, FxAllocAllocator<uint16_t>>(GetUInt16(sp));
   for (auto& element : rec->FeatureIndices)
     element = GetUInt16(sp);
 }
@@ -217,7 +218,8 @@
 void CFX_CTTGSUBTable::ParseFeature(FT_Bytes raw, TFeatureRecord* rec) {
   FT_Bytes sp = raw;
   rec->FeatureParams = GetUInt16(sp);
-  rec->LookupListIndices = std::vector<uint16_t>(GetUInt16(sp));
+  rec->LookupListIndices =
+      std::vector<uint16_t, FxAllocAllocator<uint16_t>>(GetUInt16(sp));
   for (auto& listIndex : rec->LookupListIndices)
     listIndex = GetUInt16(sp);
 }
@@ -262,7 +264,8 @@
                                             TCoverageFormat1* rec) {
   FT_Bytes sp = raw;
   (void)GetUInt16(sp);
-  rec->GlyphArray = std::vector<uint16_t>(GetUInt16(sp));
+  rec->GlyphArray =
+      std::vector<uint16_t, FxAllocAllocator<uint16_t>>(GetUInt16(sp));
   for (auto& glyph : rec->GlyphArray)
     glyph = GetUInt16(sp);
 }
@@ -308,7 +311,8 @@
   (void)GetUInt16(sp);
   uint16_t offset = GetUInt16(sp);
   rec->Coverage = ParseCoverage(&raw[offset]);
-  rec->Substitutes = std::vector<uint16_t>(GetUInt16(sp));
+  rec->Substitutes =
+      std::vector<uint16_t, FxAllocAllocator<uint16_t>>(GetUInt16(sp));
   for (auto& substitute : rec->Substitutes)
     substitute = GetUInt16(sp);
 }
diff --git a/core/fpdfapi/font/cfx_cttgsubtable.h b/core/fpdfapi/font/cfx_cttgsubtable.h
index 54e16b4..8155b6c 100644
--- a/core/fpdfapi/font/cfx_cttgsubtable.h
+++ b/core/fpdfapi/font/cfx_cttgsubtable.h
@@ -13,6 +13,7 @@
 #include <set>
 #include <vector>
 
+#include "core/fxcrt/fx_memory_wrappers.h"
 #include "core/fxge/fx_freetype.h"
 
 class CFX_CTTGSUBTable {
@@ -30,7 +31,7 @@
     uint32_t LangSysTag;
     uint16_t LookupOrder;
     uint16_t ReqFeatureIndex;
-    std::vector<uint16_t> FeatureIndices;
+    std::vector<uint16_t, FxAllocAllocator<uint16_t>> FeatureIndices;
   };
 
   struct TScriptRecord {
@@ -48,7 +49,7 @@
 
     uint32_t FeatureTag;
     uint16_t FeatureParams;
-    std::vector<uint16_t> LookupListIndices;
+    std::vector<uint16_t, FxAllocAllocator<uint16_t>> LookupListIndices;
   };
 
   struct TRangeRecord {
@@ -68,7 +69,7 @@
     TCoverageFormat1();
     ~TCoverageFormat1() override;
 
-    std::vector<uint16_t> GlyphArray;
+    std::vector<uint16_t, FxAllocAllocator<uint16_t>> GlyphArray;
   };
 
   struct TCoverageFormat2 final : public TCoverageFormatBase {
@@ -105,7 +106,7 @@
     TSubTable2();
     ~TSubTable2() override;
 
-    std::vector<uint16_t> Substitutes;
+    std::vector<uint16_t, FxAllocAllocator<uint16_t>> Substitutes;
   };
 
   struct TLookup {
diff --git a/core/fpdfapi/font/cpdf_cmap.h b/core/fpdfapi/font/cpdf_cmap.h
index e2caf8d..ac9ecff 100644
--- a/core/fpdfapi/font/cpdf_cmap.h
+++ b/core/fpdfapi/font/cpdf_cmap.h
@@ -10,6 +10,7 @@
 #include <vector>
 
 #include "core/fpdfapi/font/cpdf_cidfont.h"
+#include "core/fxcrt/fx_memory_wrappers.h"
 #include "core/fxcrt/retain_ptr.h"
 #include "third_party/base/span.h"
 
@@ -89,7 +90,7 @@
   int m_Coding = CIDCODING_UNKNOWN;
   std::vector<bool> m_MixedTwoByteLeadingBytes;
   std::vector<CodeRange> m_MixedFourByteLeadingRanges;
-  std::vector<uint16_t> m_DirectCharcodeToCIDTable;
+  std::vector<uint16_t, FxAllocAllocator<uint16_t>> m_DirectCharcodeToCIDTable;
   std::vector<CIDRange> m_AdditionalCharcodeToCIDMappings;
   UnownedPtr<const FXCMAP_CMap> m_pEmbedMap;
 };
diff --git a/core/fpdftext/cpdf_textpage.h b/core/fpdftext/cpdf_textpage.h
index 20da8f5..1fb187d 100644
--- a/core/fpdftext/cpdf_textpage.h
+++ b/core/fpdftext/cpdf_textpage.h
@@ -14,6 +14,7 @@
 #include "core/fpdfapi/page/cpdf_pageobjectholder.h"
 #include "core/fxcrt/cfx_widetextbuf.h"
 #include "core/fxcrt/fx_coordinates.h"
+#include "core/fxcrt/fx_memory_wrappers.h"
 #include "core/fxcrt/fx_string.h"
 #include "core/fxcrt/unowned_ptr.h"
 #include "third_party/base/optional.h"
@@ -134,7 +135,7 @@
       const std::function<bool(const CharInfo&)>& predicate) const;
 
   UnownedPtr<const CPDF_Page> const m_pPage;
-  std::vector<uint16_t> m_CharIndices;
+  std::vector<uint16_t, FxAllocAllocator<uint16_t>> m_CharIndices;
   std::deque<CharInfo> m_CharList;
   std::deque<CharInfo> m_TempCharList;
   CFX_WideTextBuf m_TextBuf;
diff --git a/core/fxge/apple/fx_apple_platform.cpp b/core/fxge/apple/fx_apple_platform.cpp
index f87c3dd..04dc9e3 100644
--- a/core/fxge/apple/fx_apple_platform.cpp
+++ b/core/fxge/apple/fx_apple_platform.cpp
@@ -7,6 +7,7 @@
 #include <memory>
 #include <vector>
 
+#include "core/fxcrt/fx_memory_wrappers.h"
 #include "core/fxcrt/fx_system.h"
 #include "core/fxge/apple/fx_mac_impl.h"
 #include "core/fxge/cfx_cliprgn.h"
@@ -58,7 +59,7 @@
     if (!pFont->GetPlatformFont())
       return false;
   }
-  std::vector<uint16_t> glyph_indices(nChars);
+  std::vector<uint16_t, FxAllocAllocator<uint16_t>> glyph_indices(nChars);
   std::vector<CGPoint> glyph_positions(nChars);
   for (int i = 0; i < nChars; i++) {
     glyph_indices[i] =
diff --git a/fxbarcode/datamatrix/BC_ErrorCorrection.cpp b/fxbarcode/datamatrix/BC_ErrorCorrection.cpp
index 9c6ff7d..6d660c7 100644
--- a/fxbarcode/datamatrix/BC_ErrorCorrection.cpp
+++ b/fxbarcode/datamatrix/BC_ErrorCorrection.cpp
@@ -25,6 +25,7 @@
 #include <algorithm>
 #include <vector>
 
+#include "core/fxcrt/fx_memory_wrappers.h"
 #include "fxbarcode/datamatrix/BC_Encoder.h"
 #include "fxbarcode/datamatrix/BC_SymbolInfo.h"
 
@@ -152,7 +153,7 @@
   if (table >= kFactorTableNum)
     return WideString();
 
-  std::vector<uint16_t> ecc(numECWords);
+  std::vector<uint16_t, FxAllocAllocator<uint16_t>> ecc(numECWords);
   for (size_t i = 0; i < len; ++i) {
     uint16_t m = ecc[numECWords - 1] ^ codewords[i];
     for (int32_t j = numECWords - 1; j > 0; --j) {