Switch CPDF_TextPage::m_CharIndices back to DataVector.

Utilize the newly added FX_DATA_PARTITION_EXCEPTION to do so. Although
the private struct type in CPDF_TextPage now has to be unnested.

Change-Id: I5ed7abc7270acf03b8120c8a492f024d3a0291c7
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/98370
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdftext/cpdf_textpage.h b/core/fpdftext/cpdf_textpage.h
index 17954ca..ec8ddee 100644
--- a/core/fpdftext/cpdf_textpage.h
+++ b/core/fpdftext/cpdf_textpage.h
@@ -14,7 +14,9 @@
 #include <vector>
 
 #include "core/fpdfapi/page/cpdf_pageobjectholder.h"
+#include "core/fxcrt/data_vector.h"
 #include "core/fxcrt/fx_coordinates.h"
+#include "core/fxcrt/fx_memory_wrappers.h"
 #include "core/fxcrt/unowned_ptr.h"
 #include "core/fxcrt/widestring.h"
 #include "core/fxcrt/widetext_buffer.h"
@@ -24,6 +26,13 @@
 class CPDF_Page;
 class CPDF_TextObject;
 
+struct TextPageCharSegment {
+  int index;
+  int count;
+};
+
+FX_DATA_PARTITION_EXCEPTION(TextPageCharSegment);
+
 class CPDF_TextPage {
  public:
   enum class CharType : uint8_t {
@@ -102,11 +111,6 @@
     CFX_Matrix m_formMatrix;
   };
 
-  struct CharSegment {
-    int index;
-    int count;
-  };
-
   void Init();
   bool IsHyphen(wchar_t curChar) const;
   void ProcessObject();
@@ -141,7 +145,7 @@
       const std::function<bool(const CharInfo&)>& predicate) const;
 
   UnownedPtr<const CPDF_Page> const m_pPage;
-  std::vector<CharSegment> m_CharIndices;
+  DataVector<TextPageCharSegment> m_CharIndices;
   std::deque<CharInfo> m_CharList;
   std::deque<CharInfo> m_TempCharList;
   WideTextBuffer m_TextBuf;