Rename Jbig2Module to Jbig2Decoder.

Change-Id: I0c071931ca3eeb175499f4939e60a811f7064e52
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/69915
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/page/cpdf_dib.cpp b/core/fpdfapi/page/cpdf_dib.cpp
index f3ea222..a72ac5f 100644
--- a/core/fpdfapi/page/cpdf_dib.cpp
+++ b/core/fpdfapi/page/cpdf_dib.cpp
@@ -26,7 +26,7 @@
 #include "core/fpdfapi/parser/fpdf_parser_utility.h"
 #include "core/fxcodec/basic/basicmodule.h"
 #include "core/fxcodec/fx_codec.h"
-#include "core/fxcodec/jbig2/jbig2module.h"
+#include "core/fxcodec/jbig2/jbig2_decoder.h"
 #include "core/fxcodec/jpeg/jpegmodule.h"
 #include "core/fxcodec/jpx/cjpx_decoder.h"
 #include "core/fxcodec/scanlinedecoder.h"
@@ -347,12 +347,12 @@
       if (m_pGlobalAcc->GetStream())
         nGlobalObjNum = m_pGlobalAcc->GetStream()->GetObjNum();
     }
-    iDecodeStatus = Jbig2Module::StartDecode(
+    iDecodeStatus = Jbig2Decoder::StartDecode(
         m_pJbig2Context.get(), m_pDocument->CodecContext(), m_Width, m_Height,
         pSrcSpan, nSrcObjNum, pGlobalSpan, nGlobalObjNum,
         m_pCachedBitmap->GetBuffer(), m_pCachedBitmap->GetPitch(), pPause);
   } else {
-    iDecodeStatus = Jbig2Module::ContinueDecode(m_pJbig2Context.get(), pPause);
+    iDecodeStatus = Jbig2Decoder::ContinueDecode(m_pJbig2Context.get(), pPause);
   }
 
   if (iDecodeStatus < 0) {
diff --git a/core/fxcodec/BUILD.gn b/core/fxcodec/BUILD.gn
index 99122f1..41270b4 100644
--- a/core/fxcodec/BUILD.gn
+++ b/core/fxcodec/BUILD.gn
@@ -56,8 +56,8 @@
     "jbig2/JBig2_SymbolDict.h",
     "jbig2/JBig2_TrdProc.cpp",
     "jbig2/JBig2_TrdProc.h",
-    "jbig2/jbig2module.cpp",
-    "jbig2/jbig2module.h",
+    "jbig2/jbig2_decoder.cpp",
+    "jbig2/jbig2_decoder.h",
     "jpeg/jpeg_common.cpp",
     "jpeg/jpeg_common.h",
     "jpeg/jpegmodule.cpp",
diff --git a/core/fxcodec/jbig2/jbig2module.cpp b/core/fxcodec/jbig2/jbig2_decoder.cpp
similarity index 91%
rename from core/fxcodec/jbig2/jbig2module.cpp
rename to core/fxcodec/jbig2/jbig2_decoder.cpp
index 46413ed..3c10cc4 100644
--- a/core/fxcodec/jbig2/jbig2module.cpp
+++ b/core/fxcodec/jbig2/jbig2_decoder.cpp
@@ -4,7 +4,7 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#include "core/fxcodec/jbig2/jbig2module.h"
+#include "core/fxcodec/jbig2/jbig2_decoder.h"
 
 #include "core/fxcodec/jbig2/JBig2_Context.h"
 #include "core/fxcodec/jbig2/JBig2_DocumentContext.h"
@@ -44,7 +44,7 @@
 Jbig2Context::~Jbig2Context() = default;
 
 // static
-FXCODEC_STATUS Jbig2Module::StartDecode(
+FXCODEC_STATUS Jbig2Decoder::StartDecode(
     Jbig2Context* pJbig2Context,
     std::unique_ptr<JBig2_DocumentContext>* pContextHolder,
     uint32_t width,
@@ -78,8 +78,8 @@
 }
 
 // static
-FXCODEC_STATUS Jbig2Module::ContinueDecode(Jbig2Context* pJbig2Context,
-                                           PauseIndicatorIface* pPause) {
+FXCODEC_STATUS Jbig2Decoder::ContinueDecode(Jbig2Context* pJbig2Context,
+                                            PauseIndicatorIface* pPause) {
   bool succeeded = pJbig2Context->m_pContext->Continue(pPause);
   return Decode(pJbig2Context, succeeded);
 }
diff --git a/core/fxcodec/jbig2/jbig2module.h b/core/fxcodec/jbig2/jbig2_decoder.h
similarity index 81%
rename from core/fxcodec/jbig2/jbig2module.h
rename to core/fxcodec/jbig2/jbig2_decoder.h
index c253a9a..97867ca 100644
--- a/core/fxcodec/jbig2/jbig2module.h
+++ b/core/fxcodec/jbig2/jbig2_decoder.h
@@ -4,8 +4,8 @@
 
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
 
-#ifndef CORE_FXCODEC_JBIG2_JBIG2MODULE_H_
-#define CORE_FXCODEC_JBIG2_JBIG2MODULE_H_
+#ifndef CORE_FXCODEC_JBIG2_JBIG2_DECODER_H_
+#define CORE_FXCODEC_JBIG2_JBIG2_DECODER_H_
 
 #include <memory>
 
@@ -35,7 +35,7 @@
   std::unique_ptr<CJBig2_Context> m_pContext;
 };
 
-class Jbig2Module {
+class Jbig2Decoder {
  public:
   static FXCODEC_STATUS StartDecode(
       Jbig2Context* pJbig2Context,
@@ -53,14 +53,14 @@
   static FXCODEC_STATUS ContinueDecode(Jbig2Context* pJbig2Context,
                                        PauseIndicatorIface* pPause);
 
-  Jbig2Module() = delete;
-  Jbig2Module(const Jbig2Module&) = delete;
-  Jbig2Module& operator=(const Jbig2Module&) = delete;
+  Jbig2Decoder() = delete;
+  Jbig2Decoder(const Jbig2Decoder&) = delete;
+  Jbig2Decoder& operator=(const Jbig2Decoder&) = delete;
 };
 
 }  // namespace fxcodec
 
 using Jbig2Context = fxcodec::Jbig2Context;
-using Jbig2Module = fxcodec::Jbig2Module;
+using Jbig2Decoder = fxcodec::Jbig2Decoder;
 
-#endif  // CORE_FXCODEC_JBIG2_JBIG2MODULE_H_
+#endif  // CORE_FXCODEC_JBIG2_JBIG2_DECODER_H_
diff --git a/testing/fuzzers/pdf_codec_jbig2_fuzzer.cc b/testing/fuzzers/pdf_codec_jbig2_fuzzer.cc
index ac24dfd..659a375 100644
--- a/testing/fuzzers/pdf_codec_jbig2_fuzzer.cc
+++ b/testing/fuzzers/pdf_codec_jbig2_fuzzer.cc
@@ -6,7 +6,7 @@
 
 #include "core/fxcodec/jbig2/JBig2_Context.h"
 #include "core/fxcodec/jbig2/JBig2_DocumentContext.h"
-#include "core/fxcodec/jbig2/jbig2module.h"
+#include "core/fxcodec/jbig2/jbig2_decoder.h"
 #include "core/fxcrt/fx_safe_types.h"
 #include "core/fxge/dib/cfx_dibitmap.h"
 #include "core/fxge/fx_dib.h"
@@ -37,11 +37,11 @@
 
   Jbig2Context jbig2_context;
   std::unique_ptr<JBig2_DocumentContext> document_context;
-  FXCODEC_STATUS status = Jbig2Module::StartDecode(
+  FXCODEC_STATUS status = Jbig2Decoder::StartDecode(
       &jbig2_context, &document_context, width, height, {data, size}, 1, {}, 0,
       bitmap->GetBuffer(), bitmap->GetPitch(), nullptr);
 
   while (status == FXCODEC_STATUS_DECODE_TOBECONTINUE)
-    status = Jbig2Module::ContinueDecode(&jbig2_context, nullptr);
+    status = Jbig2Decoder::ContinueDecode(&jbig2_context, nullptr);
   return 0;
 }