Backed out csets f9763adebe68, a1c1fe33a052, bf35d13e27f3, c6ad01bf0b66 (bug 1412090) for ASan failures.
authorJonathan Kew <jkew@mozilla.com>
Sun, 05 Nov 2017 09:35:24 +0000
changeset 443482 df53224b917158a08bccadeef488f30a2b2ac89b
parent 443481 f9763adebe6847072575978df2f8e010d790b083
child 443483 ebc611dc8c85055ac62bc945e9871cdc317cf6f9
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1412090
milestone58.0a1
backs outf9763adebe6847072575978df2f8e010d790b083
a1c1fe33a052ac9ff96fbbe389f53687d25e2afc
bf35d13e27f392dc5dcdab3e7755c69b632f46ab
c6ad01bf0b669096565646e8f47bb8e6286d22a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out csets f9763adebe68, a1c1fe33a052, bf35d13e27f3, c6ad01bf0b66 (bug 1412090) for ASan failures.
dom/ipc/ContentChild.cpp
dom/ipc/ContentChild.h
dom/ipc/ContentParent.cpp
dom/ipc/ContentParent.h
dom/ipc/PContent.ipdl
gfx/thebes/gfxFcPlatformFontList.cpp
gfx/thebes/gfxFcPlatformFontList.h
gfx/thebes/gfxMacPlatformFontList.h
gfx/thebes/gfxMacPlatformFontList.mm
gfx/thebes/gfxPlatform.h
gfx/thebes/gfxPlatformGtk.cpp
gfx/thebes/gfxPlatformGtk.h
gfx/thebes/gfxPlatformMac.cpp
gfx/thebes/gfxPlatformMac.h
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -543,24 +543,24 @@ NS_INTERFACE_MAP_BEGIN(ContentChild)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContentChild)
 NS_INTERFACE_MAP_END
 
 
 mozilla::ipc::IPCResult
 ContentChild::RecvSetXPCOMProcessAttributes(const XPCOMInitData& aXPCOMInit,
                                             const StructuredCloneData& aInitialData,
                                             nsTArray<LookAndFeelInt>&& aLookAndFeelIntCache,
-                                            nsTArray<SystemFontListEntry>&& aFontList)
+                                            nsTArray<FontFamilyListEntry>&& aFontFamilyList)
 {
   if (!sShutdownCanary) {
     return IPC_OK();
   }
 
   mLookAndFeelCache = Move(aLookAndFeelIntCache);
-  mFontList = Move(aFontList);
+  mFontFamilies = Move(aFontFamilyList);
   gfx::gfxVars::SetValuesForInitialize(aXPCOMInit.gfxNonDefaultVarUpdates());
   InitXPCOM(aXPCOMInit, aInitialData);
   InitGraphicsDeviceData(aXPCOMInit.contentDeviceData());
 
   return IPC_OK();
 }
 
 bool
@@ -2534,24 +2534,16 @@ mozilla::ipc::IPCResult
 ContentChild::RecvUpdateDictionaryList(InfallibleTArray<nsString>&& aDictionaries)
 {
   mAvailableDictionaries = aDictionaries;
   mozInlineSpellChecker::UpdateCanEnableInlineSpellChecking();
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
-ContentChild::RecvUpdateFontList(InfallibleTArray<SystemFontListEntry>&& aFontList)
-{
-  mFontList = Move(aFontList);
-  gfxPlatform::GetPlatform()->UpdateFontList();
-  return IPC_OK();
-}
-
-mozilla::ipc::IPCResult
 ContentChild::RecvUpdateAppLocales(nsTArray<nsCString>&& aAppLocales)
 {
   LocaleService::GetInstance()->AssignAppLocales(aAppLocales);
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 ContentChild::RecvUpdateRequestedLocales(nsTArray<nsCString>&& aRequestedLocales)
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -394,18 +394,16 @@ public:
                                                    const ClonedMessageData& aData) override;
 
   virtual mozilla::ipc::IPCResult RecvGeolocationUpdate(const GeoPosition& somewhere) override;
 
   virtual mozilla::ipc::IPCResult RecvGeolocationError(const uint16_t& errorCode) override;
 
   virtual mozilla::ipc::IPCResult RecvUpdateDictionaryList(InfallibleTArray<nsString>&& aDictionaries) override;
 
-  virtual mozilla::ipc::IPCResult RecvUpdateFontList(InfallibleTArray<SystemFontListEntry>&& aFontList) override;
-
   virtual mozilla::ipc::IPCResult RecvUpdateAppLocales(nsTArray<nsCString>&& aAppLocales) override;
   virtual mozilla::ipc::IPCResult RecvUpdateRequestedLocales(nsTArray<nsCString>&& aRequestedLocales) override;
 
   virtual mozilla::ipc::IPCResult RecvAddPermission(const IPC::Permission& permission) override;
 
   virtual mozilla::ipc::IPCResult RecvFlushMemory(const nsString& reason) override;
 
   virtual mozilla::ipc::IPCResult RecvActivateA11y(const uint32_t& aMainChromeTid,
@@ -600,17 +598,17 @@ public:
           const bool& anonymize,
           const bool& minimizeMemoryUsage,
           const MaybeFileDesc& DMDFile) override;
 
   virtual mozilla::ipc::IPCResult
   RecvSetXPCOMProcessAttributes(const XPCOMInitData& aXPCOMInit,
                                 const StructuredCloneData& aInitialData,
                                 nsTArray<LookAndFeelInt>&& aLookAndFeelIntCache,
-                                nsTArray<SystemFontListEntry>&& aFontList) override;
+                                nsTArray<FontFamilyListEntry>&& aFontFamilyList) override;
 
   virtual mozilla::ipc::IPCResult
   RecvProvideAnonymousTemporaryFile(const uint64_t& aID, const FileDescOrError& aFD) override;
 
   mozilla::ipc::IPCResult
   RecvSetPermissionsWithKey(const nsCString& aPermissionKey,
                             nsTArray<IPC::Permission>&& aPerms) override;
 
@@ -638,21 +636,21 @@ public:
   virtual mozilla::ipc::IPCResult
   RecvAddDynamicScalars(nsTArray<DynamicScalarDefinition>&& aDefs) override;
 
 #if defined(XP_WIN) && defined(ACCESSIBILITY)
   bool
   SendGetA11yContentId();
 #endif // defined(XP_WIN) && defined(ACCESSIBILITY)
 
-  // Get a reference to the font list passed from the chrome process,
+  // Get a reference to the font family list passed from the chrome process,
   // for use during gfx initialization.
-  InfallibleTArray<mozilla::dom::SystemFontListEntry>&
-  SystemFontList() {
-    return mFontList;
+  InfallibleTArray<mozilla::dom::FontFamilyListEntry>&
+  SystemFontFamilyList() {
+    return mFontFamilies;
   }
 
   // PURLClassifierChild
   virtual PURLClassifierChild*
   AllocPURLClassifierChild(const Principal& aPrincipal,
                            const bool& aUseTrackingProtection,
                            bool* aSuccess) override;
   virtual bool
@@ -746,20 +744,20 @@ private:
 
   InfallibleTArray<nsAutoPtr<AlertObserver> > mAlertObservers;
   RefPtr<ConsoleListener> mConsoleListener;
 
   nsTHashtable<nsPtrHashKey<nsIObserver>> mIdleObservers;
 
   InfallibleTArray<nsString> mAvailableDictionaries;
 
-  // Temporary storage for a list of available fonts, passed from the
+  // Temporary storage for a list of available font families, passed from the
   // parent process and used to initialize gfx in the child. Currently used
-  // only on MacOSX and Linux.
-  InfallibleTArray<mozilla::dom::SystemFontListEntry> mFontList;
+  // only on MacOSX.
+  InfallibleTArray<mozilla::dom::FontFamilyListEntry> mFontFamilies;
   // Temporary storage for nsXPLookAndFeel flags.
   nsTArray<LookAndFeelInt> mLookAndFeelCache;
 
   /**
    * An ID unique to the process containing our corresponding
    * content parent.
    *
    * We expect our content parent to set this ID immediately after opening a
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -165,17 +165,16 @@
 #include "SourceSurfaceRawData.h"
 #include "TabParent.h"
 #include "URIUtils.h"
 #include "nsIWebBrowserChrome.h"
 #include "nsIDocShell.h"
 #include "nsDocShell.h"
 #include "nsOpenURIInFrameParams.h"
 #include "mozilla/net/NeckoMessageUtils.h"
-#include "gfxPlatform.h"
 #include "gfxPrefs.h"
 #include "prio.h"
 #include "private/pprio.h"
 #include "ContentProcessManager.h"
 #include "mozilla/dom/ipc/StructuredCloneData.h"
 #include "mozilla/psm/PSMContentListener.h"
 #include "nsPluginHost.h"
 #include "nsPluginTags.h"
@@ -2218,20 +2217,19 @@ ContentParent::InitInternal(ProcessPrior
       ErrorResult rv;
       initialData.Write(jsapi.cx(), init, rv);
       if (NS_WARN_IF(rv.Failed())) {
         rv.SuppressException();
         MOZ_CRASH();
       }
     }
   }
-  // This is only implemented (returns a non-empty list) by MacOSX and Linux
-  // at present.
-  nsTArray<SystemFontListEntry> fontList;
-  gfxPlatform::GetPlatform()->ReadSystemFontList(&fontList);
+  // This is only implemented (returns a non-empty list) by MacOSX at present.
+  nsTArray<FontFamilyListEntry> fontFamilies;
+  gfxPlatform::GetPlatform()->GetSystemFontFamilyList(&fontFamilies);
   nsTArray<LookAndFeelInt> lnfCache = LookAndFeel::GetIntCache();
 
   // Content processes have no permission to access profile directory, so we
   // send the file URL instead.
   StyleSheet* ucs = nsLayoutStylesheetCache::For(StyleBackendType::Gecko)->UserContentSheet();
   if (ucs) {
     SerializeURI(ucs->GetSheetURI(), xpcomInit.userContentSheetURL());
   } else {
@@ -2264,17 +2262,17 @@ ContentParent::InitInternal(ProcessPrior
   // Send the dynamic scalar definitions to the new process.
   TelemetryIPC::GetDynamicScalarDefinitions(xpcomInit.dynamicScalarDefs());
 
   // Must send screen info before send initialData
   ScreenManager& screenManager = ScreenManager::GetSingleton();
   screenManager.CopyScreensToRemote(this);
 
   Unused << SendSetXPCOMProcessAttributes(xpcomInit, initialData, lnfCache,
-                                          fontList);
+                                          fontFamilies);
 
   if (aSendRegisteredChrome) {
     nsCOMPtr<nsIChromeRegistry> registrySvc = nsChromeRegistry::GetService();
     nsChromeRegistryChrome* chromeRegistry =
       static_cast<nsChromeRegistryChrome*>(registrySvc.get());
     chromeRegistry->SendRegisteredChrome(this);
   }
 
@@ -4261,27 +4259,16 @@ ContentParent::NotifyUpdatedDictionaries
   InfallibleTArray<nsString> dictionaries;
   spellChecker->GetDictionaryList(&dictionaries);
 
   for (auto* cp : AllProcesses(eLive)) {
     Unused << cp->SendUpdateDictionaryList(dictionaries);
   }
 }
 
-void
-ContentParent::NotifyUpdatedFonts()
-{
-  InfallibleTArray<SystemFontListEntry> fontList;
-  gfxPlatform::GetPlatform()->ReadSystemFontList(&fontList);
-
-  for (auto* cp : AllProcesses(eLive)) {
-    Unused << cp->SendUpdateFontList(fontList);
-  }
-}
-
 /*static*/ void
 ContentParent::UnregisterRemoteFrame(const TabId& aTabId,
                                const ContentParentId& aCpId,
                                bool aMarkedDestroying)
 {
   if (XRE_IsParentProcess()) {
     ContentProcessManager* cpm = ContentProcessManager::GetSingleton();
     ContentParent* cp = cpm->GetContentProcessById(aCpId);
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -264,18 +264,16 @@ public:
       sContentParents ? sContentParents->getFirst() : nullptr;
     return ContentParentIterator(aPolicy, first);
   }
 
   static bool IgnoreIPCPrincipal();
 
   static void NotifyUpdatedDictionaries();
 
-  static void NotifyUpdatedFonts();
-
 #if defined(XP_WIN)
   /**
    * Windows helper for firing off an update window request to a plugin
    * instance.
    *
    * aWidget - the eWindowType_plugin_ipc_chrome widget associated with
    *           this plugin window.
    */
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -127,29 +127,16 @@ struct FontListEntry {
 // from chrome to content processes.
 // The entryType field distinguishes several types of font family
 // record; see gfxMacPlatformFontList.h for values and meaning.
 struct FontFamilyListEntry {
     nsString familyName;
     uint8_t  entryType;
 };
 
-// Used on Linux to pass list of font patterns from chrome to content.
-struct FontPatternListEntry {
-    nsCString pattern;
-    bool      appFontFamily;
-};
-
-// Wrap the Font*ListEntry records in a union so the SetXPCOMProcessAttributes
-// message can pass an array of either type.
-union SystemFontListEntry {
-    FontFamilyListEntry;
-    FontPatternListEntry;
-};
-
 union PrefValue {
   nsCString;
   int32_t;
   bool;
 };
 
 union MaybePrefValue {
   PrefValue;
@@ -437,18 +424,16 @@ child:
     async NotifyAlertsObserver(nsCString topic, nsString data);
 
     async GeolocationUpdate(GeoPosition somewhere);
 
     async GeolocationError(uint16_t errorCode);
 
     async UpdateDictionaryList(nsString[] dictionaries);
 
-    async UpdateFontList(SystemFontListEntry[] fontList);
-
     async UpdateAppLocales(nsCString[] appLocales);
     async UpdateRequestedLocales(nsCString[] requestedLocales);
 
     // nsIPermissionManager messages
     async AddPermission(Permission permission);
 
     async FlushMemory(nsString reason);
 
@@ -486,18 +471,18 @@ child:
     /**
      * Send BlobURLRegistrationData to child process.
      */
     async InitBlobURLs(BlobURLRegistrationData[] registrations);
 
     async SetXPCOMProcessAttributes(XPCOMInitData xpcomInit,
                                     StructuredCloneData initialData,
                                     LookAndFeelInt[] lookAndFeelIntCache,
-                                    /* used on MacOSX and Linux only: */
-                                    SystemFontListEntry[] systemFontList);
+                                    /* used on MacOSX only: */
+                                    FontFamilyListEntry[] fontFamilyList);
 
     // Notify child that last-pb-context-exited notification was observed
     async LastPrivateDocShellDestroyed();
 
     async NotifyProcessPriorityChanged(ProcessPriority priority);
     async MinimizeMemoryUsage();
 
     /**
--- a/gfx/thebes/gfxFcPlatformFontList.cpp
+++ b/gfx/thebes/gfxFcPlatformFontList.cpp
@@ -7,56 +7,44 @@
 
 #include "gfxFcPlatformFontList.h"
 #include "gfxFont.h"
 #include "gfxFontConstants.h"
 #include "gfxFontFamilyList.h"
 #include "gfxFT2Utils.h"
 #include "gfxPlatform.h"
 #include "mozilla/ArrayUtils.h"
-#include "mozilla/dom/ContentChild.h"
-#include "mozilla/dom/ContentParent.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Sprintf.h"
 #include "mozilla/TimeStamp.h"
 #include "nsGkAtoms.h"
 #include "nsUnicodeProperties.h"
 #include "nsUnicodeRange.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsCharSeparatedTokenizer.h"
-#include "nsXULAppAPI.h"
 
 #include "mozilla/gfx/HelpersCairo.h"
 
 #include <fontconfig/fcfreetype.h>
-#include <unistd.h>
 
 #ifdef MOZ_WIDGET_GTK
 #include <gdk/gdk.h>
 #include "gfxPlatformGtk.h"
 #endif
 
 #ifdef MOZ_X11
 #include "mozilla/X11Util.h"
 #endif
 
-#ifdef MOZ_CONTENT_SANDBOX
-#include "mozilla/SandboxBrokerPolicyFactory.h"
-#include "mozilla/SandboxSettings.h"
-#endif
-
 using namespace mozilla;
 using namespace mozilla::gfx;
 using namespace mozilla::unicode;
 
-using mozilla::dom::SystemFontListEntry;
-using mozilla::dom::FontPatternListEntry;
-
 #ifndef FC_POSTSCRIPT_NAME
 #define FC_POSTSCRIPT_NAME  "postscriptname"      /* String */
 #endif
 
 #define PRINTING_FC_PROPERTY "gfx.printing"
 
 #define LOG_FONTLIST(args) MOZ_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \
                                LogLevel::Debug, args)
@@ -1212,43 +1200,16 @@ gfxFontconfigFontFamily::SupportsLangGro
 
 /* virtual */
 gfxFontconfigFontFamily::~gfxFontconfigFontFamily()
  {
     // Should not be dropped by stylo
     MOZ_ASSERT(NS_IsMainThread());
 }
 
-void
-gfxFontconfigFontFamily::AddFacesToFontList(
-    InfallibleTArray<SystemFontListEntry>* aFontList)
-{
-    if (HasStyles()) {
-        for (auto& fe : mAvailableFonts) {
-            if (!fe) {
-                continue;
-            }
-            auto fce = static_cast<gfxFontconfigFontEntry*>(fe.get());
-            char* pattern = (char*)FcNameUnparse(fce->GetPattern());
-            nsDependentCString patternStr(pattern, strlen(pattern));
-            aFontList->AppendElement(FontPatternListEntry(patternStr,
-                                                          mContainsAppFonts));
-            free(pattern);
-        }
-    } else {
-        for (auto& pat : mFontPatterns) {
-            char* pattern = (char*)FcNameUnparse(pat);
-            nsDependentCString patternStr(pattern, strlen(pattern));
-            aFontList->AppendElement(FontPatternListEntry(patternStr,
-                                                          mContainsAppFonts));
-            free(pattern);
-        }
-    }
-}
-
 gfxFontconfigFont::gfxFontconfigFont(const RefPtr<UnscaledFontFontconfig>& aUnscaledFont,
                                      cairo_scaled_font_t *aScaledFont,
                                      FcPattern *aPattern,
                                      gfxFloat aAdjustedSize,
                                      gfxFontEntry *aFontEntry,
                                      const gfxFontStyle *aFontStyle,
                                      bool aNeedsBold)
     : gfxFT2FontBase(aUnscaledFont, aScaledFont, aFontEntry, aFontStyle)
@@ -1278,30 +1239,28 @@ gfxFontconfigFont::GetScaledFont(mozilla
 
 gfxFcPlatformFontList::gfxFcPlatformFontList()
     : mLocalNames(64)
     , mGenericMappings(32)
     , mFcSubstituteCache(64)
     , mLastConfig(nullptr)
     , mAlwaysUseFontconfigGenerics(true)
 {
-    if (XRE_IsParentProcess()) {
-        // if the rescan interval is set, start the timer
-        int rescanInterval = FcConfigGetRescanInterval(nullptr);
-        if (rescanInterval) {
-            mLastConfig = FcConfigGetCurrent();
-            NS_NewTimerWithFuncCallback(getter_AddRefs(mCheckFontUpdatesTimer),
-                                        CheckFontUpdates,
-                                        this,
-                                        (rescanInterval + 1) * 1000,
-                                        nsITimer::TYPE_REPEATING_SLACK,
-                                        "gfxFcPlatformFontList::gfxFcPlatformFontList");
-            if (!mCheckFontUpdatesTimer) {
-                NS_WARNING("Failure to create font updates timer");
-            }
+    // if the rescan interval is set, start the timer
+    int rescanInterval = FcConfigGetRescanInterval(nullptr);
+    if (rescanInterval) {
+        mLastConfig = FcConfigGetCurrent();
+        NS_NewTimerWithFuncCallback(getter_AddRefs(mCheckFontUpdatesTimer),
+                                    CheckFontUpdates,
+                                    this,
+                                    (rescanInterval + 1) * 1000,
+                                    nsITimer::TYPE_REPEATING_SLACK,
+                                    "gfxFcPlatformFontList::gfxFcPlatformFontList");
+        if (!mCheckFontUpdatesTimer) {
+            NS_WARNING("Failure to create font updates timer");
         }
     }
 
 #ifdef MOZ_BUNDLED_FONTS
     mBundledFontsInitialized = false;
 #endif
 }
 
@@ -1309,211 +1268,123 @@ gfxFcPlatformFontList::~gfxFcPlatformFon
 {
     if (mCheckFontUpdatesTimer) {
         mCheckFontUpdatesTimer->Cancel();
         mCheckFontUpdatesTimer = nullptr;
     }
 }
 
 void
-gfxFcPlatformFontList::AddFontSetFamilies(FcFontSet* aFontSet,
-                                          const SandboxPolicy* aPolicy,
-                                          bool aAppFonts)
+gfxFcPlatformFontList::AddFontSetFamilies(FcFontSet* aFontSet, bool aAppFonts)
 {
     // This iterates over the fonts in a font set and adds in gfxFontFamily
-    // objects for each family. Individual gfxFontEntry objects for each face
-    // are not created here; the patterns are just stored in the family. When
-    // a family is actually used, it will be populated with gfxFontEntry
-    // records and the patterns moved to those.
+    // objects for each family. The patterns for individual fonts are not
+    // copied here. When a family is actually used, the fonts in the family
+    // are enumerated and the patterns copied. Note that we're explicitly
+    // excluding non-scalable fonts such as X11 bitmap fonts, which
+    // Chrome Skia/Webkit code does also.
 
     if (!aFontSet) {
         NS_WARNING("AddFontSetFamilies called with a null font set.");
         return;
     }
 
     FcChar8* lastFamilyName = (FcChar8*)"";
     RefPtr<gfxFontconfigFontFamily> fontFamily;
     nsAutoString familyName;
     for (int f = 0; f < aFontSet->nfont; f++) {
-        FcPattern* pattern = aFontSet->fonts[f];
+        FcPattern* font = aFontSet->fonts[f];
 
-        // Skip any fonts that aren't readable for us (e.g. due to restrictive
-        // file ownership/permissions).
-        FcChar8* path;
-        if (FcPatternGetString(pattern, FC_FILE, 0, &path) != FcResultMatch) {
-            continue;
-        }
-        if (access(reinterpret_cast<const char*>(path), F_OK | R_OK) != 0) {
+        // get canonical name
+        uint32_t cIndex = FindCanonicalNameIndex(font, FC_FAMILYLANG);
+        FcChar8* canonical = nullptr;
+        FcPatternGetString(font, FC_FAMILY, cIndex, &canonical);
+        if (!canonical) {
             continue;
         }
 
-#ifdef MOZ_CONTENT_SANDBOX
-        // Skip any fonts that will be blocked by the content-process sandbox
-        // policy.
-        if (aPolicy && !(aPolicy->Lookup(reinterpret_cast<const char*>(path)) &
-                         SandboxBroker::Perms::MAY_READ)) {
-            continue;
-        }
-#endif
+        // same as the last one? no need to add a new family, skip
+        if (FcStrCmp(canonical, lastFamilyName) != 0) {
+            lastFamilyName = canonical;
 
-        AddPatternToFontList(pattern, lastFamilyName,
-                             familyName, fontFamily, aAppFonts);
-    }
-}
+            // add new family if one doesn't already exist
+            familyName.Truncate();
+            AppendUTF8toUTF16(ToCharPtr(canonical), familyName);
+            nsAutoString keyName(familyName);
+            ToLowerCase(keyName);
 
-void
-gfxFcPlatformFontList::AddPatternToFontList(FcPattern* aFont,
-                                            FcChar8*& aLastFamilyName,
-                                            nsAString& aFamilyName,
-                                            RefPtr<gfxFontconfigFontFamily>& aFontFamily,
-                                            bool aAppFonts)
-{
-    // get canonical name
-    uint32_t cIndex = FindCanonicalNameIndex(aFont, FC_FAMILYLANG);
-    FcChar8* canonical = nullptr;
-    FcPatternGetString(aFont, FC_FAMILY, cIndex, &canonical);
-    if (!canonical) {
-        return;
-    }
+            fontFamily = static_cast<gfxFontconfigFontFamily*>
+                             (mFontFamilies.GetWeak(keyName));
+            if (!fontFamily) {
+                fontFamily = new gfxFontconfigFontFamily(familyName);
+                mFontFamilies.Put(keyName, fontFamily);
+            }
+            // Record if the family contains fonts from the app font set
+            // (in which case we won't rely on fontconfig's charmap, due to
+            // bug 1276594).
+            if (aAppFonts) {
+                fontFamily->SetFamilyContainsAppFonts(true);
+            }
 
-    // same as the last one? no need to add a new family, skip
-    if (FcStrCmp(canonical, aLastFamilyName) != 0) {
-        aLastFamilyName = canonical;
-
-        // add new family if one doesn't already exist
-        aFamilyName.Truncate();
-        AppendUTF8toUTF16(ToCharPtr(canonical), aFamilyName);
-        nsAutoString keyName(aFamilyName);
-        ToLowerCase(keyName);
-
-        aFontFamily = static_cast<gfxFontconfigFontFamily*>
-            (mFontFamilies.GetWeak(keyName));
-        if (!aFontFamily) {
-            aFontFamily = new gfxFontconfigFontFamily(aFamilyName);
-            mFontFamilies.Put(keyName, aFontFamily);
-        }
-        // Record if the family contains fonts from the app font set
-        // (in which case we won't rely on fontconfig's charmap, due to
-        // bug 1276594).
-        if (aAppFonts) {
-            aFontFamily->SetFamilyContainsAppFonts(true);
+            // Add pointers to other localized family names. Most fonts
+            // only have a single name, so the first call to GetString
+            // will usually not match
+            FcChar8* otherName;
+            int n = (cIndex == 0 ? 1 : 0);
+            while (FcPatternGetString(font, FC_FAMILY, n, &otherName) == FcResultMatch) {
+                NS_ConvertUTF8toUTF16 otherFamilyName(ToCharPtr(otherName));
+                AddOtherFamilyName(fontFamily, otherFamilyName);
+                n++;
+                if (n == int(cIndex)) {
+                    n++; // skip over canonical name
+                }
+            }
         }
 
-        // Add pointers to other localized family names. Most fonts
-        // only have a single name, so the first call to GetString
-        // will usually not match
-        FcChar8* otherName;
-        int n = (cIndex == 0 ? 1 : 0);
-        while (FcPatternGetString(aFont, FC_FAMILY, n, &otherName) ==
-               FcResultMatch) {
-            NS_ConvertUTF8toUTF16 otherFamilyName(ToCharPtr(otherName));
-            AddOtherFamilyName(aFontFamily, otherFamilyName);
-            n++;
-            if (n == int(cIndex)) {
-                n++; // skip over canonical name
-            }
+        NS_ASSERTION(fontFamily, "font must belong to a font family");
+        fontFamily->AddFontPattern(font);
+
+        // map the psname, fullname ==> font family for local font lookups
+        nsAutoString psname, fullname;
+        GetFaceNames(font, familyName, psname, fullname);
+        if (!psname.IsEmpty()) {
+            ToLowerCase(psname);
+            mLocalNames.Put(psname, font);
         }
-    }
-
-    MOZ_ASSERT(aFontFamily, "font must belong to a font family");
-    aFontFamily->AddFontPattern(aFont);
-
-    // map the psname, fullname ==> font family for local font lookups
-    nsAutoString psname, fullname;
-    GetFaceNames(aFont, aFamilyName, psname, fullname);
-    if (!psname.IsEmpty()) {
-        ToLowerCase(psname);
-        mLocalNames.Put(psname, aFont);
-    }
-    if (!fullname.IsEmpty()) {
-        ToLowerCase(fullname);
-        mLocalNames.Put(fullname, aFont);
+        if (!fullname.IsEmpty()) {
+            ToLowerCase(fullname);
+            mLocalNames.Put(fullname, font);
+        }
     }
 }
 
 nsresult
 gfxFcPlatformFontList::InitFontListForPlatform()
 {
-#ifdef MOZ_BUNDLED_FONTS
-    ActivateBundledFonts();
-#endif
+    mLastConfig = FcConfigGetCurrent();
 
     mLocalNames.Clear();
     mFcSubstituteCache.Clear();
 
+    // iterate over available fonts
+    FcFontSet* systemFonts = FcConfigGetFonts(nullptr, FcSetSystem);
+    AddFontSetFamilies(systemFonts, /* aAppFonts = */ false);
     mAlwaysUseFontconfigGenerics = PrefFontListsUseOnlyGenerics();
 
-    if (!XRE_IsParentProcess()) {
-        // Content process: use the font list passed from the chrome process,
-        // because we can't rely on fontconfig in the presence of sandboxing;
-        // it may report fonts that we can't actually access.
-
-        FcChar8* lastFamilyName = (FcChar8*)"";
-        RefPtr<gfxFontconfigFontFamily> fontFamily;
-        nsAutoString familyName;
-
-        // Get font list that was passed during XPCOM startup
-        // or in an UpdateFontList message.
-        auto& fontList = dom::ContentChild::GetSingleton()->SystemFontList();
-
-        for (SystemFontListEntry& fle : fontList) {
-            MOZ_ASSERT(fle.type() ==
-                       SystemFontListEntry::Type::TFontPatternListEntry);
-            FontPatternListEntry& fpe(fle);
-            FcPattern* pattern =
-                FcNameParse((const FcChar8*)fpe.pattern().get());
-            AddPatternToFontList(pattern, lastFamilyName, familyName,
-                                 fontFamily, fpe.appFontFamily());
-        }
-
-        LOG_FONTLIST(("got font list from chrome process: "
-                      "%u faces in %u families",
-                      (unsigned)fontList.Length(), mFontFamilies.Count()));
-
-        return NS_OK;
-    }
-
-    mLastConfig = FcConfigGetCurrent();
-
-    UniquePtr<SandboxPolicy> policy;
-
-#ifdef MOZ_CONTENT_SANDBOX
-    // Create a temporary SandboxPolicy to check font paths; use a fake PID
-    // to avoid picking up any PID-specific rules by accident.
-    SandboxBrokerPolicyFactory policyFactory;
-    if (GetEffectiveContentSandboxLevel() > 0 &&
-        !PR_GetEnv("MOZ_DISABLE_CONTENT_SANDBOX")) {
-        policy = policyFactory.GetContentPolicy(-1, false);
-    }
-#endif
-
-    // iterate over available fonts
-    FcFontSet* systemFonts = FcConfigGetFonts(nullptr, FcSetSystem);
-    AddFontSetFamilies(systemFonts, policy.get(), /* aAppFonts = */ false);
-
 #ifdef MOZ_BUNDLED_FONTS
+    ActivateBundledFonts();
     FcFontSet* appFonts = FcConfigGetFonts(nullptr, FcSetApplication);
-    AddFontSetFamilies(appFonts, policy.get(), /* aAppFonts = */ true);
+    AddFontSetFamilies(appFonts, /* aAppFonts = */ true);
 #endif
 
     mOtherFamilyNamesInitialized = true;
 
     return NS_OK;
 }
 
-void
-gfxFcPlatformFontList::ReadSystemFontList(
-    InfallibleTArray<SystemFontListEntry>* retValue)
-{
-    for (auto iter = mFontFamilies.Iter(); !iter.Done(); iter.Next()) {
-        auto family = static_cast<gfxFontconfigFontFamily*>(iter.Data().get());
-        family->AddFacesToFontList(retValue);
-    }
-}
-
 // For displaying the fontlist in UI, use explicit call to FcFontList. Using
 // FcFontList results in the list containing the localized names as dictated
 // by system defaults.
 static void
 GetSystemFontList(nsTArray<nsString>& aListOfFonts, nsAtom *aLangGroup)
 {
     aListOfFonts.Clear();
 
@@ -2111,18 +1982,16 @@ gfxFcPlatformFontList::CheckFontUpdates(
     FcInitBringUptoDate();
 
     // update fontlist if current config changed
     gfxFcPlatformFontList *pfl = static_cast<gfxFcPlatformFontList*>(aThis);
     FcConfig* current = FcConfigGetCurrent();
     if (current != pfl->GetLastConfig()) {
         pfl->UpdateFontList();
         pfl->ForceGlobalReflow();
-
-        mozilla::dom::ContentParent::NotifyUpdatedFonts();
     }
 }
 
 gfxFontFamily*
 gfxFcPlatformFontList::CreateFontFamily(const nsAString& aName) const
 {
     return new gfxFontconfigFontFamily(aName);
 }
--- a/gfx/thebes/gfxFcPlatformFontList.h
+++ b/gfx/thebes/gfxFcPlatformFontList.h
@@ -16,26 +16,16 @@
 
 #include <fontconfig/fontconfig.h>
 #include "ft2build.h"
 #include FT_FREETYPE_H
 #include FT_TRUETYPE_TABLES_H
 #include <cairo.h>
 #include <cairo-ft.h>
 
-#ifdef MOZ_CONTENT_SANDBOX
-#include "mozilla/SandboxBroker.h"
-#endif
-
-namespace mozilla {
-    namespace dom {
-        class SystemFontListEntry;
-    };
-};
-
 template <>
 class nsAutoRefTraits<FcPattern> : public nsPointerRefTraits<FcPattern>
 {
 public:
     static void Release(FcPattern *ptr) { FcPatternDestroy(ptr); }
     static void AddRef(FcPattern *ptr) { FcPatternReference(ptr); }
 };
 
@@ -187,19 +177,16 @@ class gfxFontconfigFontFamily : public g
 public:
     explicit gfxFontconfigFontFamily(const nsAString& aName) :
         gfxFontFamily(aName),
         mContainsAppFonts(false),
         mHasNonScalableFaces(false),
         mForceScalable(false)
     { }
 
-    void AddFacesToFontList(
-        InfallibleTArray<mozilla::dom::SystemFontListEntry>* aFontList);
-
     void FindStyleVariations(FontInfoData *aFontInfoData = nullptr) override;
 
     // Families are constructed initially with just references to patterns.
     // When necessary, these are enumerated within FindStyleVariations.
     void AddFontPattern(FcPattern* aFontPattern);
 
     void SetFamilyContainsAppFonts(bool aContainsAppFonts)
     {
@@ -262,18 +249,16 @@ public:
 
     // initialize font lists
     virtual nsresult InitFontListForPlatform() override;
 
     void GetFontList(nsAtom *aLangGroup,
                      const nsACString& aGenericFamily,
                      nsTArray<nsString>& aListOfFonts) override;
 
-    void ReadSystemFontList(
-        InfallibleTArray<mozilla::dom::SystemFontListEntry>* retValue);
 
     gfxFontEntry*
     LookupLocalFont(const nsAString& aFontName, uint16_t aWeight,
                     int16_t aStretch, uint8_t aStyle) override;
 
     gfxFontEntry*
     MakePlatformFont(const nsAString& aFontName, uint16_t aWeight,
                      int16_t aStretch,
@@ -304,33 +289,19 @@ public:
         mGenericMappings.Clear();
     }
 
     static FT_Library GetFTLibrary();
 
 protected:
     virtual ~gfxFcPlatformFontList();
 
-#ifdef MOZ_CONTENT_SANDBOX
-    typedef mozilla::SandboxBroker::Policy SandboxPolicy;
-#else
-    // Dummy type just so we can still have a SandboxPolicy* parameter.
-    struct SandboxPolicy;
-#endif
-
     // Add all the font families found in a font set.
     // aAppFonts indicates whether this is the system or application fontset.
-    void AddFontSetFamilies(FcFontSet* aFontSet, const SandboxPolicy* aPolicy,
-                            bool aAppFonts);
-
-    // Helper for above, to add a single font pattern.
-    void AddPatternToFontList(FcPattern* aFont, FcChar8*& aLastFamilyName,
-                              nsAString& aFamilyName,
-                              RefPtr<gfxFontconfigFontFamily>& aFontFamily,
-                              bool aAppFonts);
+    void AddFontSetFamilies(FcFontSet* aFontSet, bool aAppFonts);
 
     // figure out which families fontconfig maps a generic to
     // (aGeneric assumed already lowercase)
     PrefFontList* FindGenericFamilies(const nsAString& aGeneric,
                                       nsAtom* aLanguage);
 
     // are all pref font settings set to use fontconfig generics?
     bool PrefFontListsUseOnlyGenerics();
--- a/gfx/thebes/gfxMacPlatformFontList.h
+++ b/gfx/thebes/gfxMacPlatformFontList.h
@@ -154,18 +154,18 @@ public:
     // Values for the entryType field in FontFamilyListEntry records passed
     // from chrome to content process.
     enum FontFamilyEntryType {
         kStandardFontFamily = 0, // a standard installed font family
         kHiddenSystemFontFamily = 1, // hidden system family, not exposed to UI
         kTextSizeSystemFontFamily = 2, // name of 'system' font at text sizes
         kDisplaySizeSystemFontFamily = 3 // 'system' font at display sizes
     };
-    void ReadSystemFontList(
-        InfallibleTArray<mozilla::dom::SystemFontListEntry>* aList);
+    void GetSystemFontFamilyList(
+        InfallibleTArray<mozilla::dom::FontFamilyListEntry>* aList);
 
 protected:
     gfxFontFamily*
     GetDefaultFontForPlatform(const gfxFontStyle* aStyle) override;
 
 private:
     friend class gfxPlatformMac;
 
--- a/gfx/thebes/gfxMacPlatformFontList.mm
+++ b/gfx/thebes/gfxMacPlatformFontList.mm
@@ -59,30 +59,28 @@
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsISimpleEnumerator.h"
 #include "nsCharTraits.h"
 #include "nsCocoaFeatures.h"
 #include "nsCocoaUtils.h"
 #include "gfxFontConstants.h"
 
 #include "mozilla/dom/ContentChild.h"
-#include "mozilla/dom/ContentParent.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Sprintf.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/gfx/2D.h"
 
 #include <unistd.h>
 #include <time.h>
 #include <dlfcn.h>
 
 using namespace mozilla;
 using namespace mozilla::gfx;
-using mozilla::dom::SystemFontListEntry;
 using mozilla::dom::FontFamilyListEntry;
 
 // indexes into the NSArray objects that the Cocoa font manager returns
 // as the available members of a family
 #define INDEX_FONT_POSTSCRIPT_NAME 0
 #define INDEX_FONT_FACE_NAME 1
 #define INDEX_FONT_WEIGHT 2
 #define INDEX_FONT_TRAITS 3
@@ -984,42 +982,34 @@ gfxMacPlatformFontList::gfxMacPlatformFo
     nsCOMPtr<nsIFile> langFonts(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv));
     if (NS_SUCCEEDED(rv)) {
         rv = langFonts->InitWithNativePath(NS_LITERAL_CSTRING(LANG_FONTS_DIR));
         if (NS_SUCCEEDED(rv)) {
             ActivateFontsFromDir(langFonts);
         }
     }
 
-    // Only the parent process listens for OS font-changed notifications;
-    // after rebuilding its list, it will update the content processes.
-    if (XRE_IsParentProcess()) {
-        ::CFNotificationCenterAddObserver(
-            ::CFNotificationCenterGetLocalCenter(),
-            this,
-            RegisteredFontsChangedNotificationCallback,
-            kCTFontManagerRegisteredFontsChangedNotification,
-            0,
-            CFNotificationSuspensionBehaviorDeliverImmediately);
-    }
+    ::CFNotificationCenterAddObserver(::CFNotificationCenterGetLocalCenter(),
+                                      this,
+                                      RegisteredFontsChangedNotificationCallback,
+                                      kCTFontManagerRegisteredFontsChangedNotification,
+                                      0,
+                                      CFNotificationSuspensionBehaviorDeliverImmediately);
 
     // cache this in a static variable so that MacOSFontFamily objects
     // don't have to repeatedly look it up
     sFontManager = [NSFontManager sharedFontManager];
 }
 
 gfxMacPlatformFontList::~gfxMacPlatformFontList()
 {
-    if (XRE_IsParentProcess()) {
-        ::CFNotificationCenterRemoveObserver(
-            ::CFNotificationCenterGetLocalCenter(),
-            this,
-            kCTFontManagerRegisteredFontsChangedNotification,
-            0);
-    }
+    ::CFNotificationCenterRemoveObserver(::CFNotificationCenterGetLocalCenter(),
+                                         this,
+                                         kCTFontManagerRegisteredFontsChangedNotification,
+                                         0);
 
     if (mDefaultFont) {
         ::CFRelease(mDefaultFont);
     }
 }
 
 void
 gfxMacPlatformFontList::AddFamily(const nsAString& aFamilyName,
@@ -1061,18 +1051,18 @@ gfxMacPlatformFontList::AddFamily(CFStri
     nsAutoString familyName;
     nsCocoaUtils::GetStringForNSString(family, familyName);
 
     bool isHiddenSystemFont = familyName[0] == '.';
     AddFamily(familyName, isHiddenSystemFont);
 }
 
 void
-gfxMacPlatformFontList::ReadSystemFontList(
-    InfallibleTArray<SystemFontListEntry>* aList)
+gfxMacPlatformFontList::GetSystemFontFamilyList(
+    InfallibleTArray<FontFamilyListEntry>* aList)
 {
     // Note: We rely on the records for mSystemTextFontFamilyName and
     // mSystemDisplayFontFamilyName (if present) being *before* the main
     // font list, so that those names are known in the content process
     // by the time we add the actual family records to the font list.
     aList->AppendElement(FontFamilyListEntry(mSystemTextFontFamilyName,
                                              kTextSizeSystemFontFamily));
     if (mUseSizeSensitiveSystemFont) {
@@ -1104,37 +1094,37 @@ gfxMacPlatformFontList::InitFontListForP
 
     // reset system font list
     mSystemFontFamilies.Clear();
 
     if (XRE_IsContentProcess()) {
         // Content process: use font list passed from the chrome process via
         // the GetXPCOMProcessAttributes message, because it's much faster than
         // querying Core Text again in the child.
-        auto& fontList = dom::ContentChild::GetSingleton()->SystemFontList();
-        for (SystemFontListEntry& fle : fontList) {
-            MOZ_ASSERT(fle.type() ==
-                       SystemFontListEntry::Type::TFontFamilyListEntry);
-            FontFamilyListEntry& ffe(fle);
-            switch (ffe.entryType()) {
+        mozilla::dom::ContentChild* cc =
+            mozilla::dom::ContentChild::GetSingleton();
+        for (auto f : cc->SystemFontFamilyList()) {
+            switch (f.entryType()) {
             case kStandardFontFamily:
-                AddFamily(ffe.familyName(), false);
+                AddFamily(f.familyName(), false);
                 break;
             case kHiddenSystemFontFamily:
-                AddFamily(ffe.familyName(), true);
+                AddFamily(f.familyName(), true);
                 break;
             case kTextSizeSystemFontFamily:
-                mSystemTextFontFamilyName = ffe.familyName();
+                mSystemTextFontFamilyName = f.familyName();
                 break;
             case kDisplaySizeSystemFontFamily:
-                mSystemDisplayFontFamilyName = ffe.familyName();
+                mSystemDisplayFontFamilyName = f.familyName();
                 mUseSizeSensitiveSystemFont = true;
                 break;
             }
         }
+        // The ContentChild doesn't need the font list any longer.
+        cc->SystemFontFamilyList().Clear();
     }
 
     // If this is the chrome process, or if for some reason we failed to get
     // a usable list above, get the available fonts from Core Text.
     if (!mFontFamilies.Count()) {
         InitSystemFontNames();
         CFArrayRef familyNames = CTFontManagerCopyAvailableFontFamilyNames();
         for (NSString* familyName in (NSArray*)familyNames) {
@@ -1348,18 +1338,16 @@ gfxMacPlatformFontList::RegisteredFontsC
 
     gfxMacPlatformFontList* fl = static_cast<gfxMacPlatformFontList*>(observer);
 
     // xxx - should be carefully pruning the list of fonts, not rebuilding it from scratch
     fl->UpdateFontList();
 
     // modify a preference that will trigger reflow everywhere
     fl->ForceGlobalReflow();
-
-    mozilla::dom::ContentParent::NotifyUpdatedFonts();
 }
 
 gfxFontEntry*
 gfxMacPlatformFontList::PlatformGlobalFontFallback(const uint32_t aCh,
                                                    Script aRunScript,
                                                    const gfxFontStyle* aMatchStyle,
                                                    gfxFontFamily** aMatchedFamily)
 {
--- a/gfx/thebes/gfxPlatform.h
+++ b/gfx/thebes/gfxPlatform.h
@@ -59,17 +59,17 @@ class FeatureState;
 inline uint32_t
 BackendTypeBit(BackendType b)
 {
   return 1 << uint8_t(b);
 }
 
 } // namespace gfx
 namespace dom {
-class SystemFontListEntry;
+class FontFamilyListEntry;
 }
 } // namespace mozilla
 
 #define MOZ_PERFORMANCE_WARNING(module, ...) \
   do { \
     if (gfxPlatform::PerfWarnings()) { \
       printf_stderr("[" module "] " __VA_ARGS__); \
     } \
@@ -332,22 +332,22 @@ public:
      * that correspond to the given language group or generic font family
      * (or both, or neither).
      */
     virtual nsresult GetFontList(nsAtom *aLangGroup,
                                  const nsACString& aGenericFamily,
                                  nsTArray<nsString>& aListOfFonts);
 
     /**
-     * Fill aFontList with a list of SystemFontListEntry records for the
+     * Fill aFontFamilies with a list of FontFamilyListEntry records for the
      * available fonts on the platform; used to pass the list from chrome to
-     * content process. Currently implemented only on MacOSX and Linux.
+     * content process. Currently implemented only on MacOSX.
      */
-    virtual void ReadSystemFontList(
-      InfallibleTArray<mozilla::dom::SystemFontListEntry>* aFontList)
+    virtual void GetSystemFontFamilyList(
+      InfallibleTArray<mozilla::dom::FontFamilyListEntry>* aFontFamilies)
     { }
 
     /**
      * Rebuilds the any cached system font lists
      */
     virtual nsresult UpdateFontList();
 
     /**
--- a/gfx/thebes/gfxPlatformGtk.cpp
+++ b/gfx/thebes/gfxPlatformGtk.cpp
@@ -60,17 +60,16 @@
 
 #define GDK_PIXMAP_SIZE_MAX 32767
 
 #define GFX_PREF_MAX_GENERIC_SUBSTITUTIONS "gfx.font_rendering.fontconfig.max_generic_substitutions"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 using namespace mozilla::unicode;
-using mozilla::dom::SystemFontListEntry;
 
 #if (MOZ_WIDGET_GTK == 2)
 static cairo_user_data_key_t cairo_gdk_drawable_key;
 #endif
 
 gfxPlatformGtk::gfxPlatformGtk()
 {
     if (!gfxPlatform::IsHeadless()) {
@@ -245,23 +244,16 @@ gfxPlatformGtk::GetCommonFallbackFonts(u
          ((aCh >> 16) == 2))) {
         aFontList.AppendElement(kFontTakaoPGothic);
         aFontList.AppendElement(kFontDroidSansFallback);
         aFontList.AppendElement(kFontWenQuanYiMicroHei);
         aFontList.AppendElement(kFontNanumGothic);
     }
 }
 
-void
-gfxPlatformGtk::ReadSystemFontList(
-    InfallibleTArray<SystemFontListEntry>* retValue)
-{
-    gfxFcPlatformFontList::PlatformFontList()->ReadSystemFontList(retValue);
-}
-
 gfxPlatformFontList*
 gfxPlatformGtk::CreatePlatformFontList()
 {
     gfxPlatformFontList* list = new gfxFcPlatformFontList();
     if (NS_SUCCEEDED(list->InitFontList())) {
         return list;
     }
     gfxPlatformFontList::Shutdown();
--- a/gfx/thebes/gfxPlatformGtk.h
+++ b/gfx/thebes/gfxPlatformGtk.h
@@ -17,34 +17,25 @@ extern "C" {
 }
 #endif
 
 #ifdef MOZ_X11
 struct _XDisplay;
 typedef struct _XDisplay Display;
 #endif // MOZ_X11
 
-namespace mozilla {
-    namespace dom {
-        class SystemFontListEntry;
-    };
-};
-
 class gfxPlatformGtk : public gfxPlatform {
 public:
     gfxPlatformGtk();
     virtual ~gfxPlatformGtk();
 
     static gfxPlatformGtk *GetPlatform() {
         return (gfxPlatformGtk*) gfxPlatform::GetPlatform();
     }
 
-    void ReadSystemFontList(
-        InfallibleTArray<mozilla::dom::SystemFontListEntry>* retValue) override;
-
     virtual already_AddRefed<gfxASurface>
       CreateOffscreenSurface(const IntSize& aSize,
                              gfxImageFormat aFormat) override;
 
     virtual nsresult GetFontList(nsAtom *aLangGroup,
                                  const nsACString& aGenericFamily,
                                  nsTArray<nsString>& aListOfFonts) override;
 
--- a/gfx/thebes/gfxPlatformMac.cpp
+++ b/gfx/thebes/gfxPlatformMac.cpp
@@ -25,17 +25,17 @@
 #include <CoreVideo/CoreVideo.h>
 
 #include "mozilla/layers/CompositorBridgeParent.h"
 #include "VsyncSource.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 
-using mozilla::dom::SystemFontListEntry;
+using mozilla::dom::FontFamilyListEntry;
 
 // cribbed from CTFontManager.h
 enum {
    kAutoActivationDisabled = 1
 };
 typedef uint32_t AutoActivationSetting;
 
 // bug 567552 - disable auto-activation of fonts
@@ -108,20 +108,21 @@ gfxPlatformMac::CreatePlatformFontList()
     if (NS_SUCCEEDED(list->InitFontList())) {
         return list;
     }
     gfxPlatformFontList::Shutdown();
     return nullptr;
 }
 
 void
-gfxPlatformMac::ReadSystemFontList(
-    InfallibleTArray<SystemFontListEntry>* aFontList)
+gfxPlatformMac::GetSystemFontFamilyList(
+    InfallibleTArray<FontFamilyListEntry>* aFontFamilies)
 {
-    gfxMacPlatformFontList::PlatformFontList()->ReadSystemFontList(aFontList);
+    gfxMacPlatformFontList::PlatformFontList()->
+        GetSystemFontFamilyList(aFontFamilies);
 }
 
 already_AddRefed<gfxASurface>
 gfxPlatformMac::CreateOffscreenSurface(const IntSize& aSize,
                                        gfxImageFormat aFormat)
 {
     if (!Factory::AllowedSurfaceSize(aSize)) {
         return nullptr;
--- a/gfx/thebes/gfxPlatformMac.h
+++ b/gfx/thebes/gfxPlatformMac.h
@@ -35,18 +35,18 @@ public:
                     const gfxFontStyle *aStyle,
                     gfxTextPerfMetrics* aTextPerf,
                     gfxUserFontSet *aUserFontSet,
                     gfxFloat aDevToCssSize) override;
 
     virtual gfxPlatformFontList* CreatePlatformFontList() override;
 
     void
-    ReadSystemFontList(InfallibleTArray<mozilla::dom::SystemFontListEntry>*
-                       aFontList) override;
+    GetSystemFontFamilyList(InfallibleTArray<mozilla::dom::FontFamilyListEntry>*
+                            aFontFamilies) override;
 
     bool IsFontFormatSupported(uint32_t aFormatFlags) override;
 
     virtual void GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
                                         Script aRunScript,
                                         nsTArray<const char*>& aFontList) override;
 
     // lookup the system font for a particular system font type and set