Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp |
| diff --git a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp |
| index 57e48b357383b9e79a6dbd8d8a53cf995dde2af5..5eda5f758ae6cb8f7eb94e927e32c49d24e304b4 100644 |
| --- a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp |
| +++ b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp |
| @@ -56,7 +56,7 @@ RemoteFontFaceSource::RemoteFontFaceSource(FontResource* font, |
| : m_font(font), |
| m_fontSelector(fontSelector), |
| m_display(display), |
| - m_period(display == FontDisplaySwap ? SwapPeriod : BlockPeriod), |
| + m_period(BlockPeriod), |
|
Kunihiko Sakamoto
2016/10/12 06:10:14
Would this change current behavior when WebFontsCa
Shao-Chuan Lee
2016/10/12 06:50:58
If the flag is off then isCacheAwareLoadingActivat
Kunihiko Sakamoto
2016/10/12 08:56:30
Ah OK, I missed that part.
|
| m_histograms(font->url().protocolIsData() |
| ? FontLoadHistograms::FromDataURL |
| : font->isLoaded() ? FontLoadHistograms::FromMemoryCache |
| @@ -73,6 +73,10 @@ RemoteFontFaceSource::RemoteFontFaceSource(FontResource* font, |
| "Slow network is detected. Fallback font will be used while loading: " + |
| m_font->url().elidedString())); |
| } |
| + |
| + if (m_display == FontDisplaySwap && |
| + !m_font->resourceRequest().isCacheAwareLoadingActivated()) |
| + m_period = SwapPeriod; |
| } |
| RemoteFontFaceSource::~RemoteFontFaceSource() {} |
| @@ -154,6 +158,11 @@ void RemoteFontFaceSource::fontLoadLongLimitExceeded(FontResource*) { |
| m_histograms.longLimitExceeded(m_isInterventionTriggered); |
| } |
| +void RemoteFontFaceSource::willReloadAfterDiskCacheMiss(const FontResource*) { |
| + if (m_display == FontDisplaySwap) |
| + switchToSwapPeriod(); |
| +} |
| + |
| void RemoteFontFaceSource::switchToSwapPeriod() { |
| ASSERT(m_period == BlockPeriod); |
| m_period = SwapPeriod; |