Replace pdfium::nullopt with absl::nullopt.

Just search and replace. Then delete unused using statements from
third_party/base/optional.h.

Bug: pdfium:1726
Change-Id: Ia25c974142c37956e8fb41c200736633d6769785
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/85515
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/font/cfx_cttgsubtable.cpp b/core/fpdfapi/font/cfx_cttgsubtable.cpp
index f79484f..b948e60 100644
--- a/core/fpdfapi/font/cfx_cttgsubtable.cpp
+++ b/core/fpdfapi/font/cfx_cttgsubtable.cpp
@@ -81,7 +81,7 @@
     if (result.has_value())
       return result.value();
   }
-  return pdfium::nullopt;
+  return absl::nullopt;
 }
 
 Optional<uint32_t> CFX_CTTGSUBTable::GetVerticalGlyphSub2(
@@ -106,7 +106,7 @@
       }
     }
   }
-  return pdfium::nullopt;
+  return absl::nullopt;
 }
 
 int CFX_CTTGSUBTable::GetCoverageIndex(TCoverageFormatBase* Coverage,
diff --git a/core/fpdfapi/font/cpdf_cmapparser.cpp b/core/fpdfapi/font/cpdf_cmapparser.cpp
index fb3810a..706903e8 100644
--- a/core/fpdfapi/font/cpdf_cmapparser.cpp
+++ b/core/fpdfapi/font/cpdf_cmapparser.cpp
@@ -168,7 +168,7 @@
     ByteStringView first,
     ByteStringView second) {
   if (first.IsEmpty() || first[0] != '<')
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   size_t i;
   for (i = 1; i < first.GetLength(); ++i) {
@@ -177,7 +177,7 @@
   }
   size_t char_size = (i - 1) / 2;
   if (char_size > 4)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   CPDF_CMap::CodeRange range;
   range.m_CharSize = char_size;
diff --git a/core/fpdfapi/font/cpdf_tounicodemap.cpp b/core/fpdfapi/font/cpdf_tounicodemap.cpp
index 26bb35c..d2dcb73 100644
--- a/core/fpdfapi/font/cpdf_tounicodemap.cpp
+++ b/core/fpdfapi/font/cpdf_tounicodemap.cpp
@@ -75,16 +75,16 @@
 Optional<uint32_t> CPDF_ToUnicodeMap::StringToCode(ByteStringView str) {
   size_t len = str.GetLength();
   if (len <= 2 || str[0] != '<' || str[len - 1] != '>')
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   FX_SAFE_UINT32 code = 0;
   for (char c : str.Substr(1, len - 2)) {
     if (!FXSYS_IsHexDigit(c))
-      return pdfium::nullopt;
+      return absl::nullopt;
 
     code = code * 16 + FXSYS_HexCharToInt(c);
     if (!code.IsValid())
-      return pdfium::nullopt;
+      return absl::nullopt;
   }
   return Optional<uint32_t>(code.ValueOrDie());
 }
diff --git a/core/fpdfapi/page/cpdf_form.cpp b/core/fpdfapi/page/cpdf_form.cpp
index 3562208..9d95c4d 100644
--- a/core/fpdfapi/page/cpdf_form.cpp
+++ b/core/fpdfapi/page/cpdf_form.cpp
@@ -109,11 +109,11 @@
 Optional<std::pair<RetainPtr<CFX_DIBitmap>, CFX_Matrix>>
 CPDF_Form::GetBitmapAndMatrixFromSoleImageOfForm() const {
   if (GetPageObjectCount() != 1)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   CPDF_ImageObject* pImageObject = (*begin())->AsImage();
   if (!pImageObject)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   return {{pImageObject->GetIndependentBitmap(), pImageObject->matrix()}};
 }
diff --git a/core/fpdfapi/page/cpdf_function.cpp b/core/fpdfapi/page/cpdf_function.cpp
index 77cdb1e..da75360 100644
--- a/core/fpdfapi/page/cpdf_function.cpp
+++ b/core/fpdfapi/page/cpdf_function.cpp
@@ -129,19 +129,19 @@
 Optional<uint32_t> CPDF_Function::Call(pdfium::span<const float> inputs,
                                        pdfium::span<float> results) const {
   if (m_nInputs != inputs.size())
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   std::vector<float> clamped_inputs(m_nInputs);
   for (uint32_t i = 0; i < m_nInputs; i++) {
     float domain1 = m_Domains[i * 2];
     float domain2 = m_Domains[i * 2 + 1];
     if (domain1 > domain2)
-      return pdfium::nullopt;
+      return absl::nullopt;
 
     clamped_inputs[i] = pdfium::clamp(inputs[i], domain1, domain2);
   }
   if (!v_Call(clamped_inputs, results))
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   if (m_Ranges.empty())
     return m_nOutputs;
@@ -150,7 +150,7 @@
     float range1 = m_Ranges[i * 2];
     float range2 = m_Ranges[i * 2 + 1];
     if (range1 > range2)
-      return pdfium::nullopt;
+      return absl::nullopt;
 
     results[i] = pdfium::clamp(results[i], range1, range2);
   }
diff --git a/core/fpdfapi/page/cpdf_pageobjectholder.cpp b/core/fpdfapi/page/cpdf_pageobjectholder.cpp
index 3cb302c..4e9563a 100644
--- a/core/fpdfapi/page/cpdf_pageobjectholder.cpp
+++ b/core/fpdfapi/page/cpdf_pageobjectholder.cpp
@@ -88,7 +88,7 @@
     const GraphicsData& gd) {
   auto it = m_GraphicsMap.find(gd);
   if (it == m_GraphicsMap.end())
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   return it->second;
 }
@@ -101,7 +101,7 @@
 Optional<ByteString> CPDF_PageObjectHolder::FontsMapSearch(const FontData& fd) {
   auto it = m_FontsMap.find(fd);
   if (it == m_FontsMap.end())
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   return it->second;
 }
diff --git a/core/fpdfapi/parser/fpdf_parser_decode.cpp b/core/fpdfapi/parser/fpdf_parser_decode.cpp
index 8c2dc7a..632ebfa 100644
--- a/core/fpdfapi/parser/fpdf_parser_decode.cpp
+++ b/core/fpdfapi/parser/fpdf_parser_decode.cpp
@@ -372,7 +372,7 @@
     return DecoderArray();
 
   if (!pFilter->IsArray() && !pFilter->IsName())
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   const CPDF_Object* pParams =
       pDict->GetDirectObjectFor(pdfium::stream::kDecodeParms);
@@ -380,7 +380,7 @@
   DecoderArray decoder_array;
   if (const CPDF_Array* pDecoders = pFilter->AsArray()) {
     if (!ValidateDecoderPipeline(pDecoders))
-      return pdfium::nullopt;
+      return absl::nullopt;
 
     const CPDF_Array* pParamsArray = ToArray(pParams);
     for (size_t i = 0; i < pDecoders->size(); ++i) {
diff --git a/core/fpdfapi/parser/fpdf_parser_decode.h b/core/fpdfapi/parser/fpdf_parser_decode.h
index 8204ad8..f16e53a 100644
--- a/core/fpdfapi/parser/fpdf_parser_decode.h
+++ b/core/fpdfapi/parser/fpdf_parser_decode.h
@@ -76,7 +76,7 @@
                           std::unique_ptr<uint8_t, FxFreeDeleter>* dest_buf,
                           uint32_t* dest_size);
 
-// Returns pdfium::nullopt if the filter in |pDict| is the wrong type or an
+// Returns absl::nullopt if the filter in |pDict| is the wrong type or an
 // invalid decoder pipeline.
 // Returns an empty vector if there is no filter, or if the filter is an empty
 // array.
diff --git a/core/fpdfapi/parser/fpdf_parser_utility.cpp b/core/fpdfapi/parser/fpdf_parser_utility.cpp
index 22d9fb2..09c3017 100644
--- a/core/fpdfapi/parser/fpdf_parser_utility.cpp
+++ b/core/fpdfapi/parser/fpdf_parser_utility.cpp
@@ -80,12 +80,12 @@
   uint8_t buf[kBufSize];
   for (FX_FILESIZE offset = 0; offset <= 1024; ++offset) {
     if (!pFile->ReadBlockAtOffset(buf, offset, kBufSize))
-      return pdfium::nullopt;
+      return absl::nullopt;
 
     if (memcmp(buf, "%PDF", 4) == 0)
       return offset;
   }
-  return pdfium::nullopt;
+  return absl::nullopt;
 }
 
 int32_t GetDirectInteger(const CPDF_Dictionary* pDict, const ByteString& key) {
diff --git a/core/fpdfapi/render/cpdf_imagerenderer.cpp b/core/fpdfapi/render/cpdf_imagerenderer.cpp
index 0881dab..7cb7e25 100644
--- a/core/fpdfapi/render/cpdf_imagerenderer.cpp
+++ b/core/fpdfapi/render/cpdf_imagerenderer.cpp
@@ -611,7 +611,7 @@
   CFX_FloatRect image_rect_f = m_ImageMatrix.GetUnitRect();
   FX_RECT image_rect = image_rect_f.GetOuterRect();
   if (!image_rect.Valid())
-    return pdfium::nullopt;
+    return absl::nullopt;
   return image_rect;
 }
 
diff --git a/core/fpdfdoc/cpdf_action.cpp b/core/fpdfdoc/cpdf_action.cpp
index e8b4058..4fea331 100644
--- a/core/fpdfdoc/cpdf_action.cpp
+++ b/core/fpdfdoc/cpdf_action.cpp
@@ -143,7 +143,7 @@
 Optional<WideString> CPDF_Action::MaybeGetJavaScript() const {
   const CPDF_Object* pObject = GetJavaScriptObject();
   if (!pObject)
-    return pdfium::nullopt;
+    return absl::nullopt;
   return pObject->GetUnicodeText();
 }
 
diff --git a/core/fpdfdoc/cpdf_defaultappearance.cpp b/core/fpdfdoc/cpdf_defaultappearance.cpp
index 35e8a0e..3904bf9 100644
--- a/core/fpdfdoc/cpdf_defaultappearance.cpp
+++ b/core/fpdfdoc/cpdf_defaultappearance.cpp
@@ -66,7 +66,7 @@
 Optional<ByteString> CPDF_DefaultAppearance::GetFont(float* fFontSize) {
   *fFontSize = 0.0f;
   if (m_csDA.IsEmpty())
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   ByteString csFontNameTag;
   CPDF_SimpleParser syntax(m_csDA.AsStringView().raw_span());
@@ -80,7 +80,7 @@
 
 Optional<CFX_Color> CPDF_DefaultAppearance::GetColor() const {
   if (m_csDA.IsEmpty())
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   float fc[4];
   CPDF_SimpleParser syntax(m_csDA.AsStringView().raw_span());
@@ -101,13 +101,13 @@
     fc[3] = StringToFloat(syntax.GetWord());
     return CFX_Color(CFX_Color::Type::kCMYK, fc[0], fc[1], fc[2], fc[3]);
   }
-  return pdfium::nullopt;
+  return absl::nullopt;
 }
 
 Optional<CFX_Color::TypeAndARGB> CPDF_DefaultAppearance::GetColorARGB() const {
   Optional<CFX_Color> maybe_color = GetColor();
   if (!maybe_color.has_value())
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   const CFX_Color& color = maybe_color.value();
   if (color.nColorType == CFX_Color::Type::kGray) {
@@ -133,7 +133,7 @@
                    static_cast<int>(b * 255 + 0.5f)));
   }
   NOTREACHED();
-  return pdfium::nullopt;
+  return absl::nullopt;
 }
 
 bool CPDF_DefaultAppearance::FindTagParamFromStartForTesting(
diff --git a/core/fpdfdoc/cpdf_formcontrol.cpp b/core/fpdfdoc/cpdf_formcontrol.cpp
index 875b65b..16c95da 100644
--- a/core/fpdfdoc/cpdf_formcontrol.cpp
+++ b/core/fpdfdoc/cpdf_formcontrol.cpp
@@ -190,7 +190,7 @@
 Optional<WideString> CPDF_FormControl::GetDefaultControlFontName() const {
   RetainPtr<CPDF_Font> pFont = GetDefaultControlFont();
   if (!pFont)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   return WideString::FromDefANSI(pFont->GetBaseFontName().AsStringView());
 }
diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp
index df8e5ad..40e550c 100644
--- a/core/fpdfdoc/cpdf_formfield.cpp
+++ b/core/fpdfdoc/cpdf_formfield.cpp
@@ -55,7 +55,7 @@
       value < static_cast<int>(kFormFieldTypeCount)) {
     return static_cast<FormFieldType>(value);
   }
-  return pdfium::nullopt;
+  return absl::nullopt;
 }
 
 // static
diff --git a/core/fpdfdoc/cpdf_pagelabel.cpp b/core/fpdfdoc/cpdf_pagelabel.cpp
index be45003..9e90b92 100644
--- a/core/fpdfdoc/cpdf_pagelabel.cpp
+++ b/core/fpdfdoc/cpdf_pagelabel.cpp
@@ -80,18 +80,18 @@
 
 Optional<WideString> CPDF_PageLabel::GetLabel(int nPage) const {
   if (!m_pDocument)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   if (nPage < 0 || nPage >= m_pDocument->GetPageCount())
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   const CPDF_Dictionary* pPDFRoot = m_pDocument->GetRoot();
   if (!pPDFRoot)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   const CPDF_Dictionary* pLabels = pPDFRoot->GetDictFor("PageLabels");
   if (!pLabels)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   CPDF_NumberTree numberTree(pLabels);
   const CPDF_Object* pValue = nullptr;
diff --git a/core/fpdfdoc/cpdf_viewerpreferences.cpp b/core/fpdfdoc/cpdf_viewerpreferences.cpp
index 9b97762..55156db 100644
--- a/core/fpdfdoc/cpdf_viewerpreferences.cpp
+++ b/core/fpdfdoc/cpdf_viewerpreferences.cpp
@@ -44,11 +44,11 @@
     const ByteString& bsKey) const {
   const CPDF_Dictionary* pDict = GetViewerPreferences();
   if (!pDict)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   const CPDF_Name* pName = ToName(pDict->GetObjectFor(bsKey));
   if (!pName)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   return pName->GetString();
 }
diff --git a/core/fpdftext/cpdf_textpage.cpp b/core/fpdftext/cpdf_textpage.cpp
index 19e43b9..c64dce5 100644
--- a/core/fpdftext/cpdf_textpage.cpp
+++ b/core/fpdftext/cpdf_textpage.cpp
@@ -1412,7 +1412,7 @@
     wchar_t unicode) {
   const CharInfo* pPrevCharInfo = GetPrevCharInfo();
   if (!pPrevCharInfo)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   CharInfo info;
   info.m_Index = m_TextBuf.GetLength();
diff --git a/core/fpdftext/cpdf_textpagefind.cpp b/core/fpdftext/cpdf_textpagefind.cpp
index ebb72a1..6d3b586 100644
--- a/core/fpdftext/cpdf_textpagefind.cpp
+++ b/core/fpdftext/cpdf_textpagefind.cpp
@@ -98,7 +98,7 @@
   while (iSubString--) {
     lpszFullString = wcschr(lpszFullString, L' ');
     if (!lpszFullString)
-      return pdfium::nullopt;
+      return absl::nullopt;
 
     lpszFullString++;
     while (*lpszFullString == L' ')
@@ -109,7 +109,7 @@
   int nLen = lpchEnd ? static_cast<int>(lpchEnd - lpszFullString)
                      : static_cast<int>(wcslen(lpszFullString));
   if (nLen < 0)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   return WideString(lpszFullString, static_cast<size_t>(nLen));
 }
diff --git a/core/fxcodec/fx_codec.cpp b/core/fxcodec/fx_codec.cpp
index c94eb71..13aea98 100644
--- a/core/fxcodec/fx_codec.cpp
+++ b/core/fxcodec/fx_codec.cpp
@@ -75,14 +75,14 @@
                                    int width) {
   FX_SAFE_UINT32 pitch = CalculatePitch8Safely(bpc, components, width);
   if (!pitch.IsValid())
-    return pdfium::nullopt;
+    return absl::nullopt;
   return pitch.ValueOrDie();
 }
 
 Optional<uint32_t> CalculatePitch32(int bpp, int width) {
   FX_SAFE_UINT32 pitch = CalculatePitch32Safely(bpp, width);
   if (!pitch.IsValid())
-    return pdfium::nullopt;
+    return absl::nullopt;
   return pitch.ValueOrDie();
 }
 
diff --git a/core/fxcodec/jbig2/JBig2_TrdProc.cpp b/core/fxcodec/jbig2/JBig2_TrdProc.cpp
index b7bbfd0..8af7119 100644
--- a/core/fxcodec/jbig2/JBig2_TrdProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_TrdProc.cpp
@@ -22,7 +22,7 @@
   FX_SAFE_UINT32 result = dimension;
   result += delta;
   if (!result.IsValid())
-    return pdfium::nullopt;
+    return absl::nullopt;
   return result.ValueOrDie();
 }
 
@@ -32,7 +32,7 @@
   FX_SAFE_INT32 result = offset;
   result += dimension >> shift;
   if (!result.IsValid())
-    return pdfium::nullopt;
+    return absl::nullopt;
   return result.ValueOrDie();
 }
 
diff --git a/core/fxcodec/jpeg/jpegmodule.cpp b/core/fxcodec/jpeg/jpegmodule.cpp
index df220bc..c561325 100644
--- a/core/fxcodec/jpeg/jpegmodule.cpp
+++ b/core/fxcodec/jpeg/jpegmodule.cpp
@@ -402,7 +402,7 @@
     pdfium::span<const uint8_t> src_span) {
   ImageInfo info;
   if (!JpegLoadInfo(src_span, &info))
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   return info;
 }
diff --git a/core/fxcodec/jpx/cjpx_decoder.cpp b/core/fxcodec/jpx/cjpx_decoder.cpp
index f42da8d..44a5da8 100644
--- a/core/fxcodec/jpx/cjpx_decoder.cpp
+++ b/core/fxcodec/jpx/cjpx_decoder.cpp
@@ -63,15 +63,15 @@
   OpjImageRgbData data;
   data.r.reset(static_cast<int*>(opj_image_data_alloc(size)));
   if (!data.r)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   data.g.reset(static_cast<int*>(opj_image_data_alloc(size)));
   if (!data.g)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   data.b.reset(static_cast<int*>(opj_image_data_alloc(size)));
   if (!data.b)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   return data;
 }
diff --git a/core/fxcrt/bytestring.cpp b/core/fxcrt/bytestring.cpp
index ebd766a..2b67694 100644
--- a/core/fxcrt/bytestring.cpp
+++ b/core/fxcrt/bytestring.cpp
@@ -532,41 +532,41 @@
 
 Optional<size_t> ByteString::Find(char ch, size_t start) const {
   if (!m_pData)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   if (!IsValidIndex(start))
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   const char* pStr = static_cast<const char*>(
       memchr(m_pData->m_String + start, ch, m_pData->m_nDataLength - start));
   return pStr ? Optional<size_t>(static_cast<size_t>(pStr - m_pData->m_String))
-              : pdfium::nullopt;
+              : absl::nullopt;
 }
 
 Optional<size_t> ByteString::Find(ByteStringView subStr, size_t start) const {
   if (!m_pData)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   if (!IsValidIndex(start))
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   const char* pStr =
       FX_strstr(m_pData->m_String + start, m_pData->m_nDataLength - start,
                 subStr.unterminated_c_str(), subStr.GetLength());
   return pStr ? Optional<size_t>(static_cast<size_t>(pStr - m_pData->m_String))
-              : pdfium::nullopt;
+              : absl::nullopt;
 }
 
 Optional<size_t> ByteString::ReverseFind(char ch) const {
   if (!m_pData)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   size_t nLength = m_pData->m_nDataLength;
   while (nLength--) {
     if (m_pData->m_String[nLength] == ch)
       return nLength;
   }
-  return pdfium::nullopt;
+  return absl::nullopt;
 }
 
 void ByteString::MakeLower() {
diff --git a/core/fxcrt/css/cfx_csscomputedstyle.cpp b/core/fxcrt/css/cfx_csscomputedstyle.cpp
index 87cf08a..637331c 100644
--- a/core/fxcrt/css/cfx_csscomputedstyle.cpp
+++ b/core/fxcrt/css/cfx_csscomputedstyle.cpp
@@ -28,7 +28,7 @@
 Optional<WideString> CFX_CSSComputedStyle::GetLastFontFamily() const {
   if (!m_InheritedData.m_pFontFamily ||
       m_InheritedData.m_pFontFamily->values().empty()) {
-    return pdfium::nullopt;
+    return absl::nullopt;
   }
 
   return m_InheritedData.m_pFontFamily->values()
diff --git a/core/fxcrt/widestring.cpp b/core/fxcrt/widestring.cpp
index b38503f..79989b4 100644
--- a/core/fxcrt/widestring.cpp
+++ b/core/fxcrt/widestring.cpp
@@ -83,7 +83,7 @@
         ++pStr;
     }
     if (nWidth < 0 || nWidth > 128 * 1024)
-      return pdfium::nullopt;
+      return absl::nullopt;
     int nPrecision = 0;
     if (*pStr == '.') {
       pStr++;
@@ -97,7 +97,7 @@
       }
     }
     if (nPrecision < 0 || nPrecision > 128 * 1024)
-      return pdfium::nullopt;
+      return absl::nullopt;
     int nModifier = 0;
     if (*pStr == L'I' && *(pStr + 1) == L'6' && *(pStr + 2) == L'4') {
       pStr += 3;
@@ -254,7 +254,7 @@
                                   const wchar_t* pFormat,
                                   va_list argList) {
   if (!size)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   WideString str;
   {
@@ -272,7 +272,7 @@
 
     bool bSufficientBuffer = ret >= 0 || buffer[size - 1] == 0;
     if (!bSufficientBuffer)
-      return pdfium::nullopt;
+      return absl::nullopt;
   }
   str.ReleaseBuffer(str.GetStringLength());
   return str;
@@ -761,41 +761,41 @@
 
 Optional<size_t> WideString::Find(wchar_t ch, size_t start) const {
   if (!m_pData)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   if (!IsValidIndex(start))
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   const wchar_t* pStr =
       wmemchr(m_pData->m_String + start, ch, m_pData->m_nDataLength - start);
   return pStr ? Optional<size_t>(static_cast<size_t>(pStr - m_pData->m_String))
-              : pdfium::nullopt;
+              : absl::nullopt;
 }
 
 Optional<size_t> WideString::Find(WideStringView subStr, size_t start) const {
   if (!m_pData)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   if (!IsValidIndex(start))
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   const wchar_t* pStr =
       FX_wcsstr(m_pData->m_String + start, m_pData->m_nDataLength - start,
                 subStr.unterminated_c_str(), subStr.GetLength());
   return pStr ? Optional<size_t>(static_cast<size_t>(pStr - m_pData->m_String))
-              : pdfium::nullopt;
+              : absl::nullopt;
 }
 
 Optional<size_t> WideString::ReverseFind(wchar_t ch) const {
   if (!m_pData)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   size_t nLength = m_pData->m_nDataLength;
   while (nLength--) {
     if (m_pData->m_String[nLength] == ch)
       return nLength;
   }
-  return pdfium::nullopt;
+  return absl::nullopt;
 }
 
 void WideString::MakeLower() {
diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp
index 147e26e..4004d43 100644
--- a/core/fxge/cfx_font.cpp
+++ b/core/fxge/cfx_font.cpp
@@ -424,23 +424,23 @@
 
 Optional<FX_RECT> CFX_Font::GetGlyphBBox(uint32_t glyph_index) {
   if (!m_Face)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   FX_RECT result;
   if (FXFT_Is_Face_Tricky(m_Face->GetRec())) {
     int error = FT_Set_Char_Size(m_Face->GetRec(), 0, 1000 * 64, 72, 72);
     if (error)
-      return pdfium::nullopt;
+      return absl::nullopt;
 
     error = FT_Load_Glyph(m_Face->GetRec(), glyph_index,
                           FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
     if (error)
-      return pdfium::nullopt;
+      return absl::nullopt;
 
     FT_Glyph glyph;
     error = FT_Get_Glyph(m_Face->GetRec()->glyph, &glyph);
     if (error)
-      return pdfium::nullopt;
+      return absl::nullopt;
 
     FT_BBox cbox;
     FT_Glyph_Get_CBox(glyph, FT_GLYPH_BBOX_PIXELS, &cbox);
@@ -465,12 +465,12 @@
         static_cast<int32_t>(FXFT_Get_Face_Descender(m_Face->GetRec())));
     FT_Done_Glyph(glyph);
     if (FT_Set_Pixel_Sizes(m_Face->GetRec(), 0, 64) != 0)
-      return pdfium::nullopt;
+      return absl::nullopt;
     return result;
   }
   constexpr int kFlag = FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH;
   if (FT_Load_Glyph(m_Face->GetRec(), glyph_index, kFlag) != 0)
-    return pdfium::nullopt;
+    return absl::nullopt;
   int em = FXFT_Get_Face_UnitsPerEM(m_Face->GetRec());
   if (em == 0) {
     result.left = FXFT_Get_Glyph_HoriBearingX(m_Face->GetRec());
@@ -572,7 +572,7 @@
 
 Optional<FX_RECT> CFX_Font::GetRawBBox() const {
   if (!m_Face)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   return FX_RECT(FXFT_Get_Face_xMin(m_Face->GetRec()),
                  FXFT_Get_Face_yMin(m_Face->GetRec()),
diff --git a/core/fxge/cfx_fontmapper.cpp b/core/fxge/cfx_fontmapper.cpp
index 24ca860..401e598 100644
--- a/core/fxge/cfx_fontmapper.cpp
+++ b/core/fxge/cfx_fontmapper.cpp
@@ -716,7 +716,7 @@
     if (thisname.First(name.GetLength()) == name)
       return thisname;
   }
-  return pdfium::nullopt;
+  return absl::nullopt;
 }
 
 Optional<ByteString> CFX_FontMapper::LocalizedFontNameStartingWith(
@@ -725,7 +725,7 @@
     if (thispair.first.First(name.GetLength()) == name)
       return thispair.second;
   }
-  return pdfium::nullopt;
+  return absl::nullopt;
 }
 #endif  // defined(OS_WIN)
 
@@ -832,7 +832,7 @@
                          return FXSYS_stricmp(element.m_pName, name) < 0;
                        });
   if (found == end || FXSYS_stricmp(found->m_pName, name->c_str()))
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   *name = kBase14FontNames[static_cast<size_t>(found->m_Index)];
   return found->m_Index;
diff --git a/core/fxge/cfx_fontmgr.cpp b/core/fxge/cfx_fontmgr.cpp
index 5e01413..705f202 100644
--- a/core/fxge/cfx_fontmgr.cpp
+++ b/core/fxge/cfx_fontmgr.cpp
@@ -171,7 +171,7 @@
     return pdfium::make_span(kMMFonts[mm_index].m_pFontData,
                              kMMFonts[mm_index].m_dwSize);
   }
-  return pdfium::nullopt;
+  return absl::nullopt;
 }
 
 bool CFX_FontMgr::FreeTypeVersionSupportsHinting() const {
diff --git a/core/fxge/cfx_path.cpp b/core/fxge/cfx_path.cpp
index ee5ce2d..8bfbc9a 100644
--- a/core/fxge/cfx_path.cpp
+++ b/core/fxge/cfx_path.cpp
@@ -399,13 +399,13 @@
 
   if (!matrix) {
     if (!IsRectImpl(path_points))
-      return pdfium::nullopt;
+      return absl::nullopt;
 
     return CreateRectFromPoints(path_points[0].m_Point, path_points[2].m_Point);
   }
 
   if (!IsRectPreTransform(path_points))
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   CFX_PointF points[5];
   for (size_t i = 0; i < path_points.size(); ++i) {
@@ -414,11 +414,11 @@
     if (i == 0)
       continue;
     if (XYBothNotEqual(points[i], points[i - 1]))
-      return pdfium::nullopt;
+      return absl::nullopt;
   }
 
   if (XYBothNotEqual(points[0], points[3]))
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   return CreateRectFromPoints(points[0], points[2]);
 }
diff --git a/core/fxge/dib/cfx_dibitmap.cpp b/core/fxge/dib/cfx_dibitmap.cpp
index 8ef8b82..a9e0742 100644
--- a/core/fxge/dib/cfx_dibitmap.cpp
+++ b/core/fxge/dib/cfx_dibitmap.cpp
@@ -689,11 +689,11 @@
     FXDIB_Format format,
     uint32_t pitch) {
   if (width <= 0 || height <= 0)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   int bpp = GetBppFromFormat(format);
   if (!bpp)
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   uint32_t actual_pitch = pitch;
   if (actual_pitch == 0) {
@@ -704,7 +704,7 @@
     safe_pitch /= 32;
     safe_pitch *= 4;
     if (!safe_pitch.IsValid())
-      return pdfium::nullopt;
+      return absl::nullopt;
 
     actual_pitch = safe_pitch.ValueOrDie();
   }
@@ -712,7 +712,7 @@
   FX_SAFE_UINT32 safe_size = actual_pitch;
   safe_size *= height;
   if (!safe_size.IsValid())
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   return PitchAndSize{actual_pitch, safe_size.ValueOrDie()};
 }
diff --git a/core/fxge/text_glyph_pos.cpp b/core/fxge/text_glyph_pos.cpp
index 0f3b95e..d5bb26b 100644
--- a/core/fxge/text_glyph_pos.cpp
+++ b/core/fxge/text_glyph_pos.cpp
@@ -20,13 +20,13 @@
   left += m_pGlyph->left();
   left -= offset.x;
   if (!left.IsValid())
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   FX_SAFE_INT32 top = m_Origin.y;
   top -= m_pGlyph->top();
   top -= offset.y;
   if (!top.IsValid())
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   return CFX_Point(left.ValueOrDie(), top.ValueOrDie());
 }
diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp
index 7e2da08..f9cabfc 100644
--- a/core/fxge/win32/cfx_psrenderer.cpp
+++ b/core/fxge/win32/cfx_psrenderer.cpp
@@ -48,13 +48,13 @@
     const ByteString& psname,
     pdfium::span<const uint8_t> font_data) {
   if (font_data.empty())
-    return pdfium::nullopt;
+    return absl::nullopt;
 
   // Per Type 42 font spec.
   constexpr size_t kMaxSfntStringSize = 65535;
   if (font_data.size() > kMaxSfntStringSize) {
     // TODO(thestig): Fonts that are too big need to be written out in sections.
-    return pdfium::nullopt;
+    return absl::nullopt;
   }
 
   // Each byte is written as 2 ASCIIHex characters, so really 64 chars per line.
diff --git a/core/fxge/win32/cgdi_plus_ext.cpp b/core/fxge/win32/cgdi_plus_ext.cpp
index e4f5c9c..3b1e9e6 100644
--- a/core/fxge/win32/cgdi_plus_ext.cpp
+++ b/core/fxge/win32/cgdi_plus_ext.cpp
@@ -392,7 +392,7 @@
     if (distance_square < 2.25f)
       return std::make_pair(i, pair1);
   }
-  return pdfium::nullopt;
+  return absl::nullopt;
 }
 
 class GpStream final : public IStream {