Add jumbo build support for fxbarcode.

BUG=pdfium:964

Change-Id: Ic306a374bc9b710e2ac043eebe43504e5bd75926
Reviewed-on: https://pdfium-review.googlesource.com/22870
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 3c32f3c..f4e5fe9 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1671,8 +1671,7 @@
     configs += [ ":pdfium_core_config" ]
   }
 
-  # TODO(crbug.com/pdfium/964): Support jumbo builds.
-  static_library("fxbarcode") {
+  jumbo_static_library("fxbarcode") {
     sources = [
       "fxbarcode/BC_Library.cpp",
       "fxbarcode/BC_Library.h",
diff --git a/fxbarcode/datamatrix/BC_C40Encoder.cpp b/fxbarcode/datamatrix/BC_C40Encoder.cpp
index 348315e..bb8b11c 100644
--- a/fxbarcode/datamatrix/BC_C40Encoder.cpp
+++ b/fxbarcode/datamatrix/BC_C40Encoder.cpp
@@ -31,7 +31,7 @@
 
 namespace {
 
-WideString EncodeToCodewords(const WideString& sb, int32_t startPos) {
+WideString EncodeToC40Codewords(const WideString& sb, int32_t startPos) {
   wchar_t c1 = sb[startPos];
   wchar_t c2 = sb[startPos + 1];
   wchar_t c3 = sb[startPos + 2];
@@ -99,7 +99,7 @@
 }
 void CBC_C40Encoder::writeNextTriplet(CBC_EncoderContext& context,
                                       WideString& buffer) {
-  context.writeCodewords(EncodeToCodewords(buffer, 0));
+  context.writeCodewords(EncodeToC40Codewords(buffer, 0));
   buffer.Delete(0, 3);
 }
 void CBC_C40Encoder::handleEOD(CBC_EncoderContext& context,
diff --git a/fxbarcode/datamatrix/BC_EdifactEncoder.cpp b/fxbarcode/datamatrix/BC_EdifactEncoder.cpp
index 438c87a..41180dc 100644
--- a/fxbarcode/datamatrix/BC_EdifactEncoder.cpp
+++ b/fxbarcode/datamatrix/BC_EdifactEncoder.cpp
@@ -33,7 +33,7 @@
 
 namespace {
 
-WideString EncodeToCodewords(const WideString& sb, int32_t startPos) {
+WideString EncodeToEdifactCodewords(const WideString& sb, int32_t startPos) {
   int32_t len = sb.GetLength() - startPos;
   if (len == 0)
     return WideString();
@@ -72,7 +72,7 @@
   }
 
   int32_t restChars = count - 1;
-  WideString encoded = EncodeToCodewords(buffer, 0);
+  WideString encoded = EncodeToEdifactCodewords(buffer, 0);
   if (encoded.IsEmpty())
     return false;
 
@@ -136,7 +136,7 @@
     context.m_pos++;
     int32_t count = buffer.GetLength();
     if (count >= 4) {
-      WideString encoded = EncodeToCodewords(buffer, 0);
+      WideString encoded = EncodeToEdifactCodewords(buffer, 0);
       if (encoded.IsEmpty()) {
         e = BCExceptionGeneric;
         return;
diff --git a/fxbarcode/oned/BC_OnedCodaBarWriter.cpp b/fxbarcode/oned/BC_OnedCodaBarWriter.cpp
index 791904d..3c3ea4a 100644
--- a/fxbarcode/oned/BC_OnedCodaBarWriter.cpp
+++ b/fxbarcode/oned/BC_OnedCodaBarWriter.cpp
@@ -30,9 +30,9 @@
 
 namespace {
 
-const char ALPHABET_STRING[] = "0123456789-$:/.+ABCDTN";
+const char kOnedCodaAlphabet[] = "0123456789-$:/.+ABCDTN";
 
-const int32_t CHARACTER_ENCODINGS[22] = {
+const int32_t kOnedCodaCharacterEncoding[22] = {
     0x003, 0x006, 0x009, 0x060, 0x012, 0x042, 0x021, 0x024,
     0x030, 0x048, 0x00c, 0x018, 0x045, 0x051, 0x054, 0x015,
     0x01A, 0x029, 0x00B, 0x00E, 0x01A, 0x029};
@@ -158,10 +158,10 @@
         break;
     }
     int32_t code = 0;
-    size_t len = strlen(ALPHABET_STRING);
+    size_t len = strlen(kOnedCodaAlphabet);
     for (size_t i = 0; i < len; i++) {
-      if (ch == ALPHABET_STRING[i]) {
-        code = CHARACTER_ENCODINGS[i];
+      if (ch == kOnedCodaAlphabet[i]) {
+        code = kOnedCodaCharacterEncoding[i];
         break;
       }
     }
diff --git a/fxbarcode/oned/BC_OnedCode39Writer.cpp b/fxbarcode/oned/BC_OnedCode39Writer.cpp
index 4f25eb1..f26ebc1 100644
--- a/fxbarcode/oned/BC_OnedCode39Writer.cpp
+++ b/fxbarcode/oned/BC_OnedCode39Writer.cpp
@@ -30,11 +30,13 @@
 
 namespace {
 
-const char ALPHABET_STRING[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%";
+const char kOnedCode39Alphabet[] =
+    "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%";
 
-const char CHECKSUM_STRING[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%";
+const char kOnedCode39Checksum[] =
+    "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%";
 
-const int32_t CHARACTER_ENCODINGS[44] = {
+const int32_t kOnedCode39CharacterEncoding[44] = {
     0x034, 0x121, 0x061, 0x160, 0x031, 0x130, 0x070, 0x025, 0x124,
     0x064, 0x109, 0x049, 0x148, 0x019, 0x118, 0x058, 0x00D, 0x10C,
     0x04C, 0x01C, 0x103, 0x043, 0x142, 0x013, 0x112, 0x052, 0x007,
@@ -141,11 +143,11 @@
     return '*';
 
   int32_t checksum = 0;
-  size_t len = strlen(ALPHABET_STRING);
+  size_t len = strlen(kOnedCode39Alphabet);
   for (const auto& c : contents) {
     size_t j = 0;
     for (; j < len; j++) {
-      if (ALPHABET_STRING[j] == c) {
+      if (kOnedCode39Alphabet[j] == c) {
         if (c != '*')
           checksum += j;
         break;
@@ -155,7 +157,7 @@
       return '*';
   }
   checksum = checksum % 43;
-  return CHECKSUM_STRING[checksum];
+  return kOnedCode39Checksum[checksum];
 }
 
 uint8_t* CBC_OnedCode39Writer::EncodeImpl(const ByteString& contents,
@@ -173,20 +175,20 @@
   m_iContentLen = encodedContents.GetLength();
   int32_t codeWidth = (wideStrideNum * m_iWideNarrRatio + narrStrideNum) * 2 +
                       1 + m_iContentLen;
-  size_t len = strlen(ALPHABET_STRING);
+  size_t len = strlen(kOnedCode39Alphabet);
   for (size_t j = 0; j < m_iContentLen; j++) {
     for (size_t i = 0; i < len; i++) {
-      if (ALPHABET_STRING[i] != encodedContents[j])
+      if (kOnedCode39Alphabet[i] != encodedContents[j])
         continue;
 
-      ToIntArray(CHARACTER_ENCODINGS[i], widths);
+      ToIntArray(kOnedCode39CharacterEncoding[i], widths);
       for (size_t k = 0; k < 9; k++)
         codeWidth += widths[k];
     }
   }
   outlength = codeWidth;
   std::unique_ptr<uint8_t, FxFreeDeleter> result(FX_Alloc(uint8_t, codeWidth));
-  ToIntArray(CHARACTER_ENCODINGS[39], widths);
+  ToIntArray(kOnedCode39CharacterEncoding[39], widths);
   int32_t e = BCExceptionNO;
   int32_t pos = AppendPattern(result.get(), 0, widths, 9, 1, e);
   if (e != BCExceptionNO)
@@ -199,10 +201,10 @@
 
   for (int32_t l = m_iContentLen - 1; l >= 0; l--) {
     for (size_t i = 0; i < len; i++) {
-      if (ALPHABET_STRING[i] != encodedContents[l])
+      if (kOnedCode39Alphabet[i] != encodedContents[l])
         continue;
 
-      ToIntArray(CHARACTER_ENCODINGS[i], widths);
+      ToIntArray(kOnedCode39CharacterEncoding[i], widths);
       pos += AppendPattern(result.get(), pos, widths, 9, 1, e);
       if (e != BCExceptionNO)
         return nullptr;
@@ -211,7 +213,7 @@
     if (e != BCExceptionNO)
       return nullptr;
   }
-  ToIntArray(CHARACTER_ENCODINGS[39], widths);
+  ToIntArray(kOnedCode39CharacterEncoding[39], widths);
   pos += AppendPattern(result.get(), pos, widths, 9, 1, e);
   if (e != BCExceptionNO)
     return nullptr;
diff --git a/fxbarcode/oned/BC_OnedEAN13Writer.cpp b/fxbarcode/oned/BC_OnedEAN13Writer.cpp
index daf53a8..a6315bc 100644
--- a/fxbarcode/oned/BC_OnedEAN13Writer.cpp
+++ b/fxbarcode/oned/BC_OnedEAN13Writer.cpp
@@ -35,11 +35,11 @@
 
 namespace {
 
-const int8_t FIRST_DIGIT_ENCODINGS[10] = {0x00, 0x0B, 0x0D, 0xE,  0x13,
-                                          0x19, 0x1C, 0x15, 0x16, 0x1A};
-const int8_t START_END_PATTERN[3] = {1, 1, 1};
-const int8_t MIDDLE_PATTERN[5] = {1, 1, 1, 1, 1};
-const int8_t L_PATTERNS[10][4] = {
+const int8_t kFirstDigitEncodings[10] = {0x00, 0x0B, 0x0D, 0xE,  0x13,
+                                         0x19, 0x1C, 0x15, 0x16, 0x1A};
+const int8_t kOnedEAN13StartPattern[3] = {1, 1, 1};
+const int8_t kOnedEAN13MiddlePattern[5] = {1, 1, 1, 1, 1};
+const int8_t kOnedEAN13LPattern[10][4] = {
     {3, 2, 1, 1}, {2, 2, 2, 1}, {2, 1, 2, 2}, {1, 4, 1, 1}, {1, 1, 3, 2},
     {1, 2, 3, 1}, {1, 1, 1, 4}, {1, 3, 1, 2}, {1, 2, 1, 3}, {3, 1, 1, 2}};
 const int8_t L_AND_G_PATTERNS[20][4] = {
@@ -98,13 +98,13 @@
 
   m_iDataLenth = 13;
   int32_t firstDigit = FXSYS_DecimalCharToInt(contents.First());
-  int32_t parities = FIRST_DIGIT_ENCODINGS[firstDigit];
+  int32_t parities = kFirstDigitEncodings[firstDigit];
   outLength = m_codeWidth;
   std::unique_ptr<uint8_t, FxFreeDeleter> result(
       FX_Alloc(uint8_t, m_codeWidth));
   int32_t pos = 0;
   int32_t e = BCExceptionNO;
-  pos += AppendPattern(result.get(), pos, START_END_PATTERN, 3, 1, e);
+  pos += AppendPattern(result.get(), pos, kOnedEAN13StartPattern, 3, 1, e);
   if (e != BCExceptionNO)
     return nullptr;
 
@@ -118,17 +118,17 @@
     if (e != BCExceptionNO)
       return nullptr;
   }
-  pos += AppendPattern(result.get(), pos, MIDDLE_PATTERN, 5, 0, e);
+  pos += AppendPattern(result.get(), pos, kOnedEAN13MiddlePattern, 5, 0, e);
   if (e != BCExceptionNO)
     return nullptr;
 
   for (i = 7; i <= 12; i++) {
     int32_t digit = FXSYS_DecimalCharToInt(contents[i]);
-    pos += AppendPattern(result.get(), pos, L_PATTERNS[digit], 4, 1, e);
+    pos += AppendPattern(result.get(), pos, kOnedEAN13LPattern[digit], 4, 1, e);
     if (e != BCExceptionNO)
       return nullptr;
   }
-  pos += AppendPattern(result.get(), pos, START_END_PATTERN, 3, 1, e);
+  pos += AppendPattern(result.get(), pos, kOnedEAN13StartPattern, 3, 1, e);
   if (e != BCExceptionNO)
     return nullptr;
   return result.release();
diff --git a/fxbarcode/oned/BC_OnedEAN8Writer.cpp b/fxbarcode/oned/BC_OnedEAN8Writer.cpp
index 865979c..988528e 100644
--- a/fxbarcode/oned/BC_OnedEAN8Writer.cpp
+++ b/fxbarcode/oned/BC_OnedEAN8Writer.cpp
@@ -36,9 +36,9 @@
 
 namespace {
 
-const int8_t START_END_PATTERN[3] = {1, 1, 1};
-const int8_t MIDDLE_PATTERN[5] = {1, 1, 1, 1, 1};
-const int8_t L_PATTERNS[10][4] = {
+const int8_t kOnedEAN8StartPattern[3] = {1, 1, 1};
+const int8_t kOnedEAN8MiddlePattern[5] = {1, 1, 1, 1, 1};
+const int8_t kOnedEAN8LPattern[10][4] = {
     {3, 2, 1, 1}, {2, 2, 2, 1}, {2, 1, 2, 2}, {1, 4, 1, 1}, {1, 1, 3, 2},
     {1, 2, 3, 1}, {1, 1, 1, 4}, {1, 3, 1, 2}, {1, 2, 1, 3}, {3, 1, 1, 2}};
 
@@ -108,28 +108,28 @@
       FX_Alloc(uint8_t, m_codeWidth));
   int32_t pos = 0;
   int32_t e = BCExceptionNO;
-  pos += AppendPattern(result.get(), pos, START_END_PATTERN, 3, 1, e);
+  pos += AppendPattern(result.get(), pos, kOnedEAN8StartPattern, 3, 1, e);
   if (e != BCExceptionNO)
     return nullptr;
 
   int32_t i = 0;
   for (i = 0; i <= 3; i++) {
     int32_t digit = FXSYS_DecimalCharToInt(contents[i]);
-    pos += AppendPattern(result.get(), pos, L_PATTERNS[digit], 4, 0, e);
+    pos += AppendPattern(result.get(), pos, kOnedEAN8LPattern[digit], 4, 0, e);
     if (e != BCExceptionNO)
       return nullptr;
   }
-  pos += AppendPattern(result.get(), pos, MIDDLE_PATTERN, 5, 0, e);
+  pos += AppendPattern(result.get(), pos, kOnedEAN8MiddlePattern, 5, 0, e);
   if (e != BCExceptionNO)
     return nullptr;
 
   for (i = 4; i <= 7; i++) {
     int32_t digit = FXSYS_DecimalCharToInt(contents[i]);
-    pos += AppendPattern(result.get(), pos, L_PATTERNS[digit], 4, 1, e);
+    pos += AppendPattern(result.get(), pos, kOnedEAN8LPattern[digit], 4, 1, e);
     if (e != BCExceptionNO)
       return nullptr;
   }
-  pos += AppendPattern(result.get(), pos, START_END_PATTERN, 3, 1, e);
+  pos += AppendPattern(result.get(), pos, kOnedEAN8StartPattern, 3, 1, e);
   if (e != BCExceptionNO)
     return nullptr;
   return result.release();