Replace FX_SAFE_STRSIZE with FX_SAFE_SIZE_T

BUG=pdfium:828

Change-Id: If9560338c456b28f968e743a90a3629791d87df0
Reviewed-on: https://pdfium-review.googlesource.com/14832
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
diff --git a/core/fxcrt/bytestring.cpp b/core/fxcrt/bytestring.cpp
index bd195dd..3079eb7 100644
--- a/core/fxcrt/bytestring.cpp
+++ b/core/fxcrt/bytestring.cpp
@@ -125,7 +125,7 @@
 }
 
 ByteString::ByteString(const ByteStringView& str1, const ByteStringView& str2) {
-  FX_SAFE_STRSIZE nSafeLen = str1.GetLength();
+  FX_SAFE_SIZE_T nSafeLen = str1.GetLength();
   nSafeLen += str2.GetLength();
 
   size_t nNewLen = nSafeLen.ValueOrDie();
@@ -139,7 +139,7 @@
 }
 
 ByteString::ByteString(const std::initializer_list<ByteStringView>& list) {
-  FX_SAFE_STRSIZE nSafeLen = 0;
+  FX_SAFE_SIZE_T nSafeLen = 0;
   for (const auto& item : list)
     nSafeLen += item.GetLength();
 
diff --git a/core/fxcrt/cfx_binarybuf.cpp b/core/fxcrt/cfx_binarybuf.cpp
index d1bd053..3673fa5 100644
--- a/core/fxcrt/cfx_binarybuf.cpp
+++ b/core/fxcrt/cfx_binarybuf.cpp
@@ -49,7 +49,7 @@
 }
 
 void CFX_BinaryBuf::ExpandBuf(size_t add_size) {
-  FX_SAFE_STRSIZE new_size = m_DataSize;
+  FX_SAFE_SIZE_T new_size = m_DataSize;
   new_size += add_size;
   if (m_AllocSize >= new_size.ValueOrDie())
     return;
diff --git a/core/fxcrt/fx_safe_types.h b/core/fxcrt/fx_safe_types.h
index aae6080..51eb89c 100644
--- a/core/fxcrt/fx_safe_types.h
+++ b/core/fxcrt/fx_safe_types.h
@@ -14,6 +14,5 @@
 typedef pdfium::base::CheckedNumeric<int32_t> FX_SAFE_INT32;
 typedef pdfium::base::CheckedNumeric<size_t> FX_SAFE_SIZE_T;
 typedef pdfium::base::CheckedNumeric<FX_FILESIZE> FX_SAFE_FILESIZE;
-typedef pdfium::base::CheckedNumeric<size_t> FX_SAFE_STRSIZE;
 
 #endif  // CORE_FXCRT_FX_SAFE_TYPES_H_
diff --git a/core/fxcrt/widestring.cpp b/core/fxcrt/widestring.cpp
index a4632ee..b9d6dc2 100644
--- a/core/fxcrt/widestring.cpp
+++ b/core/fxcrt/widestring.cpp
@@ -314,7 +314,7 @@
 }
 
 WideString::WideString(const WideStringView& str1, const WideStringView& str2) {
-  FX_SAFE_STRSIZE nSafeLen = str1.GetLength();
+  FX_SAFE_SIZE_T nSafeLen = str1.GetLength();
   nSafeLen += str2.GetLength();
 
   size_t nNewLen = nSafeLen.ValueOrDie();
@@ -328,7 +328,7 @@
 }
 
 WideString::WideString(const std::initializer_list<WideStringView>& list) {
-  FX_SAFE_STRSIZE nSafeLen = 0;
+  FX_SAFE_SIZE_T nSafeLen = 0;
   for (const auto& item : list)
     nSafeLen += item.GetLength();
 
diff --git a/core/fxcrt/xml/cfx_xmlsyntaxparser.cpp b/core/fxcrt/xml/cfx_xmlsyntaxparser.cpp
index 2d1d3d7..d72e7af 100644
--- a/core/fxcrt/xml/cfx_xmlsyntaxparser.cpp
+++ b/core/fxcrt/xml/cfx_xmlsyntaxparser.cpp
@@ -106,7 +106,7 @@
                pdfium::base::checked_cast<size_t>(m_pStream->GetLength()));
   m_iCurrentPos = m_pStream->GetBOMLength();
 
-  FX_SAFE_STRSIZE alloc_size_safe = m_iXMLPlaneSize;
+  FX_SAFE_SIZE_T alloc_size_safe = m_iXMLPlaneSize;
   alloc_size_safe += 1;  // For NUL.
   if (!alloc_size_safe.IsValid() || alloc_size_safe.ValueOrDie() <= 0) {
     m_syntaxParserResult = FX_XmlSyntaxResult::Error;
diff --git a/testing/libfuzzer/pdf_fm2js_fuzzer.cc b/testing/libfuzzer/pdf_fm2js_fuzzer.cc
index 438d102..c93804a 100644
--- a/testing/libfuzzer/pdf_fm2js_fuzzer.cc
+++ b/testing/libfuzzer/pdf_fm2js_fuzzer.cc
@@ -11,7 +11,7 @@
 #include "xfa/fxfa/fm2js/cxfa_fm2jscontext.h"
 
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
-  FX_SAFE_STRSIZE safe_size = size;
+  FX_SAFE_SIZE_T safe_size = size;
   if (!safe_size.IsValid())
     return 0;
 
diff --git a/testing/libfuzzer/pdf_xml_fuzzer.cc b/testing/libfuzzer/pdf_xml_fuzzer.cc
index 0c3cf4f..d8010f9 100644
--- a/testing/libfuzzer/pdf_xml_fuzzer.cc
+++ b/testing/libfuzzer/pdf_xml_fuzzer.cc
@@ -46,7 +46,7 @@
 }  // namespace
 
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
-  FX_SAFE_STRSIZE safe_size = size;
+  FX_SAFE_SIZE_T safe_size = size;
   if (!safe_size.IsValid())
     return 0;