Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: third_party/WebKit/Source/core/css/FontFaceSet.cpp

Issue 2340273002: Fix FontFaceSet state getting stuck at loading (Closed)
Patch Set: Separate test case Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/css/FontFaceSet.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/FontFaceSet.cpp
diff --git a/third_party/WebKit/Source/core/css/FontFaceSet.cpp b/third_party/WebKit/Source/core/css/FontFaceSet.cpp
index 44228468db9f65f7681215fe8d5ec67c0325f9e0..d14839a1aede17e9e26d01c8ef8d4f8171fbc375 100644
--- a/third_party/WebKit/Source/core/css/FontFaceSet.cpp
+++ b/third_party/WebKit/Source/core/css/FontFaceSet.cpp
@@ -47,7 +47,8 @@ namespace blink {
static const int defaultFontSize = 10;
static const char defaultFontFamily[] = "sans-serif";
-class LoadFontPromiseResolver final : public FontFace::LoadFontCallback {
+class LoadFontPromiseResolver final : public GarbageCollectedFinalized<LoadFontPromiseResolver>, public FontFace::LoadFontCallback {
+ USING_GARBAGE_COLLECTED_MIXIN(LoadFontPromiseResolver);
public:
static LoadFontPromiseResolver* create(FontFaceArray faces, ScriptState* scriptState)
{
@@ -218,14 +219,14 @@ void FontFaceSet::beginFontLoading(FontFace* fontFace)
addToLoadingFonts(fontFace);
}
-void FontFaceSet::fontLoaded(FontFace* fontFace)
+void FontFaceSet::notifyLoaded(FontFace* fontFace)
{
m_histogram.updateStatus(fontFace);
m_loadedFonts.append(fontFace);
removeFromLoadingFonts(fontFace);
}
-void FontFaceSet::loadError(FontFace* fontFace)
+void FontFaceSet::notifyError(FontFace* fontFace)
{
m_histogram.updateStatus(fontFace);
m_failedFonts.append(fontFace);
@@ -250,6 +251,7 @@ void FontFaceSet::addToLoadingFonts(FontFace* fontFace)
handlePendingEventsAndPromisesSoon();
}
m_loadingFonts.add(fontFace);
+ fontFace->addCallback(this);
}
void FontFaceSet::removeFromLoadingFonts(FontFace* fontFace)
@@ -554,6 +556,7 @@ DEFINE_TRACE(FontFaceSet)
EventTargetWithInlineData::trace(visitor);
Supplement<Document>::trace(visitor);
ActiveDOMObject::trace(visitor);
+ FontFace::LoadFontCallback::trace(visitor);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/FontFaceSet.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698