Rename CCodec_TiffModule to fxcodec::TiffModule.

BUG=pdfium:1311

Change-Id: Ifcf798ee123e382efadc7bf05854454edaaadfd7
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/55813
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxcodec/BUILD.gn b/core/fxcodec/BUILD.gn
index 936e13b..f31a0ef 100644
--- a/core/fxcodec/BUILD.gn
+++ b/core/fxcodec/BUILD.gn
@@ -118,8 +118,8 @@
     }
     if (pdf_enable_xfa_tiff) {
       sources += [
-        "codec/ccodec_tiffmodule.cpp",
-        "codec/ccodec_tiffmodule.h",
+        "codec/tiffmodule.cpp",
+        "codec/tiffmodule.h",
       ]
       deps += [ "../../third_party:fx_tiff" ]
     }
diff --git a/core/fxcodec/codec/ccodec_progressivedecoder.cpp b/core/fxcodec/codec/ccodec_progressivedecoder.cpp
index b2af93c..01125bb 100644
--- a/core/fxcodec/codec/ccodec_progressivedecoder.cpp
+++ b/core/fxcodec/codec/ccodec_progressivedecoder.cpp
@@ -1379,7 +1379,7 @@
 #ifdef PDF_ENABLE_XFA_TIFF
 bool CCodec_ProgressiveDecoder::TiffDetectImageTypeFromFile(
     CFX_DIBAttribute* pAttribute) {
-  CCodec_TiffModule* pTiffModule = m_pCodecMgr->GetTiffModule();
+  TiffModule* pTiffModule = m_pCodecMgr->GetTiffModule();
   if (!pTiffModule) {
     m_status = FXCODEC_STATUS_ERR_FORMAT;
     return false;
@@ -1404,7 +1404,7 @@
 }
 
 FXCODEC_STATUS CCodec_ProgressiveDecoder::TiffContinueDecode() {
-  CCodec_TiffModule* pTiffModule = m_pCodecMgr->GetTiffModule();
+  TiffModule* pTiffModule = m_pCodecMgr->GetTiffModule();
   if (!pTiffModule) {
     m_status = FXCODEC_STATUS_ERR_MEMORY;
     return m_status;
diff --git a/core/fxcodec/codec/ccodec_progressivedecoder.h b/core/fxcodec/codec/ccodec_progressivedecoder.h
index ab91bb1..f148f4a 100644
--- a/core/fxcodec/codec/ccodec_progressivedecoder.h
+++ b/core/fxcodec/codec/ccodec_progressivedecoder.h
@@ -31,7 +31,7 @@
 #endif  // PDF_ENABLE_XFA_PNG
 
 #ifdef PDF_ENABLE_XFA_TIFF
-#include "core/fxcodec/codec/ccodec_tiffmodule.h"
+#include "core/fxcodec/codec/tiffmodule.h"
 #endif  // PDF_ENABLE_XFA_TIFF
 
 class CCodec_ModuleMgr;
diff --git a/core/fxcodec/codec/fx_codec.cpp b/core/fxcodec/codec/fx_codec.cpp
index 3748267..0284cb5 100644
--- a/core/fxcodec/codec/fx_codec.cpp
+++ b/core/fxcodec/codec/fx_codec.cpp
@@ -60,7 +60,7 @@
 #endif
 
 #ifdef PDF_ENABLE_XFA_TIFF
-  SetTiffModule(pdfium::MakeUnique<CCodec_TiffModule>());
+  SetTiffModule(pdfium::MakeUnique<TiffModule>());
 #endif
 }
 
diff --git a/core/fxcodec/codec/ccodec_tiffmodule.cpp b/core/fxcodec/codec/tiffmodule.cpp
similarity index 94%
rename from core/fxcodec/codec/ccodec_tiffmodule.cpp
rename to core/fxcodec/codec/tiffmodule.cpp
index b39a9be..d23ef7d 100644
--- a/core/fxcodec/codec/ccodec_tiffmodule.cpp
+++ b/core/fxcodec/codec/tiffmodule.cpp
@@ -4,7 +4,7 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "core/fxcodec/codec/ccodec_tiffmodule.h"
+#include "core/fxcodec/codec/tiffmodule.h"
 
 #include <limits>
 #include <memory>
@@ -486,7 +486,9 @@
   return false;
 }
 
-std::unique_ptr<CodecModuleIface::Context> CCodec_TiffModule::CreateDecoder(
+namespace fxcodec {
+
+std::unique_ptr<CodecModuleIface::Context> TiffModule::CreateDecoder(
     const RetainPtr<IFX_SeekableReadStream>& file_ptr) {
   auto pDecoder = pdfium::MakeUnique<CTiffContext>();
   if (!pDecoder->InitDecoder(file_ptr))
@@ -495,33 +497,35 @@
   return pDecoder;
 }
 
-FX_FILESIZE CCodec_TiffModule::GetAvailInput(Context* pContext) const {
+FX_FILESIZE TiffModule::GetAvailInput(Context* pContext) const {
   NOTREACHED();
   return 0;
 }
 
-bool CCodec_TiffModule::Input(Context* pContext,
-                              RetainPtr<CFX_CodecMemory> codec_memory,
-                              CFX_DIBAttribute*) {
+bool TiffModule::Input(Context* pContext,
+                       RetainPtr<CFX_CodecMemory> codec_memory,
+                       CFX_DIBAttribute*) {
   NOTREACHED();
   return false;
 }
 
-bool CCodec_TiffModule::LoadFrameInfo(Context* pContext,
-                                      int32_t frame,
-                                      int32_t* width,
-                                      int32_t* height,
-                                      int32_t* comps,
-                                      int32_t* bpc,
-                                      CFX_DIBAttribute* pAttribute) {
+bool TiffModule::LoadFrameInfo(Context* pContext,
+                               int32_t frame,
+                               int32_t* width,
+                               int32_t* height,
+                               int32_t* comps,
+                               int32_t* bpc,
+                               CFX_DIBAttribute* pAttribute) {
   ASSERT(pAttribute);
 
   auto* ctx = static_cast<CTiffContext*>(pContext);
   return ctx->LoadFrameInfo(frame, width, height, comps, bpc, pAttribute);
 }
 
-bool CCodec_TiffModule::Decode(Context* pContext,
-                               const RetainPtr<CFX_DIBitmap>& pDIBitmap) {
+bool TiffModule::Decode(Context* pContext,
+                        const RetainPtr<CFX_DIBitmap>& pDIBitmap) {
   auto* ctx = static_cast<CTiffContext*>(pContext);
   return ctx->Decode(pDIBitmap);
 }
+
+}  // namespace fxcodec
diff --git a/core/fxcodec/codec/ccodec_tiffmodule.h b/core/fxcodec/codec/tiffmodule.h
similarity index 80%
rename from core/fxcodec/codec/ccodec_tiffmodule.h
rename to core/fxcodec/codec/tiffmodule.h
index 1306e18..71d69c5 100644
--- a/core/fxcodec/codec/ccodec_tiffmodule.h
+++ b/core/fxcodec/codec/tiffmodule.h
@@ -4,8 +4,8 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef CORE_FXCODEC_CODEC_CCODEC_TIFFMODULE_H_
-#define CORE_FXCODEC_CODEC_CCODEC_TIFFMODULE_H_
+#ifndef CORE_FXCODEC_CODEC_TIFFMODULE_H_
+#define CORE_FXCODEC_CODEC_TIFFMODULE_H_
 
 #include <memory>
 
@@ -15,7 +15,9 @@
 class CFX_DIBitmap;
 class IFX_SeekableReadStream;
 
-class CCodec_TiffModule final : public CodecModuleIface {
+namespace fxcodec {
+
+class TiffModule final : public CodecModuleIface {
  public:
   std::unique_ptr<Context> CreateDecoder(
       const RetainPtr<IFX_SeekableReadStream>& file_ptr);
@@ -36,4 +38,8 @@
   bool Decode(Context* ctx, const RetainPtr<CFX_DIBitmap>& pDIBitmap);
 };
 
-#endif  // CORE_FXCODEC_CODEC_CCODEC_TIFFMODULE_H_
+}  // namespace fxcodec
+
+using TiffModule = fxcodec::TiffModule;
+
+#endif  // CORE_FXCODEC_CODEC_TIFFMODULE_H_
diff --git a/core/fxcodec/fx_codec.h b/core/fxcodec/fx_codec.h
index 1d4a9c6..3fc46aa 100644
--- a/core/fxcodec/fx_codec.h
+++ b/core/fxcodec/fx_codec.h
@@ -30,7 +30,7 @@
 #endif  // PDF_ENABLE_XFA_PNG
 
 #ifdef PDF_ENABLE_XFA_TIFF
-#include "core/fxcodec/codec/ccodec_tiffmodule.h"
+#include "core/fxcodec/codec/tiffmodule.h"
 #endif  // PDF_ENABLE_XFA_TIFF
 #endif  // PDF_ENABLE_XFA
 
@@ -87,8 +87,8 @@
 #endif  // PDF_ENABLE_XFA_PNG
 
 #ifdef PDF_ENABLE_XFA_TIFF
-  CCodec_TiffModule* GetTiffModule() const { return m_pTiffModule.get(); }
-  void SetTiffModule(std::unique_ptr<CCodec_TiffModule> module) {
+  TiffModule* GetTiffModule() const { return m_pTiffModule.get(); }
+  void SetTiffModule(std::unique_ptr<TiffModule> module) {
     m_pTiffModule = std::move(module);
   }
 #endif  // PDF_ENABLE_XFA_TIFF
@@ -115,7 +115,7 @@
 #endif  // PDF_ENABLE_XFA_PNG
 
 #ifdef PDF_ENABLE_XFA_TIFF
-  std::unique_ptr<CCodec_TiffModule> m_pTiffModule;
+  std::unique_ptr<TiffModule> m_pTiffModule;
 #endif  // PDF_ENABLE_XFA_TIFF
 #endif  // PDF_ENABLE_XFA
 };
diff --git a/third_party/libtiff/0006-HeapBufferOverflow-ChopUpSingleUncompressedStrip.patch b/third_party/libtiff/0006-HeapBufferOverflow-ChopUpSingleUncompressedStrip.patch
index 5d44fb1..9ef4749 100644
--- a/third_party/libtiff/0006-HeapBufferOverflow-ChopUpSingleUncompressedStrip.patch
+++ b/third_party/libtiff/0006-HeapBufferOverflow-ChopUpSingleUncompressedStrip.patch
@@ -1,7 +1,7 @@
-diff --git a/core/fxcodec/codec/ccodec_tiffmodule.cpp b/core/fxcodec/codec/ccodec_tiffmodule.cpp
+diff --git a/core/fxcodec/codec/tiffmodule.cpp b/core/fxcodec/codec/tiffmodule.cpp
 index 09cfea4..20fda63 100644
---- a/core/fxcodec/codec/ccodec_tiffmodule.cpp
-+++ b/core/fxcodec/codec/ccodec_tiffmodule.cpp
+--- a/core/fxcodec/codec/tiffmodule.cpp
++++ b/core/fxcodec/codec/tiffmodule.cpp
 @@ -79,6 +79,10 @@ int _TIFFmemcmp(const void* ptr1, const void* ptr2, tmsize_t size) {
    return memcmp(ptr1, ptr2, (size_t)size);
  }