Fix clang_use_chrome_plugin for Mac and Skia builds

These changes are specific to Mac and Skia builds. They are
needed for these builds to compile with clang_use_chrome_plugin.

BUG=pdfium:469

Review-Url: https://codereview.chromium.org/2081523002
diff --git a/core/fxge/apple/apple_int.h b/core/fxge/apple/apple_int.h
index 5a3c075..c19282b 100644
--- a/core/fxge/apple/apple_int.h
+++ b/core/fxge/apple/apple_int.h
@@ -134,9 +134,7 @@
                       const CFX_Matrix* pMatrix,
                       uint32_t flags,
                       void*& handle,
-                      int blend_type) override {
-    return FALSE;
-  }
+                      int blend_type) override;
   FX_BOOL DrawDeviceText(int nChars,
                          const FXTEXT_CHARPOS* pCharPos,
                          CFX_Font* pFont,
diff --git a/core/fxge/apple/fx_mac_imp.cpp b/core/fxge/apple/fx_mac_imp.cpp
index a0f2acb..528b727 100644
--- a/core/fxge/apple/fx_mac_imp.cpp
+++ b/core/fxge/apple/fx_mac_imp.cpp
@@ -25,15 +25,18 @@
     {"Times-BoldItalic", "Times New Roman Bold Italic"},
     {"Times-Italic", "Times New Roman Italic"},
 };
+
 class CFX_MacFontInfo : public CFX_FolderFontInfo {
  public:
-  virtual void* MapFont(int weight,
-                        FX_BOOL bItalic,
-                        int charset,
-                        int pitch_family,
-                        const FX_CHAR* family,
-                        int& iExact);
+  // CFX_FolderFontInfo
+  void* MapFont(int weight,
+                FX_BOOL bItalic,
+                int charset,
+                int pitch_family,
+                const FX_CHAR* family,
+                int& iExact) override;
 };
+
 #define JAPAN_GOTHIC "Hiragino Kaku Gothic Pro W6"
 #define JAPAN_MINCHO "Hiragino Mincho Pro W6"
 static void GetJapanesePreference(CFX_ByteString& face,
diff --git a/core/fxge/apple/fx_quartz_device.cpp b/core/fxge/apple/fx_quartz_device.cpp
index 4e1e62d..8adf632 100644
--- a/core/fxge/apple/fx_quartz_device.cpp
+++ b/core/fxge/apple/fx_quartz_device.cpp
@@ -731,6 +731,16 @@
   return TRUE;
 }
 
+FX_BOOL CFX_QuartzDeviceDriver::StartDIBits(const CFX_DIBSource* pBitmap,
+                                            int bitmap_alpha,
+                                            uint32_t color,
+                                            const CFX_Matrix* pMatrix,
+                                            uint32_t flags,
+                                            void*& handle,
+                                            int blend_type) {
+  return FALSE;
+}
+
 FX_BOOL CFX_QuartzDeviceDriver::CG_DrawGlyphRun(
     int nChars,
     const FXTEXT_CHARPOS* pCharPos,
diff --git a/core/fxge/include/fx_ge_apple.h b/core/fxge/include/fx_ge_apple.h
index 57acef6..6dce866 100644
--- a/core/fxge/include/fx_ge_apple.h
+++ b/core/fxge/include/fx_ge_apple.h
@@ -8,10 +8,14 @@
 #define CORE_FXGE_INCLUDE_FX_GE_APPLE_H_
 
 #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+
+#include "core/fxge/include/fx_ge.h"
+
 class CFX_QuartzDevice : public CFX_RenderDevice {
  public:
   CFX_QuartzDevice();
-  ~CFX_QuartzDevice();
+  ~CFX_QuartzDevice() override;
+
   FX_BOOL Attach(CGContextRef context, int32_t nDeviceClass = FXDC_DISPLAY);
   FX_BOOL Attach(CFX_DIBitmap* pBitmap);
   FX_BOOL Create(int32_t width, int32_t height, FXDIB_Format format);
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index c82b7f3..f253b06 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -759,6 +759,15 @@
   return TRUE;
 }
 
+FX_BOOL CFX_SkiaDeviceDriver::DrawCosmeticLine(FX_FLOAT x1,
+                                               FX_FLOAT y1,
+                                               FX_FLOAT x2,
+                                               FX_FLOAT y2,
+                                               uint32_t color,
+                                               int blend_type) {
+  return FALSE;
+}
+
 FX_BOOL CFX_SkiaDeviceDriver::FillRectWithBlend(const FX_RECT* pRect,
                                                 uint32_t fill_color,
                                                 int blend_type) {
@@ -907,6 +916,10 @@
   return true;
 }
 
+uint8_t* CFX_SkiaDeviceDriver::GetBuffer() const {
+  return m_pBitmap->GetBuffer();
+}
+
 FX_BOOL CFX_SkiaDeviceDriver::GetClipBox(FX_RECT* pRect) {
   // TODO(caryclark) call m_canvas->getClipDeviceBounds() instead
   pRect->left = 0;
@@ -953,6 +966,10 @@
   return bRet;
 }
 
+CFX_DIBitmap* CFX_SkiaDeviceDriver::GetBackDrop() {
+  return m_pOriDevice;
+}
+
 FX_BOOL CFX_SkiaDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
                                         uint32_t argb,
                                         const FX_RECT* pSrcRect,
@@ -1086,6 +1103,10 @@
   return TRUE;
 }
 
+FX_BOOL CFX_SkiaDeviceDriver::ContinueDIBits(void* handle, IFX_Pause* pPause) {
+  return FALSE;
+}
+
 void CFX_SkiaDeviceDriver::PreMultiply() {
   void* buffer = m_pBitmap->GetBuffer();
   if (!buffer)
diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h
index 15f6306..5ad66f7 100644
--- a/core/fxge/skia/fx_skia_device.h
+++ b/core/fxge/skia/fx_skia_device.h
@@ -64,16 +64,14 @@
                            FX_FLOAT x2,
                            FX_FLOAT y2,
                            uint32_t color,
-                           int blend_type) override {
-    return FALSE;
-  }
+                           int blend_type) override;
 
   FX_BOOL GetClipBox(FX_RECT* pRect) override;
 
   /** Load device buffer into a DIB */
   FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, int left, int top) override;
 
-  CFX_DIBitmap* GetBackDrop() override { return m_pOriDevice; }
+  CFX_DIBitmap* GetBackDrop() override;
 
   FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap,
                     uint32_t color,
@@ -99,9 +97,7 @@
                       void*& handle,
                       int blend_type) override;
 
-  FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) override {
-    return FALSE;
-  }
+  FX_BOOL ContinueDIBits(void* handle, IFX_Pause* pPause) override;
 
   void CancelDIBits(void* handle) override {}
 
@@ -119,7 +115,8 @@
                       int alpha,
                       FX_BOOL bAlphaMode) override;
 
-  virtual uint8_t* GetBuffer() const { return m_pBitmap->GetBuffer(); }
+  virtual uint8_t* GetBuffer() const;
+
   void PaintStroke(SkPaint* spaint,
                    const CFX_GraphStateData* pGraphState,
                    const SkMatrix& matrix);
diff --git a/xfa/fgas/font/fgas_stdfontmgr.cpp b/xfa/fgas/font/fgas_stdfontmgr.cpp
index fc839e9..00b1028 100644
--- a/xfa/fgas/font/fgas_stdfontmgr.cpp
+++ b/xfa/fgas/font/fgas_stdfontmgr.cpp
@@ -13,9 +13,11 @@
 #include "xfa/fgas/font/fgas_gefont.h"
 
 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
+
 IFGAS_FontMgr* IFGAS_FontMgr::Create(FX_LPEnumAllFonts pEnumerator) {
   return new CFGAS_StdFontMgrImp(pEnumerator);
 }
+
 CFGAS_StdFontMgrImp::CFGAS_StdFontMgrImp(FX_LPEnumAllFonts pEnumerator)
     : m_pEnumerator(pEnumerator),
       m_FontFaces(),
@@ -74,6 +76,7 @@
   }
   return NULL;
 }
+
 CFGAS_GEFont* CFGAS_StdFontMgrImp::GetDefFontByCharset(
     uint8_t nCharset,
     uint32_t dwFontStyles,
@@ -128,6 +131,7 @@
   return GetDefFontByCodePage(FX_GetDefCodePageByLanguage(wLanguage),
                               dwFontStyles, pszFontFamily);
 }
+
 CFGAS_GEFont* CFGAS_StdFontMgrImp::LoadFont(const FX_WCHAR* pszFontFamily,
                                             uint32_t dwFontStyles,
                                             uint16_t wCodePage) {
@@ -159,6 +163,7 @@
   }
   return NULL;
 }
+
 CFGAS_GEFont* CFGAS_StdFontMgrImp::LoadFont(const uint8_t* pBuffer,
                                             int32_t iLength) {
   ASSERT(pBuffer && iLength > 0);
@@ -207,6 +212,7 @@
   }
   return NULL;
 }
+
 CFGAS_GEFont* CFGAS_StdFontMgrImp::LoadFont(CFGAS_GEFont* pSrcFont,
                                             uint32_t dwFontStyles,
                                             uint16_t wCodePage) {
@@ -258,6 +264,7 @@
     break;
   }
 }
+
 void CFGAS_StdFontMgrImp::RemoveFont(CFGAS_GEFont* pFont) {
   RemoveFont(m_CPFonts, pFont);
   RemoveFont(m_FamilyFonts, pFont);
@@ -270,6 +277,7 @@
     m_Fonts.RemoveAt(iFind, 1);
   }
 }
+
 FX_FONTDESCRIPTOR const* CFGAS_StdFontMgrImp::FindFont(
     const FX_WCHAR* pszFontFamily,
     uint32_t dwFontStyles,
@@ -308,6 +316,7 @@
   }
   return NULL;
 }
+
 FX_FONTDESCRIPTOR const* FX_DefFontMatcher(FX_LPFONTMATCHPARAMS pParams,
                                            const CFX_FontDescriptors& fonts) {
   FX_FONTDESCRIPTOR const* pBestFont = NULL;
@@ -363,6 +372,7 @@
   }
   return iBestSimilar < 1 ? NULL : pBestFont;
 }
+
 int32_t FX_GetSimilarValue(FX_FONTDESCRIPTOR const* pFont,
                            uint32_t dwFontStyles) {
   int32_t iValue = 0;
@@ -384,9 +394,11 @@
   }
   return iValue;
 }
+
 FX_LPMatchFont FX_GetDefFontMatchor() {
   return FX_DefFontMatcher;
 }
+
 uint32_t FX_GetGdiFontStyles(const LOGFONTW& lf) {
   uint32_t dwStyles = 0;
   if ((lf.lfPitchAndFamily & 0x03) == FIXED_PITCH) {
@@ -404,6 +416,7 @@
   }
   return dwStyles;
 }
+
 static int32_t CALLBACK FX_GdiFontEnumProc(ENUMLOGFONTEX* lpelfe,
                                            NEWTEXTMETRICEX* lpntme,
                                            DWORD dwFontType,
@@ -427,6 +440,7 @@
   FX_Free(pFont);
   return 1;
 }
+
 static void FX_EnumGdiFonts(CFX_FontDescriptors& fonts,
                             const FX_WCHAR* pwsFaceName,
                             FX_WCHAR wUnicode) {
@@ -442,9 +456,11 @@
                       (FONTENUMPROCW)FX_GdiFontEnumProc, (LPARAM)&fonts, 0);
   ::ReleaseDC(NULL, hDC);
 }
+
 FX_LPEnumAllFonts FX_GetDefFontEnumerator() {
   return FX_EnumGdiFonts;
 }
+
 #else
 const FX_CHAR* g_FontFolders[] = {
 #if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_
@@ -457,11 +473,18 @@
 #endif
 };
 
+CFX_FontDescriptor::CFX_FontDescriptor()
+    : m_nFaceIndex(0), m_dwFontStyles(0), m_dwUsb(), m_dwCsb() {}
+
+CFX_FontDescriptor::~CFX_FontDescriptor() {}
+
 CFX_FontSourceEnum_File::CFX_FontSourceEnum_File() {
   for (size_t i = 0; i < FX_ArraySize(g_FontFolders); ++i)
     m_FolderPaths.Add(g_FontFolders[i]);
 }
 
+CFX_FontSourceEnum_File::~CFX_FontSourceEnum_File() {}
+
 CFX_ByteString CFX_FontSourceEnum_File::GetNextFile() {
 Restart:
   void* pCurHandle =
@@ -522,6 +545,7 @@
   }
   return bsName;
 }
+
 FX_POSITION CFX_FontSourceEnum_File::GetStartPosition() {
   m_wsNext = GetNextFile().UTF8Decode();
   if (0 == m_wsNext.GetLength()) {
@@ -600,11 +624,13 @@
     return FALSE;
   return TRUE;
 }
+
 FX_BOOL CFGAS_FontMgrImp::EnumFonts() {
   if (EnumFontsFromFontMapper())
     return TRUE;
   return EnumFontsFromFiles();
 }
+
 void CFGAS_FontMgrImp::Release() {
   for (int32_t i = 0; i < m_InstalledFonts.GetSize(); i++) {
     delete m_InstalledFonts[i];
@@ -633,24 +659,28 @@
   }
   delete this;
 }
+
 CFGAS_GEFont* CFGAS_FontMgrImp::GetDefFontByCodePage(
     uint16_t wCodePage,
     uint32_t dwFontStyles,
     const FX_WCHAR* pszFontFamily) {
   return nullptr;
 }
+
 CFGAS_GEFont* CFGAS_FontMgrImp::GetDefFontByCharset(
     uint8_t nCharset,
     uint32_t dwFontStyles,
     const FX_WCHAR* pszFontFamily) {
   return nullptr;
 }
+
 CFGAS_GEFont* CFGAS_FontMgrImp::GetDefFontByUnicode(
     FX_WCHAR wUnicode,
     uint32_t dwFontStyles,
     const FX_WCHAR* pszFontFamily) {
   return nullptr;
 }
+
 CFGAS_GEFont* CFGAS_FontMgrImp::GetDefFontByLanguage(
     uint16_t wLanguage,
     uint32_t dwFontStyles,
@@ -698,6 +728,7 @@
   pFonts->Add(pFont);
   return pFont;
 }
+
 CFGAS_GEFont* CFGAS_FontMgrImp::GetFontByCharset(
     uint8_t nCharset,
     uint32_t dwFontStyles,
@@ -705,6 +736,7 @@
   return GetFontByCodePage(FX_GetCodePageFromCharset(nCharset), dwFontStyles,
                            pszFontFamily);
 }
+
 CFGAS_GEFont* CFGAS_FontMgrImp::GetFontByUnicode(
     FX_WCHAR wUnicode,
     uint32_t dwFontStyles,
@@ -756,6 +788,7 @@
     m_FailedUnicodes2NULL.SetAt(wUnicode, nullptr);
   return nullptr;
 }
+
 FX_BOOL CFGAS_FontMgrImp::VerifyUnicode(CFX_FontDescriptor* pDesc,
                                         FX_WCHAR wcUnicode) {
   IFX_FileRead* pFileRead = CreateFontStream(pDesc->m_wsFaceName.UTF8Encode());
@@ -933,6 +966,7 @@
   }
   return nullptr;
 }
+
 int32_t CFGAS_FontMgrImp::MatchFonts(CFX_FontDescriptorInfos& MatchedFonts,
                                      uint16_t wCodePage,
                                      uint32_t dwFontStyles,
@@ -1078,6 +1112,7 @@
   }
   return nPenalty;
 }
+
 void CFGAS_FontMgrImp::ClearFontCache() {
   FX_POSITION pos = m_Hash2CandidateList.GetStartPosition();
   while (pos) {
@@ -1094,6 +1129,7 @@
     pFileRead->Release();
   }
 }
+
 void CFGAS_FontMgrImp::RemoveFont(CFGAS_GEFont* pEFont) {
   if (NULL == pEFont) {
     return;
@@ -1180,6 +1216,7 @@
     FXFT_Done_Face(pFace);
   } while (index < num_faces);
 }
+
 uint32_t CFGAS_FontMgrImp::GetFlags(FXFT_Face pFace) {
   uint32_t flag = 0;
   if (FT_IS_FIXED_WIDTH(pFace)) {
@@ -1200,10 +1237,12 @@
   }
   return flag;
 }
+
 #define GetUInt8(p) ((uint8_t)((p)[0]))
 #define GetUInt16(p) ((uint16_t)((p)[0] << 8 | (p)[1]))
 #define GetUInt32(p) \
   ((uint32_t)((p)[0] << 24 | (p)[1] << 16 | (p)[2] << 8 | (p)[3]))
+
 void CFGAS_FontMgrImp::GetNames(const uint8_t* name_table,
                                 CFX_WideStringArray& Names) {
   if (NULL == name_table) {
@@ -1246,6 +1285,7 @@
   uint16_t wBit;
   uint16_t wCharset;
 };
+
 FX_BIT2CHARSET g_FX_Bit2Charset1[16] = {
     {1 << 0, FX_CHARSET_ANSI},
     {1 << 1, FX_CHARSET_MSWin_EasterEuropean},
@@ -1264,6 +1304,7 @@
     {1 << 14, FX_CHARSET_Default},
     {1 << 15, FX_CHARSET_Default},
 };
+
 FX_BIT2CHARSET g_FX_Bit2Charset2[16] = {
     {1 << 0, FX_CHARSET_Thai},
     {1 << 1, FX_CHARSET_ShiftJIS},
@@ -1282,6 +1323,7 @@
     {1 << 14, FX_CHARSET_OEM},
     {1 << 15, FX_CHARSET_Symbol},
 };
+
 FX_BIT2CHARSET g_FX_Bit2Charset3[16] = {
     {1 << 0, FX_CHARSET_Default},  {1 << 1, FX_CHARSET_Default},
     {1 << 2, FX_CHARSET_Default},  {1 << 3, FX_CHARSET_Default},
@@ -1292,6 +1334,7 @@
     {1 << 12, FX_CHARSET_Default}, {1 << 13, FX_CHARSET_Default},
     {1 << 14, FX_CHARSET_Default}, {1 << 15, FX_CHARSET_Default},
 };
+
 FX_BIT2CHARSET g_FX_Bit2Charset4[16] = {
     {1 << 0, FX_CHARSET_Default},  {1 << 1, FX_CHARSET_Default},
     {1 << 2, FX_CHARSET_Default},  {1 << 3, FX_CHARSET_Default},
@@ -1302,12 +1345,14 @@
     {1 << 12, FX_CHARSET_Default}, {1 << 13, FX_CHARSET_Default},
     {1 << 14, FX_CHARSET_Default}, {1 << 15, FX_CHARSET_US},
 };
+
 #define CODEPAGERANGE_IMPLEMENT(n)                   \
   for (int32_t i = 0; i < 16; i++) {                 \
     if ((a##n & g_FX_Bit2Charset##n[i].wBit) != 0) { \
       Charsets.Add(g_FX_Bit2Charset##n[i].wCharset); \
     }                                                \
   }
+
 void CFGAS_FontMgrImp::GetCharsets(FXFT_Face pFace,
                                    CFX_ArrayTemplate<uint16_t>& Charsets) {
   Charsets.RemoveAll();
@@ -1326,6 +1371,7 @@
     Charsets.Add(FX_CHARSET_Default);
   }
 }
+
 #undef CODEPAGERANGE_IMPLEMENT
 void CFGAS_FontMgrImp::GetUSBCSB(FXFT_Face pFace,
                                  uint32_t* USB,
@@ -1347,6 +1393,7 @@
     CSB[1] = 0;
   }
 }
+
 int32_t CFGAS_FontMgrImp::IsPartName(const CFX_WideString& Name1,
                                      const CFX_WideString& Name2) {
   if (Name1.Find(Name2.c_str()) != -1) {
@@ -1354,4 +1401,5 @@
   }
   return 0;
 }
+
 #endif
diff --git a/xfa/fgas/font/fgas_stdfontmgr.h b/xfa/fgas/font/fgas_stdfontmgr.h
index 11d91fc..66b1412 100644
--- a/xfa/fgas/font/fgas_stdfontmgr.h
+++ b/xfa/fgas/font/fgas_stdfontmgr.h
@@ -82,11 +82,8 @@
 
 class CFX_FontDescriptor {
  public:
-  CFX_FontDescriptor() : m_nFaceIndex(0), m_dwFontStyles(0) {
-    m_dwUsb[0] = m_dwUsb[1] = m_dwUsb[2] = m_dwUsb[3] = 0;
-    m_dwCsb[0] = m_dwCsb[1] = 0;
-  }
-  ~CFX_FontDescriptor() {}
+  CFX_FontDescriptor();
+  ~CFX_FontDescriptor();
 
   int32_t m_nFaceIndex;
   CFX_WideString m_wsFaceName;
@@ -95,6 +92,7 @@
   uint32_t m_dwUsb[4];
   uint32_t m_dwCsb[2];
 };
+
 typedef CFX_ArrayTemplate<CFX_FontDescriptor*> CFX_FontDescriptors;
 
 struct FX_FontDescriptorInfo {
@@ -112,6 +110,7 @@
     return nPenalty == other.nPenalty;
   }
 };
+
 typedef CFX_ArrayTemplate<FX_FontDescriptorInfo> CFX_FontDescriptorInfos;
 
 struct FX_HandleParentPath {
@@ -127,6 +126,7 @@
 class CFX_FontSourceEnum_File {
  public:
   CFX_FontSourceEnum_File();
+  ~CFX_FontSourceEnum_File();
 
   void Release() { delete this; }
   FX_POSITION GetStartPosition();