Index: third_party/WebKit/Source/core/css/RemoteFontFaceSource.h |
diff --git a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h |
index d10c7371756135cac93b46227096527ee5161434..2e3753c22b59dcb9724af624f13c5fc2bfd5e904 100644 |
--- a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h |
+++ b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.h |
@@ -14,9 +14,17 @@ namespace blink { |
class FontLoader; |
+enum FontDisplay { |
+ FontDisplayAuto, |
+ FontDisplayBlock, |
+ FontDisplaySwap, |
+ FontDisplayFallback, |
+ FontDisplayOptional |
+}; |
+ |
class RemoteFontFaceSource final : public CSSFontFaceSource, public FontResourceClient { |
public: |
- explicit RemoteFontFaceSource(FontResource*, PassRefPtrWillBeRawPtr<FontLoader>); |
+ explicit RemoteFontFaceSource(FontResource*, PassRefPtrWillBeRawPtr<FontLoader>, FontDisplay); |
~RemoteFontFaceSource() override; |
FontResource* resource() override { return m_font.get(); } |
@@ -28,7 +36,8 @@ public: |
void didStartFontLoad(FontResource*) override; |
void fontLoaded(FontResource*) override; |
- void fontLoadWaitLimitExceeded(FontResource*) override; |
+ void fontLoadShortLimitExceeded(FontResource*) override; |
+ void fontLoadLongLimitExceeded(FontResource*) override; |
// For UMA reporting |
bool hadBlankText() override { return m_histograms.hadBlankText(); } |
@@ -42,6 +51,8 @@ protected: |
void pruneTable(); |
private: |
+ enum DisplayPeriod { BlockPeriod, SwapPeriod, FailurePeriod }; |
+ |
class FontLoadHistograms { |
DISALLOW_ALLOCATION(); |
public: |
@@ -57,8 +68,13 @@ private: |
double m_fallbackPaintTime; |
}; |
+ void switchToSwapPeriod(); |
+ void switchToFailurePeriod(); |
+ |
ResourcePtr<FontResource> m_font; |
RefPtrWillBeMember<FontLoader> m_fontLoader; |
+ const FontDisplay m_display; |
+ DisplayPeriod m_period; |
FontLoadHistograms m_histograms; |
}; |