| 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 ba85f54259f5b63e642679c401d53ee95e4032d0..a31d95a1e2486ca77c574d0ef291c306ccab42d2 100644
|
| --- a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
|
| +++ b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
|
| @@ -50,6 +50,12 @@ bool isConnectionTypeSlow() {
|
| return networkStateNotifier().connectionType() == WebConnectionTypeCellular2G;
|
| }
|
|
|
| +bool isInterventionV2Enabled() {
|
| + return RuntimeEnabledFeatures::webFontsInterventionV2With2GEnabled() ||
|
| + RuntimeEnabledFeatures::webFontsInterventionV2With3GEnabled() ||
|
| + RuntimeEnabledFeatures::webFontsInterventionV2WithSlow2GEnabled();
|
| +}
|
| +
|
| } // namespace
|
|
|
| RemoteFontFaceSource::RemoteFontFaceSource(FontResource* font,
|
| @@ -197,20 +203,16 @@ bool RemoteFontFaceSource::shouldTriggerWebFontsIntervention() {
|
| m_histograms.dataSource() == FontLoadHistograms::FromDataURL)
|
| return false;
|
|
|
| - bool isV2Enabled =
|
| - RuntimeEnabledFeatures::webFontsInterventionV2With2GEnabled() ||
|
| - RuntimeEnabledFeatures::webFontsInterventionV2With3GEnabled() ||
|
| - RuntimeEnabledFeatures::webFontsInterventionV2WithSlow2GEnabled();
|
| -
|
| bool networkIsSlow =
|
| - isV2Enabled ? isEffectiveConnectionTypeSlowFor(m_fontSelector->document())
|
| - : isConnectionTypeSlow();
|
| + isInterventionV2Enabled()
|
| + ? isEffectiveConnectionTypeSlowFor(m_fontSelector->document())
|
| + : isConnectionTypeSlow();
|
|
|
| return networkIsSlow && m_display == FontDisplayAuto;
|
| }
|
|
|
| bool RemoteFontFaceSource::isLowPriorityLoadingAllowedForRemoteFont() const {
|
| - return m_isInterventionTriggered;
|
| + return m_isInterventionTriggered && isInterventionV2Enabled();
|
| }
|
|
|
| PassRefPtr<SimpleFontData> RemoteFontFaceSource::createFontData(
|
|
|