Unreviewed, rolling out r201551 and r201552.
authorryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Jun 2016 21:40:16 +0000 (21:40 +0000)
committerryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Jun 2016 21:40:16 +0000 (21:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=158275

This change caused 3 API tests to crash on ios-simulator
(Requested by ryanhaddad on #webkit).

Reverted changesets:

"Precache primary font in a secondary thread"
https://bugs.webkit.org/show_bug.cgi?id=158243
http://trac.webkit.org/changeset/201551

"Remove accidental fprintf."
http://trac.webkit.org/changeset/201552

Patch by Commit Queue <commit-queue@webkit.org> on 2016-06-01

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201570 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/CSSFontFace.cpp
Source/WebCore/css/CSSFontFace.h
Source/WebCore/css/CSSFontFaceSource.cpp
Source/WebCore/css/CSSFontFaceSource.h
Source/WebCore/css/CSSFontSelector.cpp
Source/WebCore/css/CSSFontSelector.h
Source/WebCore/css/CSSSegmentedFontFace.cpp
Source/WebCore/css/CSSSegmentedFontFace.h
Source/WebCore/platform/graphics/FontCache.cpp
Source/WebCore/platform/graphics/FontCache.h
Source/WebCore/platform/graphics/FontCascade.cpp
Source/WebCore/platform/graphics/FontSelector.h
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp

index 7e39f3a..822ff10 100644 (file)
@@ -1,3 +1,20 @@
+2016-06-01  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r201551 and r201552.
+        https://bugs.webkit.org/show_bug.cgi?id=158275
+
+        This change caused 3 API tests to crash on ios-simulator
+        (Requested by ryanhaddad on #webkit).
+
+        Reverted changesets:
+
+        "Precache primary font in a secondary thread"
+        https://bugs.webkit.org/show_bug.cgi?id=158243
+        http://trac.webkit.org/changeset/201551
+
+        "Remove accidental fprintf."
+        http://trac.webkit.org/changeset/201552
+
 2016-06-01  Chris Fleizach  <cfleizach@apple.com>
 
         AX: iOS: VoiceOver can't access attachments in mail messages
index 9de92c6..0782e80 100644 (file)
@@ -520,19 +520,6 @@ RefPtr<Font> CSSFontFace::font(const FontDescription& fontDescription, bool synt
     return nullptr;
 }
 
-Vector<ResolvedFontFamily> CSSFontFace::resolveFamilies() const
-{
-    Vector<ResolvedFontFamily> result;
-    for (auto& source : m_sources) {
-        if (source->familyNameOrURI().isEmpty())
-            continue;
-        if (source->status() == CSSFontFaceSource::Status::Failure)
-            continue;
-        result.append({ source->familyNameOrURI(), source->url() });
-    }
-    return result;
-}
-
 #if ENABLE(SVG_FONTS)
 bool CSSFontFace::hasSVGFontFaceSource() const
 {
index 69c4cc2..544e3d8 100644 (file)
@@ -27,7 +27,6 @@
 
 #include "CSSFontFaceRule.h"
 #include "FontFeatureSettings.h"
-#include "FontSelector.h"
 #include "TextFlags.h"
 #include <memory>
 #include <wtf/Forward.h>
@@ -136,8 +135,6 @@ public:
     // We don't guarantee that the FontFace wrapper will be the same every time you ask for it.
     Ref<FontFace> wrapper();
 
-    Vector<ResolvedFontFamily> resolveFamilies() const;
-
 #if ENABLE(SVG_FONTS)
     bool hasSVGFontFaceSource() const;
 #endif
index fa822a2..e95656f 100644 (file)
@@ -188,13 +188,6 @@ RefPtr<Font> CSSFontFaceSource::font(const FontDescription& fontDescription, boo
     return nullptr;
 }
 
-Optional<URL> CSSFontFaceSource::url() const
-{
-    if (!m_font)
-        return Nullopt;
-    return m_font->url();
-}
-
 #if ENABLE(SVG_FONTS)
 bool CSSFontFaceSource::isSVGFontFaceSource() const
 {
index 27f80ba..08d45a8 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "CachedFontClient.h"
 #include "CachedResourceHandle.h"
-#include "URL.h"
 #include <runtime/ArrayBufferView.h>
 #include <wtf/text/AtomicString.h>
 
@@ -72,8 +71,6 @@ public:
     bool isSVGFontFaceSource() const;
 #endif
 
-    Optional<URL> url() const;
-
 private:
     void fontLoaded(CachedFont&) override;
 
index 31f4e2d..e8b2185 100644 (file)
@@ -334,22 +334,4 @@ RefPtr<Font> CSSFontSelector::fallbackFontAt(const FontDescription& fontDescript
     return FontCache::singleton().fontForFamily(fontDescription, settings->pictographFontFamily());
 }
 
-Vector<ResolvedFontFamily> CSSFontSelector::resolveFamilies(const Vector<AtomicString>& families, const FontDescription& fontDescription, UChar32 character)
-{
-    Vector<ResolvedFontFamily> result;
-
-    for (auto& family : families) {
-        if (family.isEmpty())
-            continue;
-        auto* segmentedFace = m_cssFontFaceSet->getFontFace(fontDescription.traitsMask(), family);
-        if (!segmentedFace) {
-            result.append({ resolveGenericFamily(m_document, fontDescription, family), { } });
-            continue;
-        }
-        result.appendVector(segmentedFace->resolveFamilies(character));
-    }
-
-    return result;
-}
-
 }
index e4231db..5ec4271 100644 (file)
@@ -64,8 +64,6 @@ public:
     size_t fallbackFontCount() override;
     RefPtr<Font> fallbackFontAt(const FontDescription&, size_t) override;
 
-    Vector<ResolvedFontFamily> resolveFamilies(const Vector<AtomicString>&, const FontDescription&, UChar32) override;
-
     void clearDocument();
 
     void addFontFaceRule(StyleRuleFontFace&, bool isInitiatingElementInUserAgentShadowTree);
index 2ef5b4d..778e649 100644 (file)
@@ -138,20 +138,4 @@ FontRanges CSSSegmentedFontFace::fontRanges(const FontDescription& fontDescripti
     return result;
 }
 
-Vector<ResolvedFontFamily> CSSSegmentedFontFace::resolveFamilies(UChar32 character) const
-{
-    for (auto& face : m_fontFaces) {
-        bool inRange = face->ranges().isEmpty();
-        for (auto& range : face->ranges()) {
-            if (character >= range.from && character <= range.to) {
-                inRange = true;
-                break;
-            }
-        }
-        if (inRange)
-            return face->resolveFamilies();
-    }
-    return { };
-}
-
 }
index f2538b0..e1bd5a6 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "CSSFontFace.h"
 #include "FontCache.h"
-#include "FontSelector.h"
 #include <wtf/HashMap.h>
 #include <wtf/RefCounted.h>
 #include <wtf/Vector.h>
@@ -58,8 +57,6 @@ public:
     void ref() override { RefCounted<CSSSegmentedFontFace>::ref(); }
     void deref() override { RefCounted<CSSSegmentedFontFace>::deref(); }
 
-    Vector<ResolvedFontFamily> resolveFamilies(UChar32 character) const;
-
 private:
     CSSSegmentedFontFace();
     void fontLoaded(CSSFontFace&) override;
index 735b5af..806c76d 100644 (file)
@@ -106,7 +106,6 @@ public:
         , m_fontFaceFeatures(fontFaceFeatures ? *fontFaceFeatures : FontFeatureSettings())
         , m_fontFaceVariantSettings(fontFaceVariantSettings ? *fontFaceVariantSettings : FontVariantSettings())
     { }
-    FontPlatformDataCacheKey(const FontPlatformDataCacheKey&) = default;
 
     explicit FontPlatformDataCacheKey(HashTableDeletedValueType t)
         : m_fontDescriptionKey(t)
@@ -160,16 +159,6 @@ static FontPlatformDataCache& fontPlatformDataCache()
     return cache;
 }
 
-#if PLATFORM(COCOA) && ENABLE(PLATFORM_FONT_LOOKUP)
-using PrecacheMap = HashMap<FontPlatformDataCacheKey, FontCache::PrecacheTask*, FontPlatformDataCacheKeyHash, WTF::SimpleClassHashTraits<FontPlatformDataCacheKey>>;
-
-static PrecacheMap& precacheTasksInProgress()
-{
-    static NeverDestroyed<PrecacheMap> map;
-    return map;
-}
-#endif
-
 static AtomicString alternateFamilyName(const AtomicString& familyName)
 {
     switch (familyName.length()) {
@@ -254,12 +243,6 @@ FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fo
 
     FontPlatformDataCacheKey key(familyName, fontDescription, fontFaceFeatures, fontFaceVariantSettings);
 
-#if PLATFORM(COCOA) && ENABLE(PLATFORM_FONT_LOOKUP)
-    auto* precacheTask = precacheTasksInProgress().get(key);
-    if (precacheTask)
-        platformCancelPrecache(*precacheTask);
-#endif
-
     auto addResult = fontPlatformDataCache().add(key, nullptr);
     FontPlatformDataCache::iterator it = addResult.iterator;
     if (addResult.isNewEntry) {
@@ -506,66 +489,6 @@ void FontCache::invalidate()
     purgeInactiveFontData();
 }
 
-#if PLATFORM(COCOA) && ENABLE(PLATFORM_FONT_LOOKUP)
-void FontCache::precache(const Vector<AtomicString>& resolvedFamilies, const FontDescription& fontDescription)
-{
-    if (resolvedFamilies.isEmpty())
-        return;
-    auto& family = resolvedFamilies.first();
-
-    FontPlatformDataCacheKey key(family, fontDescription, nullptr, nullptr);
-
-    // Maybe we have it already?
-    auto it = fontPlatformDataCache().find(key);
-    if (it != fontPlatformDataCache().end()) {
-        if (it->value)
-            return;
-
-        // We already know this font isn't available. Try the next.
-        Vector<AtomicString> remainingFamilies;
-        remainingFamilies.appendRange(resolvedFamilies.begin() + 1, resolvedFamilies.end());
-        precache(remainingFamilies, fontDescription);
-        return;
-    }
-
-    auto taskAdd = precacheTasksInProgress().add(key, nullptr);
-    if (!taskAdd.isNewEntry)
-        return;
-
-    auto& task = platformPrecache(family, fontDescription, [key, resolvedFamilies, fontDescription] (auto platformData, bool wasCanceled) {
-        precacheTasksInProgress().remove(key);
-
-        if (wasCanceled)
-            return;
-
-        if (platformData) {
-            fontPlatformDataCache().add(key, WTFMove(platformData));
-            return;
-        }
-
-        // Didn't find the font. Try the next one.
-        Vector<AtomicString> remainingFamilies;
-
-        auto alternateName = alternateFamilyName(resolvedFamilies.first());
-        if (!alternateName.isNull()) {
-            remainingFamilies = resolvedFamilies;
-            remainingFamilies.first() = alternateName;
-        } else {
-            fontPlatformDataCache().add(key, nullptr);
-            remainingFamilies.appendRange(resolvedFamilies.begin() + 1, resolvedFamilies.end());
-        }
-
-        singleton().precache(remainingFamilies, fontDescription);
-    });
-
-    taskAdd.iterator->value = &task;
-}
-#else
-void FontCache::precache(const Vector<AtomicString>&, const FontDescription&)
-{
-}
-#endif
-
 #if !PLATFORM(COCOA)
 RefPtr<Font> FontCache::similarFont(const FontDescription&, const AtomicString&)
 {
index 25a6240..e88dea4 100644 (file)
@@ -193,8 +193,6 @@ public:
     WEBCORE_EXPORT Ref<Font> fontForPlatformData(const FontPlatformData&);
     RefPtr<Font> similarFont(const FontDescription&, const AtomicString& family);
 
-    void precache(const Vector<AtomicString>& resolvedFamilies, const FontDescription&);
-
     void addClient(FontSelector&);
     void removeClient(FontSelector&);
 
@@ -214,8 +212,6 @@ public:
     RefPtr<OpenTypeVerticalData> verticalData(const FontPlatformData&);
 #endif
 
-    struct PrecacheTask;
-
 private:
     FontCache();
     ~FontCache() = delete;
@@ -231,12 +227,6 @@ private:
 #endif
     std::unique_ptr<FontPlatformData> createFontPlatformData(const FontDescription&, const AtomicString& family, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings);
 
-#if PLATFORM(COCOA) && ENABLE(PLATFORM_FONT_LOOKUP)
-    using PrecacheCompletionHandler = std::function<void (std::unique_ptr<FontPlatformData>, bool wasCanceled)>;
-    PrecacheTask& platformPrecache(const AtomicString& family, const FontDescription&, PrecacheCompletionHandler&&);
-    void platformCancelPrecache(PrecacheTask&);
-#endif
-
     Timer m_purgeTimer;
 
 #if PLATFORM(COCOA)
index 026ebad..e74a8c8 100644 (file)
@@ -261,29 +261,6 @@ void pruneSystemFallbackFonts()
         entry->fonts->pruneSystemFallbacks();
 }
 
-static void precachePrimaryFamily(const FontCascadeDescription& fontDescription, FontSelector& fontSelector)
-{
-    Vector<AtomicString> families;
-    for (unsigned i = 0; i < fontDescription.familyCount(); ++i)
-        families.append(fontDescription.familyAt(i));
-
-    // Primary family lookup falls back to the standard family.
-    families.append(standardFamily);
-
-    auto resolvedPrimaryFamilies = fontSelector.resolveFamilies(families, fontDescription, ' ');
-
-    Vector<AtomicString> resolvedPrimaryFamilyNames;
-    for (auto& family : resolvedPrimaryFamilies) {
-        // This doesn't handle web fonts for now.
-        if (family.url)
-            break;
-        resolvedPrimaryFamilyNames.append(family.name);
-    }
-
-    // Asynchronously find first available font and precache it so it is likely to be available when needed.
-    FontCache::singleton().precache(resolvedPrimaryFamilyNames, fontDescription);
-}
-
 static Ref<FontCascadeFonts> retrieveOrAddCachedFonts(const FontCascadeDescription& fontDescription, RefPtr<FontSelector>&& fontSelector)
 {
     auto key = makeFontCascadeCacheKey(fontDescription, fontSelector.get());
@@ -293,9 +270,6 @@ static Ref<FontCascadeFonts> retrieveOrAddCachedFonts(const FontCascadeDescripti
     if (!addResult.isNewEntry && keysMatch(addResult.iterator->value->key, key))
         return addResult.iterator->value->fonts.get();
 
-    if (fontSelector)
-        precachePrimaryFamily(fontDescription, *fontSelector);
-
     auto& newEntry = addResult.iterator->value;
     newEntry = std::make_unique<FontCascadeCacheEntry>(WTFMove(key), FontCascadeFonts::create(WTFMove(fontSelector)));
     Ref<FontCascadeFonts> glyphs = newEntry->fonts.get();
index d365fc6..01f4842 100644 (file)
@@ -26,7 +26,6 @@
 #pragma once
 
 #include "FontRanges.h"
-#include "URL.h"
 #include <wtf/Forward.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
@@ -45,11 +44,6 @@ public:
     virtual bool isLoading() const = 0;
 };
 
-struct ResolvedFontFamily {
-    AtomicString name;
-    Optional<URL> url;
-};
-
 class FontSelector : public RefCounted<FontSelector> {
 public:
     virtual ~FontSelector() { }
@@ -64,8 +58,6 @@ public:
     virtual void registerForInvalidationCallbacks(FontSelectorClient&) = 0;
     virtual void unregisterForInvalidationCallbacks(FontSelectorClient&) = 0;
 
-    virtual Vector<ResolvedFontFamily> resolveFamilies(const Vector<AtomicString>& families, const FontDescription&, UChar32 character) = 0;
-
     virtual unsigned uniqueId() const = 0;
     virtual unsigned version() const = 0;
 };
index 09e6f3d..c08a398 100644 (file)
@@ -34,8 +34,6 @@
 #include <wtf/HashSet.h>
 #include <wtf/MainThread.h>
 #include <wtf/NeverDestroyed.h>
-#include <wtf/RunLoop.h>
-#include <wtf/WorkQueue.h>
 
 namespace WebCore {
 
@@ -662,7 +660,18 @@ void FontCache::setFontWhitelist(const Vector<String>& inputWhitelist)
         whitelist.add(item);
 }
 
-static RetainPtr<CTFontRef> fontWithFamily(const String& family, CTFontSymbolicTraits desiredTraits, FontWeight weight, const FontFeatureSettings& featureSettings, const FontVariantSettings& variantSettings, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, const TextRenderingMode& textRenderingMode, float size, bool isWhitelisted)
+#if ENABLE(PLATFORM_FONT_LOOKUP)
+static RetainPtr<CTFontRef> platformFontLookupWithFamily(const AtomicString& family, CTFontSymbolicTraits requestedTraits, FontWeight weight, float size)
+{
+    const auto& whitelist = fontWhitelist();
+    if (whitelist.size() && !whitelist.contains(family))
+        return nullptr;
+
+    return adoptCF(CTFontCreateForCSS(family.string().createCFString().get(), toCoreTextFontWeight(weight), requestedTraits, size));
+}
+#endif
+
+static RetainPtr<CTFontRef> fontWithFamily(const AtomicString& family, CTFontSymbolicTraits desiredTraits, FontWeight weight, const FontFeatureSettings& featureSettings, const FontVariantSettings& variantSettings, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, const TextRenderingMode& textRenderingMode, float size)
 {
     if (family.isEmpty())
         return nullptr;
@@ -670,11 +679,8 @@ static RetainPtr<CTFontRef> fontWithFamily(const String& family, CTFontSymbolicT
     RetainPtr<CTFontRef> foundFont = platformFontWithFamilySpecialCase(family, weight, desiredTraits, size);
     if (!foundFont) {
 #if ENABLE(PLATFORM_FONT_LOOKUP)
-        if (!isWhitelisted)
-            return nullptr;
-        foundFont = adoptCF(CTFontCreateForCSS(family.createCFString().get(), toCoreTextFontWeight(weight), desiredTraits, size));
+        foundFont = platformFontLookupWithFamily(family, desiredTraits, weight, size);
 #else
-        UNUSED_PARAM(isWhitelisted);
         foundFont = platformFontWithFamily(family, desiredTraits, weight, textRenderingMode, size);
 #endif
     }
@@ -713,24 +719,24 @@ static void autoActivateFont(const String& name, CGFloat size)
 }
 #endif
 
-// This is only thread safe with ENABLE(PLATFORM_FONT_LOOKUP) due to fontWithFamily() implementation
-static std::unique_ptr<FontPlatformData> createFontPlatformDataThreadSafe(const FontDescription& fontDescription, const String& family, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, bool isWhitelisted, bool shouldAutoActivateIfNeeded)
+std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings)
 {
     CTFontSymbolicTraits traits = computeTraits(fontDescription);
     float size = fontDescription.computedPixelSize();
 
-    RetainPtr<CTFontRef> font = fontWithFamily(family, traits, fontDescription.weight(), fontDescription.featureSettings(), fontDescription.variantSettings(), fontFaceFeatures, fontFaceVariantSettings, fontDescription.textRenderingMode(), size, isWhitelisted);
+    RetainPtr<CTFontRef> font = fontWithFamily(family, traits, fontDescription.weight(), fontDescription.featureSettings(), fontDescription.variantSettings(), fontFaceFeatures, fontFaceVariantSettings, fontDescription.textRenderingMode(), size);
 
 #if PLATFORM(MAC)
-    if (!font && shouldAutoActivateIfNeeded) {
+    if (!font) {
+        if (!shouldAutoActivateFontIfNeeded(family))
+            return nullptr;
+
         // Auto activate the font before looking for it a second time.
         // Ignore the result because we want to use our own algorithm to actually find the font.
-        autoActivateFont(family, size);
+        autoActivateFont(family.string(), size);
 
-        font = fontWithFamily(family, traits, fontDescription.weight(), fontDescription.featureSettings(), fontDescription.variantSettings(), fontFaceFeatures, fontFaceVariantSettings, fontDescription.textRenderingMode(), size, isWhitelisted);
+        font = fontWithFamily(family, traits, fontDescription.weight(), fontDescription.featureSettings(), fontDescription.variantSettings(), fontFaceFeatures, fontFaceVariantSettings, fontDescription.textRenderingMode(), size);
     }
-#else
-    UNUSED_PARAM(shouldAutoActivateIfNeeded);
 #endif
 
     if (!font)
@@ -742,19 +748,6 @@ static std::unique_ptr<FontPlatformData> createFontPlatformDataThreadSafe(const
     return std::make_unique<FontPlatformData>(font.get(), size, syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.textRenderingMode());
 }
 
-std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings)
-{
-    const auto& whitelist = fontWhitelist();
-    bool isWhitelisted = whitelist.isEmpty() || whitelist.contains(family);
-
-    bool shouldAutoActivateIfNeeded = false;
-#if PLATFORM(MAC)
-    shouldAutoActivateIfNeeded = shouldAutoActivateFontIfNeeded(family);
-#endif
-
-    return createFontPlatformDataThreadSafe(fontDescription, family, fontFaceFeatures, fontFaceVariantSettings, isWhitelisted, shouldAutoActivateIfNeeded);
-}
-
 typedef HashSet<RetainPtr<CTFontRef>, WTF::RetainPtrObjectHash<CTFontRef>, WTF::RetainPtrObjectHashTraits<CTFontRef>> FallbackDedupSet;
 static FallbackDedupSet& fallbackDedupSet()
 {
@@ -803,53 +796,4 @@ RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& descr
     return fontForPlatformData(alternateFont);
 }
 
-#if ENABLE(PLATFORM_FONT_LOOKUP)
-struct FontCache::PrecacheTask {
-    String family;
-    FontDescription fontDescription;
-    bool shouldAutoActivateIfNeeded { false };
-    bool isWhitelisted { true };
-    PrecacheCompletionHandler completionHandler;
-
-    std::unique_ptr<FontPlatformData> result;
-    std::atomic_bool isCanceled { false };
-};
-
-FontCache::PrecacheTask& FontCache::platformPrecache(const AtomicString& family, const FontDescription& fontDescription, PrecacheCompletionHandler&& completionHandler)
-{
-    static WorkQueue& queue = WorkQueue::create("org.webkit.font-precache", WorkQueue::Type::Serial, WorkQueue::QOS::UserInitiated).leakRef();
-
-    auto task = std::make_unique<PrecacheTask>();
-    task->family = family;
-    task->fontDescription = fontDescription;
-    const auto& whitelist = fontWhitelist();
-    task->isWhitelisted = whitelist.isEmpty() || whitelist.contains(family);
-#if PLATFORM(MAC)
-    task->shouldAutoActivateIfNeeded = shouldAutoActivateFontIfNeeded(family);
-#endif
-    task->completionHandler = WTFMove(completionHandler);
-
-    auto& resultTask = *task;
-
-    queue.dispatch([task = task.release()] {
-        if (!task->isCanceled) {
-            auto family = task->family.isolatedCopy();
-            task->result = createFontPlatformDataThreadSafe(task->fontDescription, family, nullptr, nullptr, task->isWhitelisted, task->shouldAutoActivateIfNeeded);
-        }
-
-        RunLoop::main().dispatch([task] {
-            std::unique_ptr<PrecacheTask> deleter(task);
-            task->completionHandler(WTFMove(task->result), task->isCanceled);
-        });
-    });
-
-    return resultTask;
-}
-
-void FontCache::platformCancelPrecache(FontCache::PrecacheTask& task)
-{
-    task.isCanceled = true;
-}
-#endif
-
 }